It just follows the parsing rules.

Think about it: before 6!:2 can be executed, you
have to know whether it is being invoked dyadically
or monadically.  So you have to see whether its left
operand is a noun or not.  But you can't just look at
] : that might be part of ]`] which is a noun.  So
you have to go one more token, to the aa, before you
can decide to execute 6!:2.

Nouns are processed by value.  Therefore, the value
of aa put on the stack is the value before executing 6!:2.

      aa=. '1'
   smoutput aa [ [ 6!:2 'smoutput aa=. ''2'' [ wait 1'
2
2

Henry Rich

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Devon 
> McCormick
> Sent: Friday, October 17, 2008 10:50 PM
> To: J-programming forum
> Subject: [Jprogramming] Order of evaluation oddity
> 
> Something I never noticed before:
> 
>    aa=. '1'
>    smoutput aa [ 6!:2 'smoutput aa=. ''2'' [ wait 1'
> 2
> 1
>    aa
> 2
> 
> The leftmost "smoutput" gets the value of "a" before it's 
> re-assigned within
> the "6!:2" statement?
> 
> -- 
> Devon McCormick, CFA
> ^me^ at acm.
> org is my
> preferred e-mail
> ----------------------------------------------------------------------
> 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