aboutsummaryrefslogtreecommitdiff
path: root/src/pr.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-20 14:37:53 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-20 14:40:23 -0500
commitbf89575eb73e4c06eea61bfa92521c4507341f62 (patch)
tree2ccdd638f7afbc6b97e5a3925a70ea373a766d71 /src/pr.bqn
parent55ce1825ebc76493316063ea8b0f7e1c0aa95677 (diff)
Add _fillBy_ primitive and finish structural function fill support
Diffstat (limited to 'src/pr.bqn')
-rwxr-xr-xsrc/pr.bqn9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pr.bqn b/src/pr.bqn
index 7e12537e..9e7db7e7 100755
--- a/src/pr.bqn
+++ b/src/pr.bqn
@@ -24,16 +24,17 @@ Inc ← {
}
# Required functionality passed in as an argument
-def ← ⟨"Type","Decompose","Glyph","Fill","Log","GroupLen","GroupOrd"⟩
+def ← ⟨"Type","Decompose","Glyph","Fill","Log","GroupLen","GroupOrd","_fillBy_"⟩
keep ← "!+-×÷⋆⌊=≤≢⥊⊑↕⌜`⊘"
len ⇐ def+○≠keep
ki ← chr⊐keep
-kt ← (+`nc)(∾(def≠⊸»⊣)+⊔⟜⊒∘⍋)ki
+dt ← ⊔⟜⊒ (+´·∧`'_'=0‿¯1⊸⊏)¨ def
+ns ← » ne←+`nc
+kt ← ∾ (ns+≠¨dt) + ⊔⟜⊒ne⍋ki
names ↩ (⥊¨kt⊏chr)⌾(ki⊸⊏)names
-
E_isdef ← (3≤≠)◶⟨0,∧´⟨chr," ","←↩"⟩∊˜¨3⊸↑⟩
-E_proc ← ({𝕨∘𝕩}´ {𝕨•_R_𝕩}⟜⥊¨⟜(≠↑chr˜) def)∘{
+E_proc ← ({𝕨∘𝕩}´ def {𝕨•_R_𝕩}⟜⥊¨ chr⊏˜∾ns+dt)∘{
l←≠chr
q←≠`𝕩='"' ⋄ q∨↩≠`q<𝕩=''' ⋄ f←¬∨`q<𝕩='#'
∾ (((l×f/q)+chr⊸⊐) (≥⟜l)◶⟨⊑⟜names,⥊∘⊢⟩¨ ⊢) f/𝕩