aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-06 09:50:32 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-06 10:44:21 -0400
commit65d08855120a48dae3b0b1225e463b76ce20498d (patch)
tree2db5a018ad654d28c3b5a78188925c49a4e329e4
parent9327d48ba01c4d44f38745b6b907b93f49b54622 (diff)
Remove cshim by getting primitive list in dc.bqn from dzref
-rwxr-xr-xcshim.bqn3
-rwxr-xr-xdc.bqn10
-rw-r--r--docs/running.html2
-rw-r--r--running.md2
-rwxr-xr-xtest/bt2
5 files changed, 8 insertions, 11 deletions
diff --git a/cshim.bqn b/cshim.bqn
deleted file mode 100755
index 8b42855d..00000000
--- a/cshim.bqn
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /usr/bin/env dbqn
-
-((<•path∾"dc.bqn")∾•args) •EX •path∾"dzref"
diff --git a/dc.bqn b/dc.bqn
index 57813262..a0fc5730 100755
--- a/dc.bqn
+++ b/dc.bqn
@@ -1,4 +1,4 @@
-#! ./dzref
+#! /usr/bin/env dbqn
# dzaima/BQN block headers are a little different from the version used
# in the Javascript implementation:
@@ -6,13 +6,13 @@
# - dzaima/BQN uses variable names instead of counts (but we make the
# names up anyway, except for special names).
-compile ← ⟨•path∾"src/c.bqn","Compile"⟩ •EX •path∾"dzref"
-
-prims←⟨
+p←"⟨
+,-,×,÷,⋆,√,⌊,⌈,|,¬,∧,∨,<,>,≠,=,≤,≥,≡,≢,⊣,⊢,⥊,∾,≍,↑,↓,↕,⌽,⍉,/,⍋,⍒,⊏,⊑,⊐,⊒,∊,⍷,⊔,!
˙,˜,˘,¨,⌜,⁼,´,˝,`
∘,○,⊸,⟜,⌾,⊘,◶,⎉,⚇,⍟
-⟩
+⟩"
+⟨Compile,prims⟩ ← ⟨•path∾"src/c.bqn","⟨Compile,"∾p∾"⟩"⟩ •EX •path∾"dzref"
+
special←<˘∘‿2⥊"𝕤𝕩𝕨𝕣𝕗𝕘"
DRun←{
⟨bc,o,blk⟩ ← prims Compile 𝕩
diff --git a/docs/running.html b/docs/running.html
index f199925b..9d7ad14b 100644
--- a/docs/running.html
+++ b/docs/running.html
@@ -15,7 +15,7 @@
<p><a href="https://github.com/dzaima/BQN/">dzaima/BQN</a> is an implementation in Java created by modifying the existing dzaima/APL. It should be easy to run on desktop Linux and Android. It is still in development and has almost complete syntax support but incomplete primitive support.</p>
<h3 id="dzaimareference-bqn">dzaima+reference BQN</h3>
<p>This repository contains a dzaima/BQN script <code><span class='Value'>dzref</span></code> that fills in the gaps in primitive support using BQN implementations of primitives that are not yet up to spec (<a href="https://github.com/mlochbaum/BQN/blob/master/spec/reference.bqn">reference implementations</a> of all primitives starting from a small set of pre-existing functions are part of BQN's specification).</p>
-<p>You can run <code><span class='Value'>dzref</span></code> from ordinary dzaima/BQN using the <code><span class='Value'>•</span><span class='Function'>EX</span></code> command; see for example <a href="https://github.com/mlochbaum/BQN/blob/master/cshim.bqn">cshim.bqn</a>. For testing, it is run as a Unix script, in which case it depends on an executable <code><span class='Value'>dbqn</span></code> that runs dzaima/BQN on a file argument. I use the following script, using the path to a clone of dzaima/BQN for the jar file.</p>
+<p>You can run <code><span class='Value'>dzref</span></code> from ordinary dzaima/BQN using the <code><span class='Value'>•</span><span class='Function'>EX</span></code> command; see for example <a href="https://github.com/mlochbaum/BQN/blob/master/wcshim.bqn">wcshim.bqn</a>. For testing, it is run as a Unix script, in which case it depends on an executable <code><span class='Value'>dbqn</span></code> that runs dzaima/BQN on a file argument. I use the following script, using the path to a clone of dzaima/BQN for the jar file.</p>
<pre><span class='Comment'>#! /bin/bash
</span>
<span class='Value'>java</span> <span class='Function'>-</span><span class='Value'>jar</span> <span class='Function'>/</span><span class='Value'>path</span><span class='Function'>/</span><span class='Value'>to</span><span class='Function'>/</span><span class='Value'>dzaima</span><span class='Function'>/BQN/BQN.jar</span> <span class='Function'>-</span><span class='Value'>f</span> <span class='String'>&quot;$@&quot;</span>
diff --git a/running.md b/running.md
index 6acf3d98..20587b9e 100644
--- a/running.md
+++ b/running.md
@@ -22,7 +22,7 @@ All versions have automated tests in the [test](test/) directory, with the self-
This repository contains a dzaima/BQN script `dzref` that fills in the gaps in primitive support using BQN implementations of primitives that are not yet up to spec ([reference implementations](spec/reference.bqn) of all primitives starting from a small set of pre-existing functions are part of BQN's specification).
-You can run `dzref` from ordinary dzaima/BQN using the `•EX` command; see for example [cshim.bqn](cshim.bqn). For testing, it is run as a Unix script, in which case it depends on an executable `dbqn` that runs dzaima/BQN on a file argument. I use the following script, using the path to a clone of dzaima/BQN for the jar file.
+You can run `dzref` from ordinary dzaima/BQN using the `•EX` command; see for example [wcshim.bqn](wcshim.bqn). For testing, it is run as a Unix script, in which case it depends on an executable `dbqn` that runs dzaima/BQN on a file argument. I use the following script, using the path to a clone of dzaima/BQN for the jar file.
#! /bin/bash
diff --git a/test/bt b/test/bt
index ce4e9a18..8fdabfe3 100755
--- a/test/bt
+++ b/test/bt
@@ -1,6 +1,6 @@
#! /usr/bin/env dbqn
-dRun ← ⟨"dRun"⟩ •EX •path∾"../cshim.bqn"
+dRun ← •EX •path∾"../dc.bqn"
c ← ∾(•LNS •path∾∾⟜"cases.bqn")¨""‿"b"
{𝕩: c ∾↩ (¬":"⊑∘∊⊢)¨⊸/ "1 %"⊸∾¨ (3≤≠)◶0‿(('#'≠2⊸⊑)∧" "≡2⊸↑)¨⊸/ •LNS •path∾"testref.bqn" }⍟⊢⊑(<"-ref")∊•args
M ← {e‿b: (⍎e)⊸≢◶""‿{(@+10)∾˜""""∾b∾""": expected "∾e∾" but received "∾⍕𝕩} DRun b}