I guess most APL developers get caught by scalars having rank 0 and/or rank 1, occasionally.
I needed to verify that an argument, a nested vector, to a function contained 1. arrays of rank 2, had the same number of rows and 3. were simple arrays i.e. had depth 1.
I spent ages figuring out why
- Code: Select all
⍴⍴¨RefData
was returning (seemed like) the number of elements in the argument and not the rank of each element. Somehow, I had always assumed that ⍴⍴ was a composite symbol like ∘. What I needed was, of course:
⍴¨⍴¨RefData
. Embarrassing!