Don wrote:
>    "When moving the fork to tacit form, we need to remove the "y"s,
> so that the fork consists of verbs. If the structure had
> remained as it was, the fork in tacit programming
> would have been:   (M1)DM2 . The right to left rule would have
> remained. The dyadic verb would still be identified by a right parenthesis
> on its left. On execution, the right argument would be placed where
> each of the "y"s had been.
>
>    However, for some benefit, which must have been good - but no one has
> brought it up yet - the fork was changed to (M1DM2), which does not follow
> the right to left rule. Supposing we have a stream of verbs in 
> parenthesis,
> say (%:+/+#^+:-), how do we know which is monadic and which is dyadic? 
> There
> is no noun or parentheses in the stream to help. We know that the first
> three on the right are a fork, but what next? If it stops at 4, such as
> (#^+:-), we know that the fourth is dyadic, because it becomes a hook.
> In fact, the sequence is defined as alternating (DMDM) and that continues
> indefinitely (MDMDMDMDMDM). Thus J tells whether a verb is monadic or
> dyadic by its position in the stream. From the right, the odd numbered
> positions are monadic and the even numbered positions dyadic.

I do not understand your continued emphasis on monadic verbs in this 
discussion.  Your assertion that J tells whether a verb is monadic by its 
position in the stream is just plain wrong.

It is perfectly possible to have a monadic verb in any of the even positions 
provided there is a cap to its left. It is even possible to have a cap with 
a verb which may be used in either a monadic or dyadic context, and the cap 
forces use of the monadic form.

When the tacit verb is called, it will return a domain error it is called 
dyadically and it can only be executed monadically, or it is called 
monadically and can only be executed dyadically.  There are many cases where 
a train can be executed from either a monadic or a dyadic context.

There is a clear and simple sense in which the train follows the right to 
left rule.  The first three verbs from the right are executed with reference 
to the arguments of the train, then that result is the right argument of the 
next verb in the train.  So we have for the odd number of verbs case
      v  v (v v (v v (v v v)))
where each parenthesis reaches out to the arguments of the call of the train 
and each pair of verbs and its right parenthesized group is treated as a 
fork.

For the even number of verbs case we have a hook
     v (v v (v v (v v v)))

I cannot see how your (M1)DM2 expression as the definition of a train would 
work if  all of the verbs are dyadic.  The train structure is simple and 
designed to provide a powerful tool for function composition.  It is not 
designed, and I doubt if it should be designed to mimic the model of 
execution of an explicit expression.

However once its structure is understood it seems to me to mesh very well 
with the right to left execution rules.

Fraser 

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

Reply via email to