|
From: | Louis de Forcrand |
Subject: | Re: [Bug-apl] stacked rank operator |
Date: | Thu, 25 Aug 2016 01:19:12 +0200 |
(2 3 5 4$i.24)(+"1"_1)(2 4$i.8) 0 2 4 6 4 6 8 10 8 10 12 14 12 14 16 18 16 18 20 22 20 22 24 26 0 2 4 6 4 6 8 10 8 10 12 14 12 14 16 18 16 18 20 22 20 22 24 26 0 2 4 6 4 6 8 10 8 10 12 14 16 18 20 22 20 22 24 26 24 26 28 30 4 6 8 10 8 10 12 14 12 14 16 18 16 18 20 22 20 22 24 26 24 26 28 30 4 6 8 10 8 10 12 14 12 14 16 18 16 18 20 22 20 22 24 26 24 26 28 30 That’s the (almost surely correct) result from a J session. Here’s an operator R which functions identically to the rank operator in J, to which I believe the ISO operator is identical: ∇ [0] Z←X(U R N)Y;M;L;R;E [1] (M P Q)←⌽3⍴⌽N [2] E←{⊂[⌽(K|(-K←K+1)⌈K⌊⍺-⍺<0)↑⌽⍳K←≢⍴⍵]⍵;K} [3] Z←⊃⍎(⎕IO+0≠⎕NC'X')⊃'U¨M E Y' '(P E X)U¨Q E Y' ∇ You guys should try every twisted operation you can on R to make sure it works. I’ll ask the wizards in the J forum what they think. As a side-note, I’m liking the lambda local vars. They don’t look a bit out of place. Hope it helps, Louis
|
[Prev in Thread] | Current Thread | [Next in Thread] |