What would J be like if hooks and forks were not an artifact of the parser
but were implemented as explicit commands?

Fork would be an adverb which takes a verb and produces a conjunction.
The result of that conjunction would be a verb.

Hook would be a conjunction.

Trident would disappear from the parsing rules.

Bident would have semantics like U @: V

This would make some expressions much easier.  Expressions which
chain monads together would become much simpler.  However, expressions
which chain dyads together would be a bit more complicated -- counting
from the right you would need to decorate all the even verbs with the
fork conjunction.

For example, if fork were ]: the classic J expression for mean would
become:
  mean =: +/ %]: #

The dictionary would need to be changed.  Every book or page ever
written about J would need to be changed.

Worse, implicit parenthesis involving forks would follow different
rules from implicit parenthesis involving non-forks.  To work around
this, you'd have to rewrite the rules for adjectives and conjunctions.

The result would not look much like J.  For example, the classic
J expression for mean might be more like
  mean=: /+ %]: #

--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to