trusted
83
edits
m (→custom string mapping for entering APL glyphs: formatting) |
|||
Line 46: | Line 46: | ||
assert←{⍺←'LENGTH ERROR: one frame must be a prefix of the other' ⋄ 0∊⍵:⍺ ⎕SIGNAL 8 ⋄ void←0} | assert←{⍺←'LENGTH ERROR: one frame must be a prefix of the other' ⋄ 0∊⍵:⍺ ⎕SIGNAL 8 ⋄ void←0} | ||
r←1↓⌽3⍴⌽⍵⍵ ⍝ dyadic ranks | r←1↓⌽3⍴⌽⍵⍵ ⍝ dyadic ranks | ||
rm←r⌊∘(≢⍴)¨⍺ ⍵ ⍝ modified ranks; rm⍲.≤(≢⍴)¨⍺ ⍵ | |||
lf rf←(-rm)↓¨⍴¨⍺⍵ ⍝ frames | lf rf←(-rm)↓¨⍴¨⍺⍵ ⍝ frames | ||
cf←lf{⍺<⍥≢⍵:⍺ ⋄ ⍵}rf ⍝ common frame, assuming frames agree | cf←lf{⍺<⍥≢⍵:⍺ ⋄ ⍵}rf ⍝ common frame, assuming frames agree | ||
Line 54: | Line 54: | ||
} | } | ||
i←⊢⍴∘⍳×/ | i←⊢⍴∘⍳×/ ⍝ J's i.3 4 5 | ||
x←i⊢2 3 | x←i⊢2 3 | ||
y←i⊢2 3 4 5 | y←i⊢2 3 4 5 | ||
⍝ these should | ⍝ these should match: (x{⍺⍵}_FA_ 1 2⊢y) ≡ (x{⍺⍵}⍤1 2⍤¯1⊢y) | ||
x{⍺⍵}_FA_ 1 2⊢y | x{⍺⍵}_FA_ 1 2⊢y | ||
⍝ no result; somehow went to the end of the assert dfn | ⍝ no result; somehow went to the end of the assert dfn | ||
</syntaxhighlight> | </syntaxhighlight> |