|
From: | Louis de Forcrand |
Subject: | Re: [Bug-apl] Supporting negative ranks for ⍤ operator |
Date: | Thu, 28 Apr 2016 00:29:52 +0200 |
The three-item form is used if the associated function is ambivalent (applied to the P-cells of ⍵ if monadic, applied to corresponding Q-cells of ⍺ and R-cells of ⍵ if dyadic). I don't believe it is possible to define ambivalent functions in ISO APL however, so it is kind of redundant. It is probably left over from Sharp APL. As to the negative rank, I believe that it is an obvious flaw in the standard. Being able to apply a function to the items of the argument is incredibly useful. Of course this is achievable like so: {⍺ (f ⍤ (¯1+≢⍴⍺⍵)) ⍵} ⍝ without ⍺ for the monadic form Now that I've checked, I'm pretty sure that GNU APL does support rank (negative or not), but not with all primitives. Try it out with ⊖ or +⌿ on a rank-3 or above array, and then with ]BOXING and ⊂ on the same array… looks like a bug to me. The rank operator isn't easy to grasp, and it's surely harder to implement. Good luck, Louis
|
[Prev in Thread] | Current Thread | [Next in Thread] |