diff options
| -rwxr-xr-x | dc.bqn | 8 | ||||
| -rw-r--r-- | md.bqn | 4 | ||||
| -rw-r--r-- | running.md | 4 | ||||
| -rwxr-xr-x | src/cjs.bqn | 4 | ||||
| -rwxr-xr-x | src/pr.bqn | 4 | ||||
| -rwxr-xr-x | test/dz_comp | 2 | ||||
| -rwxr-xr-x | test/dz_rt | 2 | ||||
| -rw-r--r-- | wc.bqn | 2 | ||||
| -rwxr-xr-x | wcshim.bqn | 2 |
9 files changed, 16 insertions, 16 deletions
@@ -4,15 +4,15 @@ # multiple bodies, and use variable names instead of counts. # Rearrange and make up some names so the bytecode can be run. -compile ← •EX •path∾"src/c.bqn" -prims ← (•EX •path∾"dzref"){𝔽} "⟨ +compile ← •Import •path∾"src/c.bqn" +prims ← (•Import •path∾"dzref"){𝔽} "⟨ +,-,×,÷,⋆,√,⌊,⌈,|,¬,∧,∨,<,>,≠,=,≤,≥,≡,≢,⊣,⊢,⥊,∾,≍,↑,↓,↕,«,»,⌽,⍉,/,⍋,⍒,⊏,⊑,⊐,⊒,∊,⍷,⊔,! ˙,˜,˘,¨,⌜,⁼,´,˝,` ∘,○,⊸,⟜,⌾,⊘,◶,⎉,⚇,⍟ ⟩" special←<˘∘‿2⥊"𝕤𝕩𝕨𝕣𝕗𝕘" -DCompile←{ +DCompile⇐{ ⟨bc,o,fblk⟩ ← prims Compile 𝕩 blk‿bdy ← <˘⍉>(↕≠fblk){ ⟨t,i,l,n⟩←𝕩 @@ -21,4 +21,4 @@ DCompile←{ }¨fblk ⟨bc,o,blk,bdy⟩ } -DRun←•COMP∘DCompile +DRun⇐•COMP∘DCompile @@ -173,7 +173,7 @@ blobURL ← repoURL∾"/blob/master/" # Environments _getCodeExec ← {𝕗⋄⍎} -_getSvgExec ← {𝕗⋄⟨•path∾"svg.bqn","⍎"⟩ •EX •path∾"dzref"} +_getSvgExec ← {𝕗⋄⟨•path∾"svg.bqn","⍎"⟩ •Import •path∾"dzref"} ################################ @@ -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"⟩ •EX •path∾"dzref" +fmtm ← ⟨•path∾"src/fmt.bqn"⟩ •Import •path∾"dzref" Fmt ← ⍕ _fmtm @@ -22,13 +22,13 @@ 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 [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. +You can run `dzref` from ordinary dzaima/BQN using the `•Import` 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 java -jar /path/to/dzaima/BQN/BQN.jar -f "$@" -The left argument for `•EX` or the shell arguments can contain up to two arguments for the script. The first is a file to run, and the second is BQN code to be run after it. +The left argument for `•Import` or the shell arguments can contain up to two arguments for the script. The first is a file to run, and the second is BQN code to be run after it. ### BQN2NGN diff --git a/src/cjs.bqn b/src/cjs.bqn index fc9db6f1..b481cdc0 100755 --- a/src/cjs.bqn +++ b/src/cjs.bqn @@ -1,6 +1,6 @@ #! /usr/bin/env dbqn -compile ← •EX •path∾"c.bqn" +compile ← •Import •path∾"c.bqn" Comp ← ((<"runtime["∾⍕∾"]"˙)¨↕62)⊸Compile FP ← ∞⊸=◶⟨⍕,"Infinity"⟩ Esc ← (⟨"\t","\n","\r","\'","\"""⟩∾<∘⥊)⊑˜("'"""∾˜@+9‿10‿13)⊑∘⊐⊢ @@ -13,7 +13,7 @@ Fout ← ⟨⊢,Fconst,L⟩ {L𝕎¨𝕩}¨ ⊢ Frun ← ("provide.concat("∾∾⟜")")⌾(1⊸⊑) Fout Long ← ∾ (1‿2/⟨" new Uint8Array("∾∾⟜")"⋄((@+10)∾" ,")⊸∾⟩) {𝕎𝕩}¨ ⊢ • ← (⊑"r"‿"c"‿"fmt"⊐⊏)◶⟨ - {𝕩⋄Long Frun {𝕩⊸↓⌾(1⊸⊑)Comp𝕨}´ •EX •path∾"pr.bqn"} + {𝕩⋄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"} ¯1 ↓ · J L∘Fout∘Comp¨ @@ -26,6 +26,7 @@ Inc ← { # Required functionality passed in as an argument def ← ⟨"IsArray","Type","Log","GroupLen","GroupOrd"⟩ keep ← "!+-×÷⋆⌊=≤≢⥊⊑↕⌜`⊘" +len ⇐ def+○≠keep ki ← chr⊐keep kt ← (+`nc)(∾((≠def)∾¯1↓⊣)+⊔⟜⊒∘⍋)ki names ↩ (⥊¨kt⊏chr)⌾(ki⊸⊏)names @@ -43,5 +44,4 @@ E_redef ← { # handles [fmd] [←↩] (E_proc 1↑𝕩) ∾ "←" ∾ tail } -ref ← ∾∾⟜(@+10)¨ E_isdef◶E_proc‿E_redef¨ impl∾<"⟨"∾"⟩"∾˜1↓⥊","⊸∾˘chr -⟨ref, def+○≠keep⟩ +ref ⇐ ∾∾⟜(@+10)¨ E_isdef◶E_proc‿E_redef¨ impl∾<"⟨"∾"⟩"∾˜1↓⥊","⊸∾˘chr diff --git a/test/dz_comp b/test/dz_comp index 52dbcc51..73806102 100755 --- a/test/dz_comp +++ b/test/dz_comp @@ -1,6 +1,6 @@ #! /usr/bin/env dbqn -dRun ← •EX •path∾"../dc.bqn" +⟨DRun⟩ ← •Import •path∾"../dc.bqn" c ← ∾(•LNS •path∾∾⟜"cases.bqn")¨""‿"b" {𝕩: c ∾↩ (¬":"⊑∘∊⊢)¨⊸/ "1 %"⊸∾¨ (3≤≠)◶0‿(('#'≠2⊸⊑)∧" "≡2⊸↑)¨⊸/ •LNS •path∾"prim.bqn" }⍟⊢⊑(<"-prim")∊•args M ← {e‿b: (⍎e)⊸≢◶""‿{(@+10)∾˜""""∾b∾""": expected "∾e∾" but received "∾⍕𝕩} DRun b} @@ -4,7 +4,7 @@ impl ← •LNS •path∾"../src/r.bqn" -drun ← •EX •path∾"../dc.bqn" +⟨DRun⟩ ← •Import •path∾"../dc.bqn" chrs←⟨ "!+-×÷⋆√⌊⌈∧∨¬|=≠≤<>≥≡≢⊣⊢⥊∾≍↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔" @@ -3,7 +3,7 @@ # WebAssembly backend (very incomplete) i←"⟨cgl,charSet,Tokenize⟩" -⟨cgl,charSet,Tokenize⟩ ← ⟨•path∾"src/c.bqn",i⟩ •EX •path∾"dzref" +⟨cgl,charSet,Tokenize⟩ ← ⟨•path∾"src/c.bqn",i⟩ •Import •path∾"dzref" chF←(⊑cgl)↑charSet bF‿bM‿bC‿bS‿bG‿bB‿bL‿bO‿bI‿bU‿bD‿bN‿bA‿bW←≍¨˜⟜(+`≠↑0∾⊢)cgl M←1⊸⊑(0⊸≤∧>)-⟜⊑ @@ -1,3 +1,3 @@ #! /usr/bin/env dbqn -((<•path∾"wc.bqn")∾•args) •EX •path∾"dzref" +((<•path∾"wc.bqn")∾•args) •Import •path∾"dzref" |
