On Fri, 14 Aug 2009, Viktor Cerovski wrote:
> To me the real question that follows from such an explanation is: when does
> the name get executed? Since I lately increasingly tend to think of/in J in
> terms of functional programming, where there is no execution, it seems that
> the execution is a bit more involved in defining J than I see it necessary
> to achieve what J gets done.

I think J is just opposite to what you expected in that it will
perform execution as soon as it get enough arguments.  
Take the original question

           a =. /

           a / 
        a/

this is a bident and not evaluated because J does not how to reduce it
so it keep it as is 

           a a               NB.  If stacked by value, would expect / /
        a a

this is also a bident and J does not how to reduce so it is not evaluated.

           + a a
        +//

Once the left argument is supplied to the bident, +a evaluated to verb
which become the left argument of the remaining 'a' and evaluation
continue.    

I think this is comparable to a verb train of hook and fork.

     foo=:  f g h

the fork foo or (f g h) does not dereference f g h even they are
already defined as some other verbs because a verb needs noun argument
to evaluate just as an adverb needs a noun or verb argument for
evaluation.  Another example, suppose c is not yet defined.

      c a
   c/          

a is evaluated because it got c which assumed to be a verb

      c=. +
      c a
   c/          

c is defined by not evaluated because the is no noun argument.

If there is not enough argument for evaluation, it waits.  Once there
are enough arguments for verb, adverb or conjunction, evaluation starts
immediately (compilation) without waiting for the arguments for
execution of the resulting verbs or adverbs.  Noun needs no arguments
thus always evaluated at sight.

Execution here means the 9 production rules in DOJ.

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to