aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-09 08:18:49 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-09 08:18:49 -0400
commitd69cb9ec07fe52297bb33140a6780f5620285951 (patch)
tree8503fa1e4ee96a17cc59c4e277f4257584aa03b2
parent0a464f3cf79fa8b08c3a2e5a18991f6d45f15eab (diff)
Operators ⎉⍟◶ now fully supported in dzaima/BQN
-rwxr-xr-xspec/dzref45
1 files changed, 2 insertions, 43 deletions
diff --git a/spec/dzref b/spec/dzref
index 773ea614..f0354d9f 100755
--- a/spec/dzref
+++ b/spec/dzref
@@ -1,23 +1,11 @@
#!/usr/bin/env dbqn
-impl ← "◶ ← {𝕨((𝕨𝔽𝕩)⊑𝕘){𝔽}𝕩}
+impl ← "
∧ ← ×
∨ ← (+-×)
#⌜
-# LAYER 2: Pervasion
-# After defining _perv, we apply it to all scalar functions,
-# making them pervasive. I'm not going to write that out.
-
-ToArray ← IsArray◶<‿⊢
-
-_perv←{ # Pervasion
- (⊢⊘∨○IsArray)◶⟨𝔽⋄𝔽{𝕨𝔽_perv𝕩}¨⟩
-}
-
-
-#⌜
# LAYER 3: Remove other limits
# Now all implementations are full but ↕ is monadic only
@@ -41,27 +29,6 @@ _depthOp_←{
𝕨 n _d 𝕩
}
⚇ ← _depthOp_
-_rankOp_←{
- k←𝕨(≍○(≠≢) (0≤⊢)◶⟨⌊⟜-,0⌈-⟩¨ 𝔾_ranks)𝕩
- Enc←{
- f←⊑⟜(≢𝕩)¨↕𝕨
- c←1×´s←𝕨Cell𝕩
- f⥊⊑⟜(⥊𝕩)¨∘((s⥊↕c)+c×⊢)¨↕1×´f
- }
- > ((⊑k)Enc𝕨) 𝔽¨ ((1-˜≠)⊸⊑k)Enc𝕩
-}
-_iterate_←{
- n←𝕨𝔾𝕩
- f←⊑𝕨⟨𝔽⟩⊘⟨𝕨𝔽⊢⟩𝕩
- l←u←0
- {!Int𝕩⋄l↩l⌊𝕩⋄u↩u⌈𝕩}⚇0 n
- a←𝕩⋄_p←{𝔽∘⊣`(1+𝕩)⥊<a}
- pos←F _p u ⋄ neg←F⁼_p-l
- (|⊑<⟜0⊑pos‿neg˜)⚇0 n
-}
-
-⎉ ← _rankOp_
-⍟ ← _iterate_
#⌜
@@ -105,14 +72,6 @@ Windows←{
Reverse ← {!1≤≠≢𝕩 ⋄ (-↕⊸¬≠𝕩)⊏𝕩}
Rotate ← {!Int𝕨 ⋄ l←≠𝕩⋄(l|𝕨+↕l)⊏𝕩} _onAxes_ 0
-Indices←{
- ! 1=≠≢𝕩
- ! ∧´Nat¨𝕩
- ⟨⟩∾´𝕩⥊¨↕≠𝕩
-}
-Rep ← Indices⊸⊏
-Replicate ← {0<≠≢𝕨}◶(⥊˜⟜≠Rep⊢)‿{!𝕨=○≠𝕩⋄𝕨Rep𝕩} _onAxes_ (1-0=≠)
-
↕ ↩ ↕ ⊘ Windows
⌽ ← Reverse ⊘ Rotate
@@ -223,7 +182,7 @@ X←Raw←{≤4}
chrs←⟨
"!∧∨∾↑↕⌽⍉⍋⍒⊐⊒∊⍷⊔"
""
- "⎉⚇⍟◶"
+ "⚇"
nc ← ≠¨chrs
chr ← ∾chrs