|
From: | Juergen Sauermann |
Subject: | [Bug-apl] rank operator with axis |
Date: | Wed, 02 Jul 2014 17:19:56 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 |
Hi, I have changed the rank operator with axis, i.e. ⍤[X]. The old implementation tried to improve on the somewhat broken syntax specified in the ISO standard: A ⍤[y] B ←→ A ⍤ y B ⍤[y] B ←→ ⍤ y B The new implementation follows NARS which uses ⊂[X] instead of ⊂ when conforming the final result. Note that the "flat" format like A ⍤ y B can give surprising results, so you should always put the operator arguments in parentheses like (A ⍤ y) B for clarity. The current implementation (axis or not) binds y to B and not to ⍤, so A ⍤ y B means A ⍤ (y B) and not (A ⍤ y) B. The "correct" binding of APL2 would read a simple thing as A ⍤ 1 2 3 B as (A ⍤ 1)(2 3 B) which might surprise less-frequent users of ⍤. It is unknown how APL2 itself would handle this because they haven't implemented ⍤ (or any other primitive operator with a value instead of a function as the right function argument). /// Jürgen |
[Prev in Thread] | Current Thread | [Next in Thread] |