Ö←{ ⍝ ⍥
0::⎕SIGNAL⊂⎕DMX.(('EN'EN)('EM'EM)('Message'(OSError{⍵,2⌽(×≢⊃⍬⍴2⌽⍺,⊂'')/'") ("',⊃⍬⍴2⌽⍺}Message)))
ncs←⎕NC↑'⍵⍵' '⍺'
0 3≡ncs:⍺⍺ ⍵⍵ ⍵ ⍝ f⍥g Y
2 3≡ncs:⍺ ⍺⍺⍥⍵⍵ ⍵ ⍝ X f⍥g Y
1<≢⍴⍵⍵:⎕SIGNAL 4 ⍝ non-vec/scal: RANK
1≠1 4⍸≢⍵⍵:⎕SIGNAL 5 ⍝ not 1…3 elements: LENGTH
(c←⎕NS ⍬).⎕CT←1E¯14 ⍝ tolerant space
c.≢∘⌊⌽⍵⍵:⎕SIGNAL 11 ⍝ not ints: DOMAIN
⍺←{⍵ ⋄ ⍺⍺} ⍝ monadic: pass-thorugh
a←⍺ ⍝ [17941]
k←⌽3⍴⌽⍵⍵ ⍝ r → r r r q r → r q r p q r → p q r