I wrote:
>  Bernecky, R., and R.K.W. Hui, Gerunds and 
>   Representations, APL91, APL Quote Quad, 
>  Volume 21, Number 4, 1991-08.  
>
>       http://www.snakeisland.com/gerunds.htm

Unfortunately, the paper doesn't go into much more detail on the
construction of a.r.s than does the Dic page cited earlier.

        The atomic (boxed, canonical) representation
        of an object uniquely represents it, and is either
        a boxed identifier (for primitive objects); or a
        boxed list of two boxes, the identifier and arguments
        (for derived objects). The identifier for
        a primitive verb, adverb, or conjunction is simply
        (and arbitrarily) its 1- or 2-letter spelling;
        the identifiers for a noun, hook, and fork are
        0, 2, and 3, respectively. Arguments are recursively
        so represented. User-defined conjunctions
        and adverbs (operators) and verbs (functions)
        are merely those derived from the definition conjunction
        (:), and are, therefore, covered by this
        scheme. 

It does, however, go into depth on their motivation and justification.  And,
for those of us with a tinge of OCD, it also dispels the mystery of the
heretofore inexplicable gaps in the function codes for `: (which, today,
only takes codes 0, 3, and 6).

In particular, the paper laid out several function codes absent today.  The
full table is: 

        g`:0 Abut (same as today, mostly)
        g`:1 DO-UNTIL (takes exactly 4 verbs)
        g`:3 or g/ Insert (same as today; variously called g`:2 and g`:3 in
the paper)
        g`:4 Recursion (takes exactly 4 verbs)
        g`:5 IF-THEN-ELSE and CASE (we'd use @. today)
        g`:6 MIMD (today's g`:6 is closer to a combination of what the paper
has as g`:57 and g`:59)
        g`:57 Hook 
        g`:59 Fork 

The latter two (57 & 59) have been rationalized & generalized as g`:6 today,
and the original g`:6 can be implemented with a combination of `:0 and " in
today's notation (modulo actual, physical, parallelization).

-Dan

PS:  For the real wonks, point of historical interest:

Despite this early paper's assertion that 

        User-defined conjunctions and adverbs (operators) 
        and verbs (functions) are merely those derived from
        the definition conjunction (:), and are, therefore, 
        covered by this scheme.

At one point, J did have explicit a.r. encodings for user-defined operators.
>From the archived documentation at
http://www.cs.trinity.edu/About/The_Courses/cs2322/jdoc/dict/dx005.htm :

 0  Noun
 2  Hook
 3  Fork
 4  Bonded conjunction
 5  Bident
 6  Trident
 7  Defined operator (pro-adverb or pro-conjunction)    

These extra codes - 5, 6, and 7 - were later removed. In fact, they were all
probably both introduced and removed with the trains table. The trains table
was introduced after the 1991 paper (explaining why it thought : was the
only way to define operators) and removed in J5, taking the vast majority of
bidents, tridents and tacitly defined operators with it, thus rendering
codes 5,6, and 7 obsolete. 

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

Reply via email to