aboutsummaryrefslogtreecommitdiff
path: root/dzref
diff options
context:
space:
mode:
Diffstat (limited to 'dzref')
-rwxr-xr-xdzref29
1 files changed, 2 insertions, 27 deletions
diff --git a/dzref b/dzref
index 03c14965..25aca0bd 100755
--- a/dzref
+++ b/dzref
@@ -104,41 +104,16 @@ ReorderAxes←{
Transpose←(=-1˜)⊸ReorderAxes⍟(0<=)
⍉ ← Transpose ⊘ ReorderAxes
-# Sorting
-Cmp ← ∨○IsArray◶{ # No arrays
- 𝕨(>-<)𝕩 # Assume they're numbers
-}‿{ # At least one array
- e←𝕨-˜○(0∨´0=≢)𝕩
- 𝕨(e=0)◶e‿{
- c←𝕨×∘-○(IsArray+=)𝕩
- s←≢𝕨 ⋄ t←≢𝕩 ⋄ r←𝕨⌊○=𝕩
- l←s{i←+´∧`𝕨=𝕩⋄m←1×´i↑𝕨⋄{c↩×-´𝕩⋄m↩m×⌊´𝕩}∘(⊑¨⟜𝕨‿𝕩)⍟(r⊸>)i⋄m}○(r↑⌽)t
- a←⥊𝕨⋄b←⥊𝕩
- Trav←(=⟜l)◶{Trav∘(1+𝕩)⍟(0⊸=)a Cmp○(𝕩⊸⊑)b}‿c
- Trav 0
- }𝕩
-}
-
-_bins←{
- c←1-˜=𝕨
- ! 0≤c
- LE←𝔽⎉c≤0˜
- ! (0<≠)◶⟨1,∧´·LE˝˘2↕⊢⟩𝕨
- 𝕨 (0<≠𝕨)◶⟨0⎉c∘⊢,+˝LE⎉¯1‿∞⟩ 𝕩
-}
-
OccurrenceCount ← ⊐˜(⊢-⊏)⍋∘⍋
ProgressiveIndexOf ← {𝕨⊐○(≍˘⟜OccurrenceCount𝕨⊸⊐)𝕩}
-⍋ ↩ ⍋ ⊘ ( Cmp _bins)
-⍒ ↩ ⍒ ⊘ (-∘Cmp _bins)
⊒ ← OccurrenceCount⊘ ProgressiveIndexOf
"
X←Raw←{≤4}
{
chrs←⟨
- "!∾↕⌽⍉⍋⍒⊐⊒∊⍷"
+ "!∾↕⌽⍉⊐⊒∊⍷"
""
"⚇"
@@ -162,7 +137,7 @@ X←Raw←{≤4}
⍎¨ ⟨
"IsArray ← 0≠≡"
'!' Mod "{𝕩 ⋄ ≤1}⍟¬"
- ⟩∾Mod⟜⥊¨ "↕∾⌽⊐⍋⍒"
+ ⟩∾Mod⟜⥊¨ "↕∾⌽⊐"
# checks if line is a builtin redefinition