aboutsummaryrefslogtreecommitdiff
path: root/bqn.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 /bqn.bqn
parent676bc61b903c9c3201913ac1b11ae2d3e0ad6e1d (diff)
Use a custom primitive set to compile the runtime
Diffstat (limited to 'bqn.bqn')
-rw-r--r--bqn.bqn8
1 files changed, 5 insertions, 3 deletions
diff --git a/bqn.bqn b/bqn.bqn
index 6f2eeb15..b40eb862 100644
--- a/bqn.bqn
+++ b/bqn.bqn
@@ -1,8 +1,10 @@
# BQN hosted in dzaima/BQN
# Result is a function that executes BQN code.
-⟨DRun,DCompile⟩ ← •Import "dc.bqn"
-⟨ref,glyphs⟩ ← •Import "src/pr.bqn"
+⟨ref,prims⟩ ← •Import "src/pr.bqn"
+⟨DRun⟩ ← •Import "dc.bqn"
+⟨DCompile⟩ ← prims •Import "dc.bqn"
+glyphs ← ∾ •Import "src/glyphs.bqn"
provide ← ⟨
•Type # Type
@@ -12,7 +14,7 @@ provide ← ⟨
∾⊔∘⊢ # GroupOrd
!,+,-,×,÷,⋆,⌊,=,≤,≢,⥊,⊑,↕,⌜,`,•_fillBy_,⊘,⎊
-rt‿SetPrims ← •COMP provide⊸(⊣»«)⌾(1⊸⊑) DCompile ref
+rt‿SetPrims ← •COMP provide DCompile ref
PrimInd ← rt⊸⊐⌾<
Decompose ← ((≠glyphs)>PrimInd)◶⟨•Decompose,0⊸≍⟩
SetPrims ⟨ Decompose, PrimInd ⟩