aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-07 12:12:46 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-07 12:13:59 -0400
commit176c78f51809ba3648d7a4cdedc78553df5904ae (patch)
tree556619a931598fdb2a49b706351821ac4d044886
parent7cb25167c2f4eb3cd0858f23d9662d9853d54cb6 (diff)
Use a new scope for execution in dzref
-rwxr-xr-xdzref8
-rw-r--r--md.bqn3
-rw-r--r--src/c.bqn6
3 files changed, 10 insertions, 7 deletions
diff --git a/dzref b/dzref
index 7e94b37e..0d070602 100755
--- a/dzref
+++ b/dzref
@@ -80,7 +80,8 @@ ProgressiveIndexOf ← {𝕨⊐○(≍˘⟜OccurrenceCount𝕨⊸⊐)𝕩}
⊒ ← OccurrenceCount⊘ ProgressiveIndexOf
"
-X←Raw←{F:≤4}
+raw ← {⍎}
+X ← {F:≤4}
{v:
chrs←⟨
"∾↕⊐⊒∊⍷"
@@ -104,7 +105,7 @@ X←Raw←{F:≤4}
# built-in assumptions
Mod ← {((⊑chr⊐𝕨)⊑names) ∾ " ← " ∾ 𝕩}
- ⍎¨ ⟨
+ Raw¨ ⟨
"IsArray ← 0≠≡"
⟩∾Mod⟜⥊¨ "↕∾⊐"
@@ -127,13 +128,12 @@ X←Raw←{F:≤4}
lf ← @+10
pre ← E_isdef◶E_proc‿E_redef¨ lf((⊢-˜¬×+`)∘=⊔⊢)impl
- Raw↩⍎
ExecFile←{
path ← "dot_path←" ∾ '"' (⊣∾⊣∾˜(1+=)/⊢) (∨`⌾⌽'/'=𝕩)/𝕩
src ← "•path"•_r_"dot_path"∘E_proc¨ •LNS 𝕩
Raw ∾ ∾⟜lf¨ path <⊸∾ src
}
X↩Raw∘E_proc
- ⍎ ∾ ∾⟜lf¨ pre
+ Raw ∾ ∾⟜lf¨ pre
≠◶(X˙)‿{ExecFile ⊑𝕩}‿{ExecFile ⊑𝕩 ⋄ X 1⊑𝕩} •args
}
diff --git a/md.bqn b/md.bqn
index f8ab861f..62c67555 100644
--- a/md.bqn
+++ b/md.bqn
@@ -22,6 +22,9 @@
################################
# Utilities
+# Linefeed
+lf ← @+10
+
# Shift cells 𝕨 into array 𝕩, maintaining its total length
Shl ← ≠∘⊢ ↑ ∾ # From the left
Shr ← -∘≠∘⊢ ↑ ∾˜ # From the right
diff --git a/src/c.bqn b/src/c.bqn
index 5c205177..0fe5b049 100644
--- a/src/c.bqn
+++ b/src/c.bqn
@@ -1,9 +1,9 @@
-nl←@+10
+lf←@+10
charSet‿cgl←(∾ ≍○< ≠¨)⟨
"+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!" # Function
"˙˜˘¨⌜⁼´˝`" # Modifier
"∘○⊸⟜⌾⊘◶⎉⚇⍟" # Composition
- nl∾"⋄," # Separator
+ lf∾"⋄," # Separator
"←↩→" # Gets
"(){}⟨⟩" # Bracket
"‿" # Ligature
@@ -34,7 +34,7 @@ spc←⥊3‿5‿6-⌜3‿0
Tokenize←{
r←𝕩='#'⋄s←/(≠↑2⊸↓)⊸∧𝕩='''⋄d←/dm←𝕩='"'
g←⍋q←∾⟨ s⋄¯1↓d⋄/r⟩ ⋄q↩g⊏q
- e← g⊏∾⟨2+s⋄ 1↓d⋄(⊢-¯1↓0∾⊢)∘⊏⟜(0∾+`r)⊸//(𝕩=nl)∾1⟩
+ e← g⊏∾⟨2+s⋄ 1↓d⋄(⊢-¯1↓0∾⊢)∘⊏⟜(0∾+`r)⊸//(𝕩=lf)∾1⟩
Se←{(⊏˜𝕨)Se 1¨⌾((𝕩/𝕨)⊸⊏)𝕩}⍟{0=⊑⌽𝕩}
st←¯1↓Se⟜(1↑˜≠)∾⟜≠q⍋e⋄b←st/q∾˘e
ToI←¯1↓·/⁼(≠𝕩)∾˜⥊