aboutsummaryrefslogtreecommitdiff
path: root/src/pr.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-25 21:26:27 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-25 21:26:27 -0400
commitc15a166a65d55c806aea9f28f8b5bfc36954a757 (patch)
treea5d3ccf952d4d6e39594c5f128f5cc3442548029 /src/pr.bqn
parent676bc61b903c9c3201913ac1b11ae2d3e0ad6e1d (diff)
Use a custom primitive set to compile the runtime
Diffstat (limited to 'src/pr.bqn')
-rwxr-xr-xsrc/pr.bqn14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pr.bqn b/src/pr.bqn
index e918518e..29337498 100755
--- a/src/pr.bqn
+++ b/src/pr.bqn
@@ -4,20 +4,20 @@
# All primitives
chrs←•Import "glyphs.bqn"
-glyphs ⇐ ∾chrs
+glyphs ← ∾chrs
# Provided values, to be passed in through the constants array
-def ← ⟨"Type","Fill","Log","GroupLen","GroupOrd","_fillBy_"⟩
+alias‿def ← (⊑¨ ≍○< 1⊸↓¨) ⟨"?Type","∩Fill","⍣Log",
+ "$GroupLen","%GroupOrd","⍝_fillBy_"⟩
keep ← "!+-×÷⋆⌊=≤≢⥊⊑↕⌜`⊘⎊"
-len ⇐ def+○≠keep
+
+type ← ((+´·∧`'_'=0‿¯1⊸⊏)¨def) ∾ chrs((+`≠¨)∘⊣⍋∾⊸⊐)keep
+prims ⇐ type ⊔ alias∾keep
GetRepls ← {
c‿n ← 𝕩
ki ← (⊑¨c)⊐keep
- dt ← ⊔⟜⊒ (+´·∧`'_'=0‿¯1⊸⊏)¨ def
- ns ← » ne←+`≠¨chrs
- kt ← ∾ (ns+≠¨dt) + ⊔⟜⊒ne⍋ki
- ⟨c,(kt⊏c)⌾(ki⊸⊏)n⟩∾¨⟨def,(∾ns+dt)⊏c⟩
+ ⟨c,c⊣⌾(ki⊸⊏)n⟩∾¨⟨def,⥊¨alias⟩
}
⟨E_proc⟩ ← chrs‿GetRepls •Import "pp.bqn"