diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-08-17 21:42:17 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-08-17 22:39:42 -0400 |
| commit | c3dee69d6e936fd8b6d1cf2b3676d612913a61fc (patch) | |
| tree | 6d7ccfef62e6ccd79ac28438447fd4177ece8942 /src/r.bqn | |
| parent | 37597898e329c2f6928a61c089f5b27a97e53b86 (diff) | |
Define monadic ⊐ to be ⍷⊸⊐ in the runtime
Diffstat (limited to 'src/r.bqn')
| -rw-r--r-- | src/r.bqn | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -410,19 +410,20 @@ _search←{ # 0 for ∊˜, 1 for ⊐ ⟩ ToArray𝕩 } } -UniqueMask←{ +_self←{ "Unique mask argument must have rank at least 1" ! 1≤=𝕩 g←⍋𝕩 - (1¨⊸GroupOrd g)⊏0⊸<◶⟨1,-⟜1≢○(⊑⟜(g⊏<˘⍟(1<=)𝕩))⊢⟩⌜↕≠𝕩 + (1¨⊸GroupOrd g) ⊏ g 𝔽 0⊸<◶⟨1,-⟜1≢○(⊑⟜(g⊏<˘⍟(1<=)𝕩))⊢⟩⌜↕≠𝕩 } +SelfClas ← (1¨⊸GroupOrd∘⍋∘/˜⊏˜1-˜+`∘⊢) _self Find←{ r←=𝕨 "Find left argument rank cannot exceed right argument rank" ! r≤=𝕩 𝕨 ≡⎉r (≢𝕨) ↕⎉r 𝕩 } -⊐ ← ("No monadic form: ⊐"!0˜) ⊘ (1 _search) -∊ ← UniqueMask ⊘ (0 _search˜) +⊐ ← SelfClas ⊘ (1 _search) +∊ ← ⊢_self ⊘ (0 _search˜) ⍷ ← ∊⊸/ ⊘ Find ReorderAxes←{ |
