Vocabulary/ModifierTrains/DerivedHooks

From J Wiki
Jump to navigation Jump to search

Many examples of modifier tridents form modifier forks. These forks are documented on the modifier trains page. (And, many other examples of modifier tridents are invalid, for example (a:a:a:) throws an error.)

However, some modifier trains evaluate two items of the trident and (if the evaluation succeeds without error) can then form a hook with the result of that evaluation and the remaining parsed item. For example, (-1&) would become the adverb _1&

When a verb is evaluated, its result is always a noun (unless an error occurs).

Usually, when evaluated, adverbs and conjunctions create verb results. For example, +/ is a verb and +&1 is a verb. But not always. For example, (2 :'u%v') produces a conjunction.

NAA/VAA
N0 A1 or V0 A1 is evaluated and, depending on A1 the parse action then becomes
NA (evaluates) as (N01 A2) or
VA (evaluates) as (V01 A2) or
AA adverb which behaves like: {{(u A01) A2}} or
CA conjunction ...like: {{(u C01 v) A2}} or
ANA/AVA
N1 A2 or V1 A2 is evaluated and, depending on A2 the parse action then becomes
AN (invalid by itself) or
AV adverb ...like: {{(u A0) V12}} or
AA adverb ...like: {{(u A0) A12}} or
AC adverb ...like: {{(u A0) C12 u}} or
NNA
N1 A2 is evaluated and the parse action then becomes
NN (invalid) or
NV (invalid) or
NA (evaluates) as (N0 A12) or
NC adverb ...like: {{N0 C12 u}}
VNA/VVA
N1 A2 or V1 A2 is evaluated and the parse action then becomes
VN (evaluates) as (V0 N12) or
VV verb hook which behaves like: ({{y V01 V2 y}} : {{x V01 V2 y}}) or
VA (evaluates) as (V0 A12) or
VC adverb ...like: {{V0 C12 u}}
VNC
V0 N1 is evaluated and the parse action then becomes NC adverb ...like: {{N01 C2 u}}
NAC/VAC
N0 A1 or V0 A1 is evaluated and the parse action then becomes
NC adverb ...like: {{N01 C2 u}} or
VC adverb ...like: {{V01 C2 u}} or
AC adverb ...like: {{(u A01) C2 u}}
CC conjunction ...like: {{(u C01 v) (u C2 v)}}
NAN/VAN
N0 A1 or V0 A1 is evaluated and the parse action then becomes
NN (invalid) or
VN (evaluates) as (V01 N2) or
AN (invalid) or
CN adverb ...like: {{u C01 N2}}
NAV/VAV
N0 A1 or V0 A1 is evaluated and the parse action then becomes
NN (invalid) or
VV verb hook ...like: {{y V01 V2 y}} : {{x V01 V2 y}} or
AV adverb ...like: {{(u A01) V2}} or
CV adverb ...like: {{u C01 V2}}

Also, some important combinations of three adjacent items are evaluated in higher priority parsing actions, and are documented elsewhere:

NVN
Dyadic verb
NCN/NCV/VCN/VCV
Conjunction
VVV
Verb fork