1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# BQN hosted in dzaima/BQN
# Result is a function that executes BQN code.
⟨DRun,DCompile⟩ ← •Import "dc.bqn"
⟨ref,glyphs⟩ ← •Import "src/pr.bqn"
provide ← ⟨
•Type # Type
•FillFn # Fill
⋆⁼ # Log
{(𝕨⌈≠)⊸↑≠¨⊔𝕩} # GroupLen
∾⊔∘⊢ # GroupOrd
!,+,-,×,÷,⋆,⌊,=,≤,≢,⥊,⊑,↕,⌜,`,•_fillBy_,⊘
⟩
rt‿SetPrims ← •COMP provide⊸(⊣»«)⌾(1⊸⊑) DCompile ref
PrimInd ← rt⊸⊐⌾<
Decompose ← ((≠glyphs)>PrimInd)◶⟨•Decompose,0⊸≍⟩
SetPrims ⟨ Decompose, PrimInd ⟩
sys ← {𝕩⊏˜𝕨⊸⊐}˝⍉>⟨
"bqn"‿{BQN𝕩}
"type"‿•Type
"glyph"‿(glyphs⊑˜PrimInd)
"decompose"‿Decompose
⟩
BQN ← ⟨rt,Sys⟩⊸DRun
|