David Ward Lambert wrote:
>NB. Write a function to number the rows of its argument.
>NB. Example: `a' is an n-dimensional numerical array.
>NB. I created this pretty length error:   (i.*/}:$a),"0 _1 a

Not too bad, but your */ was overdoing it.

        (i.}:$a) ,"0 1 a

gives you structured indexes which will then match one-on-one against
the rows.

I recommend to you to work through section II.B "Agreement" in the
Dictionary, walking through these cases each:

        2 + 3
        2 3 + 4 5
        2 + 3 4 5
        2 3 + (i. 2 2)

Note: there's no use of the rank conjunction here.  You'll need to
understand basic agreement rules before you make them the target
of further "foo voodoo.

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

Reply via email to