aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-02 10:08:35 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-02 10:08:35 -0400
commitcee3266185a1c1347b05fc31837797f4e62ba14b (patch)
treeecae813b74977ea2dfbd6c51c02b296a1c8ac890
parent30602c5a85a62fe983a9684d67ed0eecd9b405ae (diff)
More dzaima/BQN primitives are now up to spec
-rwxr-xr-xspec/dzref20
1 files changed, 2 insertions, 18 deletions
diff --git a/spec/dzref b/spec/dzref
index 5eb258ec..c8403cce 100755
--- a/spec/dzref
+++ b/spec/dzref
@@ -12,14 +12,6 @@ _eachm←{
E 0 ⋄ (≢𝕩)⥊r
}
¨ ← _eachm ⍝ LIMITED to monadic case and array 𝕩
-_reduce←{
- ! 1=≠≢𝕩
- l←≠v←𝕩 ⋄ F←𝔽
- r←𝕨 (0<l)◶{𝕩⋄Identity f}‿{l↩l-1⋄l⊑𝕩}⊘⊣ 𝕩
- {r↩(𝕩⊑v)F r}¨(l-1)⊸-¨↕l
- r
-}
-´ ← _reduce
⍝⌜
@@ -31,25 +23,17 @@ ToArray ← IsArray◶<‿⊢
∾ ← {k←≠𝕨⋄k⊸≤◶⟨⊑⟜𝕨⋄-⟜k⊑𝕩˜⟩¨↕k+≠𝕩} ⍝ LIMITED to two vector arguments
-_table←{
- m←≠a←⥊𝕨 ⋄ n←≠b←⥊𝕩 ⋄ F←𝔽
- r←↕m×n
- {𝕩⊸{r↩r((n×𝕨)+𝕩)_amend˜(𝕨⊑a)F(𝕩⊑b)}¨↕n}¨↕m
- (𝕨∾○≢𝕩)⥊r
-}
-
_eachd←{
_e←{ ⍝ 𝕨 has smaller or equal rank
k←≠p←≢𝕨 ⋄ q←≢𝕩
! ∧´(⊑⟜p=⊑⟜q)¨↕k
l←1×´(q⊑˜k⊸+)¨↕q≠⊸-k
a←⥊𝕨 ⋄ b←⥊𝕩
- q⥊⥊(≠a) (⊑⟜a𝔽l⊸×⊸+⊑b˜)_table○↕ l
+ q⥊⥊(≠a) (⊑⟜a𝔽l⊸×⊸+⊑b˜)⌜○↕ l
}
(>○(≠≢))◶⟨𝔽_e⋄𝔽˜_e˜⟩
}
-⌜ ← {(𝔽_eachm)⊘(𝔽_table)○ToArray}
¨ ↩ {(𝔽_eachm)⊘(𝔽_eachd)○ToArray}
_perv←{ ⍝ Pervasion
@@ -306,7 +290,7 @@ ProgressiveIndexOf ← {𝕨⊐○(≍˘⟜OccurrenceCount𝕨⊸⊐)𝕩}
{
chrs←⟨
"!√∧∨|≡∾↑↓↕⌽⍉/⍋⍒⊏⊐⊒∊⍷⊔"
- "˘¨⌜´`"
+ "˘¨`"
"⎉⚇⍟◶"
nc ← ≠¨chrs