aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-05 10:09:18 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-05 10:09:18 -0400
commitcea2d535ba34acc17568004be9f87a145fd64616 (patch)
treef0191b36c731e0f6081dfcaa65ac379652ee7995 /docs
parent78c26551d039c1cb07521c6601eb2b389a7d9644 (diff)
Distinguish compiler, runtime, and assertion errors
Diffstat (limited to 'docs')
-rw-r--r--docs/bqn.js17
-rw-r--r--docs/repl.js2
2 files changed, 12 insertions, 7 deletions
diff --git a/docs/bqn.js b/docs/bqn.js
index 08b19b58..ebf4a92f 100644
--- a/docs/bqn.js
+++ b/docs/bqn.js
@@ -78,10 +78,13 @@ let run = (B,O,S) => { // Bytecode, Objects, Sections/blocks
}
// Runtime
+let assertFn = pre => (x,w) => {
+ if (x!==1) throw Error(pre + (has(w)?": "+w.join(""):""));
+ return x;
+}
let arr = (r,sh) => {r.sh=sh;return r;}
let list = l => arr(l,[l.length]);
let str = s => list(Array.from(s));
-let unstr = a => has(a)?a.join(""):a;
let m1 = m => {m.m=1;return m;}
let m2 = m => {m.m=2;return m;}
let ctrans = (c,t) => String.fromCodePoint(c.codePointAt(0)+t);
@@ -142,7 +145,7 @@ let provide = [
,(x,w) => has(w)?Math.log(x)/Math.log(w):Math.log(x) // Log
,group_len // GroupLen
,group_ord // GroupOrd
- ,(x,w) => {if(x!==1)throw Error(unstr(w)); return x;} // !
+ ,assertFn("Primitive failed") // !
,plus // +
,minus // -
,(x,w) => w*x // ×
@@ -165,17 +168,19 @@ let runtime = run(
,provide.concat([0,1,2,32,3,8,-1,Infinity,-Infinity,4,str("Argument to fold must be a list"),str("Equal-rank argument shapes don\'t agree"),str("Argument shape prefixes don\'t agree"),str("Grade argument must have rank at least 1"),str("Replication argument in Indices or Replicate must have rank 1"),str("Amounts to replicate must be natural numbers"),str("Right argument to Select must be an array"),str("Indices in Select must be integers"),str("Select indices out of range"),str("Reverse argument must have rank at least 1"),str("Amount to rotate must be an integer"),str("First-axis function right argument must have rank at least 1"),str("Left argument must have rank at most 1"),str("Left argument length must be at most right argument rank"),str("Elements in Merge argument must have matching shapes"),str("No monadic form: ≥"),str("No monadic form: ≤"),str("Identity not found"),str("Shape argument to Reshape must have rank at most 1"),str("Shape in Reshape must consist of natural numbers"),str("Can\'t compute axis length in Reshape when rest of shape is empty"),str("Shape in Reshape must be a natural number or ∘ ⌊ ⌽ ↑"),str("Shape must be exact when reshaping with ∘"),str("Range argument must consist of natural numbers"),str("Range argument must be a number or list"),str("Insert argument must have rank at least 1"),str("Rank of joined arguments must differ by at most 1"),str("Cell shapes of joined arguments must match"),str("Left argument to Take or Drop must be an integer"),str("Prefixes argument must have rank at least 1"),str("Suffixes argument must have rank at least 1"),str("Windows right argument must be an array"),str("Windows left argument must have rank at most 1"),str("Windows left argument length must be at most right argument rank"),str("Windows left argument must consist of natural numbers"),str("Window length must be at most axis length plus one"),str("Replicate argument lengths must match"),str("Join argument must be an array"),str("Join argument elements must all have the same rank"),str("Join argument element rank must be at least argument rank"),str("Join argument element shapes must be compatible"),str("Grouping argument must consist of integers"),str("Grouping argument values cannot be less than ¯1"),str("Group Indices argument must be a list"),str("Group right argument must be an array"),str("Compound group left argument must be a list"),str("Group left argument total rank must be at most right argument rank"),str("Group argument lengths must be compatible"),str("Indices in compound Pick must be lists"),str("Pick index length must match right argument rank"),str("Pick indices must consist of integers"),str("Pick index out of range"),str("Bins argument must have rank at least 1"),str("Bins right argument rank is too small"),str("Bins left argument must be sorted"),str("Search principal argument must have rank at least 1"),str("Unique mask argument must have rank at least 1"),str("Find left argument rank cannot exceed right argument rank"),str("Left argument to Reorder Axes must have rank at most 1"),str("Reorder Axes left argument length must not exceed right argument rank"),str("Reorder Axes left argument must consist of natural numbers"),str("No such axis in Reorder Axes"),str("Inverse failed"),str("Inverse does not exist"),str("Inverse not found"),str("Repetition numbers must be integers")])
,[[0,1,0,138],[2,0,2935,6],[0,0,2962,3],[0,0,2966,3],[0,0,2970,3],[1,0,2974,5],[1,0,2982,5],[2,0,3000,6],[2,0,3015,6],[2,0,3034,6],[2,0,3056,6],[2,0,3078,6],[0,0,3110,3],[0,0,3121,3],[0,0,3130,3],[1,0,3139,9],[0,0,3252,3],[0,0,3292,4],[1,1,3368,4],[1,1,3441,3],[0,0,3505,3],[0,0,3516,5],[2,0,3600,12],[0,0,3806,4],[0,0,3855,6],[0,0,3945,7],[0,0,4074,4],[0,0,4230,4],[0,0,4291,4],[2,0,4393,16],[1,1,4623,2],[0,0,4647,3],[0,0,4674,3],[0,0,4700,3],[1,1,4739,2],[2,1,4749,4],[0,0,4785,4],[1,1,4882,2],[0,0,4915,3],[0,0,4942,3],[0,0,4964,3],[0,0,4986,3],[0,0,4997,3],[0,0,5026,3],[0,0,5032,9],[0,0,5183,5],[0,0,5216,3],[0,0,5225,3],[1,1,5231,2],[2,0,5300,10],[2,0,5359,8],[1,0,5552,5],[0,0,5594,8],[0,0,5830,4],[0,0,5911,3],[0,0,5961,4],[0,0,6082,3],[0,0,6132,4],[0,0,6298,3],[0,0,6317,3],[0,0,6351,3],[0,0,6365,7],[0,0,6412,11],[1,0,6677,8],[0,0,6776,4],[0,0,6859,6],[0,0,7202,4],[0,0,7415,3],[0,0,7433,4],[1,0,7505,9],[1,1,7575,3],[1,0,7600,14],[1,1,8035,4],[1,0,8085,6],[0,0,8224,4],[0,0,8292,3],[0,0,8366,3],[0,0,8421,4],[0,0,8550,4],[0,0,8670,3],[2,0,8710,6],[2,0,8739,7],[0,0,8780,6],[0,0,8930,3],[0,0,9000,3],[0,0,9037,5],[0,0,9181,3],[0,0,9228,3],[0,0,9254,3],[0,0,9341,3],[1,1,9396,2],[2,0,9405,13],[1,1,9559,2],[1,1,9573,2],[1,1,9577,2],[0,0,9581,3],[0,0,9593,3],[0,0,9616,3],[1,0,9637,6],[1,0,9754,11],[1,0,9975,5],[0,0,9990,3],[0,0,10005,3],[0,0,10020,3],[1,0,10065,8],[0,0,10204,8],[0,0,10372,5],[0,0,10447,3],[0,0,10464,3],[0,0,10470,4],[0,0,10519,3],[0,0,10529,3],[0,0,10557,5],[1,0,10653,5],[0,0,10664,8],[0,0,10921,3],[0,0,10962,3],[0,0,10982,3],[1,0,11036,6],[0,0,11189,6],[0,0,11317,10],[0,0,11502,3],[0,0,11602,3],[0,0,11644,3],[0,0,11697,4],[0,0,11757,3],[0,0,11788,3],[0,0,11826,6],[0,0,11933,6],[0,0,11983,4],[0,0,12013,3],[0,0,12032,4],[1,1,12190,2],[0,0,12194,3],[1,0,12237,5],[1,0,12274,5],[1,0,12285,5],[0,0,12296,14],[0,0,12472,3],[0,0,12493,3],[0,0,12547,3],[0,0,12582,3],[0,0,12606,4],[1,0,12666,5],[0,0,12733,3],[0,0,12762,3],[0,0,12779,5],[0,0,12890,3],[0,0,12945,3],[0,0,12969,5],[0,0,13098,3],[0,0,13138,3],[0,0,13221,3],[0,0,13255,3],[0,0,13284,3],[0,0,13302,3],[0,0,13319,3],[0,0,13348,3],[0,0,13391,6],[0,0,13470,3]]
);
-runtime.map((r,i) => {
- let prims = "+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!˙˜˘¨⌜⁼´˝`∘○⊸⟜⌾⊘◶⎉⚇⍟";
- r.glyph = prims.charAt(i); // Used to format
-});
// Compiler
+runtime[40] = assertFn("Compilation failed");
let compile = run(
new Uint8Array([0,53,0,0,0,52,17,22,0,0,11,14,0,74,22,0,1,11,0,75,0,76,0,77,0,21,21,0,0,17,0,78,0,79,0,80,0,81,0,82,0,83,0,53,0,25,16,0,0,0,84,17,0,85,0,54,22,0,2,11,0,25,16,0,40,0,0,7,0,87,17,0,20,16,0,37,0,21,7,0,86,17,0,55,0,0,0,52,17,0,21,0,88,17,3,14,22,0,3,11,0,21,16,22,0,4,11,14,15,1,22,0,5,11,14,15,2,21,0,4,7,22,0,6,11,14,21,0,3,0,39,0,13,7,16,0,19,0,21,0,57,19,0,23,0,13,19,0,44,0,0,7,9,0,48,0,37,0,39,0,22,7,7,8,16,22,0,7,22,0,8,22,0,9,22,0,10,22,0,11,22,0,12,22,0,13,22,0,14,22,0,15,22,0,16,22,0,17,22,0,18,22,0,19,22,0,20,4,14,11,14,21,0,19,0,30,16,0,0,0,58,17,22,0,21,11,14,0,30,0,48,0,1,8,0,12,0,9,0,15,0,47,0,57,8,19,0,30,0,47,0,56,8,19,22,0,22,11,14,21,0,3,0,23,0,55,17,0,39,0,13,7,16,0,42,0,0,7,16,22,0,23,11,14,0,57,0,21,0,61,0,25,16,0,26,16,0,27,0,60,17,17,0,21,21,0,3,0,23,0,59,17,0,39,0,13,7,16,0,21,0,57,17,0,27,16,0,23,21,0,15,0,30,0,56,17,0,1,21,0,23,17,17,17,22,0,24,11,14,0,59,0,57,3,2,0,40,0,1,7,0,59,0,60,0,62,3,3,17,0,20,16,22,0,25,11,14,15,3,22,0,26,11,14,15,4,22,0,27,11,14,0,52,0,30,0,47,0,56,8,0,24,0,47,0,56,8,21,0,27,3,4,0,50,0,29,0,31,21,0,16,0,30,16,0,90,0,91,3,3,19,0,30,9,8,22,0,28,11,14,15,5,22,0,29,11,14,15,6,22,0,30,11,14,15,7,22,0,31,11,14,15,8,22,0,32,11,14,15,9,22,0,33,11,25,21,0,1,0,33,0,90,0,91,3,2,17,0,42,0,10,7,16,0,8,16,0,36,0,89,17,14,0,57,0,36,0,47,0,21,8,0,92,21,0,1,0,13,16,0,11,0,56,17,0,37,0,27,7,0,93,17,0,94,21,0,1,3,4,17,25,21,0,1,0,48,0,29,8,0,48,0,17,0,51,0,18,0,27,0,13,19,0,45,21,1,5,8,8,8,0,18,0,19,19,22,0,2,11,14,21,0,1,0,28,16,22,0,3,11,14,0,19,0,28,21,0,1,0,29,21,0,3,17,19,0,6,0,56,19,0,37,0,1,7,0,56,19,0,37,0,29,7,21,0,3,19,21,0,2,0,19,19,25,0,95,0,14,21,0,1,17,22,0,3,11,14,0,90,0,14,21,0,1,17,0,9,0,47,0,24,0,47,0,61,8,0,23,0,13,19,8,16,0,27,16,22,0,4,11,14,0,91,0,14,21,0,1,17,22,0,5,11,0,27,16,22,0,6,11,14,21,0,4,21,0,6,0,24,0,63,17,21,0,3,0,27,16,3,3,0,21,16,22,0,7,11,0,28,16,22,0,8,11,14,21,0,7,0,29,21,0,8,17,22,0,7,12,14,21,0,4,0,0,0,61,17,21,0,6,0,24,0,56,17,0,56,0,21,21,1,0,0,14,21,0,1,17,17,0,27,16,0,27,0,47,21,0,3,0,44,0,0,7,16,0,21,0,57,17,0,48,0,29,0,45,0,19,0,21,0,57,19,0,24,0,63,19,0,1,0,19,19,8,8,8,16,3,3,0,21,16,0,29,21,0,8,17,22,0,9,11,14,15,10,0,51,15,11,8,22,0,10,11,14,21,0,9,0,28,21,0,7,17,0,13,0,48,0,21,8,16,0,13,0,37,0,23,7,0,56,19,0,48,21,0,10,8,16,0,24,0,63,17,22,0,11,11,14,21,0,9,0,38,0,21,7,21,0,7,17,0,27,21,0,11,17,22,0,12,11,14,0,20,0,37,0,21,7,21,0,1,0,13,16,19,0,41,0,27,7,9,0,24,0,63,19,22,0,13,11,14,21,0,12,21,0,13,16,22,0,14,11,0,44,0,13,7,16,0,8,16,22,0,15,11,14,21,0,5,0,9,0,47,0,19,0,37,0,21,7,0,57,19,0,24,0,56,19,8,16,0,9,21,0,14,17,0,9,21,0,15,17,22,0,16,11,0,8,16,0,9,22,0,15,13,14,21,0,12,0,27,21,0,3,0,29,21,0,7,0,27,21,0,11,17,17,0,8,16,17,22,0,17,11,14,21,0,17,21,0,13,16,0,44,0,13,7,16,0,2,21,0,17,0,38,0,30,7,16,21,0,13,16,0,37,0,1,7,21,0,16,17,0,44,0,0,7,16,17,0,37,0,1,7,0,56,17,0,37,0,35,7,21,0,1,17,22,0,18,11,0,34,16,22,0,19,11,14,21,0,17,0,38,0,26,0,45,0,30,8,7,16,21,0,13,16,0,27,21,0,15,17,22,0,20,11,14,21,0,1,0,27,21,0,15,17,0,27,0,47,21,0,20,8,0,49,0,39,21,1,4,0,30,16,7,8,16,21,1,6,16,0,37,0,1,7,21,0,20,17,22,0,21,11,14,21,1,17,21,1,18,21,1,19,3,3,0,39,0,30,7,0,56,17,0,42,0,0,7,16,0,22,21,1,17,0,30,16,17,21,1,22,21,0,21,17,22,0,22,11,0,11,0,47,0,19,0,21,0,57,19,0,23,0,13,19,8,16,22,0,23,11,14,21,1,16,0,30,16,0,14,21,0,21,17,22,0,24,11,14,21,0,24,0,0,22,0,22,13,14,21,0,24,0,0,22,0,23,13,14,21,1,19,0,42,0,0,7,16,0,0,0,63,17,0,14,21,0,21,17,22,0,25,11,14,21,0,21,0,15,0,47,21,1,19,0,30,16,0,48,0,0,8,8,0,2,0,18,19,0,1,0,19,19,21,1,2,17,0,35,21,0,23,0,44,0,0,7,16,0,2,21,0,22,0,11,21,0,25,17,17,0,37,0,1,7,0,56,17,17,22,0,26,11,14,21,0,21,0,27,21,0,23,17,0,37,0,1,7,21,1,19,0,30,16,17,0,37,0,3,0,45,0,5,8,7,21,1,2,17,22,0,27,11,14,21,0,26,0,31,16,22,0,28,11,0,11,0,47,0,44,0,6,7,0,21,0,63,19,0,23,0,13,19,8,16,22,0,29,11,14,21,0,27,0,27,21,0,29,17,0,12,0,57,17,22,0,30,11,0,13,16,22,0,31,11,14,21,0,27,0,6,0,57,17,0,14,0,47,0,61,8,0,48,0,9,8,0,0,0,19,19,21,0,22,0,11,0,47,0,19,0,37,0,21,7,0,57,19,0,24,0,56,19,8,16,0,37,0,27,7,21,0,25,17,17,22,0,27,12,14,21,0,21,0,27,0,47,21,0,20,8,0,49,21,0,18,0,31,21,0,19,17,0,0,21,0,31,17,0,0,21,1,23,17,8,16,0,27,0,47,21,0,23,8,0,49,21,0,30,0,28,16,0,28,16,0,29,21,0,28,17,0,0,21,1,23,17,8,16,0,27,21,1,20,21,1,22,21,0,21,17,0,10,21,0,22,17,0,8,16,0,10,21,0,23,17,17,22,0,21,12,14,21,1,10,21,1,22,21,0,21,17,0,9,0,47,0,19,0,10,21,1,12,0,30,16,0,0,0,61,0,58,3,2,17,0,33,21,0,21,17,19,0,21,0,56,19,0,23,0,13,19,8,16,0,8,16,0,37,0,27,7,22,0,21,13,14,21,1,10,21,1,22,21,0,21,17,0,9,21,1,12,0,30,16,0,0,0,59,0,60,3,2,17,0,33,21,0,21,17,0,37,0,21,7,0,56,17,0,24,0,56,17,17,0,8,16,0,37,0,27,7,22,0,21,13,14,21,1,23,0,1,21,0,21,17,21,0,31,0,48,0,11,8,0,9,0,15,0,47,0,57,8,19,16,22,0,32,11,14,21,1,24,0,29,21,0,21,0,5,21,1,23,17,17,0,27,0,47,21,0,32,8,0,49,21,0,27,8,16,22,0,33,11,14,21,1,15,0,30,16,0,37,0,22,7,0,60,17,21,1,22,21,0,21,17,0,2,0,60,17,0,0,22,0,21,13,14,21,0,21,21,0,33,21,0,30,0,8,16,0,42,0,0,7,16,21,0,19,0,21,21,0,26,0,29,21,0,29,0,27,16,0,27,21,0,30,17,17,17,3,4,25,21,1,18,0,30,16,0,0,0,47,0,25,8,0,58,17,22,0,3,22,0,4,22,0,5,22,0,6,4,4,11,14,21,1,17,0,30,16,0,48,0,1,8,0,26,0,45,0,42,0,2,0,47,0,53,8,0,48,0,0,8,7,8,9,22,0,7,11,14,21,0,7,0,24,0,47,0,56,8,21,0,7,9,0,1,9,3,2,0,50,0,30,0,14,21,0,3,19,8,22,0,8,11,14,0,24,0,47,0,56,0,48,0,0,8,8,0,57,0,13,0,4,0,53,19,0,3,21,0,7,19,3,2,0,50,0,13,0,11,0,57,19,8,9,0,0,0,23,0,45,21,0,7,8,19,0,47,21,0,4,0,11,16,0,48,0,31,8,8,22,0,9,11,14,0,64,0,65,21,0,9,3,3,0,50,0,29,0,31,21,0,5,21,0,6,3,2,19,0,30,9,8,22,0,10,11,14,21,1,21,0,31,21,0,1,17,0,30,16,22,0,11,11,14,21,0,1,0,23,21,0,11,17,21,0,10,0,24,0,47,0,56,8,21,0,10,9,0,1,9,3,2,0,50,0,30,0,14,21,0,3,19,8,16,22,0,12,11,14,21,0,12,21,0,1,0,13,16,0,11,21,0,11,17,0,51,0,37,0,18,0,24,0,56,0,0,21,0,11,17,19,21,0,8,9,0,4,0,53,19,0,48,0,2,8,7,8,21,0,1,17,25,0,66,22,0,3,11,14,21,0,1,0,6,0,56,17,0,41,0,4,7,21,0,3,17,0,5,16,22,0,4,11,14,21,0,4,0,0,0,56,17,0,44,0,0,7,0,48,0,19,0,21,0,57,19,0,23,0,13,19,0,48,0,27,8,0,1,0,19,0,30,0,63,19,0,25,9,19,8,16,0,28,16,0,28,16,22,0,5,11,14,21,0,1,15,12,21,0,4,17,0,29,21,0,5,17,25,0,40,0,14,7,0,43,15,13,7,0,19,0,45,0,38,0,57,7,8,19,0,30,0,63,19,22,0,3,11,14,15,14,22,0,4,11,14,0,57,21,0,4,0,97,8,0,37,0,56,21,0,4,0,98,8,7,3,2,0,50,0,13,0,46,0,12,8,8,22,0,5,11,14,21,0,1,21,0,5,0,99,3,2,0,50,0,13,0,46,0,5,8,0,11,21,0,3,19,8,21,0,2,17,0,37,0,36,7,0,57,17,25,0,93,0,27,21,0,1,0,13,16,0,11,0,56,17,17,0,21,0,100,17,0,37,0,36,7,0,57,17,25,21,0,2,22,0,3,22,0,4,4,2,11,14,21,1,12,0,30,0,48,0,1,8,0,7,0,61,19,0,4,0,63,19,0,2,21,1,22,19,21,0,1,17,22,0,5,11,0,44,0,0,7,16,22,0,6,11,0,28,16,22,0,7,11,14,21,1,12,0,30,16,0,0,0,61,17,0,37,0,22,7,0,61,17,21,1,22,21,0,1,17,0,2,21,0,5,17,22,0,8,11,14,21,0,1,0,29,0,47,21,0,7,8,0,46,0,27,0,47,0,63,0,48,0,14,8,8,0,37,0,1,7,0,56,19,0,17,0,51,21,1,30,8,0,27,0,47,0,56,0,48,0,14,8,8,19,8,21,0,5,17,14,21,0,6,0,30,21,0,7,0,30,16,17,0,15,0,57,17,0,36,0,101,17,14,21,1,13,21,1,22,21,0,1,17,0,10,0,47,0,26,0,47,0,56,8,8,16,22,0,9,11,14,21,0,9,0,29,0,47,21,0,7,8,0,49,0,26,0,47,0,63,8,8,16,22,0,10,11,14,21,0,10,0,10,21,0,9,17,22,0,11,11,14,21,0,9,0,29,21,0,7,17,0,28,16,0,37,0,29,7,22,0,7,13,14,21,0,11,0,8,16,0,2,22,0,4,13,14,0,57,0,12,21,0,5,17,22,0,12,11,14,21,1,12,0,30,16,0,0,0,56,17,0,14,21,0,1,17,0,11,21,0,11,17,22,0,13,11,14,21,1,10,21,1,22,21,0,1,17,0,10,21,0,9,17,0,10,21,0,12,17,0,29,0,37,0,21,7,0,1,0,21,0,45,0,44,0,0,7,8,19,0,56,19,0,28,0,48,0,28,0,48,0,37,0,29,7,8,0,1,0,37,0,29,7,19,0,29,0,47,0,28,8,0,18,19,8,0,18,0,21,0,63,19,19,21,0,7,17,0,24,0,63,17,0,0,0,56,17,0,44,0,0,7,16,0,28,16,22,0,14,11,14,21,0,8,0,29,21,0,14,17,0,44,0,0,7,16,22,0,15,11,0,28,16,22,0,16,11,14,21,0,16,0,37,0,29,7,22,0,14,13,14,21,0,16,0,37,0,29,7,22,0,15,13,14,21,0,14,0,37,0,29,7,22,0,1,13,14,21,0,8,0,29,21,0,14,17,22,0,17,11,14,0,57,0,11,21,0,17,17,0,27,16,22,0,18,11,14,0,57,0,12,21,0,17,17,22,0,19,11,0,44,0,0,7,16,22,0,20,11,14,0,57,0,48,0,21,8,0,44,0,0,7,9,0,27,0,56,0,21,21,0,19,17,19,0,19,0,21,0,57,19,0,23,0,13,19,0,48,0,1,8,9,22,0,21,11,14,0,14,0,45,21,0,21,8,0,24,0,56,19,0,11,0,57,19,22,0,22,11,14,21,0,1,0,28,21,1,15,0,30,16,0,0,0,60,17,0,0,0,57,0,59,0,58,0,60,3,4,17,17,21,0,22,0,47,0,59,8,0,2,0,61,19,0,6,21,0,22,0,47,0,61,8,19,0,2,0,61,19,0,0,21,0,22,0,47,0,56,8,19,0,21,0,57,19,16,22,0,23,11,14,21,1,25,0,29,21,0,23,17,22,0,24,11,14,21,0,4,0,29,0,47,21,0,14,0,29,21,0,18,17,8,0,49,0,58,0,25,16,0,27,0,47,0,15,0,47,0,61,8,0,0,0,56,19,8,16,0,29,21,0,23,0,24,0,56,17,17,8,16,22,0,4,12,14,21,0,4,0,15,0,56,17,0,10,21,0,4,0,14,0,59,17,0,29,0,47,21,0,7,8,0,49,0,26,0,47,0,63,8,8,16,17,0,19,0,2,0,47,0,13,0,45,0,25,8,0,0,0,56,19,8,0,44,0,6,7,9,0,46,0,14,8,0,10,0,47,0,8,8,19,0,9,0,18,19,21,0,13,17,0,0,22,0,4,13,14,21,1,23,0,1,21,0,1,17,22,0,25,11,21,0,3,0,48,0,11,8,0,9,0,15,0,47,0,57,8,19,16,22,0,26,11,0,27,16,22,0,27,11,14,21,0,1,0,29,21,0,27,17,22,0,28,11,14,21,1,15,21,1,22,21,0,1,17,0,27,16,22,0,29,11,14,21,1,11,0,30,16,0,14,21,0,1,17,0,29,21,1,11,21,1,22,21,0,1,17,0,2,0,47,0,13,0,45,0,25,8,8,16,0,44,0,6,7,16,17,22,0,30,11,14,21,0,8,0,1,21,0,5,17,0,29,21,0,14,17,0,44,0,0,7,16,0,28,16,22,0,7,12,14,21,0,14,0,29,21,0,7,17,22,0,31,11,14,21,0,9,0,1,21,0,10,17,0,29,21,0,31,17,0,12,0,27,0,46,0,1,8,0,11,19,0,57,17,0,37,0,3,7,0,61,17,0,0,0,56,17,22,0,32,11,14,21,1,12,0,30,16,0,0,0,60,17,0,14,21,0,1,17,0,29,21,0,7,17,0,27,16,22,0,33,11,14,21,0,9,0,29,21,0,31,17,0,28,16,22,0,34,11,0,37,0,29,7,22,0,7,13,14,21,0,14,0,29,21,0,7,17,22,0,31,12,14,21,0,7,0,37,0,29,7,22,0,1,13,14,21,0,31,0,37,0,29,7,22,0,4,13,14,21,0,31,0,37,0,29,7,22,0,12,13,14,21,0,9,0,12,21,0,10,17,0,29,21,0,31,17,0,27,16,22,0,35,11,14,21,0,7,0,28,16,22,0,36,11,14,21,0,34,0,28,16,0,29,22,0,33,13,14,21,1,10,21,1,22,21,0,1,17,22,0,37,11,14,21,0,9,0,29,21,0,31,17,0,10,21,0,12,17,0,10,21,0,37,17,22,0,38,11,14,21,1,11,0,30,16,0,37,0,22,7,0,61,17,21,1,22,21,0,1,17,22,0,39,11,14,21,0,39,0,10,21,0,38,17,0,1,22,0,4,13,14,0,61,0,16,21,0,4,17,22,0,40,11,14,0,59,0,14,21,0,4,17,0,26,0,56,17,0,10,0,56,0,16,21,0,4,17,17,22,0,41,11,14,21,0,41,0,29,21,0,38,0,26,0,63,17,0,2,0,47,0,13,0,45,0,25,8,8,16,0,44,0,6,7,16,17,22,0,42,11,14,21,0,41,0,26,0,56,17,0,9,21,1,11,0,30,16,0,0,0,56,17,0,14,21,0,1,17,17,0,11,21,0,42,17,22,0,43,11,14,0,59,0,14,21,0,4,17,0,26,0,56,17,0,11,21,0,39,17,0,10,21,0,40,17,22,0,44,11,14,21,0,43,0,10,21,0,44,17,0,8,16,0,26,16,0,2,0,45,0,44,0,6,7,8,0,1,0,18,19,0,47,0,13,0,45,0,25,8,8,16,0,26,16,22,0,45,11,14,21,0,39,0,27,16,21,0,45,0,48,0,29,8,0,0,0,56,19,0,0,0,19,19,16,22,0,46,11,14,0,56,0,1,21,0,46,17,0,37,0,21,7,21,0,1,0,13,16,17,0,41,0,27,7,16,0,24,0,63,17,0,19,0,21,0,57,19,0,23,0,13,19,0,48,0,1,8,16,0,29,21,0,36,17,0,44,0,0,7,16,0,26,0,63,17,22,0,47,11,0,29,21,0,7,17,22,0,48,11,14,21,0,4,0,27,0,47,21,0,48,8,0,49,0,39,0,63,7,8,16,22,0,4,12,14,21,0,44,0,8,16,0,44,0,0,7,0,2,0,45,0,44,0,6,7,8,0,1,0,19,19,21,0,38,19,0,15,0,11,0,7,19,0,61,19,0,9,0,19,19,16,0,9,21,0,38,0,2,0,47,0,13,0,45,0,25,8,0,0,0,56,19,8,0,44,0,6,7,9,0,46,0,15,8,21,0,39,17,17,22,0,49,11,14,21,0,39,0,10,21,0,38,17,0,37,0,21,7,0,57,17,0,24,0,56,17,0,12,21,0,40,17,22,0,50,11,14,21,0,50,0,27,16,0,26,16,22,0,51,11,14,21,0,50,0,26,0,63,17,0,11,21,0,40,17,0,10,0,56,0,14,21,0,4,17,17,0,11,21,0,50,0,26,0,56,17,0,9,21,0,44,17,17,0,9,21,0,42,0,8,16,0,10,21,0,49,17,17,0,11,21,0,48,0,26,0,56,17,17,0,27,16,22,0,52,11,14,0,57,0,14,21,0,4,17,0,11,21,0,44,17,0,10,0,57,0,16,21,0,4,17,0,9,21,0,42,17,17,0,9,21,1,14,0,30,16,0,13,21,0,1,17,17,0,37,0,21,7,0,57,17,0,24,0,56,17,0,29,21,0,52,17,22,0,53,11,14,21,0,3,0,0,21,1,23,17,0,16,21,0,1,17,22,0,54,11,14,21,1,9,0,42,0,0,7,16,0,0,0,63,17,0,15,21,0,1,17,0,10,21,0,54,17,0,27,16,22,0,55,11,14,21,0,1,0,29,21,0,55,17,22,0,56,11,0,34,16,0,9,16,22,0,57,11,14,21,1,12,0,30,16,0,0,0,58,17,0,14,21,0,1,0,27,21,0,12,17,17,22,0,58,11,14,0,56,0,21,21,0,38,17,0,9,21,0,12,0,21,0,56,17,17,0,1,0,57,0,21,21,0,37,17,17,0,44,0,0,7,16,0,27,0,56,0,21,21,0,12,17,17,0,24,0,47,0,1,8,0,1,0,24,19,0,56,17,0,27,21,0,58,17,0,0,0,56,17,22,0,59,11,14,21,0,58,0,21,0,57,17,0,29,0,47,0,44,0,0,7,8,21,0,12,17,0,12,21,0,37,17,0,27,16,22,0,60,11,14,21,1,12,0,30,16,0,0,0,61,17,0,14,21,0,1,17,0,27,16,22,0,61,11,14,21,0,47,0,9,21,0,30,17,0,9,21,0,26,17,22,0,62,11,0,29,21,0,27,17,22,0,63,11,14,21,0,62,21,0,21,16,22,0,64,11,14,21,0,20,0,29,21,0,27,17,0,37,21,0,16,0,29,21,0,18,17,0,21,21,0,1,0,13,16,17,7,0,29,0,27,0,47,21,0,63,8,19,0,21,21,0,16,0,27,21,0,19,17,0,21,0,63,17,0,48,0,29,8,19,16,22,0,65,11,14,21,0,65,0,28,16,0,29,0,47,21,0,28,0,27,0,47,21,0,63,8,0,48,0,21,8,16,22,0,66,11,0,48,0,29,8,0,28,9,8,16,22,0,67,11,14,21,0,65,0,19,0,29,21,0,67,0,27,0,47,0,15,0,47,21,0,27,0,13,16,8,8,16,19,0,13,0,47,0,19,0,21,0,57,19,0,23,0,13,19,8,9,0,46,0,10,8,21,0,66,17,0,42,0,9,7,0,56,17,0,36,0,102,17,14,21,0,67,0,29,0,47,21,0,63,0,37,0,27,7,16,0,1,16,0,21,21,0,63,17,0,48,0,29,0,45,0,44,0,0,7,8,8,0,28,9,8,16,0,27,0,47,21,0,27,0,13,16,0,48,0,11,8,8,16,22,0,67,12,14,21,0,67,0,37,0,29,7,22,0,63,13,14,21,0,28,0,29,21,0,67,17,0,13,0,47,0,19,0,21,0,57,19,0,23,0,13,19,8,0,11,21,0,63,19,0,48,0,19,0,42,0,10,7,0,57,19,0,51,0,37,0,27,0,45,21,1,31,8,7,8,8,16,14,21,0,27,0,29,0,47,21,0,67,8,0,49,0,29,0,47,21,0,63,0,2,0,47,0,13,0,45,0,25,8,8,16,0,44,0,6,7,16,8,8,16,22,0,68,11,14,21,0,25,0,29,21,0,29,17,0,0,0,61,17,0,15,0,47,0,57,8,0,48,0,0,8,16,0,0,21,0,23,0,7,0,61,17,0,2,0,59,17,0,29,21,0,20,0,29,21,0,29,17,17,17,0,21,21,0,62,0,44,0,0,7,16,0,8,0,47,0,2,0,47,21,0,19,8,0,44,0,6,7,9,8,16,0,1,21,0,24,0,29,21,0,20,17,17,0,29,21,0,68,17,17,22,0,69,11,14,21,0,29,0,21,21,0,27,17,22,0,70,11,0,11,16,0,20,0,59,17,0,21,16,22,0,71,11,14,21,0,47,0,29,21,0,70,17,0,0,0,67,17,21,0,29,0,39,0,57,7,16,0,21,21,0,68,21,0,15,0,48,0,29,8,0,46,0,1,8,21,0,27,17,17,21,0,69,3,3,22,0,72,11,14,21,0,36,0,29,22,0,18,13,14,21,0,55,21,0,55,21,0,18,21,0,18,21,0,61,21,0,60,21,0,33,21,0,33,21,0,35,21,0,35,21,0,46,21,0,45,0,29,21,0,51,17,0,6,0,56,17,0,0,21,0,51,17,21,0,53,0,0,21,0,52,17,0,0,0,47,21,0,45,0,48,0,29,8,0,2,21,0,53,19,8,16,3,13,0,21,16,0,37,0,29,7,21,0,7,17,0,21,21,0,71,17,0,28,16,22,0,73,11,14,21,0,55,0,39,0,57,7,16,21,0,56,0,31,21,0,57,17,21,0,18,0,39,0,68,7,16,21,0,18,0,13,16,0,25,16,0,0,0,56,17,3,4,0,21,21,0,72,17,0,21,16,22,0,74,11,14,21,0,61,0,39,0,69,7,16,21,0,60,0,39,0,70,7,16,21,0,48,0,29,21,0,33,17,0,0,0,59,17,21,0,59,21,0,48,0,29,21,0,35,17,0,0,0,59,17,21,0,32,21,0,1,0,0,21,0,43,17,0,27,21,0,39,17,0,0,21,1,11,0,30,16,0,1,0,71,17,17,21,0,4,0,29,21,0,51,17,0,0,0,60,17,21,0,42,0,29,21,0,52,17,0,2,0,73,17,0,1,21,0,53,17,0,0,0,72,17,0,14,0,47,0,53,8,0,2,0,55,19,0,0,0,19,19,16,3,9,0,21,16,0,21,21,0,74,17,0,29,21,0,73,17,22,0,75,11,14,21,0,24,0,0,21,0,64,17,0,39,0,11,0,46,0,22,8,7,21,0,61,0,13,0,46,0,22,8,21,0,74,17,21,1,22,21,0,73,17,0,21,0,56,17,0,27,16,0,37,0,29,7,21,0,75,0,6,0,56,17,0,41,0,4,7,0,66,17,0,5,16,0,0,0,56,17,0,21,0,57,17,0,44,0,0,7,16,17,17,0,39,0,21,7,0,61,0,25,0,46,0,26,0,48,0,40,0,22,7,8,8,0,59,17,0,20,16,0,29,21,0,23,17,17,22,0,76,11,14,0,69,0,21,21,0,75,17,21,1,29,16,21,0,57,21,0,76,3,3,25,21,0,1,21,1,26,16,22,0,3,22,0,4,22,0,5,22,0,6,4,4,11,14,21,0,3,21,1,32,21,0,5,21,0,4,3,2,17,22,0,7,22,0,8,22,0,9,4,3,11,14,21,0,6,0,39,21,1,28,7,16,0,21,21,0,2,17,0,29,21,1,23,0,16,21,0,8,17,0,2,21,0,2,0,13,16,0,1,21,0,5,17,0,0,21,1,23,17,17,0,1,21,0,8,17,17,22,0,10,11,14,21,0,7,21,0,10,21,0,9,3,3,25,21,0,1,0,26,16,0,30,16,0,14,0,57,17,25,21,0,1,0,29,0,47,21,0,2,0,27,21,0,1,17,8,0,49,0,39,0,56,7,8,16,21,1,10,21,0,2,0,37,0,29,7,16,17,25,21,0,2,0,2,16,22,0,3,11,14,21,0,1,21,0,3,0,42,0,10,7,16,0,51,0,27,0,47,21,0,3,8,0,46,21,1,3,0,48,0,3,8,0,5,9,0,48,21,0,0,8,8,0,21,0,7,0,0,21,0,3,0,48,0,2,8,19,0,47,21,1,3,8,19,8,0,56,0,1,21,0,2,17,17,25,21,0,1,0,24,0,56,17,0,37,0,21,7,0,57,17,0,0,21,0,2,17,0,44,0,6,7,16,0,6,21,0,1,17,25,0,32,0,14,0,18,0,45,0,13,8,19,0,37,0,27,7,0,19,19,0,0,21,0,2,19,0,37,0,29,7,21,2,4,19,0,21,0,88,19,0,21,21,0,1,19,0,21,0,96,19,25])
,[runtime[0],runtime[1],runtime[2],runtime[3],runtime[4],runtime[6],runtime[7],runtime[8],runtime[9],runtime[10],runtime[11],runtime[12],runtime[13],runtime[14],runtime[15],runtime[16],runtime[17],runtime[19],runtime[20],runtime[21],runtime[22],runtime[23],runtime[24],runtime[25],runtime[26],runtime[27],runtime[28],runtime[30],runtime[31],runtime[33],runtime[34],runtime[35],runtime[36],runtime[37],runtime[38],runtime[39],runtime[40],runtime[42],runtime[43],runtime[44],runtime[45],runtime[46],runtime[47],runtime[48],runtime[49],runtime[50],runtime[51],runtime[52],runtime[53],runtime[54],runtime[56],runtime[59],'
,[[0,1,0,34],[0,0,475,3],[1,1,541,4],[0,0,634,34],[0,0,1945,13],[0,0,2267,6],[0,0,2373,6],[0,0,2486,3],[0,0,2516,77],[0,0,5808,11],[0,0,5931,3],[0,0,5946,3],[0,0,5986,4],[0,0,6072,3],[2,1,6107,3]]
);
+runtime[40] = assertFn("Assertion failed");
+runtime.map((r,i) => {
+ let prims = "+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!˙˜˘¨⌜⁼´˝`∘○⊸⟜⌾⊘◶⎉⚇⍟";
+ r.glyph = prims.charAt(i); // Used to format
+});
let bqn = src => run.apply(null,compile(str(src),runtime));
// Formatter
diff --git a/docs/repl.js b/docs/repl.js
index 2dbcc085..8ee1370b 100644
--- a/docs/repl.js
+++ b/docs/repl.js
@@ -16,7 +16,7 @@ let repl = ()=>{
} catch(e) {
//if (console&&console.error) console.error(e.stack);
doc.rslt.classList.add('err');
- doc.rslt.textContent=e;
+ doc.rslt.textContent=e.message||'Error';
}
}, 0);
}