aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-10-17 15:26:58 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-10-17 15:26:58 -0400
commit5c6c1c73832759cfa1e89705a26b4f90b140a819 (patch)
tree2631b4fbeb6a7afb907fdd563c1bbdd2db69c4fc
parent2d381ac8c137d5fc3eb33213c1684c25d6d6e5de (diff)
Remove unnecessary uses of •path now that •Import imcorporates it
-rwxr-xr-xdc.bqn4
-rw-r--r--md.bqn10
-rwxr-xr-xsrc/cjs.bqn8
-rwxr-xr-xsrc/pr.bqn2
-rwxr-xr-xtest/dz_comp6
-rwxr-xr-xtest/dz_rt6
-rwxr-xr-xwcshim.bqn2
7 files changed, 19 insertions, 19 deletions
diff --git a/dc.bqn b/dc.bqn
index c09e23a4..28d46020 100755
--- a/dc.bqn
+++ b/dc.bqn
@@ -4,8 +4,8 @@
# multiple bodies, and use variable names instead of counts.
# Rearrange and make up some names so the bytecode can be run.
-compile ← •Import •path∾"src/c.bqn"
-prims ← (•Import •path∾"dzref"){𝔽} "⟨
+compile ← •Import "src/c.bqn"
+prims ← (•Import "dzref"){𝔽} "⟨
+,-,×,÷,⋆,√,⌊,⌈,|,¬,∧,∨,<,>,≠,=,≤,≥,≡,≢,⊣,⊢,⥊,∾,≍,↑,↓,↕,«,»,⌽,⍉,/,⍋,⍒,⊏,⊑,⊐,⊒,∊,⍷,⊔,!
˙,˜,˘,¨,⌜,⁼,´,˝,`
∘,○,⊸,⟜,⌾,⊘,◶,⎉,⚇,⍟
diff --git a/md.bqn b/md.bqn
index 16d14491..1f5c0623 100644
--- a/md.bqn
+++ b/md.bqn
@@ -173,7 +173,7 @@ blobURL ← repoURL∾"/blob/master/"
# Environments
_getCodeExec ← {𝕗⋄⍎}
-_getSvgExec ← {𝕗⋄⟨•path∾"svg.bqn","⍎"⟩ •Import •path∾"dzref"}
+_getSvgExec ← {𝕗⋄⟨"svg.bqn","⍎"⟩ •Import "dzref"}
################################
@@ -319,7 +319,7 @@ Markdown ← {filename𝕊𝕩:
useRepl←0 ⋄ GetRepl ← {𝕩⋄ useRepl↩1 ⋄ repl}
ProcComment ← ⟨"<!--REPL-->"⟩⊸≢◶GetRepl‿{
n←≠s←"<!--SVG" ⋄ l←¯3↓⍟(1=≠𝕩)⊑𝕩 ⋄ a←s≡n↑l
- Source ← {((0<≠)◶<‿(•LNS •path∾path∾⊢) Trim n↓l) ∾ 1↓¯1↓𝕩}
+ Source ← {((0<≠)◶<‿(•LNS path∾⊢) Trim n↓l) ∾ 1↓¯1↓𝕩}
SvgExec⍟a JoinLines Source⍟a 𝕩
}
ProcHtml ← {
@@ -519,7 +519,7 @@ Markdown ← {filename𝕊𝕩:
# Uses the test cases at https://spec.commonmark.org/0.29/spec.json
# since Github doesn't seem to have published theirs
TestSections ← {
- tests ← ¯2 ↓˘ 8⊸(÷˜⟜≠∾⊣)⊸⥊2↓•LNS •path∾"spec.json"
+ tests ← ¯2 ↓˘ 8⊸(÷˜⟜≠∾⊣)⊸⥊ 2↓•LNS"spec.json"
tests ↩ ((⊑2+⊐⟜':')¨∘⊏ ((-','=¯1⊑⊢)↓↓)¨⎉1 ⊢) tests
testSection ← (1↓¯1↓⊢)¨ 5⊏˘tests
UnEscape ← {
@@ -632,7 +632,7 @@ GetMultiHighlights ← {
################################
# Format an array to a character matrix
# Won't work on functions until we can catch errors
-fmtm ← ⟨•path∾"src/fmt.bqn"⟩ •Import •path∾"dzref"
+fmtm ← ⟨"src/fmt.bqn"⟩ •Import "dzref"
Fmt ← ⍕ _fmtm
@@ -646,7 +646,7 @@ ConvertFile ← {
fileout ← ".html" ∾˜ (¯6⊸↓∾"index"˙)⍟("README"⊸MatchEnd) ¯3↓𝕩
# Contents of file to convert
- md ← •LNS •path∾𝕩
+ md ← •LNS 𝕩
# Verify and remove the html link line: the output *is* the html file.
! ("*View this file"⊸MatchStart ∧ (siteURL∾fileout∾").*")⊸MatchEnd) ⊑md
out ← 𝕩 Markdown 2↓md
diff --git a/src/cjs.bqn b/src/cjs.bqn
index b481cdc0..3e6aaabf 100755
--- a/src/cjs.bqn
+++ b/src/cjs.bqn
@@ -1,6 +1,6 @@
#! /usr/bin/env dbqn
-compile ← •Import •path∾"c.bqn"
+compile ← •Import "c.bqn"
Comp ← ((<"runtime["∾⍕∾"]"˙)¨↕62)⊸Compile
FP ← ∞⊸=◶⟨⍕,"Infinity"⟩
Esc ← (⟨"\t","\n","\r","\'","\"""⟩∾<∘⥊)⊑˜("'"""∾˜@+9‿10‿13)⊑∘⊐⊢
@@ -13,8 +13,8 @@ Fout ← ⟨⊢,Fconst,L⟩ {L𝕎¨𝕩}¨ ⊢
Frun ← ("provide.concat("∾∾⟜")")⌾(1⊸⊑) Fout
Long ← ∾ (1‿2/⟨" new Uint8Array("∾∾⟜")"⋄((@+10)∾" ,")⊸∾⟩) {𝕎𝕩}¨ ⊢
• ← (⊑"r"‿"c"‿"fmt"⊐⊏)◶⟨
- {𝕩⋄ref‿len←•Import•path∾"pr.bqn"⋄Long Frun len⊸↓⌾(1⊸⊑)Comp ref}
- {𝕩⋄Long Fout Comp J •LNS •path∾"c.bqn"}
- {𝕩⋄Long Fout Comp J •LNS •path∾"fmt.bqn"}
+ {𝕩⋄ref‿len←•Import"pr.bqn"⋄Long Frun len⊸↓⌾(1⊸⊑)Comp ref}
+ {𝕩⋄Long Fout Comp J •LNS "c.bqn"}
+ {𝕩⋄Long Fout Comp J •LNS "fmt.bqn"}
¯1 ↓ · J L∘Fout∘Comp¨
⟩ •args
diff --git a/src/pr.bqn b/src/pr.bqn
index 77d664ff..0ad1e1bb 100755
--- a/src/pr.bqn
+++ b/src/pr.bqn
@@ -2,7 +2,7 @@
# Process BQN runtime
-impl ← •LNS •path∾"r.bqn"
+impl ← •LNS "r.bqn"
chrs←⟨
"+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!"
diff --git a/test/dz_comp b/test/dz_comp
index 73806102..251d7232 100755
--- a/test/dz_comp
+++ b/test/dz_comp
@@ -1,8 +1,8 @@
#! /usr/bin/env dbqn
-⟨DRun⟩ ← •Import •path∾"../dc.bqn"
-c ← ∾(•LNS •path∾∾⟜"cases.bqn")¨""‿"b"
-{𝕩: c ∾↩ (¬":"⊑∘∊⊢)¨⊸/ "1 %"⊸∾¨ (3≤≠)◶0‿(('#'≠2⊸⊑)∧" "≡2⊸↑)¨⊸/ •LNS •path∾"prim.bqn" }⍟⊢⊑(<"-prim")∊•args
+⟨DRun⟩ ← •Import "../dc.bqn"
+c ← ∾(•LNS ∾⟜"cases.bqn")¨""‿"b"
+{𝕩: c ∾↩ (¬":"⊑∘∊⊢)¨⊸/ "1 %"⊸∾¨ (3≤≠)◶0‿(('#'≠2⊸⊑)∧" "≡2⊸↑)¨⊸/ •LNS "prim.bqn" }⍟⊢⊑(<"-prim")∊•args
M ← {e‿b: (⍎e)⊸≢◶""‿{(@+10)∾˜""""∾b∾""": expected "∾e∾" but received "∾⍕𝕩} DRun b}
r ← '%' M∘((+`-2⊸×)∘=⊔⊢)¨ c
• ← ("All "∾(⍕≠c)∾" passed!")⍟(0=≠) ∾r
diff --git a/test/dz_rt b/test/dz_rt
index 06d08adb..c8ac208e 100755
--- a/test/dz_rt
+++ b/test/dz_rt
@@ -2,9 +2,9 @@
# Compile and run the primitive implementations, and prim.bqn
-impl ← •LNS •path∾"../src/r.bqn"
+impl ← •LNS "../src/r.bqn"
-⟨DRun⟩ ← •Import •path∾"../dc.bqn"
+⟨DRun⟩ ← •Import "../dc.bqn"
chrs←⟨
"!+-×÷⋆√⌊⌈∧∨¬|=≠≤<>≥≡≢⊣⊢⥊∾≍↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔"
@@ -55,6 +55,6 @@ E_redef ← { # handles [fmd] [←↩]
}
pre ∾↩ E_isdef◶E_proc‿E_redef¨ impl
-t ← (¬∘⊑':'∊⊢)¨⊸/ 3⊸↓⌾(3⊸⊑) •LNS •path∾"prim.bqn"
+t ← (¬∘⊑':'∊⊢)¨⊸/ 3⊸↓⌾(3⊸⊑) •LNS "prim.bqn"
res ← DRun ∾ ∾⟜(@+10)¨ pre ∾ E_proc¨ t
• ← ("All "∾(⍕≠res)∾" passed!")⍟(0=≠) /res
diff --git a/wcshim.bqn b/wcshim.bqn
index 2ae4aac8..2ef3503d 100755
--- a/wcshim.bqn
+++ b/wcshim.bqn
@@ -1,3 +1,3 @@
#! /usr/bin/env dbqn
-((<•path∾"wc.bqn")∾•args) •Import •path∾"dzref"
+((<•path∾"wc.bqn")∾•args) •Import "dzref"