I was playing around with the Rank Operator, which is something that isn't
really documented in many places. I only saw references to it in the spec,
while neither APL2 nor Dyalog mentions it.

Now, there are a few things that behaves strangely, although it may be
correct.

First of all, the following works (]BOXING is 8):

      *xx ← 4 5⍴⍳10*
*      {'foo',⍵}⍤1 xx*
┌→─────────────┐
↓foo 1 2 3 4  5│
│foo 6 7 8 9 10│
│foo 1 2 3 4  5│
│foo 6 7 8 9 10│
└──────────────┘

But the following does not:

      *{'foo',⍵}⍤1 4 5⍴⍳10*
RANK ERROR
      λ1⍤1 4 5⍴⍳10
      ^ ^
      *({'foo',⍵}⍤1) 4 5⍴⍳10*
RANK ERROR
      (λ1⍤1)4 5⍴⍳10
       ^        ^

Also, the spec says it returns a function, but I can't assign it to a
variable:

      *a ← {'foo',⍵}⍤1*
RANK ERROR
      a←λ1⍤1
        ^ ^

I suppose the last one is expected, since *xy←+/* also does not work (but
should it?)

Is the behaviour correct, or is there a problem with the parsing?

Regards,
Elias

Reply via email to