Hmm...

In addition to dissect (which focuses on the details of execution),
consider what trace (which focuses on the details of parsing) tells us
about one of your examples:

   require'trace'
   trace_jtrace_ ' #@>@:;:''a man a plan a canal'''
 --------------- 4 Conj -------
 #
 @
 >
 #@>
 --------------- 4 Conj -------
 #@>
 @:
 ;:
 #@>@:;:
 --------------- 0 Monad ------
 #@>@:;:
 'a man a plan a canal'
 1 3 1 4 1 5
 ==============================
1 3 1 4 1 5

There's actually more steps involved in parsing than this - and those
are the frequent "shift" operations (which always happen in the "right
to left" order that your intuition was probably suggesting to you).
Working through parsing manually (so you can see how all those parsing
"shift" operations fit in) can be an interesting exercise.

-- 
Raul


On Fri, Jan 22, 2016 at 1:49 PM, Brian Schott <[email protected]> wrote:
> The original message was correct, not this one.
> I am very sorry for the confusion.
>
> Henry and Raul,
>
> Thanks for your replies to the message.
> I am still trying to sort out the examples with the MIDDLE TINE and am
> optimistic with dissect and the detail Henry gave. However, it sounds like
> magic or double talk to say the following because the parenthesis part
> suggest a@b is parsed first but that execution starts with d. It never
> occurred to me that execution could be in a different order from parsing.
> WOW.
>
> "Thus, a@b@c@d is parsed as ((a@b)@c)@d
>
> "Then, when it's executed, ((a@b)@c)@d executes d first, followed by c, b,
> a; so you get right-to-left execution of the verbs."
>
>
> On Fri, Jan 22, 2016 at 10:55 AM, Brian Schott <[email protected]>
> wrote:
>
>> [Sorry, that was a mistake. This is a resend]
>>
>>    #@:>@:;:'a man a plan a canal'     NB. 1
>> 6
>>    #@:>@;:'a man a plan a canal'     NB. 2
>> 6
>>    #@>@;:'a man a plan a canal'     NB. 3
>>
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to