aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-10 17:36:11 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-10 18:21:16 -0400
commit7988a14d4af00f50ea99660131c9b07661082f8c (patch)
treef28984c616337de5350b843888ce0956e15753f2 /docs
parent7738ded3bc25f837e6c6667204bb15ed4c3c44ab (diff)
Error message for •Glyph on non-primitive
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/bqn.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/bqn.js b/docs/bqn.js
index a8621740..e104f4f8 100755
--- a/docs/bqn.js
+++ b/docs/bqn.js
@@ -252,7 +252,11 @@ runtime.map((r,i) => { r.prim = i; });
let decompose = x => list(!isfunc(x) ? [-1,x] : has(x.prim) ? [0,x]
: x.repr ? x.repr() : [1,x]);
setPrims(list([decompose, x=>has(x.prim)?x.prim:runtime.length]));
-let glyph = x => "+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!˙˜˘¨⌜⁼´˝`∘○⊸⟜⌾⊘◶⎉⚇⍟"[x.prim];
+let glyph = x => {
+ let g = "+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!˙˜˘¨⌜⁼´˝`∘○⊸⟜⌾⊘◶⎉⚇⍟"[x.prim];
+ if (!has(g)) throw Error("•Glyph 𝕩: 𝕩 must be a primitive");
+ return g;
+}
// Compiler
runtime[42] = assertFn("Compiler");