diff --git a/src/builtins/arithd.c b/src/builtins/arithd.c index 0b0f5299..5acb78ba 100644 --- a/src/builtins/arithd.c +++ b/src/builtins/arithd.c @@ -141,7 +141,7 @@ static B modint_AS(B w, B xv) { return modint_AA(w, C2(shape, C1(fne, incG(w)) #define GC2f(SYMB, NAME, EXPR, DECOR, INT_SA, INT_AS, INT_AA, FLT_SAI, ANY_AS) B NAME##_c2_arr(B t, B w, B x) { \ if (isArr(w)|isArr(x)) { B r; \ if (isArr(w)&isArr(x) && RNK(w)==RNK(x)) { \ - if (!eqShPart(SH(w), SH(x), RNK(w))) thrF(SYMB ": Expected equal shape prefix (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", w, x); \ + if (!eqShPart(SH(w), SH(x), RNK(w))) thrF("𝕨" SYMB "𝕩: Expected equal shape prefix (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", w, x); \ usz ia = IA(x); \ u8 we = TI(w,elType); \ u8 xe = TI(x,elType); \ @@ -168,7 +168,7 @@ static B modint_AS(B w, B xv) { return modint_AA(w, C2(shape, C1(fne, incG(w)) } \ P2(NAME) \ } \ - thrM(SYMB ": Unexpected argument types"); \ + thrM("𝕨" SYMB "𝕩: Unexpected argument types"); \ } GC2f("÷", div , w.f/(x.f+0), , /*INT_SA*/ @@ -284,7 +284,7 @@ static B modint_AS(B w, B xv) { return modint_AA(w, C2(shape, C1(fne, incG(w)) #define AR_I_AA(CHR, NAME, EXPR, BIT, EXTRA) NOINLINE B NAME##_AA(B t, B w, B x) { \ ur wr=RNK(w); usz* xsh=SH(x); \ ur xr=RNK(x); usz* wsh=SH(w); ur mr=wrCHR_MAX) thrM("-: Invalid character"); // safe - see add + if (rp[i]>CHR_MAX) thrM("𝕨-𝕩: Invalid character"); // safe - see add } goto dec_ret; } @@ -369,7 +369,7 @@ static B modint_AS(B w, B xv) { return modint_AA(w, C2(shape, C1(fne, incG(w)) u32* rp; r = m_c32arrc(&rp, x); for (usz i = 0; i < xia; i++) { rp[i] = (u32)(xp[i]+(i32)wv); - if (rp[i]>CHR_MAX) thrM("+: Invalid character"); // safe to only check this as wv already must be below CHR_MAX, which is less than U32_MAX/2 + if (rp[i]>CHR_MAX) thrM("𝕨+𝕩: Invalid character"); // safe to only check this as wv already must be below CHR_MAX, which is less than U32_MAX/2 } goto dec_ret; } @@ -407,15 +407,15 @@ static B modint_AS(B w, B xv) { return modint_AA(w, C2(shape, C1(fne, incG(w)) #define AR_I_SCALAR(CHR, NAME, EXPR, MORE) B NAME##_c2(B t, B w, B x) { \ if (isF64(w) & isF64(x)) return m_f64(EXPR); \ MORE; AR_I_TO_ARR(NAME) \ - thrM(CHR ": Unexpected argument types"); \ + thrM("𝕨"CHR "𝕩: Unexpected argument types"); \ } AR_I_SCALAR("+", add, w.f+x.f, { - if (isC32(w) & isF64(x)) { u64 r = (u64)(o2cG(w)+o2i64(x)); if(r>CHR_MAX)thrM("+: Invalid character"); return m_c32((u32)r); } - if (isF64(w) & isC32(x)) { u64 r = (u64)(o2cG(x)+o2i64(w)); if(r>CHR_MAX)thrM("+: Invalid character"); return m_c32((u32)r); } + if (isC32(w) & isF64(x)) { u64 r = (u64)(o2cG(w)+o2i64(x)); if(r>CHR_MAX)thrM("𝕨+𝕩: Invalid character"); return m_c32((u32)r); } + if (isF64(w) & isC32(x)) { u64 r = (u64)(o2cG(x)+o2i64(w)); if(r>CHR_MAX)thrM("𝕨+𝕩: Invalid character"); return m_c32((u32)r); } }); AR_I_SCALAR("-", sub, w.f-x.f, { - if (isC32(w) & isF64(x)) { u64 r = (u64)((i32)o2cG(w)-o2i64(x)); if(r>CHR_MAX)thrM("-: Invalid character"); return m_c32((u32)r); } + if (isC32(w) & isF64(x)) { u64 r = (u64)((i32)o2cG(w)-o2i64(x)); if(r>CHR_MAX)thrM("𝕨-𝕩: Invalid character"); return m_c32((u32)r); } if (isC32(w) & isC32(x)) return m_f64((i32)(u32)w.u - (i32)(u32)x.u); }) AR_I_SCALAR("×", mul, w.f*x.f, {}) @@ -431,7 +431,7 @@ B not_c2(B t, B w, B x) { #define AR_F_SCALAR(CHR, NAME, EXPR) B NAME##_c2(B t, B w, B x) { \ if (isF64(w) & isF64(x)) return m_f64(EXPR); \ AR_F_TO_ARR(NAME) \ - thrM(CHR ": Unexpected argument types"); \ + thrM("𝕨"CHR "𝕩: Unexpected argument types"); \ } AR_F_SCALAR("÷", div , w.f/(x.f+0)) AR_F_SCALAR("⋆", pow , pow(w.f+0, x.f)) @@ -478,7 +478,7 @@ static f64 bqn_atan2iw(f64 x, f64 w) { return w / (tan(x)+0); } #define MATH(n,N,I) B n##_c2(B t, B w, B x) { \ if (isNum(w) && isNum(x)) return m_f64(I(x.f, w.f)); \ P2(n) \ - thrM("•math." N ": Unexpected argument types"); \ + thrM("𝕨 •math." N " 𝕩: Unexpected argument types"); \ } MATH(atan2,"Atan2",bqn_atan2) MATH(atan2ix,"Atan2⁼",bqn_atan2ix) @@ -510,19 +510,19 @@ static u64 lcm_u64(u64 a, u64 b) { } B gcd_c2(B t, B w, B x) { if (isNum(w) && isNum(x)) { - if (!q_u64(w) || !q_u64(x)) thrM("•math.GCD: Inputs other than natural numbers not yet supported"); + if (!q_u64(w) || !q_u64(x)) thrM("𝕨 •math.GCD 𝕩: Inputs other than natural numbers not yet supported"); return m_f64(gcd_u64(o2u64G(w), o2u64G(x))); } P2(gcd) - thrM("•math.GCD: Unexpected argument types"); + thrM("𝕨 •math.GCD 𝕩: Unexpected argument types"); } B lcm_c2(B t, B w, B x) { if (isNum(w) && isNum(x)) { - if (!q_u64(w) || !q_u64(x)) thrM("•math.LCM: Inputs other than natural numbers not yet supported"); + if (!q_u64(w) || !q_u64(x)) thrM("𝕨 •math.LCM 𝕩: Inputs other than natural numbers not yet supported"); return m_f64(lcm_u64(o2u64G(w), o2u64G(x))); } P2(lcm) - thrM("•math.LCM: Unexpected argument types"); + thrM("𝕨 •math.LCM 𝕩: Unexpected argument types"); } #undef P2 diff --git a/src/builtins/arithm.c b/src/builtins/arithm.c index cb98fc38..13e04185 100644 --- a/src/builtins/arithm.c +++ b/src/builtins/arithm.c @@ -23,7 +23,7 @@ B bit_negate(B x) { // consumes B add_c1(B t, B x) { if (isF64(x)) return x; - if (!isArr(x)) thrM("+: Argument must consist of numbers"); + if (!isArr(x)) thrM("+𝕩: Argument must consist of numbers"); if (elNum(TI(x,elType))) return x; decG(eachm_fn(m_f64(0), incG(x), add_c1)); return x; @@ -35,7 +35,7 @@ B add_c1(B t, B x) { #define GC1i(SYMB,NAME,FEXPR,TMIN,RMIN,MAIN) B NAME##_c1(B t, B x) { \ if (isF64(x)) { f64 v = x.f; return m_f64(FEXPR); } \ - if (RARE(!isArr(x))) thrM(SYMB ": Argument contained non-number"); \ + if (RARE(!isArr(x))) thrM(SYMB "𝕩: 𝕩 contained non-number"); \ u8 xe = TI(x,elType); \ if (elNum(xe)) { \ if (xe<=TMIN) return RMIN; \ @@ -112,8 +112,8 @@ GC1i("¬", not, 1-v, el_bit, bit_negate(x), NOT_BODY) thrM(MSG); \ } -GC1f( div, 1/(xv+0), "÷: Argument contained non-number") -GC1f(root, sqrt(xv), "√: Argument contained non-number") +GC1f( div, 1/(xv+0), "÷𝕩: 𝕩 contained non-number") +GC1f(root, sqrt(xv), "√𝕩: 𝕩 contained non-number") #undef GC1i #undef LOOP_BODY #undef SIGN_EXPR @@ -142,13 +142,13 @@ NOINLINE f64 logfact_inv(f64 y) { f64 fact_inv(f64 y) { return logfact_inv(log(y)); } #define P1(N) { if(isArr(x)) { SLOW1("arithm " #N, x); return arith_recm(N##_c1, x); } } -B pow_c1(B t, B x) { if (isF64(x)) return m_f64( exp(x.f)); P1( pow); thrM("⋆: Argument contained non-number"); } -B log_c1(B t, B x) { if (isF64(x)) return m_f64( log(x.f)); P1( log); thrM("⋆⁼: Argument contained non-number"); } +B pow_c1(B t, B x) { if (isF64(x)) return m_f64( exp(x.f)); P1( pow); thrM("⋆𝕩: 𝕩 contained non-number"); } +B log_c1(B t, B x) { if (isF64(x)) return m_f64( log(x.f)); P1( log); thrM("⋆⁼𝕩: 𝕩 contained non-number"); } #undef P1 static NOINLINE B arith_recm_slow(f64 (*fn)(f64), FC1 rec, B x, char* s) { if (isF64(x)) return m_f64(fn(x.f)); if(isArr(x)) return arith_recm(rec, x); - thrF("•math.%S: Argument contained non-number", s); + thrF("•math.%S 𝕩: 𝕩 contained non-number", s); } #define MATH(n,N) B n##_c1(B t, B x) { return arith_recm_slow(n, n##_c1, x, #N); } MATH(cbrt,Cbrt) MATH(log2,Log2) MATH(log10,Log10) MATH(log1p,Log1p) MATH(expm1,Expm1) diff --git a/src/builtins/cells.c b/src/builtins/cells.c index 86efebec..cf7934a6 100644 --- a/src/builtins/cells.c +++ b/src/builtins/cells.c @@ -433,7 +433,7 @@ B for_cells_c1(B f, u32 xr, u32 cr, u32 k, B x, u32 chr) { // F⎉cr x; array x, return select_cells(0, x, cam, k, true); case n_couple: { Arr* r = cpyWithShape(x); xsh=PSH(r); - if (xr==UR_MAX) thrF("≍%c: Result rank too large (%i≡=𝕩)", chr, xr); + if (xr==UR_MAX) thrF("≍%U 𝕩: Result rank too large (%i≡=𝕩)", chr==U'˘'? "˘" : "⎉𝕘", xr); ShArr* rsh = m_shArr(xr+1); shcpy(rsh->a, xsh, k); rsh->a[k] = 1; @@ -722,7 +722,7 @@ NOINLINE B for_cells_SA(B f, B w, B x, ur xcr, ur xr, u32 chr) { // w⊸F⎉xcr } if (isF64(w) && xcr>=1) { usz l = xsh[xk]; - return select_cells(WRAP(o2i64(w), l, thrF("⊏: Indexing out-of-bounds (𝕨≡%R, %s≡≠𝕩)", w, l)), x, cam, xk, false); + return select_cells(WRAP(o2i64(w), l, thrF("𝕨⊏𝕩: Indexing out-of-bounds (𝕨≡%R, %s≡≠𝕩)", w, l)), x, cam, xk, false); } break; case n_couple: if (RNK(x)==1) { @@ -732,7 +732,7 @@ NOINLINE B for_cells_SA(B f, B w, B x, ur xcr, ur xr, u32 chr) { // w⊸F⎉xcr } break; case n_pick: if (isF64(w) && xcr==1 && TI(x,arrD1)) { usz l = xsh[xk]; - return select_cells(WRAP(o2i64(w), l, thrF("⊑: Indexing out-of-bounds (𝕨≡%R, %s≡≠𝕩)", w, l)), x, cam, xk, true); + return select_cells(WRAP(o2i64(w), l, thrF("𝕨⊑𝕩: Indexing out-of-bounds (𝕨≡%R, %s≡≠𝕩)", w, l)), x, cam, xk, true); } break; case n_shifta: case n_shiftb: if (isAtm(w)) { if (IA(x)==0) return x; @@ -811,7 +811,7 @@ NOINLINE B for_cells_AA(B f, B w, B x, ur wcr, ur xcr, u32 chr) { // w F⎉wcr usz cam0 = 1; for (usz i = 0; i < k; i++) { usz wl = wsh[i], xl = xsh[i]; - if (wl != xl) thrF("%c: Argument frames don't agree (%H ≡ ≢𝕨, %H ≡ ≢𝕩, common frame of %i axes)", chr, w, x, k); + if (wl != xl) thrF("𝕨%c𝕩: Argument frames don't agree (%H ≡ ≢𝕨, %H ≡ ≢𝕩, common frame of %i axes)", chr, w, x, k); cam0*= wsh[i]; } usz ext = shProd(zsh, k, zk); diff --git a/src/builtins/cmp.c b/src/builtins/cmp.c index 9b2e7db2..819b76b7 100644 --- a/src/builtins/cmp.c +++ b/src/builtins/cmp.c @@ -154,7 +154,7 @@ B leading_axis_arith(FC2 fc2, B w, B x, usz* wsh, usz* xsh, ur mr); if (ria) cmp_fns_##NAME##AA[we](rp, tyany_ptr(w), tyany_ptr(x), ria); \ decG(w);decG(x); return r; \ base: return NAME##_rec(swapped,w,x); \ - badShape: thrF("%U: Expected equal shape prefix (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", swapped?CR:CN, swapped?x:w, swapped?w:x); \ + badShape: thrF("𝕨%U𝕩: Expected equal shape prefix (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", swapped?CR:CN, swapped?x:w, swapped?w:x); \ } CMP_AA_D("≥", "≤", ge, ) CMP_AA_D(">", "<", gt, ) diff --git a/src/builtins/compare.c b/src/builtins/compare.c index 55176fe5..a9de9c58 100644 --- a/src/builtins/compare.c +++ b/src/builtins/compare.c @@ -236,4 +236,4 @@ bool eequal(B w, B x) { // doesn't consume if (we==el_f64 && xe==el_f64) return eequalFloat(f64any_ptr(w), f64any_ptr(x), ia); if (RARE(we==el_B || xe==el_B)) return eequalSlow(w, x, ia); return equalTyped(w, x, we, xe, ia); -} \ No newline at end of file +} diff --git a/src/builtins/fns.c b/src/builtins/fns.c index 567b96f9..16840c2a 100644 --- a/src/builtins/fns.c +++ b/src/builtins/fns.c @@ -60,8 +60,8 @@ static B* ud_rec(B* p, usz d, usz r, i32* pos, usz* sh) { NOINLINE B list_range(B x) { SGetU(x) usz xia = IA(x); - if (RNK(x)!=1) thrF("↕: Argument must be either an integer or integer list (had rank %i)", RNK(x)); - if (xia>UR_MAX) thrF("↕: Result rank too large (%s≡≠𝕩)", xia); + if (RNK(x)!=1) thrF("↕𝕩: 𝕩 must be either an integer or integer list (had rank %i)", RNK(x)); + if (xia>UR_MAX) thrF("↕𝕩: Result rank too large (%s≡≠𝕩)", xia); if (xia==0) { decG(x); return m_funit(emptyIVec()); } usz sh[xia]; // stack allocation of rank items i32 pos[xia]; @@ -73,7 +73,7 @@ NOINLINE B list_range(B x) { good|= c==0; bad|= (c > I32_MAX) | mulOn(ria, c); } - if (bad && !good) thrM("↕: Result too large"); + if (bad && !good) thrM("↕𝕩: Result too large"); decG(x); Arr* r = m_fillarr0p(ria); @@ -110,13 +110,13 @@ B slash_c2(B t, B w, B x); B ud_c2(B t, B w, B x) { usz wia=1; if (isArr(w)) { - if (RNK(w)>1) thrM("↕: 𝕨 must have rank at most 1"); + if (RNK(w)>1) thrM("𝕨↕𝕩: 𝕨 must have rank at most 1"); wia = IA(w); if (wia==0) { decG(w); return isArr(x)? x : m_unit(x); } } ur xr; - if (isAtm(x) || (xr=RNK(x)) UR_MAX) thrM("↕: Result rank too large"); + if (isAtm(x) || (xr=RNK(x)) UR_MAX) thrM("𝕨↕𝕩: Result rank too large"); ur wr = wia; ur rr = xr + wr; ShArr* sh = m_shArr(rr); @@ -135,7 +135,7 @@ B ud_c2(B t, B w, B x) { for (usz i=0; i xr) thrF("⍷: Rank of 𝕨 must be at most rank of 𝕩 (%i≡=𝕨, %i≡=𝕩)", wr, xr); + if (wr > xr) thrF("𝕨⍷𝕩: Rank of 𝕨 must be at most rank of 𝕩 (%i≡=𝕨, %i≡=𝕩)", wr, xr); u8 xe, we ONLY_GCC(= 0); B r; if (xr==1 && (xe=TI(x,elType))!=el_B && xe!=el_bit && (isAtm(w) || (we=TI(w,elType))!=el_B)) { diff --git a/src/builtins/fold.c b/src/builtins/fold.c index 90b795dc..bb9312ca 100644 --- a/src/builtins/fold.c +++ b/src/builtins/fold.c @@ -103,13 +103,13 @@ static i64 (*const sum_small_fns[])(void*, usz) = { sum_small_i8, sum_small_i16, static f64 (*const sum_fns[])(void*, usz, f64) = { sum_i8, sum_i16, sum_i32, sum_f64 }; B sum_c1(B t, B x) { - if (isAtm(x) || RNK(x)!=1) thrF("•math.Sum: Argument must be a list (%H ≡ ≢𝕩)", x); + if (isAtm(x) || RNK(x)!=1) thrF("•math.Sum 𝕩: 𝕩 must be a list (%H ≡ ≢𝕩)", x); usz ia = IA(x); if (ia==0) { decG(x); return m_f64(0); } u8 xe = TI(x,elType); if (!elNum(xe)) { x = any_squeeze(x); xe = TI(x,elType); - if (!elNum(xe)) thrF("•math.Sum: Argument elements must be numbers", x); + if (!elNum(xe)) thrF("•math.Sum 𝕩: 𝕩 elements must be numbers", x); } f64 r; void* xv = tyany_ptr(x); @@ -180,7 +180,7 @@ static f64 (*const min_fns[])(void*, usz) = { min_i8, min_i16, min_i32, min_f64 static f64 (*const max_fns[])(void*, usz) = { max_i8, max_i16, max_i32, max_f64 }; B fold_c1(Md1D* d, B x) { B f = d->f; - if (isAtm(x) || RNK(x)!=1) thrF("´: Argument must be a list (%H ≡ ≢𝕩)", x); + if (isAtm(x) || RNK(x)!=1) thrF("𝔽´𝕩: 𝕩 must be a list (%H ≡ ≢𝕩)", x); usz ia = IA(x); if (ia<=2) { if (ia==2) { @@ -197,7 +197,7 @@ B fold_c1(Md1D* d, B x) { B f = d->f; B r = TI(f,identity)(f); if (!q_N(r)) return r; } - thrM("´: Identity not found"); + thrM("𝔽´𝕩: Identity not found"); } } if (RARE(!isFun(f))) { decG(x); if (isMd(f)) thrM("Calling a modifier"); return inc(f); } @@ -268,7 +268,7 @@ B fold_c1(Md1D* d, B x) { B f = d->f; } B fold_c2(Md1D* d, B w, B x) { B f = d->f; - if (isAtm(x) || RNK(x)!=1) thrF("´: 𝕩 must be a list (%H ≡ ≢𝕩)", x); + if (isAtm(x) || RNK(x)!=1) thrF("𝕨𝔽´𝕩: 𝕩 must be a list (%H ≡ ≢𝕩)", x); usz ia = IA(x); if (RARE(ia==0)) { decG(x); return w; } if (RARE(!isFun(f))) { dec(w); decG(x); if (isMd(f)) thrM("Calling a modifier"); return inc(f); } @@ -385,7 +385,7 @@ extern B insert_base(B f, B x, bool has_w, B w); // from cells.c B insert_c1(Md1D* d, B x) { B f = d->f; ur xr; - if (isAtm(x) || (xr=RNK(x))==0) thrM("˝: 𝕩 must have rank at least 1"); + if (isAtm(x) || (xr=RNK(x))==0) thrM("𝔽˝𝕩: 𝕩 must have rank at least 1"); usz len = *SH(x); if (len==0) { if (isFun(f)) { @@ -400,11 +400,11 @@ B insert_c1(Md1D* d, B x) { B f = d->f; } decG(x); return taga(r); } else if (RTID(f) == n_join) { - if (xr <= 1) thrM("˝: Identity does not exist"); + if (xr <= 1) thrM("𝔽˝𝕩: Identity does not exist"); goto join; } } - thrM("˝: Identity not found"); + thrM("𝔽˝𝕩: Identity not found"); } if (len==1) return C1(select, x); if (RARE(!isFun(f))) { decG(x); if (isMd(f)) thrM("Calling a modifier"); return inc(f); } @@ -444,7 +444,7 @@ B insert_c1(Md1D* d, B x) { B f = d->f; } B insert_c2(Md1D* d, B w, B x) { B f = d->f; ur xr; - if (isAtm(x) || (xr=RNK(x))==0) thrM("˝: 𝕩 must have rank at least 1"); + if (isAtm(x) || (xr=RNK(x))==0) thrM("𝕨˝𝕩: 𝕩 must have rank at least 1"); usz len = *SH(x); if (len==0) { decG(x); return w; } if (RARE(!isFun(f))) { dec(w); decG(x); if (isMd(f)) thrM("Calling a modifier"); return inc(f); } diff --git a/src/builtins/grade.h b/src/builtins/grade.h index b75d31ab..0bb5b19c 100644 --- a/src/builtins/grade.h +++ b/src/builtins/grade.h @@ -204,7 +204,7 @@ extern i8 (*const simd_count_i8)(u16*, u16*, void*, u64, i8); #define SORT_C1 CAT(GRADE_UD(and,or),c1) B SORT_C1(B t, B x) { - if (isAtm(x) || RNK(x)==0) thrM(GRADE_UD("∧","∨")": Argument cannot have rank 0"); + if (isAtm(x) || RNK(x)==0) thrM(GRADE_UD("∧","∨")"𝕩: 𝕩 cannot have rank 0"); usz n = *SH(x); if (n <= 1 || FL_HAS(x,GRADE_UD(fl_asc,fl_dsc))) return x; if (RNK(x)!=1) return IA(x)<=1? x : bqn_merge(SORT_C1(t, toCells(x)), 0); @@ -278,7 +278,7 @@ extern B grade_bool(B x, usz ia, bool up); // slash.c #define GRADE_CHR GRADE_UD("⍋","⍒") B GRADE_CAT(c1)(B t, B x) { - if (isAtm(x) || RNK(x)==0) thrM(GRADE_CHR": Argument cannot be a unit"); + if (isAtm(x) || RNK(x)==0) thrM(GRADE_CHR"𝕩: 𝕩 cannot be a unit"); if (RNK(x)>1) x = toCells(x); usz ia = IA(x); B r; @@ -292,7 +292,7 @@ B GRADE_CAT(c1)(B t, B x) { u8 xe = TI(x,elType); if (xe==el_bit) return grade_bool(x, ia, GRADE_UD(1,0)); - if (ia>I32_MAX) thrM(GRADE_CHR": Argument too large"); + if (ia>I32_MAX) thrM(GRADE_CHR"𝕩: 𝕩 too large"); i32* rp; r = m_i32arrv(&rp, ia); if (xe==el_i8 && ia>8) { i8* xp = i8any_ptr(x); usz n=ia; @@ -421,13 +421,13 @@ extern B select_c2(B,B,B); extern B mul_c2(B,B,B); B GRADE_CAT(c2)(B t, B w, B x) { - if (isAtm(w) || RNK(w)==0) thrM(GRADE_CHR": 𝕨 must have rank≥1"); + if (isAtm(w) || RNK(w)==0) thrM("𝕨"GRADE_CHR"𝕩: 𝕨 must have rank≥1"); if (isAtm(x)) x = m_unit(x); ur wr = RNK(w); if (wr > 1) { ur xr = RNK(x); - if (wr > xr+1) thrM(GRADE_CHR": =𝕨 cannot be greater than =𝕩"); + if (wr > xr+1) thrM("𝕨"GRADE_CHR"𝕩: =𝕨 cannot be greater than =𝕩"); i32 nxr = xr-wr+1; x = toKCells(x, nxr); w = toCells(w); @@ -466,11 +466,11 @@ B GRADE_CAT(c2)(B t, B w, B x) { } goto done; } - if (wia>I32_MAX-10) thrM(GRADE_CHR": 𝕨 too big"); + if (wia>I32_MAX-10) thrM("𝕨"GRADE_CHR"𝕩: 𝕨 too big"); u8 fl = GRADE_UD(fl_asc,fl_dsc); if (CHECK_VALID && !FL_HAS(w,fl)) { - if (!CAT(isSorted,GRADE_UD(Up,Down))(w)) thrM(GRADE_CHR": 𝕨 must be sorted"GRADE_UD(," in descending order")); + if (!CAT(isSorted,GRADE_UD(Up,Down))(w)) thrM("𝕨"GRADE_CHR"𝕩: 𝕨 must be sorted"GRADE_UD(," in descending order")); FL_SET(w, fl); } diff --git a/src/builtins/group.c b/src/builtins/group.c index 5d462865..3c07668c 100644 --- a/src/builtins/group.c +++ b/src/builtins/group.c @@ -77,7 +77,7 @@ static B group_simple(B w, B x, ur xr, usz wia, usz xn, usz* xsh, u8 we) { case el_bit: ria = xn? 1+bit_has(wp0,xn,1) : wia? bitp_get(wp0,0) : 0; break; } #undef CASE - if (bad) thrM("⊔: 𝕨 can't contain elements less than ¯1"); + if (bad) thrM("𝕨⊔𝕩: 𝕨 can't contain elements less than ¯1"); if (ria > (i64)(USZ_MAX)) thrOOM(); Arr* r = m_fillarr0p(ria); @@ -261,7 +261,7 @@ static B group_simple(B w, B x, ur xr, usz wia, usz xn, usz* xsh, u8 we) { extern GLOBAL B rt_group; B group_c2(B t, B w, B x) { - if (isAtm(x)) thrM("⊔: 𝕩 must be an array"); + if (isAtm(x)) thrM("𝕨⊔𝕩: 𝕩 must be an array"); ur xr = RNK(x); if (isArr(w) && RNK(w)==1 && xr>=1) { u8 we = TI(w,elType); @@ -273,7 +273,7 @@ B group_c2(B t, B w, B x) { usz wia = IA(w); usz* xsh = SH(x); usz xn = *xsh; - if (wia-(u64)xn > 1) thrF("⊔: ≠𝕨 must be either ≠𝕩 or one bigger (%s≡≠𝕨, %s≡≠𝕩)", wia, xn); + if (wia-(u64)xn > 1) thrF("𝕨⊔𝕩: ≠𝕨 must be either ≠𝕩 or one bigger (%s≡≠𝕨, %s≡≠𝕩)", wia, xn); return group_simple(w, x, xr, wia, xn, xsh, we); } } diff --git a/src/builtins/internal.c b/src/builtins/internal.c index d125b0ce..dee8129e 100644 --- a/src/builtins/internal.c +++ b/src/builtins/internal.c @@ -85,9 +85,9 @@ FOR_VARIATION(F) STATIC_GLOBAL B listVariations_def; B listVariations_c2(B t, B w, B x) { - if (!isArr(x)) thrM("•internal.ListVariations: 𝕩 must be an array"); + if (!isArr(x)) thrM("𝕨•internal.ListVariations𝕩: 𝕩 must be an array"); - if (!isArr(w) || RNK(w)!=1) thrM("•internal.ListVariations: 𝕨 must be a list"); + if (!isArr(w) || RNK(w)!=1) thrM("𝕨•internal.ListVariations𝕩: 𝕨 must be a list"); usz wia = IA(w); SGetU(w) bool c_incr=false, c_rmFill=false; @@ -95,7 +95,7 @@ B listVariations_c2(B t, B w, B x) { u32 c = o2c(GetU(w, i)); if (c=='i') c_incr=true; else if (c=='f') c_rmFill=true; - else thrF("internal.ListVariations: Unknown option '%c' in 𝕨", c); + else thrF("𝕨internal.ListVariations𝕩: Unknown option '%c' in 𝕨", c); } decG(w); @@ -164,13 +164,13 @@ static bool u8_get(u8** cv, u8* cE, const char* x) { STATIC_GLOBAL B variation_refs; B variation_c2(B t, B w, B x) { - if (!isArr(w)) thrM("•internal.Variation: Non-array 𝕨"); - if (!isArr(x)) thrM("•internal.Variation: Non-array 𝕩"); + if (!isArr(w)) thrM("𝕨•internal.Variation𝕩: Non-array 𝕨"); + if (!isArr(x)) thrM("𝕨•internal.Variation𝕩: Non-array 𝕩"); usz xia = IA(x); C8Arr* wc = toC8Arr(w); u8* wp = c8arrv_ptr(wc); u8* wpE = wp+PIA(wc); - if (PIA(wc)==0) thrM("•internal.Variation: Zero-length 𝕨"); + if (PIA(wc)==0) thrM("𝕨•internal.Variation𝕩: Zero-length 𝕨"); B res; if (*wp == 'A' || *wp == 'S') { bool slice = *wp == 'S'; @@ -192,7 +192,7 @@ B variation_c2(B t, B w, B x) { NOGC_E; res = taga(r); - } else thrF("•internal.Variation: Bad type \"%R\"", taga(wc)); + } else thrF("𝕨•internal.Variation𝕩: Bad type \"%R\"", taga(wc)); if (slice) { Arr* slice = TI(res,slice)(incG(res), 0, IA(res)); @@ -207,8 +207,8 @@ B variation_c2(B t, B w, B x) { } variation_refs = vec_addN(variation_refs, incG(res)); } - if (wp!=wpE) thrM("•internal.Variation: Bad 𝕨"); - } else thrM("•internal.Variation: Bad start of 𝕨"); + if (wp!=wpE) thrM("𝕨•internal.Variation𝕩: Bad 𝕨"); + } else thrM("𝕨•internal.Variation𝕩: Bad start of 𝕨"); decG(x); ptr_dec(wc); return res; @@ -257,7 +257,7 @@ static B unshare(B x) { for (usz i = 0; i < xia; i++) rp[i] = unshare(xp[i]); return unshareShape(r); } - default: thrF("•internal.Unshare: Cannot unshare array with type %i=%S", TY(x), type_repr(TY(x))); + default: thrF("𝕨•internal.Unshare𝕩: Cannot unshare array with type %i=%S", TY(x), type_repr(TY(x))); } } @@ -384,7 +384,7 @@ B iPureKeep_c1(B t, B x) { return x; } B iKeep_c1(B t, B x) { return x; } B iProperties_c2(B t, B w, B x) { - if (w.u!=m_c32(0).u || x.u != m_c32(0).u) thrM("•internal.Properties: bad arg"); + if (w.u!=m_c32(0).u || x.u != m_c32(0).u) thrM("𝕨•internal.Properties𝕩: bad arg"); i32* rp; B r = m_i32arrv(&rp, 3); rp[0] = sizeof(usz)*8; @@ -394,7 +394,7 @@ B iProperties_c2(B t, B w, B x) { } B unshare_c1(B t, B x) { - if (!isArr(x)) thrM("•internal.Unshare: Argument must be an array"); + if (!isArr(x)) thrM("•internal.Unshare𝕩: 𝕩 must be an array"); B r = unshare(x); decG(x); return r; diff --git a/src/builtins/md1.c b/src/builtins/md1.c index 4f8eb293..dfbd2db4 100644 --- a/src/builtins/md1.c +++ b/src/builtins/md1.c @@ -70,7 +70,7 @@ B tbl_c2(Md1D* d, B w, B x) { B f = d->f; ur wr = RNK(w); usz wia = IA(w); ur xr = RNK(x); usz xia = IA(x); ur rr = wr+xr; usz ria = uszMul(wia, xia); - if (rrf, x , w); } B timed_c2(Md1D* d, B w, B x) { B f = d->f; i64 am = o2i64(w); - if (am<=0) thrM("•_timed: 𝕨 must be an integer greater than 1"); + if (am<=0) thrM("𝕨 𝔽•_timed 𝕩: 𝕨 must be an integer greater than 0"); incBy(x, am-1); FC1 fc1 = c1fn(f); u64 sns = nsTime(); diff --git a/src/builtins/md2.c b/src/builtins/md2.c index 05b38d26..919bc8ba 100644 --- a/src/builtins/md2.c +++ b/src/builtins/md2.c @@ -144,8 +144,8 @@ B pick_c2(B t, B w, B x); B cond_c1(Md2D* d, B x) { B f=d->f; B g=d->g; B fr = c1iX(f, x); if (isNum(fr)) { - if (isAtm(g)||RNK(g)!=1) thrM("◶: 𝕘 must have rank 1 when index is a number"); - usz fri = WRAP(o2i64(fr), IA(g), thrM("◶: Index out of bounds of 𝕘")); + if (isAtm(g)||RNK(g)!=1) thrM("𝔽◶𝕘𝕩: 𝕘 must have rank 1 when index is a number"); + usz fri = WRAP(o2i64(fr), IA(g), thrM("𝔽◶𝕘𝕩: Index out of bounds of 𝕘")); return c1(IGetU(g, fri), x); } else { B fn = C2(pick, fr, inc(g)); @@ -157,8 +157,8 @@ B cond_c1(Md2D* d, B x) { B f=d->f; B g=d->g; B cond_c2(Md2D* d, B w, B x) { B g=d->g; B fr = c2iWX(d->f, w, x); if (isNum(fr)) { - if (isAtm(g)||RNK(g)!=1) thrM("◶: 𝕘 must have rank 1 when index is a number"); - usz fri = WRAP(o2i64(fr), IA(g), thrM("◶: Index out of bounds of 𝕘")); + if (isAtm(g)||RNK(g)!=1) thrM("𝕨𝔽◶𝕘𝕩: 𝕘 must have rank 1 when index is a number"); + usz fri = WRAP(o2i64(fr), IA(g), thrM("𝕨𝔽◶𝕘𝕩: Index out of bounds of 𝕘")); return c2(IGetU(g, fri), w, x); } else { B fn = C2(pick, fr, inc(g)); diff --git a/src/builtins/scan.c b/src/builtins/scan.c index f875c849..8b8402f6 100644 --- a/src/builtins/scan.c +++ b/src/builtins/scan.c @@ -229,7 +229,7 @@ static B scan_plus(f64 r0, B x, u8 xe, usz ia) { extern B scan_arith(B f, B w, B x, usz* xsh); // from cells.c B scan_c1(Md1D* d, B x) { B f = d->f; - if (isAtm(x) || RNK(x)==0) thrM("`: Argument cannot have rank 0"); + if (isAtm(x) || RNK(x)==0) thrM("𝔽`𝕩: 𝕩 cannot have rank 0"); ur xr = RNK(x); usz ia = IA(x); if (*SH(x)<=1 || ia==0) return x; @@ -306,9 +306,9 @@ B scan_c1(Md1D* d, B x) { B f = d->f; } B scan_c2(Md1D* d, B w, B x) { B f = d->f; - if (isAtm(x) || RNK(x)==0) thrM("`: 𝕩 cannot have rank 0"); + if (isAtm(x) || RNK(x)==0) thrM("𝕨𝔽`𝕩: 𝕩 cannot have rank 0"); ur xr = RNK(x); usz* xsh = SH(x); usz ia = IA(x); - if (isArr(w)? !ptr_eqShape(SH(w), RNK(w), xsh+1, xr-1) : xr!=1) thrF("`: Shape of 𝕨 must match the cell of 𝕩 (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", w, x); + if (isArr(w)? !ptr_eqShape(SH(w), RNK(w), xsh+1, xr-1) : xr!=1) thrF("𝕨𝔽`𝕩: Shape of 𝕨 must match the cell of 𝕩 (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", w, x); if (ia==0) { dec(w); return x; } if (RARE(!isFun(f))) { if (isMd(f)) thrM("Calling a modifier"); diff --git a/src/builtins/search.c b/src/builtins/search.c index ab66a5b4..d15732e9 100644 --- a/src/builtins/search.c +++ b/src/builtins/search.c @@ -154,11 +154,11 @@ static NOINLINE B2 splitCells(B n, B p, u8 mode) { // 0:∊ 1:⊐ 2:⊒ #define SYMB (mode==0? "∊" : mode==1? "⊐" : "⊒") #define ARG_N (mode? "𝕩" : "𝕨") #define ARG_P (mode? "𝕨" : "𝕩") - if (isAtm(p) || RNK(p)==0) thrF("%U: %U cannot have rank 0", SYMB, ARG_P); + if (isAtm(p) || RNK(p)==0) thrF("𝕨%U𝕩: %U cannot have rank 0", SYMB, ARG_P); ur pr = RNK(p); if (isAtm(n)) n = m_unit(n); ur nr = RNK(n); - if (nr < pr-1) thrF("%U: Rank of %U must be at least the cell rank of %U (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", SYMB, ARG_N, ARG_P, mode?p:n, mode?n:p); + if (nr < pr-1) thrF("𝕨%U𝕩: Rank of %U must be at least the cell rank of %U (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", SYMB, ARG_N, ARG_P, mode?p:n, mode?n:p); ur pcr = pr-1; ur nco = nr-pcr; if (nco>0 && eqShPart(SH(n)+nco, SH(p)+1, pcr)) { diff --git a/src/builtins/select.c b/src/builtins/select.c index 9c6105c9..1d836dec 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -126,10 +126,10 @@ FORCE_INLINE void cf_call(CFRes f, void* r, ux rs, void* x, ux xs) { extern GLOBAL B rt_select; B select_c1(B t, B x) { - if (isAtm(x)) thrM("⊏: Argument cannot be an atom"); + if (isAtm(x)) thrM("⊏𝕩: 𝕩 cannot be an atom"); ur xr = RNK(x); - if (xr==0) thrM("⊏: Argument cannot be rank 0"); - if (SH(x)[0]==0) thrF("⊏: Argument shape cannot start with 0 (%H ≡ ≢𝕩)", x); + if (xr==0) thrM("⊏𝕩: 𝕩 cannot be rank 0"); + if (SH(x)[0]==0) thrF("⊏𝕩: 𝕩 shape cannot start with 0 (%H ≡ ≢𝕩)", x); usz ia = shProd(SH(x), 1, xr); Arr* r = TI(x,slice)(incG(x), 0, ia); usz* sh = arr_shAlloc(r, xr-1); @@ -145,13 +145,13 @@ static NOINLINE NORETURN void select_properError(B w, B x) { } B select_c2(B t, B w, B x) { - if (isAtm(x)) thrM("⊏: 𝕩 cannot be an atom"); + if (isAtm(x)) thrM("𝕨⊏𝕩: 𝕩 cannot be an atom"); ur xr = RNK(x); - if (xr==0) thrM("⊏: 𝕩 cannot be a unit"); + if (xr==0) thrM("𝕨⊏𝕩: 𝕩 cannot be a unit"); if (isAtm(w)) { watom:; usz xn = *SH(x); - usz wi = WRAP(o2i64(w), xn, thrF("⊏: Indexing out-of-bounds (%R∊𝕨, %s≡≠𝕩)", w, xn)); + usz wi = WRAP(o2i64(w), xn, thrF("𝕨⊏𝕩: Indexing out-of-bounds (%R∊𝕨, %s≡≠𝕩)", w, xn)); if (xr==1) { B xf = getFillR(x); B xv = IGet(x, wi); @@ -220,7 +220,7 @@ B select_c2(B t, B w, B x) { #else #define CASE(S, E) case S: for (usz i=i0; i= 4) { \ switch(xl) { default:UD; CASEW(3,u8); CASEW(4,u16); CASEW(5,u32); CASEW(6,u64); } \ @@ -298,8 +298,8 @@ B select_c2(B t, B w, B x) { if (xl!=6) goto generic_l; \ M_HARR(ra, wia); B* xp = arr_bptr(x); \ SLOWIF(xp==NULL) SLOW2("𝕨⊏𝕩", w, x); \ - if (xp!=NULL) { for (usz i=0; i1) { - if (rr > UR_MAX) thrF("⊏: Result rank too large (%i≡=𝕨, %i≡=𝕩)", wr, xr); + if (rr > UR_MAX) thrF("𝕨⊏𝕩: Result rank too large (%i≡=𝕨, %i≡=𝕩)", wr, xr); ShArr* sh = m_shArr(rr); shcpy(sh->a, SH(w), wr); shcpy(sh->a+wr, SH(x)+1, xr-1); @@ -915,7 +915,7 @@ B select_rows_B(B x, ux csz, ux cam, B inds) { // consumes inds,x; ⥊ inds⊸ if (in == 0) return taga(emptyArr(x, 1)); if (in == 1) { B w = IGetU(inds,0); if (!isF64(w)) goto generic; - B r = select_cells_single(WRAP(o2i64(w), csz, thrF("⊏: Indexing out-of-bounds (%R∊𝕨, %s≡≠𝕩)", w, csz)), x, cam, csz, 1, false); + B r = select_cells_single(WRAP(o2i64(w), csz, thrF("𝕨⊏𝕩: Indexing out-of-bounds (%R∊𝕨, %s≡≠𝕩)", w, csz)), x, cam, csz, 1, false); decG(x); decG(inds); return r; } u8 ie = TI(inds,elType); diff --git a/src/builtins/selfsearch.c b/src/builtins/selfsearch.c index 18c8e201..0f23edd4 100644 --- a/src/builtins/selfsearch.c +++ b/src/builtins/selfsearch.c @@ -155,7 +155,7 @@ extern u64 (*const simd_deduplicate_u8)(void*,uint64_t,void*,void*); #define PRUP ptr_roundUpToEl B memberOf_c1(B t, B x) { - if (isAtm(x) || RNK(x)==0) thrM("∊: Argument cannot have rank 0"); + if (isAtm(x) || RNK(x)==0) thrM("∊𝕩: 𝕩 cannot have rank 0"); u64 n = *SH(x); if (n<=1) { decG(x); return n ? taga(arr_shVec(allOnes(1))) : emptyIVec(); } @@ -288,10 +288,10 @@ B memberOf_c1(B t, B x) { } B count_c1(B t, B x) { - if (isAtm(x) || RNK(x)==0) thrM("⊒: Argument cannot have rank 0"); + if (isAtm(x) || RNK(x)==0) thrM("⊒𝕩: 𝕩 cannot have rank 0"); u64 n = *SH(x); if (n<=1) { decG(x); return n ? taga(arr_shVec(allZeroes(1))) : emptyIVec(); } - if (n>(usz)I32_MAX+1) thrM("⊒: Argument length >2⋆31 not supported"); + if (n>(usz)I32_MAX+1) thrM("⊒𝕩: 𝕩 length >2⋆31 not supported"); usz csz = arr_csz(x); if (csz==0) { decG(x); return C1(ud, m_f64(n)); } @@ -401,10 +401,10 @@ static B reduceI32WidthBelow(B r, usz after) { B find_c1(B, B); B indexOf_c1(B t, B x) { - if (isAtm(x) || RNK(x)==0) thrM("⊐: 𝕩 cannot have rank 0"); + if (isAtm(x) || RNK(x)==0) thrM("⊐𝕩: 𝕩 cannot have rank 0"); u64 n = *SH(x); if (n<=1) { zeroRes: decG(x); return n? taga(arr_shVec(allZeroesFl(n))) : emptyIVec(); } - if (n>(usz)I32_MAX+1) thrM("⊐: Argument length >2⋆31 not supported"); + if (n>(usz)I32_MAX+1) thrM("⊐𝕩: 𝕩 length >2⋆31 not supported"); usz csz = arr_csz(x); if (csz==0) goto zeroRes; @@ -516,7 +516,7 @@ B indexOf_c1(B t, B x) { } B find_c1(B t, B x) { - if (isAtm(x) || RNK(x)==0) thrM("⍷: Argument cannot have rank 0"); + if (isAtm(x) || RNK(x)==0) thrM("⍷𝕩: 𝕩 cannot have rank 0"); usz n = *SH(x); if (n<=1) return x; u8 xe = TI(x,elType); diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index 4c89deb9..2a93150e 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -209,8 +209,8 @@ B shape_c2(B t, B w, B x) { sh = NULL; } else { if (RARE(isAtm(w))) w = m_unit(w); - if (RNK(w)>1) thrM("⥊: 𝕨 must have rank at most 1"); - if (IA(w)>UR_MAX) thrM("⥊: Result rank too large"); + if (RNK(w)>1) thrM("𝕨⥊𝕩: 𝕨 must have rank at most 1"); + if (IA(w)>UR_MAX) thrM("𝕨⥊𝕩: Result rank too large"); nr = IA(w); sh = nr<=1? NULL : m_shArr(nr); SGetU(w) @@ -225,24 +225,24 @@ B shape_c2(B t, B w, B x) { bad|= mulOn(nia, v); good|= v==0; } else { - if (isArr(c) || !isVal(c)) thrM("⥊: 𝕨 must consist of natural numbers or ∘ ⌊ ⌽ ↑"); - if (unkPos!=-1) thrM("⥊: 𝕨 contained multiple computed axes"); + if (isArr(c) || !isVal(c)) thrM("𝕨⥊𝕩: 𝕨 must consist of natural numbers or ∘ ⌊ ⌽ ↑"); + if (unkPos!=-1) thrM("𝕨⥊𝕩: 𝕨 contained multiple computed axes"); unkPos = i; - if (!isPrim(c)) thrM("⥊: 𝕨 must consist of natural numbers or ∘ ⌊ ⌽ ↑"); + if (!isPrim(c)) thrM("𝕨⥊𝕩: 𝕨 must consist of natural numbers or ∘ ⌊ ⌽ ↑"); unkInd = RTID(c); good|= xia==0 | unkInd==n_floor; } } - if (bad && !good) thrM("⥊: 𝕨 too large"); + if (bad && !good) thrM("𝕨⥊𝕩: 𝕨 too large"); if (unkPos!=-1) { - if (unkInd!=n_atop & unkInd!=n_floor & unkInd!=n_reverse & unkInd!=n_take) thrM("⥊: 𝕨 must consist of natural numbers or ∘ ⌊ ⌽ ↑"); - if (nia==0) thrM("⥊: Can't compute axis when the rest of the shape is empty"); + if (unkInd!=n_atop & unkInd!=n_floor & unkInd!=n_reverse & unkInd!=n_take) thrM("𝕨⥊𝕩: 𝕨 must consist of natural numbers or ∘ ⌊ ⌽ ↑"); + if (nia==0) thrM("𝕨⥊𝕩: Can't compute axis when the rest of the shape is empty"); i64 div = xia/nia; i64 mod = xia%nia; usz item; bool fill = false; if (unkInd == n_atop) { - if (mod!=0) thrM("⥊: Shape must be exact when reshaping with ∘"); + if (mod!=0) thrM("𝕨⥊𝕩: Shape must be exact when reshaping with ∘"); item = div; } else if (unkInd == n_floor) { item = div; @@ -269,7 +269,7 @@ B shape_c2(B t, B w, B x) { return truncReshape(x, xia, nia, nr, sh); } else { if (xia <= 1) { - if (RARE(xia == 0)) thrM("⥊: Empty 𝕩 and non-empty result"); + if (RARE(xia == 0)) thrM("𝕨⥊𝕩: Empty 𝕩 and non-empty result"); x = TO_GET(x, 0); goto unit; } @@ -351,7 +351,7 @@ B shape_c2(B t, B w, B x) { B pick_c1(B t, B x) { if (isAtm(x)) return x; if (RARE(IA(x)==0)) { - thrM("⊑: Argument cannot be empty"); + thrM("⊑𝕩: 𝕩 cannot be empty"); // B r = getFillE(x); // dec(x); // return r; @@ -362,10 +362,10 @@ B pick_c1(B t, B x) { static NOINLINE void checkIndexList(B w, ur xr) { SGetU(w) usz ia = IA(w); - for (usz i = 0; i < ia; i++) if (!isNum(GetU(w,i))) thrM("⊑: 𝕨 contained list with mixed-type elements"); + for (usz i = 0; i < ia; i++) if (!isNum(GetU(w,i))) thrM("𝕨⊑𝕩: 𝕨 contained list with mixed-type elements"); if (ia>xr+xr+10) { - if (RNK(w)!=1) thrF("⊑: Leaf arrays in 𝕨 must have rank 1 (element in 𝕨 has shape %H)", w); - thrF("⊑: Leaf array in 𝕨 too large (has shape %H)", w); + if (RNK(w)!=1) thrF("𝕨⊑𝕩: Leaf arrays in 𝕨 must have rank 1 (element in 𝕨 has shape %H)", w); + thrF("𝕨⊑𝕩: Leaf array in 𝕨 too large (has shape %H)", w); } } @@ -378,7 +378,7 @@ static NOINLINE void checkIndexList(B w, ur xr) { static i64 pick_convFloat(f64 f) { if (LIKELY(q_fi64(f))) return (i64)f; - thrM("⊑: 𝕨 contained a non-integer"); + thrM("𝕨⊑𝕩: 𝕨 contained a non-integer"); } static B recPick(B w, B x) { // doesn't consume @@ -394,7 +394,7 @@ static B recPick(B w, B x) { // doesn't consume case el_c8: case el_c16: case el_c32: case el_bit: case el_B: { if (ia==0) { - if (xr!=0) thrM("⊑: 𝕩 must be a unit if 𝕨 contains an empty array"); + if (xr!=0) thrM("𝕨⊑𝕩: 𝕩 must be a unit if 𝕨 contains an empty array"); return IGet(x,0); } SGetU(w) @@ -403,7 +403,7 @@ static B recPick(B w, B x) { // doesn't consume if (ia!=xr) goto wrl; PICK_IDX(c, ({ B cw = GetU(w,i); - if (!isNum(cw)) thrM("⊑: 𝕨 contained list with mixed-type elements"); + if (!isNum(cw)) thrM("𝕨⊑𝕩: 𝕨 contained list with mixed-type elements"); o2i64(cw); }), ia, goto oob); return IGet(x,c); @@ -411,7 +411,7 @@ static B recPick(B w, B x) { // doesn't consume M_HARR(r, ia); for (usz i=0; i1) thrF("%U: 𝕨 must have rank at most 1 (%H ≡ ≢𝕨)", SYMB, w); + if (wr>1) thrF("𝕨%U𝕩: 𝕨 must have rank at most 1 (%H ≡ ≢𝕨)", SYMB, w); usz wia = IA(w); - if (wia >= UR_MAX) thrF("%U: Result rank too large", SYMB); + if (wia >= UR_MAX) thrF("𝕨%U𝕩: Result rank too large", SYMB); B r, w0; if (wia<=1) { if (wia==0) { r = x; goto decW_ret; } @@ -551,7 +551,7 @@ NOINLINE B takedrop_highrank(bool take, B w, B x) { B xf = getFillR(x); if (anyFill && noFill(xf)) { #if PROPER_FILLS - thrM("↑: fill element required for overtaking, but 𝕩 doesn't have one"); + thrM("𝕨↑𝕩: fill element required for overtaking, but 𝕩 doesn't have one"); #else xf = m_f64(0); #endif @@ -636,7 +636,7 @@ NOINLINE B takedrop_highrank(bool take, B w, B x) { decW_ret: decG(w); return r; - nonint: thrF("%U: 𝕨 must consist of integers", SYMB); + nonint: thrF("𝕨%U𝕩: 𝕨 must consist of integers", SYMB); #undef SYMB } @@ -714,7 +714,7 @@ B drop_c2(B t, B w, B x) { B join_c1(B t, B x) { - if (isAtm(x)) thrM("∾: Argument must be an array"); + if (isAtm(x)) thrM("∾𝕩: 𝕩 must be an array"); ur xr = RNK(x); usz xia = IA(x); @@ -724,10 +724,10 @@ B join_c1(B t, B x) { if (isAtm(xf)) { decA(xf); decG(x); if (!PROPER_FILLS && xr==1) return emptyHVec(); - thrM("∾: Empty array 𝕩 cannot have an atom fill element"); + thrM("∾𝕩: Empty array 𝕩 cannot have an atom fill element"); } ur ir = RNK(xf); - if (ir 1) thrF("∾: Item ranks in a list can differ by at most one (contained ranks %i and %i)", 0, rm); + if (rm > 1) thrF("∾𝕩: Item ranks in a list can differ by at most one (contained ranks %i and %i)", 0, rm); rd=rm; cam++; } else { usz* csh = SH(c); ur cd = rm - cr; if (RARE(cd > rd)) { - if ((ur)(cd+1-rd) > 2-rd) thrF("∾: Item ranks in a list can differ by at most one (contained ranks %i and %i)", rm-rd*(cr==rm), cr); + if ((ur)(cd+1-rd) > 2-rd) thrF("∾𝕩: Item ranks in a list can differ by at most one (contained ranks %i and %i)", rm-rd*(cr==rm), cr); if (cr > rr) { // Previous elements were cells assert(rd==0 && rr>0); esh--; usz l = *esh; for (usz j=1; jr1s) r1s=ll[i]; ur r1 = r1s; ur a0 = r1==r0; // Root has axis a - if (tr < a0) thrM("∾: Ranks of argument items too small"); + if (tr < a0) thrM("∾𝕩: Ranks of argument items too small"); for (usz i=0; i1) thrF("∾: Item ranks along an axis can differ by at most one (contained ranks %i and %i along axis %i)", ll[i], r1, a); + if (rd>1) thrF("∾𝕩: Item ranks along an axis can differ by at most one (contained ranks %i and %i along axis %i)", ll[i], r1, a); ll[i] = -1; } else { B c = GetU(x, i*step); @@ -870,8 +870,8 @@ B join_c1(B t, B x) { bool rd = ll[i]==-1; tsh[lr] = ll[i]; ur cr=0; usz* sh=NULL; if (!isAtm(c)) { cr=RNK(c); sh=SH(c); } - if (cr != r1-rd) thrF("∾: Incompatible item ranks", base, c); - if (!eqShPart(rd?tsh0:tsh, sh, cr)) thrF("∾: Incompatible item shapes (contained arrays with shapes %H and %H along axis %i)", base, c, a); + if (cr != r1-rd) thrF("∾𝕩: Incompatible item ranks", base, c); + if (!eqShPart(rd?tsh0:tsh, sh, cr)) thrF("∾𝕩: Incompatible item shapes (contained arrays with shapes %H and %H along axis %i)", base, c, a); if (SFNS_FILLS && !noFill(rf) && !fillEqualsGetFill(rf, c)) { dec(rf); rf = bi_noFill; } } } @@ -967,7 +967,7 @@ B join_c2(B t, B w, B x) { NOGC_E; return qWithFill(r.b, f); } - if (c-wr > 1 || c-xr > 1) thrF("∾: Argument ranks must differ by 1 or less (%i≡=𝕨, %i≡=𝕩)", wr, xr); + if (c-wr > 1 || c-xr > 1) thrF("𝕨∾𝕩: Argument ranks must differ by 1 or less (%i≡=𝕨, %i≡=𝕩)", wr, xr); bool usedW; usz wia0 = IA(w); @@ -993,7 +993,7 @@ B join_c2(B t, B w, B x) { for (i32 i = 1; i < c; i++) { usz s = xsh[i+xr-c]; if (RARE(wsh[i+wr-c] != s)) { - B msg = make_fmt("∾: Lengths not matchable (%2H ≡ ≢𝕨, %H ≡ ≢𝕩)", wr, wsh, x); + B msg = make_fmt("𝕨∾𝕩: Lengths not matchable (%2H ≡ ≢𝕨, %H ≡ ≢𝕩)", wr, wsh, x); if (rnk0>1) decShObj(sh0); mm_free((Value*)shObjS(rsh)); arr_shVec(a(r)); @@ -1014,7 +1014,7 @@ B join_c2(B t, B w, B x) { B couple_c1(B t, B x) { if (isAtm(x)) return m_vec1(x); ur xr = RNK(x); - if (xr==UR_MAX) thrF("≍: Result rank too large (%i≡=𝕩)", xr); + if (xr==UR_MAX) thrF("≍𝕩: Result rank too large (%i≡=𝕩)", xr); Arr* r = cpyWithShape(x); if (xr==0) { arr_shVec(r); @@ -1030,10 +1030,10 @@ B couple_c2(B t, B w, B x) { if (isAtm(w)&isAtm(x)) return m_vec2(w, x); if (isAtm(w)) w = m_unit(w); if (isAtm(x)) x = m_unit(x); - if (!eqShape(w, x)) thrF("≍: 𝕨 and 𝕩 must have equal shapes (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", w, x); + if (!eqShape(w, x)) thrF("𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", w, x); usz ia = IA(w); ur wr = RNK(w); - if (wr==UR_MAX) thrM("≍: Result rank too large"); + if (wr==UR_MAX) thrM("𝕨≍𝕩: Result rank too large"); MAKE_MUT_INIT(r, ia*2, el_or(TI(w,elType), TI(x,elType))); MUTG_INIT(r); mut_copyG(r, 0, w, 0, ia); mut_copyG(r, ia, x, 0, ia); @@ -1055,7 +1055,7 @@ static inline void shift_check(B w, B x) { } B shiftb_c1(B t, B x) { - if (isAtm(x) || RNK(x)==0) thrM("»: Argument cannot be a scalar"); + if (isAtm(x) || RNK(x)==0) thrM("»𝕩: 𝕩 cannot be a scalar"); usz ia = IA(x); if (ia==0) return x; B xf = getFillE(x); @@ -1070,7 +1070,7 @@ B shiftb_c1(B t, B x) { return qWithFill(mut_fcd(r, x), xf); } B shiftb_c2(B t, B w, B x) { - if (isAtm(x) || RNK(x)==0) thrM("»: 𝕩 cannot be a scalar"); + if (isAtm(x) || RNK(x)==0) thrM("𝕨»𝕩: 𝕩 cannot be a scalar"); if (isAtm(w)) w = m_unit(w); shift_check(w, x); B f = fill_both(w, x); @@ -1085,7 +1085,7 @@ B shiftb_c2(B t, B w, B x) { } B shifta_c1(B t, B x) { - if (isAtm(x) || RNK(x)==0) thrM("«: Argument cannot be a scalar"); + if (isAtm(x) || RNK(x)==0) thrM("«𝕩: 𝕩 cannot be a scalar"); usz ia = IA(x); if (ia==0) return x; B xf = getFillE(x); @@ -1100,7 +1100,7 @@ B shifta_c1(B t, B x) { return qWithFill(mut_fcd(r, x), xf); } B shifta_c2(B t, B w, B x) { - if (isAtm(x) || RNK(x)==0) thrM("«: 𝕩 cannot be a scalar"); + if (isAtm(x) || RNK(x)==0) thrM("𝕨«𝕩: 𝕩 cannot be a scalar"); if (isAtm(w)) w = m_unit(w); shift_check(w, x); B f = fill_both(w, x); @@ -1126,7 +1126,7 @@ static u64 bit_reverse(u64 x) { return c; } B reverse_c1(B t, B x) { - if (isAtm(x) || RNK(x)==0) thrM("⌽: Argument cannot be a unit"); + if (isAtm(x) || RNK(x)==0) thrM("⌽𝕩: 𝕩 cannot be a unit"); usz n = *SH(x); if (n<=1) return x; u8 xl = cellWidthLog(x); @@ -1282,7 +1282,7 @@ NOINLINE B rotate_highrank(bool inv, B w, B x) { } B reverse_c2(B t, B w, B x) { if (isArr(w)) return rotate_highrank(0, w, x); - if (isAtm(x) || RNK(x)==0) thrM("⌽: 𝕩 must have rank at least 1 for atom 𝕨"); + if (isAtm(x) || RNK(x)==0) thrM("𝕨⌽𝕩: 𝕩 must have rank at least 1 for atom 𝕨"); usz xia = IA(x); if (xia==0) { o2i64(w); return x; } usz cam = SH(x)[0]; @@ -1312,13 +1312,13 @@ static usz pick_oneIndex(B w, usz xr, usz* xsh) { // throws if guaranteed bad; r if (!isNum(GetU(w,0))) return USZ_MAX; PICK_IDX(c, ({ B cw = GetU(w,i); - if (!isNum(cw)) thrM("⊑: 𝕨 contained list with mixed-type elements"); + if (!isNum(cw)) thrM("𝕨⊑𝕩: 𝕨 contained list with mixed-type elements"); o2i64(cw); }), xr, goto oob); return c; } } - oob: checkIndexList(w, xr); thrF("⊑: Indexing out-of-bounds (index %B in array of shape %2H)", w, xr, xsh); + oob: checkIndexList(w, xr); thrF("𝕨⊑𝕩: Indexing out-of-bounds (index %B in array of shape %2H)", w, xr, xsh); } static B pick_replaceOne(B fn, usz pos, B x, usz xia) { diff --git a/src/builtins/slash.c b/src/builtins/slash.c index c09e00c4..e863cd74 100644 --- a/src/builtins/slash.c +++ b/src/builtins/slash.c @@ -569,7 +569,7 @@ static B compress(B w, B x, usz wia, u8 xl, u8 xt) { extern GLOBAL B rt_slash; B slash_c1(B t, B x) { - if (RARE(isAtm(x)) || RARE(RNK(x)!=1)) thrF("/: Argument must have rank 1 (%H ≡ ≢𝕩)", x); + if (RARE(isAtm(x)) || RARE(RNK(x)!=1)) thrF("/𝕩: 𝕩 must have rank 1 (%H ≡ ≢𝕩)", x); u64 s = usum(x); if (s>=USZ_MAX) thrOOM(); if (s==0) { decG(x); return emptyIVec(); } @@ -627,7 +627,7 @@ B slash_c2(B t, B w, B x) { if (isArr(w)) { if (depth(w)>1) goto base; ur wr = RNK(w); - if (wr>1) thrF("/: Simple 𝕨 must have rank 0 or 1 (%i≡=𝕨)", wr); + if (wr>1) thrF("𝕨/𝕩: Simple 𝕨 must have rank 0 or 1 (%i≡=𝕨)", wr); if (wr<1) { w = TO_GET(w, 0); goto atom; } wia = IA(w); if (wia==0) { decG(w); return isArr(x)? x : m_unit(x); } @@ -635,9 +635,9 @@ B slash_c2(B t, B w, B x) { atom: if (!q_i32(w)) goto base; wv = o2iG(w); - if (wv < 0) thrM("/: 𝕨 cannot be negative"); + if (wv < 0) thrM("𝕨/𝕩: 𝕨 cannot be negative"); } - if (isAtm(x) || RNK(x)==0) thrM("/: 𝕩 must have rank at least 1 for simple 𝕨"); + if (isAtm(x) || RNK(x)==0) thrM("𝕨/𝕩: 𝕩 must have rank at least 1 for simple 𝕨"); ur xr = RNK(x); usz xlen = *SH(x); u8 xl = cellWidthLog(x); @@ -645,7 +645,7 @@ B slash_c2(B t, B w, B x) { B r; if (wv < 0) { // Array w - if (RARE(wia!=xlen)) thrF("/: Lengths of components of 𝕨 must match 𝕩 (%s ≠ %s)", wia, xlen); + if (RARE(wia!=xlen)) thrF("𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩 (%s ≠ %s)", wia, xlen); u64 s; u8 we = TI(w,elType); @@ -867,7 +867,7 @@ static B finish_sorted_count(B r, usz* ov, usz* oc, usz on) { #endif B slash_im(B t, B x) { - if (!isArr(x) || RNK(x)!=1) thrM("/⁼: Argument must be a list"); + if (!isArr(x) || RNK(x)!=1) thrM("/⁼𝕩: 𝕩 must be a list"); u8 xe = TI(x,elType); usz xia = IA(x); if (xia==0) { decG(x); return emptyIVec(); } @@ -886,7 +886,7 @@ B slash_im(B t, B x) { i##N* rp; r = m_i##N##arrv(&rp, RIA); \ for (usz i=0; ixp[a-1]) a++; \ u##N max=xp[a-1]; \ usz rmax=xia; \ @@ -902,7 +902,7 @@ B slash_im(B t, B x) { break; \ } \ for (usz i=a; imax) max=c; } \ - if ((i##N)max<0) thrM("/⁼: Argument cannot contain negative numbers"); \ + if ((i##N)max<0) thrM("/⁼𝕩: 𝕩 cannot contain negative numbers"); \ usz ria = max + 1; \ if (xia < ria/8) { \ u8 maxcount = 0; \ @@ -939,7 +939,7 @@ B slash_im(B t, B x) { usz os = xia>>15; \ TALLOC(u16, ov, os+1); \ i##N max = simd_count_i##N((u16*)rp, (u16*)ov, xp, xia, 0); \ - if (max < 0) thrM("/⁼: Argument cannot contain negative numbers"); \ + if (max < 0) thrM("/⁼𝕩: 𝕩 cannot contain negative numbers"); \ usz ria = (usz)max + 1; \ if (ria < sa) r = C2(take, m_f64(ria), r); \ r = finish_small_count(r, ov); \ @@ -951,7 +951,7 @@ B slash_im(B t, B x) { case el_i32: { i32* xp = i32any_ptr(x); TRY_SMALL_OUT(32) - if (xia>I32_MAX) thrM("/⁼: Argument too large"); + if (xia>I32_MAX) thrM("/⁼𝕩: 𝕩 too large"); INIT_RES(32,ria) simd_count_i32_i32(rp, xp, xia); r = num_squeeze(r); break; @@ -963,7 +963,7 @@ B slash_im(B t, B x) { i##N* xp = i##N##any_ptr(x); \ u##N max=xp[0]; \ for (usz i=1; imax) max=c; } \ - if ((i##N)max<0) thrM("/⁼: Argument cannot contain negative numbers"); \ + if ((i##N)max<0) thrM("/⁼𝕩: 𝕩 cannot contain negative numbers"); \ usz ria = max + 1; \ TALLOC(usz, t, ria); \ for (usz j=0; jmax?c:max; if (c<0) thrM("/⁼: Argument cannot contain negative numbers"); } + for (i = 0; i < xia; i++) { f64 c=xp[i]; if (c!=(usz)c) thrM("/⁼𝕩: 𝕩 must consist of natural numbers"); if (c<=max) break; max=c; } + for (j = i; j < xia; j++) { f64 c=xp[j]; if (c!=(usz)c) thrM("/⁼𝕩: 𝕩 must consist of natural numbers"); max=c>max?c:max; if (c<0) thrM("/⁼: Argument cannot contain negative numbers"); } usz ria = max+1; if (ria==0) thrOOM(); if (i==xia) { u64* rp; r = m_bitarrv(&rp, ria); for (usz i=0; iI32_MAX) thrM("/⁼: Argument too large"); + if (xia>I32_MAX) thrM("/⁼𝕩: 𝕩 too large"); i32* rp; r = m_i32arrv(&rp, ria); for (usz i=0; i= (1<<20)) thrM("•ParseFloat: Input too long"); // assumption by ryu_s2d_n + if (RNK(x)!=1) thrM("•ParseFloat 𝕩: Input must have rank 1"); + if (ia==0) thrM("•ParseFloat 𝕩: Input was empty"); + if (ia >= (1<<20)) thrM("•ParseFloat 𝕩: Input too long"); // assumption by ryu_s2d_n u8* data = c8any_ptr(x); f64 res; - if (!ryu_s2d_n(data, ia, &res)) thrM("•ParseFloat: Malformed input"); + if (!ryu_s2d_n(data, ia, &res)) thrM("•ParseFloat 𝕩: Malformed input"); decG(x); return m_f64(res); } @@ -201,7 +201,7 @@ B grOrd_c2(B t, B w, B x) { // assumes valid arguments for (usz i = 1; i < wia; i++) tmp[i] = tmp[i-1]+o2sG(GetU(w,i-1)); usz ria = tmp[wia-1]+o2sG(GetU(w,wia-1)); i32* rp; B r = m_i32arrv(&rp, ria); - if (xia>=I32_MAX) thrM("⊔: Too large"); + if (xia>=I32_MAX) thrM("𝕨⊔𝕩: Too large"); for (usz i = 0; i < xia; i++) { i64 c = o2i64(GetU(x,i)); if (c>=0) rp[tmp[c]++] = i; @@ -259,7 +259,7 @@ B casrt_c1(B t, B x) { B sys_c1(B t, B x); B out_c1(B t, B x) { - if (isAtm(x) || RNK(x)!=1) thrM("•Out: Argument must be a string"); + if (isAtm(x) || RNK(x)!=1) thrM("•Out 𝕩: 𝕩 must be a string"); printsB(x); printf("\n"); return x; } @@ -283,7 +283,7 @@ NOINLINE B vfyStr(B x, char* name, char* arg) { GLOBAL B cdPath; static NOINLINE B prep_state(B w, char* name) { // consumes w, returns ⟨path,name,args⟩ - if (!isArr(w) || RNK(w)!=1 || IA(w)>3) thrF("%U: 𝕨 must be a list with at most 3 items, but had shape %H", name, w); + if (!isArr(w) || RNK(w)!=1 || IA(w)>3) thrF("𝕨%U𝕩: 𝕨 must be a list with at most 3 items, but had shape %H", name, w); usz ia = IA(w); SGet(w) HArr_p r = m_harr0v(3); r.a[0] = ia>0? vfyStr(Get(w,0),name,"Path" ) : inc(cdPath); @@ -339,7 +339,7 @@ STATIC_GLOBAL B rand_subsetName; STATIC_GLOBAL NFnDesc* rand_subsetDesc; sc->vars[1].u = seed&0xFFFFFFFF; B rand_range_c1(B t, B x) { i64 xv = o2i64(x); - if (xv<0) thrM("(rand).Range: 𝕩 cannot be negative"); + if (xv<0) thrM("(rand).Range 𝕩: 𝕩 cannot be negative"); RAND_START; u64 rnd = wyrand(&seed); RAND_END; @@ -349,7 +349,7 @@ B rand_range_c2(B t, B w, B x) { usz am = 1; i64 max = o2i64(x); if (isArr(w)) { - if (RNK(w) > 1) thrM("(rand).Range: 𝕨 must be a valid shape"); + if (RNK(w) > 1) thrM("𝕨 (rand).Range 𝕩: 𝕨 must be a valid shape"); SGetU(w); usz wia = IA(w); bool bad=false, good=false; @@ -370,11 +370,11 @@ B rand_range_c2(B t, B w, B x) { f64* rp; r = m_f64arrp(&rp, am); PLAINLOOP for (usz i = 0; i < am; i++) rp[i] = wy2u01(wyrand(&seed)); } else { - if (max!=1) thrM("(rand).Range: 𝕩 cannot be negative"); + if (max!=1) thrM("𝕨 (rand).Range 𝕩: 𝕩 cannot be negative"); r = allZeroesFl(am); } } else if (max > (1ULL<<31)) { - if (max >= 1LL<<53) thrM("(rand).Range: 𝕩 must be less than 2⋆53"); + if (max >= 1LL<<53) thrM("𝕨 (rand).Range 𝕩: 𝕩 must be less than 2⋆53"); f64* rp; r = m_f64arrp(&rp, am); PLAINLOOP for (usz i = 0; i < am; i++) rp[i] = wy2u0k(wyrand(&seed), max); } else { @@ -416,7 +416,7 @@ B rand_range_c2(B t, B w, B x) { if (wia<2) { arr_rnk01(r, wia); } else { - if (wia>UR_MAX) thrF("(rand).Range: Result rank too large (%s≡≢𝕨)", wia); + if (wia>UR_MAX) thrF("𝕨 (rand).Range 𝕩: Result rank too large (%s≡≢𝕨)", wia); usz* sh = arr_shAlloc(r, wia); SGetU(w); for (usz i = 0; i < wia; i++) sh[i] = o2sG(GetU(w, i)); @@ -437,7 +437,7 @@ void intRange32Fill(i32* xp, ux s, ux n); B rand_deal_c1(B t, B x) { i32 xi = o2i(x); if (RARE(xi<=1)) { - if (xi<0) thrM("(rand).Deal: Argument cannot be negative"); + if (xi<0) thrM("(rand).Deal 𝕩: 𝕩 cannot be negative"); return taga(ptr_inc(bitUD[xi])); } @@ -516,10 +516,10 @@ B rand_deal_c1(B t, B x) { B rand_deal_c2(B t, B w, B x) { i32 wi = o2i(w); i32 xi = o2i(x); - if (RARE(xi<0)) thrM("(rand).Deal: 𝕩 cannot be negative"); - if (RARE(wi<0)) thrM("(rand).Deal: 𝕨 cannot be negative"); + if (RARE(xi<0)) thrM("𝕨 (rand).Deal 𝕩: 𝕩 cannot be negative"); + if (RARE(wi<0)) thrM("𝕨 (rand).Deal 𝕩: 𝕨 cannot be negative"); if (wi==0) return emptyIVec(); - if (RARE(wi>xi)) thrM("(rand).Deal: 𝕨 cannot exceed 𝕩"); + if (RARE(wi>xi)) thrM("𝕨 (rand).Deal 𝕩: 𝕨 cannot exceed 𝕩"); if (wi==xi) return rand_deal_c1(t, x); B r; RAND_START; @@ -578,9 +578,9 @@ extern void filter_ne_i32(i32* dst, i32* src, usz len, usz sum, i32 val); // sla B rand_subset_c2(B t, B w, B x) { i32 wi = o2i(w); i32 xi = o2i(x); - if (RARE(wi<0)) thrM("(rand).Subset: 𝕨 cannot be negative"); - if (RARE(xi<0)) thrM("(rand).Subset: 𝕩 cannot be negative"); - if (RARE(wi>xi)) thrM("(rand).Subset: 𝕨 cannot exceed 𝕩"); + if (RARE(wi<0)) thrM("𝕨 (rand).Subset 𝕩: 𝕨 cannot be negative"); + if (RARE(xi<0)) thrM("𝕨 (rand).Subset 𝕩: 𝕩 cannot be negative"); + if (RARE(wi>xi)) thrM("𝕨 (rand).Subset 𝕩: 𝕨 cannot exceed 𝕩"); if (wi==0) return emptyIVec(); if (wi==xi) return ud_c1(t, x); // Only one complete subset; will hang without this @@ -652,7 +652,7 @@ static NOINLINE void rand_init() { rand_subsetName = m_c8vec_0("subset"); gc_add(rand_subsetName); rand_subsetDesc = registerNFn(m_c8vec_0("(rand).Subset"), c1_bad, rand_subset_c2); } B makeRand_c1(B t, B x) { - if (!isNum(x)) thrM("•MakeRand: 𝕩 must be a number"); + if (!isNum(x)) thrM("•MakeRand 𝕩: 𝕩 must be a number"); if (rand_ns==NULL) rand_init(); B r = m_nns(rand_ns, b(x.u>>32), b(x.u&0xFFFFFFFF), m_nfn(rand_rangeDesc, bi_N), m_nfn(rand_dealDesc, bi_N), m_nfn(rand_subsetDesc, bi_N)); Scope* sc = c(NS,r)->sc; @@ -675,12 +675,12 @@ STATIC_GLOBAL NFnDesc* bqnDesc; STATIC_GLOBAL NFnDesc* rebqnDesc; STATIC_GLOBAL NFnDesc* rebqnResDesc; B rebqn_c1(B t, B x) { - if (!isNsp(x)) thrM("•ReBQN: Argument must be a namespace"); + if (!isNsp(x)) thrM("•ReBQN 𝕩: Argument must be a namespace"); B repl = ns_getC(x, "repl"); B prim = ns_getC(x, "primitives"); B sys = ns_getC(x, "system"); i32 replVal = q_N(repl) || eqStr(repl,U"none")? 0 : eqStr(repl,U"strict")? 1 : eqStr(repl,U"loose")? 2 : 3; - if (replVal==3) thrM("•ReBQN: Invalid repl value"); + if (replVal==3) thrM("•ReBQN 𝕩: Invalid repl value"); B scVal; if (replVal==0) { scVal = bi_N; @@ -708,13 +708,13 @@ B repl_c1(B t, B x) { #if USE_SETJMP GLOBAL B lastErrMsg; B currentError_c1(B t, B x) { - if (isNsp(x)) thrM("•CurrentError: Namespace 𝕩 is reserved"); + if (isNsp(x)) thrM("•CurrentError 𝕩: Namespace 𝕩 is reserved"); dec(x); - if (q_N(lastErrMsg)) thrM("•CurrentError: Not currently within any ⎊"); + if (q_N(lastErrMsg)) thrM("•CurrentError 𝕩: Not currently within any ⎊"); return inc(lastErrMsg); } #else -B currentError_c1(B t, B x) { thrM("•CurrentError: No errors as error catching has been disabled"); } +B currentError_c1(B t, B x) { thrM("•CurrentError 𝕩: No errors as error catching has been disabled"); } #endif STATIC_GLOBAL Body* hashmap_ns; @@ -759,9 +759,9 @@ static NOINLINE void hashmap_init() { hashmap_valuesDesc = registerNFn(m_c8vec_0("(hashmap).Values"), hashmap_values_c1, c2_bad); } B hashMap_c2(B t, B w, B x) { - if (!isArr(w) || RNK(w)!=1 || !isArr(x) || RNK(x)!=1) thrF("•HashMap: Arguments must be lists (%H≡≢𝕨, %H≡≢𝕩)", w, x); + if (!isArr(w) || RNK(w)!=1 || !isArr(x) || RNK(x)!=1) thrF("𝕨 •HashMap 𝕩: Arguments must be lists (%H≡≢𝕨, %H≡≢𝕩)", w, x); usz n = IA(w); - if (n != IA(x)) thrF("•HashMap: 𝕨 and 𝕩 must have the same length (%s≡≠𝕨, %s≡≠𝕩)", n, IA(x)); + if (n != IA(x)) thrF("𝕨 •HashMap 𝕩: 𝕨 and 𝕩 must have the same length (%s≡≠𝕨, %s≡≠𝕩)", n, IA(x)); if (hashmap_ns==NULL) hashmap_init(); w = taga(toHArr(w)); x = taga(toHArr(x)); B h = hashmap_build(w, n); @@ -786,7 +786,7 @@ B fchars_c1(B d, B x) { return path_chars(path_rel(nfn_objU(d), x, "•file.Chars")); } B fchars_c2(B d, B w, B x) { - if (isAtm(x) || RNK(x)!=1) thrM("•file.Chars: 𝕩 must be a list of characters"); + if (isAtm(x) || RNK(x)!=1) thrM("𝕨 •file.Chars 𝕩: 𝕩 must be a list of characters"); B p = path_rel(nfn_objU(d), w, "•file.Chars"); path_wChars(incG(p), x); decG(x); @@ -802,7 +802,7 @@ B fbytes_c1(B d, B x) { return r; } B fbytes_c2(B d, B w, B x) { - if (isAtm(x) || RNK(x)!=1) thrM("•file.Bytes: 𝕩 must be a list"); + if (isAtm(x) || RNK(x)!=1) thrM("𝕨 •file.Bytes 𝕩: 𝕩 must be a list"); B p = path_rel(nfn_objU(d), w, "•file.Bytes"); path_wBytes(incG(p), x); decG(x); @@ -813,13 +813,13 @@ B flines_c1(B d, B x) { return path_lines(path_rel(nfn_objU(d), x, "•file.Lines")); } B flines_c2(B d, B w, B x) { - if (isAtm(x) || RNK(x)!=1) thrM("•file.Lines: 𝕩 must be a list"); + if (isAtm(x) || RNK(x)!=1) thrM("𝕨 •file.Lines 𝕩: 𝕩 must be a list"); B s = emptyCVec(); usz ia = IA(x); SGet(x) for (u64 i = 0; i < ia; i++) { B l = Get(x, i); - if (isAtm(l) || RNK(l)!=1) thrM("•file.Lines: Elements of 𝕩 must be lists of characters"); + if (isAtm(l) || RNK(l)!=1) thrM("𝕨 •file.Lines 𝕩: Elements of 𝕩 must be lists of characters"); s = vec_join(s, l); //if (windows) s = vec_add(s, m_c32('\r')); TODO figure out whether or not this is a thing that should be done s = vec_addN(s, m_c32('\n')); @@ -850,7 +850,7 @@ B import_c1(B d, B x) { B tag_none = tagu64(100000000, C32_TAG); B tag_running = tagu64(100000001, C32_TAG); B prevVal = c2(ns_getC(map, "get"), tag_none, incG(path)); - if (prevVal.u == tag_running.u) thrF("•Import: cyclic import of \"%R\"", path); + if (prevVal.u == tag_running.u) thrF("•Import 𝕩: cyclic import of \"%R\"", path); if (prevVal.u != tag_none.u) { // print_fmt("cached: %R @ %i/%i\n", path, prevIdx, IA(importKeyList)); decG(path); @@ -892,7 +892,7 @@ B list_c1(B d, B x) { B createdir_c1(B d, B x) { B p = path_rel(nfn_objU(d), x, "•file.CreateDir"); if (dir_create(p)) return p; - thrM("•file.CreateDir: Failed to create directory"); + thrM("•file.CreateDir 𝕩: Failed to create directory"); } B realpath_c1(B d, B x) { return path_abs(path_rel(nfn_objU(d), x, "•file.RealPath")); @@ -902,17 +902,17 @@ B rename_c2(B d, B w, B x) { d = nfn_objU(d); B p = path_rel(d, w, "•file.Rename"); if (path_rename(path_rel(d, x, "•file.Rename"), p)) return p; - thrM("•file.Rename: Failed to rename file"); + thrM("𝕨 •file.Rename 𝕩: Failed to rename file"); } B remove_c1(B d, B x) { if (path_remove(path_rel(nfn_objU(d), x, "•file.Remove"))) return m_i32(1); - thrM("•file.Remove: Failed to remove file"); + thrM("•file.Remove 𝕩: Failed to remove file"); } B ftype_c1(B d, B x) { char ty = path_type(path_rel(nfn_objU(d), x, "•file.Type")); - if (ty==0) thrM("•file.Type: Error while accessing file"); + if (ty==0) thrM("•file.Type 𝕩: Error while accessing file"); return m_c32(ty); } @@ -927,11 +927,11 @@ B fexists_c1(B d, B x) { } B fName_c1(B t, B x) { - if (!isStr(x)) thrM("•file.Name: Argument must be a string"); + if (!isStr(x)) thrM("•file.Name 𝕩: Argument must be a string"); return path_name(x); } B fParent_c1(B t, B x) { - if (!isStr(x)) thrM("•file.Parent: Argument must be a string"); + if (!isStr(x)) thrM("•file.Parent 𝕩: Argument must be a string"); return path_parent(x); } @@ -951,7 +951,7 @@ B monoTime_c1(B t, B x) { } B delay_c1(B t, B x) { f64 sf = o2f(x); - if (sf<0 || sf>1ULL<<63) thrF("•Delay: Bad argument: %f", sf); + if (sf<0 || sf>1ULL<<63) thrF("•Delay 𝕩: Bad argument: %f", sf); struct timespec ts,ts0; u64 s = (u64)sf; ts.tv_sec = (u64)sf; @@ -985,7 +985,7 @@ B getLine_c1(B t, B x) { } B fromUtf8_c1(B t, B x) { - if (isAtm(x) || RNK(x)!=1) thrM("•FromUTF8: Argument must be a character or number list"); + if (isAtm(x) || RNK(x)!=1) thrM("•FromUTF8 𝕩: 𝕩 must be a character or number list"); usz ia = IA(x); TALLOC(char, chrs, ia); SGetU(x) @@ -993,11 +993,11 @@ B fromUtf8_c1(B t, B x) { B c = GetU(x,i); if (isC32(c)) { u32 v = o2cG(c); - if (v>=256) thrF("•FromUTF8: Argument contained a character with codepoint %i", v); + if (v>=256) thrF("•FromUTF8 𝕩: 𝕩 contained a character with codepoint %i", v); chrs[i] = v; } else { i32 v = o2i(c); - if (v<=-128 | v>=256) thrF("•FromUTF8: Argument contained the number %i", v); + if (v<=-128 | v>=256) thrF("•FromUTF8 𝕩: 𝕩 contained the number %i", v); chrs[i] = v&0xff; } } @@ -1008,7 +1008,7 @@ B fromUtf8_c1(B t, B x) { } B toUtf8_c1(B t, B x) { - if (isAtm(x) || RNK(x)!=1) thrM("•ToUTF8: Argument must be a character or number list"); + if (isAtm(x) || RNK(x)!=1) thrM("•ToUTF8 𝕩: 𝕩 must be a character or number list"); u64 len = utf8lenB(x); u8* rp; B r = m_c8arrv(&rp, len); toUTF8(x, (char*)rp); @@ -1315,8 +1315,8 @@ B tCharN_c1(B t, B x) { } } #else -B tRawMode_c1(B t, B x) { thrM("•term.RawMode not available"); } -B tCharN_c1(B t, B x) { thrM("•term.CharN not available"); } +B tRawMode_c1(B t, B x) { thrM("•term.RawMode 𝕩: •term.RawMode not available"); } +B tCharN_c1(B t, B x) { thrM("•term.CharN 𝕩: •term.CharN not available"); } #endif B tCharB_c1(B t, B x) { @@ -1330,12 +1330,12 @@ B tFlush_c1(B t, B x) { return x; } B tOutRaw_c1(B t, B x) { - if (isAtm(x) || RNK(x)!=1) thrM("•term.OutRaw: 𝕩 must be a list"); + if (isAtm(x) || RNK(x)!=1) thrM("•term.OutRaw 𝕩: 𝕩 must be a list"); file_wBytes(stdout, "stdout", x); return x; } B tErrRaw_c1(B t, B x) { - if (isAtm(x) || RNK(x)!=1) thrM("•term.ErrRaw: 𝕩 must be a list"); + if (isAtm(x) || RNK(x)!=1) thrM("•term.ErrRaw 𝕩: 𝕩 must be a list"); file_wBytes(stderr, "stderr", x); return x; } @@ -1374,7 +1374,7 @@ static NOINLINE B name_normalize(B x) { } B nKeys_c1(B t, B x) { - if (!isNsp(x)) thrM("•ns.Keys: 𝕩 must be a namespace"); + if (!isNsp(x)) thrM("•ns.Keys 𝕩: 𝕩 must be a namespace"); NSDesc* desc = c(NS,x)->desc; ux am = desc->varAm; ux eam = 0; @@ -1389,7 +1389,7 @@ B nKeys_c1(B t, B x) { return r.b; } B nGet_c2(B t, B w, B x) { - if (!isNsp(w)) thrM("•ns.Get: 𝕨 must be a namespace"); + if (!isNsp(w)) thrM("𝕨•ns.Get 𝕩: 𝕨 must be a namespace"); vfyStr(x, "•ns.Get", "𝕩"); x = name_normalize(x); B r = ns_getNU(w, x, true); @@ -1397,7 +1397,7 @@ B nGet_c2(B t, B w, B x) { return inc(r); } B nHas_c2(B t, B w, B x) { - if (!isNsp(w)) thrM("•ns.Has: 𝕨 must be a namespace"); + if (!isNsp(w)) thrM("𝕨•ns.Has 𝕩: 𝕨 must be a namespace"); vfyStr(x, "•ns.Has", "𝕩"); x = name_normalize(x); B r = ns_getNU(w, x, false); diff --git a/src/builtins/transpose.c b/src/builtins/transpose.c index 239401fd..bf32ae82 100644 --- a/src/builtins/transpose.c +++ b/src/builtins/transpose.c @@ -269,26 +269,26 @@ static void shSet(Arr* ra, ur rr, ShArr* sh) { B transp_c2(B t, B w, B x) { usz wia=1; if (isArr(w)) { - if (RNK(w)>1) thrM("⍉: 𝕨 must have rank at most 1"); + if (RNK(w)>1) thrM("𝕨⍉𝕩: 𝕨 must have rank at most 1"); wia = IA(w); if (wia==0) { decG(w); return isArr(x)? x : m_unit(x); } } ur xr; - if (isAtm(x) || (xr=RNK(x))=xr) thrF("⍉: Axis %s does not exist (%i≡=𝕩)", a, xr); + if (a>=xr) thrF("𝕨⍉𝕩: Axis %s does not exist (%i≡=𝕩)", a, xr); if (a==xr-1) { TFREE(alloc); return C1(transp, x); } p[0] = a; } else { SGetU(w) for (usz i=0; i=xr) thrF("⍉: Axis %s does not exist (%i≡=𝕩)", a, xr); + if (a>=xr) thrF("𝕨⍉𝕩: Axis %s does not exist (%i≡=𝕩)", a, xr); p[i] = a; } decG(w); @@ -314,7 +314,7 @@ B transp_c2(B t, B w, B x) { // Fill in remaining axes and check for missing ones ur rr = xr-dup; - if (max >= rr) thrF("⍉: Skipped result axis"); + if (max >= rr) thrF("𝕨⍉𝕩: Skipped result axis"); if (wia=xr) thrF("⍉⁼: Axis %s does not exist (%i≡=𝕩)", a, xr); + if (a>=xr) thrF("𝕨⍉⁼𝕩: Axis %s does not exist (%i≡=𝕩)", a, xr); i32* wp; w = m_i32arrv(&wp, a); PLAINLOOP for (usz i=0; i1) thrM("⍉⁼: 𝕨 must have rank at most 1"); + if (RNK(w)>1) thrM("𝕨⍉⁼𝕩: 𝕨 must have rank at most 1"); usz wia = IA(w); if (wia==0) return w; - if (xr=xr) thrF("⍉⁼: Axis %s does not exist (%i≡=𝕩)", a, xr); + if (a>=xr) thrF("𝕨⍉⁼𝕩: Axis %s does not exist (%i≡=𝕩)", a, xr); if (p[a]!=xr) { TFREE(p); decG(w); return bi_N; } // Handled by caller max = a>max? a : max; p[a] = i; @@ -524,9 +524,9 @@ static B invert_transp_w(B w, ur xr) { } B transp_ix(B t, B w, B x) { - if (isAtm(x)) thrM("⍉⁼: 𝕩 must not be an atom"); + if (isAtm(x)) thrM("𝕨⍉⁼𝕩: 𝕩 must not be an atom"); w = invert_transp_w(w, RNK(x)); - if (q_N(w)) thrM("⍉⁼: Duplicate axes"); + if (q_N(w)) thrM("𝕨⍉⁼𝕩: Duplicate axes"); return C2(transp, w, x); } diff --git a/src/core/stuff.c b/src/core/stuff.c index 2f9877dd..3f7ac1e6 100644 --- a/src/core/stuff.c +++ b/src/core/stuff.c @@ -452,7 +452,7 @@ B bqn_merge(B x, u32 type) { if (isAtm(xf)) { dec(xf); return x; } i32 xfr = RNK(xf); Arr* r = emptyWithFill(getFillR(xf)); - if (xr+xfr > UR_MAX) thrM(">: Result rank too large"); + if (xr+xfr > UR_MAX) thrM(">𝕩: Result rank too large"); usz* rsh = arr_shAlloc(r, xr+xfr); if (rsh) { shcpy (rsh , SH(x), xr); diff --git a/src/opt/comp.c b/src/opt/comp.c index becc224a..c519e415 100644 --- a/src/opt/comp.c +++ b/src/opt/comp.c @@ -502,4 +502,4 @@ B nativeComp_c2(B t, B w, B x) { void nativeCompiler_init() { native_comp = m_nfn(registerNFn(m_c8vec_0("(native compiler)"), c1_bad, nativeComp_c2), bi_N); gc_add(native_comp); -} \ No newline at end of file +} diff --git a/src/utils/mut.c b/src/utils/mut.c index 5cf36d58..3e32f984 100644 --- a/src/utils/mut.c +++ b/src/utils/mut.c @@ -557,7 +557,7 @@ static B m_getU_B (void* a, usz ms) { return ((B*) a)[ms]; } void apd_fail_apd(ApdMut* m, B x) { } NOINLINE char* apd_ty_base(u32 ty) { - return ty==1? ">" : ty==2? "[…]" : ty==U'˘'? "˘" : ty==U'⎉'? "⎉" : "??"; + return ty==1? ">𝕩" : ty==2? "[…]" : ty==U'˘'? "𝔽˘" : ty==U'⎉'? "𝔽⎉𝕘" : "??"; } Arr* apd_sh_err(ApdMut* m, u32 ty) { B msg = make_fmt("%U: Incompatible %S shapes (encountered shapes %2H and %H)", apd_ty_base(ty), ty>2? "result" : "element", m->cr, m->csh, m->failEl); diff --git a/test/cases/cells.bqn b/test/cases/cells.bqn index 610e5cbf..be864843 100644 --- a/test/cases/cells.bqn +++ b/test/cases/cells.bqn @@ -20,57 +20,57 @@ !"˘: Result rank too large" % (0∾254⥊2)⊸⥊∘1˘ 0‿2⥊1 !"⎉: Result rank too large" % (0∾254⥊2)⊸⥊∘1⎉¯1 0‿2⥊1 !"⎉: Result rank too large" % (1⥊˜ 0∾204⥊2)⎉50 1⥊˜ 0∾100⥊2 -!"⎉: Result rank too large (204 ≡ =𝕩, 200 ≡ =𝔽v)" % {𝕊:(200⥊1)⥊1}⎉1 (205⥊1)⥊1 +!"𝔽⎉𝕘: Result rank too large (204 ≡ =𝕩, 200 ≡ =𝔽v)" % {𝕊:(200⥊1)⥊1}⎉1 (205⥊1)⥊1 -!"⎉: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢⎉0 "ab" -!"˘: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢˘ "ab" +!"𝕨⎉𝕩: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢⎉0 "ab" +!"𝕨˘𝕩: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢˘ "ab" ! ∧´{𝕊: ! (∾≡{𝕨∾𝕩}´) (<•rand.Range∘≠⊸⊑ ⟨"ab",1‿2,⟨⟩,↕0,""⟩) ∾˜ (4•rand.Range≠)⊸⊏ ⟨1, {⇐}, 'a', <'a', <{⇐}, "ab", ↕0, ""⟩}¨↕10000 # error cases that could be affected by special code -!"∧: Argument cannot have rank 0" % ∧˘↕2 -!"∨: Argument cannot have rank 0" % ∨˘"a" +!"∧𝕩: 𝕩 cannot have rank 0" % ∧˘↕2 +!"∨𝕩: 𝕩 cannot have rank 0" % ∨˘"a" !"Expected non-negative integer, got ¯3" % 2‿¯3/⎉1 6‿2⥊0 -!"/: Lengths of components of 𝕨 must match 𝕩 (3 ≠ 4)" % 1‿2‿3⊸/˘≍4‿5‿6‿7 -!"/: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (2‿3‿1⥊↕4) /˘ ↕2 +!"𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩 (3 ≠ 4)" % 1‿2‿3⊸/˘≍4‿5‿6‿7 +!"𝕨/𝕩: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (2‿3‿1⥊↕4) /˘ ↕2 !"𝕨/𝕩: Length of compound 𝕨 must be at most rank of 𝕩" % (<↕0)/˘○(5⊸⥊)<"ab" -!"⊏: Indexing out-of-bounds (24∊𝕨, 4≡≠𝕩)" % 1‿24⊏⎉1↕4‿4 -!"⊏: Indexing out-of-bounds (4∊𝕨, 4≡≠𝕩)" % ⊏⎉1˜6‿4⥊↕24 +!"𝕨⊏𝕩: Indexing out-of-bounds (24∊𝕨, 4≡≠𝕩)" % 1‿24⊏⎉1↕4‿4 +!"𝕨⊏𝕩: Indexing out-of-bounds (4∊𝕨, 4≡≠𝕩)" % ⊏⎉1˜6‿4⥊↕24 !"𝕨⊏𝕩: 𝕨 must be an array of numbers or list of such arrays" % 0‿@‿¯1⊏⎉1 5‿2⥊0.5 !"Expected integer, got ¯5.25" % ¯5.25⊏˘∘‿4⥊↕24 -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % 0‿0‿1 ⊏˘○(≍˘) 10000×↕3 -!"⊏: 𝕩 cannot be a unit" % 0⊏˘5⥊<"a" -!"⊏: 𝕩 cannot be a unit" % (3‿0⥊⟨⟩)⊏˘↕3 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % 0‿0‿1 ⊏˘○(≍˘) 10000×↕3 +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % 0⊏˘5⥊<"a" +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % (3‿0⥊⟨⟩)⊏˘↕3 !"Expected integer, got 0.1" % 0.1⊑˘3‿5⥊↕15 -!"⊑: 𝕩 must be a list when 𝕨 is a number (3‿4 ≡ ≢𝕩)" % 5⊑˘↕2‿3‿4 -!">: Result rank too large (80 ≡ =𝕩, 205 ≡ =⊑𝕩)" % >⎉80 (200⥊1)⥊<(205⥊1)⥊1 -!"⎉: Result rank too large (195 ≡ =𝕩, 210 ≡ =𝔽v)" % >⎉5 (200⥊1)⥊<(205⥊1)⥊1 -!"∾: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")∾˘○(3/≍)≍"a" -!"∾: Argument ranks must differ by 1 or less (0≡=𝕨, 2≡=𝕩)" % 1∾˘↕3‿3‿3 -!"∾: Lengths not matchable (4‿2 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (3‿4‿2⥊4)∾˘3‿3‿3⥊5 -!"≍: 𝕨 and 𝕩 must have equal shapes (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)≍⎉2 2‿3‿3⥊↕18 -!"≍: Result rank too large (255≡=𝕩)" % ≍⎉∞ 0⥊˜255⥊1 +!"𝕨⊑𝕩: 𝕩 must be a list when 𝕨 is a number (3‿4 ≡ ≢𝕩)" % 5⊑˘↕2‿3‿4 +!">𝕩: Result rank too large (80 ≡ =𝕩, 205 ≡ =⊑𝕩)" % >⎉80 (200⥊1)⥊<(205⥊1)⥊1 +!"𝔽⎉𝕘: Result rank too large (195 ≡ =𝕩, 210 ≡ =𝔽v)" % >⎉5 (200⥊1)⥊<(205⥊1)⥊1 +!"𝕨∾𝕩: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")∾˘○(3/≍)≍"a" +!"𝕨∾𝕩: Argument ranks must differ by 1 or less (0≡=𝕨, 2≡=𝕩)" % 1∾˘↕3‿3‿3 +!"𝕨∾𝕩: Lengths not matchable (4‿2 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (3‿4‿2⥊4)∾˘3‿3‿3⥊5 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)≍⎉2 2‿3‿3⥊↕18 +!"≍𝕩: Result rank too large (255≡=𝕩)" % ≍⎉∞ 0⥊˜255⥊1 !"shift: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")«˘○(3/≍)≍"a" !"shift: =𝕨 must be =𝕩 or ¯1+=𝕩 (0≡=𝕨, 2≡=𝕩)" % 1«˘↕2‿2‿2 -!"»: Argument cannot be a scalar" % »⎉0 2‿3‿1⥊↕6 -!"⌽: Argument cannot be a unit" % ⌽˘↕10 +!"»𝕩: 𝕩 cannot be a scalar" % »⎉0 2‿3‿1⥊↕6 +!"⌽𝕩: 𝕩 cannot be a unit" % ⌽˘↕10 !"Expected integer, got 1.5" % 1.5↑˘↕2‿3‿2 -!"↑: 𝕨 must have rank at most 1 (1‿2 ≡ ≢𝕨)" % (≍1‿2)⊸↑˘↕2‿3‿2 -!"↓: 𝕨 must have rank at most 1 (4‿2 ≡ ≢𝕨)" % (4‿2⥊↕8)↓˘○≍@ +!"𝕨↑𝕩: 𝕨 must have rank at most 1 (1‿2 ≡ ≢𝕨)" % (≍1‿2)⊸↑˘↕2‿3‿2 +!"𝕨↓𝕩: 𝕨 must have rank at most 1 (4‿2 ≡ ≢𝕨)" % (4‿2⥊↕8)↓˘○≍@ !"Integer out of range: 1e20" % 1e20⌽˘3‿10⥊10 !"Expected number" % 3‿4‿@⌽˘↕3‿4 !"Expected integer, got 0.5" % 0.5⊸⌽˘4‿3⥊↕12 -!"↑: Argument must have rank at least 1" % ↑˘↕2 -!"↓: Argument must have rank at least 1" % ↓⎉0 2‿1⥊0 -!"⊐: 𝕩 cannot have rank 0" % ⊐˘"abcd" -!"⊒: Argument cannot have rank 0" % ⊒˘"abcd" -!"∊: Argument cannot have rank 0" % ∊˘"abcd" -!"⍋: 𝕨 must be sorted" % 0‿2‿1⊸⍋˘ 3‿4⥊↕12 -!"`: Shape of 𝕨 must match the cell of 𝕩 (⟨2⟩ ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (2‿2⥊1)+`˘2‿2‿3⥊0.4 -!"`: Shape of 𝕨 must match the cell of 𝕩 (⟨⟩ ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % 2+`˘↕3‿3‿3 -!"´: Argument must be a list (3‿3 ≡ ≢𝕩)" % +´˘2‿3‿3⥊↕18 -!"´: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % 1+´˘2‿3‿3⥊↕18 -!"˝: 𝕩 must have rank at least 1" % +˝˘˘10‿10⥊↕100 -!"˝: 𝕩 must have rank at least 1" % ∾˝⎉¯2 2‿3⥊9 +!"↑𝕩: 𝕩 must have rank at least 1" % ↑˘↕2 +!"↓𝕩: 𝕩 must have rank at least 1" % ↓⎉0 2‿1⥊0 +!"⊐𝕩: 𝕩 cannot have rank 0" % ⊐˘"abcd" +!"⊒𝕩: 𝕩 cannot have rank 0" % ⊒˘"abcd" +!"∊𝕩: 𝕩 cannot have rank 0" % ∊˘"abcd" +!"𝕨⍋𝕩: 𝕨 must be sorted" % 0‿2‿1⊸⍋˘ 3‿4⥊↕12 +!"𝕨𝔽`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨2⟩ ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (2‿2⥊1)+`˘2‿2‿3⥊0.4 +!"𝕨𝔽`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨⟩ ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % 2+`˘↕3‿3‿3 +!"𝔽´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % +´˘2‿3‿3⥊↕18 +!"𝕨𝔽´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % 1+´˘2‿3‿3⥊↕18 +!"𝔽˝𝕩: 𝕩 must have rank at least 1" % +˝˘˘10‿10⥊↕100 +!"𝔽˝𝕩: 𝕩 must have rank at least 1" % ∾˝⎉¯2 2‿3⥊9 {∾˝˘ ⥊⟜(↕×´) 2+↕𝕩}¨ 2‿3‿4‿5 %% ⥊⟜(↕×´)¨ ⟨2‿3,2‿12,2‿12‿5,2‿12‿5‿6⟩ {∾˝˘ (2+↕𝕩)⥊<"hi"}¨ 2‿3‿4‿5 %% ⥊⟜(<"hi")¨ ⟨2‿3,2‿12,2‿12‿5,2‿12‿5‿6⟩ @@ -89,15 +89,15 @@ %USE eqvar ⋄ ¯1‿¯2‿¯3 {𝕨⊸⊏˘𝕩}_eqvar 8‿80⥊↕557 %% 8‿3⥊79‿78‿77‿159‿158‿157‿239‿238‿237‿319‿318‿317‿399‿398‿397‿479‿478‿477‿2‿1‿0‿82‿81‿80 1‿2‿0‿1‿¯1⊸⊏⎉1 2‿3‿4⥊↕24 %% 2‿3‿5⥊1‿2‿0‿1‿3‿5‿6‿4‿5‿7‿9‿10‿8‿9‿11‿13‿14‿12‿13‿15‿17‿18‿16‿17‿19‿21‿22‿20‿21‿23 1‿2‿0‿1‿¯1⊸⊏⎉2 2‿3‿4⥊↕24 %% 2‿5‿4⥊4‿5‿6‿7‿8‿9‿10‿11‿0‿1‿2‿3‿4‿5‿6‿7‿8‿9‿10‿11‿16‿17‿18‿19‿20‿21‿22‿23‿12‿13‿14‿15‿16‿17‿18‿19‿20‿21‿22‿23 -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿¯1‿1‿¯1 {𝕨⊸⊏˘𝕩}_evar ≍˘↕5 -!"⊏: Indexing out-of-bounds (¯2∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿¯1‿¯2‿¯1 {𝕨⊸⊏˘𝕩}_evar ≍˘↕5 -!"⊏: Indexing out-of-bounds (¯129∊𝕨, 128≡≠𝕩)" % %USE evar ⋄ 10‿¯129 {𝕨⊸⊏˘𝕩}_evar 10‿128⥊1 -!"⊏: Indexing out-of-bounds (128∊𝕨, 128≡≠𝕩)" % %USE evar ⋄ 10‿128 {𝕨⊸⊏˘𝕩}_evar 10‿128⥊1 -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 1‿0‿0‿1 {𝕨⊸⊏˘𝕩}_evar 10‿1⥊1 -!"⊏: Indexing out-of-bounds (1000∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ (3⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿3⥊1 -!"⊏: Indexing out-of-bounds (1000∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ (4⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿4⥊1 -!"⊏: Indexing out-of-bounds (1000∊𝕨, 8≡≠𝕩)" % %USE evar ⋄ (8⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 -!"⊏: Indexing out-of-bounds (100∊𝕨, 8≡≠𝕩)" % %USE evar ⋄ (<100) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿¯1‿1‿¯1 {𝕨⊸⊏˘𝕩}_evar ≍˘↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯2∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿¯1‿¯2‿¯1 {𝕨⊸⊏˘𝕩}_evar ≍˘↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯129∊𝕨, 128≡≠𝕩)" % %USE evar ⋄ 10‿¯129 {𝕨⊸⊏˘𝕩}_evar 10‿128⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (128∊𝕨, 128≡≠𝕩)" % %USE evar ⋄ 10‿128 {𝕨⊸⊏˘𝕩}_evar 10‿128⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 1‿0‿0‿1 {𝕨⊸⊏˘𝕩}_evar 10‿1⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1000∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ (3⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿3⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1000∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ (4⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿4⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1000∊𝕨, 8≡≠𝕩)" % %USE evar ⋄ (8⥊1000) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (100∊𝕨, 8≡≠𝕩)" % %USE evar ⋄ (<100) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 !"Integer out of range: 9e99" % %USE evar ⋄ (<9e99) {𝕨⊸⊏˘𝕩}_evar 100‿8⥊1 ⟨1‿2⟩⊸⊏˘ 10‿8⥊↕100 %% (8×↕10) +⌜ 1‿2 ⟨1‿2⟩⊸⊏˘ 10‿4‿2⥊↕100 %% (8×↕10) +⌜ [2‿3,4‿5] @@ -131,15 +131,15 @@ %USE eqvar ⋄ ≍˘⟜'!' _eqvar 100⥊7↑1 %% ∾⟜'!'○•internal.Keep˘ 0=7|↕100 %USE eqvar ⋄ ≍˘_eqvar˜ 3‿3⥊↕9 %% 3‿2‿3⥊0‿1‿2‿0‿1‿2‿3‿4‿5‿3‿4‿5‿6‿7‿8‿6‿7‿8 %USE eqvar ⋄ (2‿3‿4‿5‿1⥊↕11) ≍⎉2 _eqvar 2‿3‿4‿5‿1⥊↕7 %% (2‿3‿4‿5‿1⥊↕11) ≍○•internal.PureKeep⎉2 2‿3‿4‿5‿1⥊↕7 -!"˘: Argument frames don't agree (3‿4 ≡ ≢𝕨, 5‿4 ≡ ≢𝕩, common frame of 1 axes)" % (3‿4⥊2) ≍˘ 5‿4⥊2 -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨4⟩ ≡ ≢𝕨, ⟨5⟩ ≡ ≢𝕩)" % (3‿4⥊2) ≍˘ 3‿5⥊2 -!"≍: 𝕨 and 𝕩 must have equal shapes (2‿2‿2 ≡ ≢𝕨, 2‿3‿2 ≡ ≢𝕩)" % (3‿2‿2‿2⥊2) ≍˘ 3‿2‿3‿2⥊2 -!"≍: 𝕨 and 𝕩 must have equal shapes (4‿1 ≡ ≢𝕨, ⟨4⟩ ≡ ≢𝕩)" % (3‿4‿1⥊0) ≍˘ 3‿4⥊0 +!"𝕨˘𝕩: Argument frames don't agree (3‿4 ≡ ≢𝕨, 5‿4 ≡ ≢𝕩, common frame of 1 axes)" % (3‿4⥊2) ≍˘ 5‿4⥊2 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨4⟩ ≡ ≢𝕨, ⟨5⟩ ≡ ≢𝕩)" % (3‿4⥊2) ≍˘ 3‿5⥊2 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (2‿2‿2 ≡ ≢𝕨, 2‿3‿2 ≡ ≢𝕩)" % (3‿2‿2‿2⥊2) ≍˘ 3‿2‿3‿2⥊2 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (4‿1 ≡ ≢𝕨, ⟨4⟩ ≡ ≢𝕩)" % (3‿4‿1⥊0) ≍˘ 3‿4⥊0 (<"ab") ≍˘ 2⥊"cd" %% 2‿2⥊⟨"ab", 'c', "ab", 'd'⟩ (<"ab") ≍˘˜ 2⥊"cd" %% 2‿2⥊⟨'c', "ab", 'd', "ab"⟩ "ab" ≍⎉1 4‿2⥊"cd" %% 4‿2‿2⥊"abcdabcdabcdabcd" -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % ≍⟜"ab"˘ "cd" -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨2⟩ ≡ ≢𝕨, ⟨⟩ ≡ ≢𝕩)" % "ab"⊸≍˘ "cd" +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % ≍⟜"ab"˘ "cd" +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨2⟩ ≡ ≢𝕨, ⟨⟩ ≡ ≢𝕩)" % "ab"⊸≍˘ "cd" ( %USE IS_HEAPVERIFY diff --git a/test/cases/hash.bqn b/test/cases/hash.bqn index f0e8826c..339c2670 100644 --- a/test/cases/hash.bqn +++ b/test/cases/hash.bqn @@ -38,12 +38,12 @@ a←(•ParseFloat¨ "1.2"‿"-0"‿"0")∾-⊸⋈0÷0 ⋄ ! (0‿3‿3‿3⊏a) {b←•internal.Unshare a←"Ai8"•internal.Variation ∾⟨16⥊0‿0‿0‿0‿0‿0‿0‿¯128, 8⥊0, 8↑2⟩ ⋄ c←8‿64•bit._cast a ⋄ ! 1‿0‿0‿1≡∊c ⋄ •internal.Keep •Hash c ⋄ ! a≡b} # make sure sign bit doesn't mutate away # error messages -!"∊: 𝕩 cannot have rank 0" % 1‿2‿3∊0 -!"⊐: 𝕨 cannot have rank 0" % 0⊐1‿2‿3 -!"⊒: 𝕨 cannot have rank 0" % 0⊒1‿2‿3 -!"∊: Rank of 𝕨 must be at least the cell rank of 𝕩 (⟨2⟩ ≡ ≢𝕨, 2‿2‿2 ≡ ≢𝕩)" % 1‿2∊2‿2‿2⥊1‿2 -!"⊐: Rank of 𝕩 must be at least the cell rank of 𝕨 (2‿2‿2 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % (2‿2‿2⥊1‿2)⊐1‿2 -!"⊒: Rank of 𝕩 must be at least the cell rank of 𝕨 (2‿2‿2 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % (2‿2‿2⥊1‿2)⊒1‿2 +!"𝕨∊𝕩: 𝕩 cannot have rank 0" % 1‿2‿3∊0 +!"𝕨⊐𝕩: 𝕨 cannot have rank 0" % 0⊐1‿2‿3 +!"𝕨⊒𝕩: 𝕨 cannot have rank 0" % 0⊒1‿2‿3 +!"𝕨∊𝕩: Rank of 𝕨 must be at least the cell rank of 𝕩 (⟨2⟩ ≡ ≢𝕨, 2‿2‿2 ≡ ≢𝕩)" % 1‿2∊2‿2‿2⥊1‿2 +!"𝕨⊐𝕩: Rank of 𝕩 must be at least the cell rank of 𝕨 (2‿2‿2 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % (2‿2‿2⥊1‿2)⊐1‿2 +!"𝕨⊒𝕩: Rank of 𝕩 must be at least the cell rank of 𝕨 (2‿2‿2 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % (2‿2‿2⥊1‿2)⊒1‿2 # hashmap ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Get "fgh" %% ⟨2⟩ @@ -54,10 +54,10 @@ a←(•ParseFloat¨ "1.2"‿"-0"‿"0")∾-⊸⋈0÷0 ⋄ ! (0‿3‿3‿3⊏a) (((•HashMap˜↕4).Delete 1).Set´ 1‿"one").Keys@ %% 0‿2‿3‿1 (((•HashMap˜↕4).Delete 1).Set´ 1‿"one").Values@ %% 0‿2‿3‿"one" ({𝕩.Set´"xy"}⍟4•HashMap˜↕0).Count@ %% 1 -!"•HashMap: Arguments must be lists (⟨⟩≡≢𝕨, ⟨3⟩≡≢𝕩)" % 'a' •HashMap "str" -!"•HashMap: 𝕨 and 𝕩 must have the same length (4≡≠𝕨, 3≡≠𝕩)" % "stri" •HashMap "str" +!"𝕨 •HashMap 𝕩: Arguments must be lists (⟨⟩≡≢𝕨, ⟨3⟩≡≢𝕩)" % 'a' •HashMap "str" +!"𝕨 •HashMap 𝕩: 𝕨 and 𝕩 must have the same length (4≡≠𝕨, 3≡≠𝕩)" % "stri" •HashMap "str" !"•HashMap: 𝕨 contained duplicate keys" % "strs" •HashMap "stri" !"(hashmap).Get: key not found" % ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Get "fg" !"(hashmap).Delete: key not found" % ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Delete 'a' m ← 1‿2 •HashMap v←•internal.Unshare 'a'‿4 ⋄ 1 m.Set 9 ⋄ ⟨v, m.Keys@, m.Values@⟩ %% ⟨'a'‿4, 1‿2, 9‿4⟩ -m ← 1‿2 •HashMap •internal.Unshare 'a'‿4 ⋄ v←m.Values@ ⋄ 1 m.Set 9 ⋄ ⟨v, m.Keys@, m.Values@⟩ %% ⟨'a'‿4, 1‿2, 9‿4⟩ \ No newline at end of file +m ← 1‿2 •HashMap •internal.Unshare 'a'‿4 ⋄ v←m.Values@ ⋄ 1 m.Set 9 ⋄ ⟨v, m.Keys@, m.Values@⟩ %% ⟨'a'‿4, 1‿2, 9‿4⟩ diff --git a/test/cases/imports.bqn b/test/cases/imports.bqn index 8e585074..87d1c380 100644 --- a/test/cases/imports.bqn +++ b/test/cases/imports.bqn @@ -17,11 +17,11 @@ ! (⊑¨r1‿r3) ≡ ⍷⊑¨r1‿r2‿r3‿r4 ) -!"•Import: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic.bqn" -!"•Import: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic.bqn" -!"•Import: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic.bqn" -!"•Import: cyclic import of "".../cyclic_A.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic_A.bqn" -!"•Import: cyclic import of "".../cyclic_B.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic_B.bqn" -!"•Import: cyclic import of "".../cyclic_A.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic_B.bqn" -!"•Import: cyclic import of "".../cyclic_B.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic_A.bqn" +!"•Import 𝕩: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic.bqn" +!"•Import 𝕩: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic.bqn" +!"•Import 𝕩: cyclic import of "".../cyclic.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic.bqn" +!"•Import 𝕩: cyclic import of "".../cyclic_A.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic_A.bqn" +!"•Import 𝕩: cyclic import of "".../cyclic_B.bqn""" % %USE file ⋄ •Import⎊CleanPath File "cyclic_B.bqn" +!"•Import 𝕩: cyclic import of "".../cyclic_A.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic_B.bqn" +!"•Import 𝕩: cyclic import of "".../cyclic_B.bqn""" % %USE file ⋄ ⟨⟩•Import⎊CleanPath File "cyclic_A.bqn" %USE file ⋄ 3 •Import File "notCyclic.bqn" %% 30 diff --git a/test/cases/prims.bqn b/test/cases/prims.bqn index d88d50f5..9d951b4d 100644 --- a/test/cases/prims.bqn +++ b/test/cases/prims.bqn @@ -10,8 +10,8 @@ # total array comparison %USE k ⋄ a ← 0‿@‿'a'‿∞‿¯∞‿1‿¯1∾⍷∾{⟨𝕩⥊0, 𝕩⥊1, {1⌾((¯1¨≢𝕩)⊸⊑)𝕩}⍟(0≠×´∘≢) 𝕩⥊0⟩}¨ ∾{⥊(<⟨⟩)∾⌜´𝕩⥊<↕3}¨↕4 ⋄ r←(⊑(⍋-⍒)∘⋈)_k⌜˜ a ⋄ ! r ≡ •Cmp⌜˜a ⋄ r %% '1'-˜73‿73⥊"1000202002000002222000002000000222222222222200000200000022220000002000000210222222222222222222222222222222222222222222222222222222222222222222222222122222222222222222222222222222222222222222222222222222222222222222222222001222222222222222222222222222222222222222222222222222222222222222222222000010000200000222200000200000022222222222220000020000002222000000200000020002122022020222222020222022022222222222222202022202202222220220222022020000201002000002222000002000000222222222222200000200000022220000002000000200020210200000222200000200000022222222222220000020000002222000000200000020002222122020222222020222022022222222222222202022202202222220220222022020000000001000000000000000000000000000000000000000000000000000000000000000200020220210000222200000200000022222222222220000020000002222000000200000020002222222120222222020222022022222222222222202022202202222220220222022022000202202201002222200002202000222222222222220000220200022222020002202000200022222222212222222202222220222222222222222220222222022222222202222220220002022022020122222020022022022222222222222202002202202222220220222022020000000002000001000000000000000000000000000000000000000000000000000000000000000000200000210200000200000020020020020020000020000002002000000200000000000000020000022120000020000002202202202202000002000000220200000020000000000000002000002001000000000000200000000200000000000000020000000000000000200020220220000222210000200000022222222222220000020000002222000000200000020002222222220222222120222022022222222222222202022202202222220220222022022000202202202002222201002202000222222222222220000220200022222020002202000200022222222222222222212222220222222222222222220222222022222222202222220220002022022020222222020122022022222222222222202002202202222220220222022020000000002000002002000001000000200200000200200000000000020020000000000000200020220220000222220000210000022222222222222000020000002222202000200000020002222222220222222220222122022222222222222222022202202222222220222022022000202202200002222200002201000222222222222220000220000022222020002202000200020220220200222220200220210022222222222222020022020002222202202220200020002222222222222222222222222122222222222222222222222202222222222222222022000202202202002222202002202201222222222222220200220220022222022022202202000000000200000200000000000000010000000000000000000000000000000000000000000000000020000022020000020000002102002002002000002000000200200000020000000000000002000002222000002000000221220220220200000200000022020000002000000000000000200000200200000000000020010000020000000000000002000000000000000000000000020000022020000020000002202102002202000002000000220200000020000000000000002000002222000002000000222221220222200000200000022220000002000000000000000200000200200000200000020020010020020000000000002002000000000000000000000020000022020000020000002202202102202000002000000220200000020000000000000002000002222000002000000222222221222200000200000022220000002000000000000000200000200000000000000020000000010000000000000000000000000000000000000000020000022020000020000002202002002102000002000000200200000020000000000000002000002222000002000000222220220221200000200000022020000002000000000000000200000200200000000000020020000020010000000000002000000000000000020002022022000022222000020000002222222222222100002000000222200000020000002000222222222022222222022202202222222222222221202220220222222022022202202200020220220200222220200220200022222222222222010022020002222202000220200020002222222222222222222222222022222222222222222122222202222222220222222022000202202202022222202022202202222222222222220201220220222222022022202202000000000200000200200000200000020020020020020000010000002002000000000000020002022022000022222000022000002222222222222200002100000222220200020000002000222222222022222222022222202222222222222222202221220222222222022202202200020220220000222220000220200022222222222222000022010002222202000220200020002022022020022222020022022002222222222222202002202100222220220222020002000222222222222222222222222222222222222222222222222221222222222222222202200020220220200222220200220220222222222222222020022022012222202202220220200000000020000020000000000000002000000002000000000000000100000000000000000000000002000002202000002000000220200200220200000200000021020000002000000000000000200000222200000200000022222022022220000020000002212000000200000000000000020000020020000000000002002000002002000000000000200100000000000002000202202200002222200002000000222222222222220000200000022221000002000000200022222222202222222202220220222222222222222220222022022222212202220220220002022022000022222000020000002222222222222200002000000222220100020000002000202202202002222202002202000222222222222220200220200022222021002202000200022222222222222222222222220222222222222222222222222022222222212222220220002022022020022222020022020002222222222222202002202000222220220122020000000000002000002002000002000000200200200200200000200000020020000001000000200020220220000222220000220000022222222222222000022000002222202000210000020002222222220222222220222222022222222222222222022222202222222220222122022000202202200002222200002200000222222222222220000220000022222020002201000200020220220200222220200220220022222222222222020022022002222202202220210020002222222222222222222222222222222222222222222222222222222222222222222122000202202202002222202002202200222222222222220200220220022222022022202201" -!"∧: Argument cannot have rank 0" % ∧@ -!"∨: Argument cannot have rank 0" % ∨@ +!"∧𝕩: 𝕩 cannot have rank 0" % ∧@ +!"∨𝕩: 𝕩 cannot have rank 0" % ∨@ (=⋈≡)˜{⇐} %% 1‿1 (≠⋈≢)˜{⇐} %% 0‿0 {⇐}(=⋈≡){⇐} %% 0‿0 @@ -28,10 +28,10 @@ ! {𝕩 ≡ ⍷2/𝕩} ⟨(0÷0)⊸+, (0÷0)⊸+⟩ # comparison -w←1‿1⥊1 ⋄ x←1‿2⥊1 ⋄ {! (∾⟨•Repr𝕩,": Expected equal shape prefix (1‿1 ≡ ≢𝕨, 1‿2 ≡ ≢𝕩)"⟩) ≡ w 𝕏⎊(•CurrentError∘@) x}¨ =‿≠‿<‿>‿≤‿≥ -w←1‿1⥊1 ⋄ x←1‿2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expected equal shape prefix (1‿1 ≡ ≢𝕨, 1‿2 ≡ ≢𝕩)"⟩) ≡ w 𝕏⎊(•CurrentError∘@) x}¨ =‿≠‿<‿>‿≤‿≥ -w←1‿1⥊1 ⋄ x←2⥊1 ⋄ {! (∾⟨•Repr𝕩,": Expected equal shape prefix (1‿1 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)"⟩) ≡ w 𝕏⎊(•CurrentError∘@) x}¨ =‿≠‿<‿>‿≤‿≥ -w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expected equal shape prefix (1‿1 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)"⟩) ≡ w 𝕏⎊(•CurrentError∘@) x}¨ =‿≠‿<‿>‿≤‿≥ +w←1‿1⥊1 ⋄ x←1‿2⥊1 ⋄ {! (∾⟨"𝕨",•Repr𝕩,"𝕩: Expected equal shape prefix (1‿1 ≡ ≢𝕨, 1‿2 ≡ ≢𝕩)"⟩) ≡ w 𝕏⎊(•CurrentError∘@) x}¨ =‿≠‿<‿>‿≤‿≥ +w←1‿1⥊1 ⋄ x←1‿2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨"𝕨",•Repr𝕩,"𝕩: Expected equal shape prefix (1‿1 ≡ ≢𝕨, 1‿2 ≡ ≢𝕩)"⟩) ≡ w 𝕏⎊(•CurrentError∘@) x}¨ =‿≠‿<‿>‿≤‿≥ +w←1‿1⥊1 ⋄ x←2⥊1 ⋄ {! (∾⟨"𝕨",•Repr𝕩,"𝕩: Expected equal shape prefix (1‿1 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)"⟩) ≡ w 𝕏⎊(•CurrentError∘@) x}¨ =‿≠‿<‿>‿≤‿≥ +w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨"𝕨",•Repr𝕩,"𝕩: Expected equal shape prefix (1‿1 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)"⟩) ≡ w 𝕏⎊(•CurrentError∘@) x}¨ =‿≠‿<‿>‿≤‿≥ !"Invalid comparison" % <˜{⇐} !"Invalid comparison" % ≤˜{⇐} !"Invalid comparison" % >˜{⇐} @@ -60,27 +60,27 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe 1 +<1 %% <2 (<1)+<1 %% <2 @-@ %% 0 -!"-: Invalid character" % @-1 -{r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} @}¨ ⟨+, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -{r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ 0 0∘𝕏⎊{𝕊: •CurrentError@} @}¨ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -{r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} 0}¨ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +!"𝕨-𝕩: Invalid character" % @-1 +{r←•Repr𝕩 ⋄ (⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} @}¨ ⟨+, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +{r←•Repr𝕩 ⋄ (⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ 0 0∘𝕏⎊{𝕊: •CurrentError@} @}¨ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +{r←•Repr𝕩 ⋄ (⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} 0}¨ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -%USE var ⋄ a←4⥊@ ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} 𝕨 V a}⌜ ⟨+, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -%USE var ⋄ a←4⥊@ ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ 0 0∘𝕏⎊{𝕊: •CurrentError@} 𝕨 V a}⌜ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -%USE var ⋄ a←4⥊0 ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} 𝕨 V a}⌜ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +%USE var ⋄ a←4⥊@ ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} 𝕨 V a}⌜ ⟨+, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +%USE var ⋄ a←4⥊@ ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ 0 0∘𝕏⎊{𝕊: •CurrentError@} 𝕨 V a}⌜ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +%USE var ⋄ a←4⥊0 ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ @ 0∘𝕏⎊{𝕊: •CurrentError@} 𝕨 V a}⌜ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -%USE var ⋄ a←4⥊@ ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ (𝕨 V a) 0∘𝕏⎊{𝕊: •CurrentError@} @}⌜ ⟨+, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -%USE var ⋄ a←4⥊0 ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ (𝕨 V a) 0∘𝕏⎊{𝕊: •CurrentError@} @}⌜ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -%USE var ⋄ a←4⥊@ ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) (r∾": Unexpected argument types") ⋈ (𝕨 V a) 0∘𝕏⎊{𝕊: •CurrentError@} 0}⌜ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +%USE var ⋄ a←4⥊@ ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ (𝕨 V a) 0∘𝕏⎊{𝕊: •CurrentError@} @}⌜ ⟨+, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +%USE var ⋄ a←4⥊0 ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ (𝕨 V a) 0∘𝕏⎊{𝕊: •CurrentError@} @}⌜ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +%USE var ⋄ a←4⥊@ ⋄ (LV a) {r←•Repr𝕩 ⋄ (⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ (𝕨 V a) 0∘𝕏⎊{𝕊: •CurrentError@} 0}⌜ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -%USE var ⋄ a←4⥊@ ⋄ b←4⥊@ ⋄ {r←•Repr f←𝕩 ⋄ {(⊢!≡´) (r∾": Unexpected argument types") ⋈ (𝕨 V a) 0∘F⎊{𝕊: •CurrentError@} 𝕩 V b}⌜○LV´ a‿b}⌜ ⟨+, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -%USE var ⋄ a←4⥊0 ⋄ b←4⥊@ ⋄ {r←•Repr f←𝕩 ⋄ {(⊢!≡´) (r∾": Unexpected argument types") ⋈ (𝕨 V a) 0∘F⎊{𝕊: •CurrentError@} 𝕩 V b}⌜○LV´ a‿b}⌜ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -%USE var ⋄ a←4⥊@ ⋄ b←4⥊0 ⋄ {r←•Repr f←𝕩 ⋄ {(⊢!≡´) (r∾": Unexpected argument types") ⋈ (𝕨 V a) 0∘F⎊{𝕊: •CurrentError@} 𝕩 V b}⌜○LV´ a‿b}⌜ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +%USE var ⋄ a←4⥊@ ⋄ b←4⥊@ ⋄ {r←•Repr f←𝕩 ⋄ {(⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ (𝕨 V a) 0∘F⎊{𝕊: •CurrentError@} 𝕩 V b}⌜○LV´ a‿b}⌜ ⟨+, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +%USE var ⋄ a←4⥊0 ⋄ b←4⥊@ ⋄ {r←•Repr f←𝕩 ⋄ {(⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ (𝕨 V a) 0∘F⎊{𝕊: •CurrentError@} 𝕩 V b}⌜○LV´ a‿b}⌜ ⟨ -, ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ +%USE var ⋄ a←4⥊@ ⋄ b←4⥊0 ⋄ {r←•Repr f←𝕩 ⋄ {(⊢!≡´) ("𝕨"∾r∾"𝕩: Unexpected argument types") ⋈ (𝕨 V a) 0∘F⎊{𝕊: •CurrentError@} 𝕩 V b}⌜○LV´ a‿b}⌜ ⟨ ×, ÷, ⋆, √, ⌊, ⌈, |, ∧, ∨, ÷⟩ -!"-: Unexpected argument types" % 0-@ -!"÷: Unexpected argument types" % 0÷@ -!"+: Argument must consist of numbers" % +@ -⟨@, "abc", ⟨1,2,+⟩, {⇐}⟩ {(⊢!≡´) (": Argument contained non-number"∾˜•Repr 𝕩) ⋈ 0∘𝕏⎊{𝕊: •CurrentError@} 𝕨}⌜ -‿×‿÷‿⋆‿√‿⌊‿⌈‿|‿¬ +!"𝕨-𝕩: Unexpected argument types" % 0-@ +!"𝕨÷𝕩: Unexpected argument types" % 0÷@ +!"+𝕩: Argument must consist of numbers" % +@ +⟨@, "abc", ⟨1,2,+⟩, {⇐}⟩ {(⊢!≡´) ("𝕩: 𝕩 contained non-number"∾˜•Repr 𝕩) ⋈ 0∘𝕏⎊{𝕊: •CurrentError@} 𝕨}⌜ -‿×‿÷‿⋆‿√‿⌊‿⌈‿|‿¬ !"This function can't be called monadically" % ≤@ !"This function can't be called monadically" % ≥@ @@ -90,7 +90,7 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe 2‿3‿0‿1/↕⋈4 %% ⋈¨6⥊0‿0‿1‿1‿1‿3 !"Expected non-negative integer, got ¯3" % 2‿¯3/↕2 !"Expected non-negative integer, got ¯3e20" % 2‿¯3e20/↕2 -!"/: Lengths of components of 𝕨 must match 𝕩 (3 ≠ 4)" % 1‿2‿3/4‿5‿6‿7 +!"𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩 (3 ≠ 4)" % 1‿2‿3/4‿5‿6‿7 !"Expected non-negative integer, got ¯1000" % (4/1000‿¯1000) / 8⥊1 !"Expected non-negative integer, got ¯1000" % (4/1000‿¯1000) / 8⥊1 !"Integer out of range: 4e19" % %USE evar ⋄ 2‿4e19 /_evar ↕2 @@ -101,9 +101,9 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe !"𝕨/𝕩: Length of compound 𝕨 must be at most rank of 𝕩" % (<↕0)/<"ab" !"𝕨/𝕩: Length of compound 𝕨 must be at most rank of 𝕩" % ⟨↕10,↕10⟩ / 10⥊10 !"𝕨/𝕩: Length of compound 𝕨 must be at most rank of 𝕩" % ⟨↕10,↕10,<0⟩ / 10‿10⥊10 -!"/: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (2‿1⥊↕4) / 4‿4⥊↕16 +!"𝕨/𝕩: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (2‿1⥊↕4) / 4‿4⥊↕16 !"𝕨/𝕩: Compound 𝕨 must have rank at most 1" % (2‿1⥊<↕4) / 4‿4⥊↕16 -!"/: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (1‿2⥊↕4) / ↕4 +!"𝕨/𝕩: Simple 𝕨 must have rank 0 or 1 (2≡=𝕨)" % (1‿2⥊↕4) / ↕4 !"𝕨/𝕩: Compound 𝕨 must have rank at most 1" % (1‿2⥊<↕4) / ↕4 !"𝕨/𝕩: 𝕨 must consist of natural numbers" % ⟨↕4, 1‿2‿3.5‿4⟩ / 4‿4⥊↕16 !"𝕨/𝕩: 𝕨 must consist of natural numbers" % ⟨↕4, 3.5⟩ / 4‿4⥊↕16 @@ -123,8 +123,8 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe # /𝕩 !"Expected non-negative integer, got ¯1000" % / 4/1000‿¯1000 -!"/: Argument must have rank 1 (3‿3 ≡ ≢𝕩)" % /↕3‿3 -!"/: Argument must have rank 1 (⟨⟩ ≡ ≢𝕩)" % /0 +!"/𝕩: 𝕩 must have rank 1 (3‿3 ≡ ≢𝕩)" % /↕3‿3 +!"/𝕩: 𝕩 must have rank 1 (⟨⟩ ≡ ≢𝕩)" % /0 !"Expected non-negative integer, got ¯1" % %USE evar ⋄ /_evar ¯1⌾(100⊸⊑) 200⥊10 !"Sum too big" % %USE evar ⋄ /_evar 1e2⥊2⋆62 !"Integer out of range: 1e20" % %USE evar ⋄ /_evar 1e20⌾(100⊸⊑) 200⥊10 @@ -135,52 +135,52 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe •internal.ElType¨ {(100⥊↕2)⊏𝕨‿𝕩}⌜˜ ⟨0, 1, 2, 127, 128, 32767, 32768, ¯32767, ¯32768, ¯32769, ¯1+2⋆31, 2⋆31, @, @+1, @+255, @+256, @+1114111, {⇐}, 1‿2⟩ %% (8-(=⌜˜<⟜5)×8-⌈⌜˜) 0‿0‿1‿1‿2‿2‿3‿2‿2‿3‿3‿4‿5‿5‿5‿6‿7‿8‿8 0‿0‿0 ⊏ 1‿3⥊↕10 %% 3‿3⥊0‿1‿2 ≢¨ ⟨(2‿0‿3‿4‿5⥊1)⊏9‿8‿0‿7⥊0 ⋄ ⟨⟩⊏0‿8‿0‿7⥊0 ⋄ (2‿3‿0‿4⥊1)⊏↕10⟩ %% ⟨2‿0‿3‿4‿5‿8‿0‿7,0‿8‿0‿7,2‿3‿0‿4⟩ -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % ⊏˜(200⥊1)⥊1 -!"⊏: Indexing out-of-bounds (24∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ 1‿24 ⊏_evar ↕4‿4 -!"⊏: Indexing out-of-bounds (¯24∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ 1‿¯24 ⊏_evar ↕4‿4 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % ⊏˜(200⥊1)⥊1 +!"𝕨⊏𝕩: Indexing out-of-bounds (24∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ 1‿24 ⊏_evar ↕4‿4 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯24∊𝕨, 4≡≠𝕩)" % %USE evar ⋄ 1‿¯24 ⊏_evar ↕4‿4 !"𝕨⊏𝕩: 𝕨 must be an array of numbers or list of such arrays" % %USE evar ⋄ (1‿¯26∾@) ⊏_evar @∾↕5 -!"⊏: Indexing out-of-bounds (¯26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ ¯26⊸⊏_evar ↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ ¯26⊸⊏_evar ↕5 !"Expected integer, got ¯26.5" % %USE evar ⋄ ¯26.5⊸⊏_evar ↕5 -!"⊏: Indexing out-of-bounds (¯26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ 1‿¯26 ⊏_evar ↕5 -!"⊏: Indexing out-of-bounds (26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ 1‿26 ⊏_evar ↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ 1‿¯26 ⊏_evar ↕5 +!"𝕨⊏𝕩: Indexing out-of-bounds (26∊𝕨, 5≡≠𝕩)" % %USE evar ⋄ 1‿26 ⊏_evar ↕5 !"Expected integer, got 1.1" % %USE evar ⋄ 0‿1.1‿2 ⊏_evar ↕10 -!"⊏: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿0‿1 ⊏_evar 1‿3⥊↕10000 -!"⊏: Indexing out-of-bounds (2∊𝕨, 2≡≠𝕩)" % %USE evar ⋄ (1+9=↕10) ⊏_evar ⟨1‿2,3⟩ -!"⊏: Indexing out-of-bounds (4∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ 1‿4‿2‿0‿10‿5‿6 ⊏_evar 1‿0‿1 -!"⊏: Indexing out-of-bounds (¯4∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ (-1‿4‿2‿0‿10‿5‿6) ⊏_evar 1‿0‿1 -!"⊏: Indexing out-of-bounds (4000∊𝕨, 1001≡≠𝕩)" % %USE evar ⋄ ( 1000×1‿4‿2‿0‿10‿5‿6) ⊏_evar 1001⥊1‿0‿1 -!"⊏: Indexing out-of-bounds (¯4000∊𝕨, 1001≡≠𝕩)" % %USE evar ⋄ (¯1000×1‿4‿2‿0‿10‿5‿6) ⊏_evar 1001⥊1‿0‿1 +!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % %USE evar ⋄ 0‿0‿1 ⊏_evar 1‿3⥊↕10000 +!"𝕨⊏𝕩: Indexing out-of-bounds (2∊𝕨, 2≡≠𝕩)" % %USE evar ⋄ (1+9=↕10) ⊏_evar ⟨1‿2,3⟩ +!"𝕨⊏𝕩: Indexing out-of-bounds (4∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ 1‿4‿2‿0‿10‿5‿6 ⊏_evar 1‿0‿1 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯4∊𝕨, 3≡≠𝕩)" % %USE evar ⋄ (-1‿4‿2‿0‿10‿5‿6) ⊏_evar 1‿0‿1 +!"𝕨⊏𝕩: Indexing out-of-bounds (4000∊𝕨, 1001≡≠𝕩)" % %USE evar ⋄ ( 1000×1‿4‿2‿0‿10‿5‿6) ⊏_evar 1001⥊1‿0‿1 +!"𝕨⊏𝕩: Indexing out-of-bounds (¯4000∊𝕨, 1001≡≠𝕩)" % %USE evar ⋄ (¯1000×1‿4‿2‿0‿10‿5‿6) ⊏_evar 1001⥊1‿0‿1 %USE tvar ⋄ !∘≡¨⟜⊏ ∾ {⥊𝕨 ⊏⎊(•CurrentError∘⊢) _tvar 𝕩}´¨ ⟨⟨0‿1, ⋈0⟩ ⋄ ⟨0‿1, "?"⟩ ⋄ ⟨0‿1, ≍0‿1⟩⟩ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄ 𝕨⊏⎊"e"𝕩}⟨1‿2,3‿4⟩ ⋄ ! 0‿1 ≡ a %USE eqvar ⋄ {1‿¯1 {r←𝕨⊏𝕩 ⋄ ! 𝕩 ≥○•internal.ElType r ⋄ r}_eqvar 𝕩}¨ ⟨↕2, ↕4, "hello", ⟨"ab", "cd", "ef"⟩, ↕⋈4⟩ -!"⊏: 𝕩 cannot be a unit" % 0⊏<"a" -!"⊏: 𝕩 cannot be a unit" % 0⊏<5 -!"⊏: 𝕩 cannot be an atom" % 0⊏5 -!"⊏: 𝕩 cannot be a unit" % ⟨⟩⊏<"a" -!"⊏: 𝕩 cannot be a unit" % ⟨⟩⊏<5 -!"⊏: 𝕩 cannot be an atom" % ⟨⟩⊏5 +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % 0⊏<"a" +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % 0⊏<5 +!"𝕨⊏𝕩: 𝕩 cannot be an atom" % 0⊏5 +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % ⟨⟩⊏<"a" +!"𝕨⊏𝕩: 𝕩 cannot be a unit" % ⟨⟩⊏<5 +!"𝕨⊏𝕩: 𝕩 cannot be an atom" % ⟨⟩⊏5 !"Expected integer, got 1.5" % ⟨1.5⟩ ⊏ "ab"‿"cd" -!"⊏: Indexing out-of-bounds (10∊𝕨, 2≡≠𝕩)" % ⟨10⟩ ⊏ "ab"‿"cd" +!"𝕨⊏𝕩: Indexing out-of-bounds (10∊𝕨, 2≡≠𝕩)" % ⟨10⟩ ⊏ "ab"‿"cd" {𝕩 ! ↕∘≠⊸⊏⊸≡ 20‿𝕩•rand.Range 2}¨ (↕70)∾⥊(64×1‿2‿3‿4‿5)+⌜¯1‿0‿1‿30‿60 # 𝕨⊑𝕩 -!"⊑: 𝕨 contained a non-integer" % ⟨0.1⟩⊑↕3 -!"⊑: 𝕨 contained a non-integer" % ⟨2⋆80⟩⊑↕3 -!"⊑: Leaf arrays in 𝕨 must have rank 1 (element: (1‿2⥊1‿2))" % %USE evar ⋄ (≍1‿2) {⟨𝕨⟩⊑𝕩}_evar ↕5‿5 +!"𝕨⊑𝕩: 𝕨 contained a non-integer" % ⟨0.1⟩⊑↕3 +!"𝕨⊑𝕩: 𝕨 contained a non-integer" % ⟨2⋆80⟩⊑↕3 +!"𝕨⊑𝕩: Leaf arrays in 𝕨 must have rank 1 (element: (1‿2⥊1‿2))" % %USE evar ⋄ (≍1‿2) {⟨𝕨⟩⊑𝕩}_evar ↕5‿5 %USE eqvar ⋄ 1‿2 ⊑_eqvar ↕5‿5 %% 1‿2 # >𝕩 -!">: Result rank too large (200 ≡ =𝕩, 205 ≡ =⊑𝕩)" % > (200⥊1)⥊<(205⥊1)⥊1 -!">: Incompatible element shapes (encountered shapes ⟨2⟩ and 4‿5)" % > ↕¨⟨2, 4‿5⟩ -!">: Incompatible element shapes (encountered shapes 2‿3 and ⟨4⟩)" % > ↕¨⟨2‿3, 4⟩ -!">: Incompatible element shapes (encountered shapes 2‿3 and 4‿5)" % > ↕¨⟨2‿3, 4‿5⟩ -!">: Incompatible element shapes (encountered shapes 2‿0 and 4‿5)" % > ↕¨⟨2‿0, 4‿5⟩ -!">: Incompatible element shapes (encountered shapes ⟨0⟩ and 4‿5)" % > ↕¨⟨0, 4‿5⟩ -!">: Incompatible element shapes (encountered shapes ⟨0⟩ and ⟨⟩)" % > ↕¨⟨0, ⟨⟩⟩ -!">: Incompatible element shapes (encountered shapes 2‿3 and ⟨⟩)" % > ↕¨⟨2‿3, ⟨⟩⟩ -!">: Incompatible element shapes (encountered shapes 4‿5 and 4‿6)" % ≢>2‿3⥊⟨4‿5⥊↕20,4‿6⥊↕1⟩ -!"∾: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and ⟨3⟩ and later higher-rank array)" % ∾⟨1‿1, 1‿1‿1, ⟨1⟩, 2‿2⥊1⟩ -!"∾: Item trailing shapes must be equal (contained arrays with shapes 1‿4 and ⟨0⟩)" % ∾⟨1‿4⥊"abcd",⟨⟩⟩ +!">𝕩: Result rank too large (200 ≡ =𝕩, 205 ≡ =⊑𝕩)" % > (200⥊1)⥊<(205⥊1)⥊1 +!">𝕩: Incompatible element shapes (encountered shapes ⟨2⟩ and 4‿5)" % > ↕¨⟨2, 4‿5⟩ +!">𝕩: Incompatible element shapes (encountered shapes 2‿3 and ⟨4⟩)" % > ↕¨⟨2‿3, 4⟩ +!">𝕩: Incompatible element shapes (encountered shapes 2‿3 and 4‿5)" % > ↕¨⟨2‿3, 4‿5⟩ +!">𝕩: Incompatible element shapes (encountered shapes 2‿0 and 4‿5)" % > ↕¨⟨2‿0, 4‿5⟩ +!">𝕩: Incompatible element shapes (encountered shapes ⟨0⟩ and 4‿5)" % > ↕¨⟨0, 4‿5⟩ +!">𝕩: Incompatible element shapes (encountered shapes ⟨0⟩ and ⟨⟩)" % > ↕¨⟨0, ⟨⟩⟩ +!">𝕩: Incompatible element shapes (encountered shapes 2‿3 and ⟨⟩)" % > ↕¨⟨2‿3, ⟨⟩⟩ +!">𝕩: Incompatible element shapes (encountered shapes 4‿5 and 4‿6)" % ≢>2‿3⥊⟨4‿5⥊↕20,4‿6⥊↕1⟩ +!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and ⟨3⟩ and later higher-rank array)" % ∾⟨1‿1, 1‿1‿1, ⟨1⟩, 2‿2⥊1⟩ +!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes 1‿4 and ⟨0⟩)" % ∾⟨1‿4⥊"abcd",⟨⟩⟩ >⟨<'a',1⟩ %% 'a'‿1 >⟨1,2,<3,4,<<5⟩ %% ⟨1,2,3,4,<5⟩ ≢>0‿1⥊<2‿3⥊<"ab" %% ↕4 @@ -204,11 +204,11 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄ # ∾𝕩 ∾⟨"ab", 12, "de"⟩ %% ⟨'a','b',12,'d','e'⟩ -!"∾: Item trailing shapes must be equal (contained arrays with shapes 3‿3 and 3‿4)" % ∾⟨↕3‿3,↕3‿4⟩ -!"∾: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and 3‿3)" % ∾⟨1‿2,↕3‿3⟩ -!"∾: Item ranks along an axis can differ by at most one (contained ranks 1 and 3 along axis 0)" % ∾2‿1 ⥊ ⥊⟜0¨ ⟨0‿2‿3, 0⟩ -!"∾: Incompatible item shapes (contained arrays with shapes 1‿0 and 1‿0 along axis 1)" % ∾ {1‿𝕩⥊0}¨ [0‿1, 0‿0] -!"∾: Incompatible item ranks" % ∾ ⥊⟜0¨ [0‿1⋈0‿1, 0‿1⋈1] +!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes 3‿3 and 3‿4)" % ∾⟨↕3‿3,↕3‿4⟩ +!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and 3‿3)" % ∾⟨1‿2,↕3‿3⟩ +!"∾𝕩: Item ranks along an axis can differ by at most one (contained ranks 1 and 3 along axis 0)" % ∾2‿1 ⥊ ⥊⟜0¨ ⟨0‿2‿3, 0⟩ +!"∾𝕩: Incompatible item shapes (contained arrays with shapes 1‿0 and 1‿0 along axis 1)" % ∾ {1‿𝕩⥊0}¨ [0‿1, 0‿0] +!"∾𝕩: Incompatible item ranks" % ∾ ⥊⟜0¨ [0‿1⋈0‿1, 0‿1⋈1] ∾3‿3⥊<1‿0‿3⥊0 %% 3‿0‿3⥊0 ∾3‿3⥊<0‿0⥊⟨⟩ %% 0‿0⥊⟨⟩ ⊑1↑⥊∾3‿3⥊<1‿0‿3⥊<"hi" %% " " @@ -216,8 +216,8 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄ ∾⟨⟩ %% ⟨⟩ # 𝕨∾𝕩 -!"∾: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")∾≍"a" -!"∾: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % (("abc")∾"def")∾1‿1⥊1 +!"𝕨∾𝕩: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc"∾"def")∾≍"a" +!"𝕨∾𝕩: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % (("abc")∾"def")∾1‿1⥊1 ! (∘‿2⥊"abcdefgh") ≡ ["ab","cd"]∾["ef","gh"] ! (∘‿2⥊"abcdef") ≡ ["ab","cd"]∾"ef" @@ -226,26 +226,26 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄ ! (∘‿2⥊"abcdef") ≡ (a←["ab","cd"])∾"ef" ⋄ •internal.Keep a ! (∘‿2⥊"abcdef") ≡ "ab"∾a←["cd","ef"] ⋄ •internal.Keep a -!"∾: Argument ranks must differ by 1 or less (0≡=𝕨, 2≡=𝕩)" % 1∾↕3‿3 -!"∾: Argument ranks must differ by 1 or less (1≡=𝕨, 3≡=𝕩)" % 1‿2∾↕3‿3‿3 -!"∾: Argument ranks must differ by 1 or less (3≡=𝕨, 1≡=𝕩)" % 1‿2∾˜↕3‿3‿3 -!"∾: Lengths not matchable (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)∾↕3‿3 +!"𝕨∾𝕩: Argument ranks must differ by 1 or less (0≡=𝕨, 2≡=𝕩)" % 1∾↕3‿3 +!"𝕨∾𝕩: Argument ranks must differ by 1 or less (1≡=𝕨, 3≡=𝕩)" % 1‿2∾↕3‿3‿3 +!"𝕨∾𝕩: Argument ranks must differ by 1 or less (3≡=𝕨, 1≡=𝕩)" % 1‿2∾˜↕3‿3‿3 +!"𝕨∾𝕩: Lengths not matchable (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)∾↕3‿3 -!"∾: Lengths not matchable (2‿2 ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % ["ab","cd"]∾["efg","hjk"] -!"∾: Lengths not matchable (2‿2 ≡ ≢𝕨, ⟨3⟩ ≡ ≢𝕩)" % ["ab","cd"]∾"efg" -!"∾: Lengths not matchable (⟨3⟩ ≡ ≢𝕨, 2‿2 ≡ ≢𝕩)" % "abz"∾["cd","ef"] -!"∾: Lengths not matchable (2‿2 ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (a←["ab","cd"])∾["efg","hjk"] -!"∾: Lengths not matchable (2‿2 ≡ ≢𝕨, ⟨3⟩ ≡ ≢𝕩)" % (a←["ab","cd"])∾"efg" -!"∾: Lengths not matchable (⟨3⟩ ≡ ≢𝕨, 2‿2 ≡ ≢𝕩)" % "abz"∾a←["cd","ef"] +!"𝕨∾𝕩: Lengths not matchable (2‿2 ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % ["ab","cd"]∾["efg","hjk"] +!"𝕨∾𝕩: Lengths not matchable (2‿2 ≡ ≢𝕨, ⟨3⟩ ≡ ≢𝕩)" % ["ab","cd"]∾"efg" +!"𝕨∾𝕩: Lengths not matchable (⟨3⟩ ≡ ≢𝕨, 2‿2 ≡ ≢𝕩)" % "abz"∾["cd","ef"] +!"𝕨∾𝕩: Lengths not matchable (2‿2 ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (a←["ab","cd"])∾["efg","hjk"] +!"𝕨∾𝕩: Lengths not matchable (2‿2 ≡ ≢𝕨, ⟨3⟩ ≡ ≢𝕩)" % (a←["ab","cd"])∾"efg" +!"𝕨∾𝕩: Lengths not matchable (⟨3⟩ ≡ ≢𝕨, 2‿2 ≡ ≢𝕩)" % "abz"∾a←["cd","ef"] # 𝕨≍𝕩 -!"≍: 𝕨 and 𝕩 must have equal shapes (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)≍↕3‿3 -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % 1‿2‿3≍1‿2 -!"≍: 𝕨 and 𝕩 must have equal shapes (⟨3⟩ ≡ ≢𝕨, ⟨⟩ ≡ ≢𝕩)" % 1‿2‿3≍1 -!"≍: Result rank too large" % ≍˜(255⥊1)⥊1 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (3‿4 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (↕3‿4)≍↕3‿3 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)" % 1‿2‿3≍1‿2 +!"𝕨≍𝕩: 𝕨 and 𝕩 must have equal shapes (⟨3⟩ ≡ ≢𝕨, ⟨⟩ ≡ ≢𝕩)" % 1‿2‿3≍1 +!"𝕨≍𝕩: Result rank too large" % ≍˜(255⥊1)⥊1 # ≍𝕩 -!"≍: Result rank too large (255≡=𝕩)" % ≍⍟256 1 +!"≍𝕩: Result rank too large (255≡=𝕩)" % ≍⍟256 1 %USE eqvar ⋄ 1‿2‿3‿4‿5‿64 {c𝕊e: ∾_eqvar´¨ ⟨4‿c, c⟩ ⋈⌜○({𝕩⥊ %% +‿÷‿×‿=‿+‿+ -!"/: Lengths of components of 𝕨 must match 𝕩 (6 ≠ 7)" % 0¨⌾(1‿0‿0‿0‿1‿1⊸/) 0‿1‿0‿1‿0‿1‿0 +!"𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩 (6 ≠ 7)" % 0¨⌾(1‿0‿0‿0‿1‿1⊸/) 0‿1‿0‿1‿0‿1‿0 4↑ (⋈⋈3)⌾(0‿1‿0⊸/) ↕⋈3 %!PROPER_FILLS %% ⟨⋈0,⋈3,⋈2,0⟩ 4↑ ⊢⌾(0‿1‿0⊸/) ↕⋈3 %!PROPER_FILLS %% ⟨⋈0,⋈1,⋈2,0⟩ 4↑ ⊢⌾(0‿0‿0⊸/) ↕⋈3 %!PROPER_FILLS %% ⟨⋈0,⋈1,⋈2,0⟩ diff --git a/test/cases/undo.bqn b/test/cases/undo.bqn index 041c1c9f..17059e17 100644 --- a/test/cases/undo.bqn +++ b/test/cases/undo.bqn @@ -18,8 +18,13 @@ !"≍⁼: Argument must have a leading axis of 1" % ≍⁼ "foo" !"≍⁼: Argument must have a leading axis of 1" % ≍⁼ 3‿1‿1⥊<"foo" -!"⌽: Argument cannot be a unit" % ⌽⁼ 0 +!"⌽𝕩: 𝕩 cannot be a unit" % ⌽⁼ 0 ⌽⁼ ↕10 %% 9-↕10 -!"⍉⁼: 𝕩 must not be an atom" % ⍉⁼ 3 +!"⍉⁼𝕩: 𝕩 must not be an atom" % ⍉⁼ 3 +!"𝕨⍉⁼𝕩: 𝕩 must not be an atom" % 0 ⍉⁼ 3 +!"𝕨⍉⁼𝕩: Length of 𝕨 must be at most rank of 𝕩" % 0‿0 ⍉⁼ ↕3 +!"𝕨⍉⁼𝕩: Axis 9 does not exist (1≡=𝕩)" % 9 ⍉⁼ ↕3 +!"𝕨⍉⁼𝕩: Axis 9 does not exist (3≡=𝕩)" % 9 ⍉⁼ 3‿3‿3⥊3 +!"𝕨⍉⁼𝕩: 𝕨 must have rank at most 1" % (1‿1⥊0) ⍉⁼ ↕3 ⍉⁼ <3 %% <3 diff --git a/test/cases/usz32.bqn b/test/cases/usz32.bqn index 47b75e5b..753a2e85 100644 --- a/test/cases/usz32.bqn +++ b/test/cases/usz32.bqn @@ -1,5 +1,5 @@ !"Out of memory" % a←(2⋆20) ⥊ 1e9 ⋄ ≠•internal.Keep {𝕊: a}˘ a -!"⥊: 𝕨 too large" % a←(2⋆20) ⥊ 1e9 ⋄ ≠•internal.Keep a˘ a +!"𝕨⥊𝕩: 𝕨 too large" % a←(2⋆20) ⥊ 1e9 ⋄ ≠•internal.Keep a˘ a !"Out of memory" % ≠•internal.Keep (2⋆25)/(2⋆10)⥊10 !"Out of memory" % k←16384 ⋄ n←k÷˜2⋆32 ⋄ ≠•internal.Keep (n⥊k) / n⥊1 !"Out of memory" % k←64 ⋄ n←k÷˜2⋆32 ⋄ ≠•internal.Keep (n⥊k) / n⥊1 # %SLOW