clean up error messages

incl. correcting •_timed's message being wrong
This commit is contained in:
dzaima 2025-02-06 12:23:55 +02:00
parent 308f93368e
commit e3a4132722
15 changed files with 163 additions and 140 deletions

View File

@ -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*/
@ -407,7 +407,7 @@ 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, {
@ -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)

View File

@ -340,7 +340,7 @@ static NOINLINE B to_fill_cell(B x, ur k, u32 chr) { // consumes x
ur cr = RNK(x)-k;
usz* sh = SH(x)+k;
usz csz = 1;
for (usz i=0; i<cr; i++) if (mulOn(csz, sh[i])) thrF("%c𝕩: Empty argument too large (%H ≡ ≢𝕩)", chr, x);
for (usz i=0; i<cr; i++) if (mulOn(csz, sh[i])) thrF("%c: Empty argument too large (%H ≡ ≢𝕩)", chr, x);
MAKE_MUT(fc, csz);
mut_fill(fc, 0, xf, csz); dec(xf);
Arr* ca = mut_fp(fc);
@ -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;

View File

@ -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("´𝕩: 𝕩 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); }

View File

@ -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 (rr<xr) thrF("𝕨⌜𝕩: Result rank too large (%i≡=𝕨, %i≡=𝕩)", wr, xr);
if (rr<xr) thrF("𝕨𝔽⌜𝕩: Result rank too large (%i≡=𝕨, %i≡=𝕩)", wr, xr);
B r;
usz* rsh;
@ -154,7 +154,7 @@ B swap_c2(Md1D* d, B w, B x) { return c2(d->f, 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();

View File

@ -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));

View File

@ -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("`𝕩: 𝕩 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");

View File

@ -277,7 +277,7 @@ B show_c1(B t, B x) {
}
NOINLINE B vfyStr(B x, char* name, char* arg) {
if (!isStr(x)) thrF("%U𝕩: %U must be a string", name, arg);
if (!isStr(x)) thrF("%U: %U must be a string", name, arg);
return x;
}
@ -1038,7 +1038,7 @@ static i32 sh_core(bool raw, B x, usz xia, B inObj, u64 iLen, B* s_outp, B* s_er
SGetU(x)
for (u64 i = 0; i < xia; i++) {
B c = GetU(x, i);
if (isAtm(c) || RNK(c)!=1) thrM("•SH𝕩: 𝕩 must be a list of strings");
if (isAtm(c) || RNK(c)!=1) thrM("•SH: 𝕩 must be a list of strings");
u64 len = utf8lenB(c);
TALLOC(char, cstr, len+1);
toUTF8(c, cstr);
@ -1051,7 +1051,7 @@ static i32 sh_core(bool raw, B x, usz xia, B inObj, u64 iLen, B* s_outp, B* s_er
int p_in[2];
int p_out[2];
int p_err[2];
if (pipe(p_in) || pipe(p_out) || pipe(p_err)) thrM("•SH𝕩: Failed to create process: Couldn't create pipes"); // TODO these pipes will easily leak
if (pipe(p_in) || pipe(p_out) || pipe(p_err)) thrM("•SH: Failed to create process: Couldn't create pipes"); // TODO these pipes will easily leak
shDbg("pipes: %d %d %d %d %d %d\n", p_in[0], p_in[1], p_out[0], p_out[1], p_err[0], p_err[1]);
fcntl(p_in[1], F_SETFL, O_NONBLOCK); // make our side of pipes never block because we're working on multiple
fcntl(p_out[0], F_SETFL, O_NONBLOCK);
@ -1065,7 +1065,7 @@ static i32 sh_core(bool raw, B x, usz xia, B inObj, u64 iLen, B* s_outp, B* s_er
// spawn the actual process
pid_t pid;
if(posix_spawnp(&pid, argv[0], &a, NULL, argv, environ) != 0) thrF("•SH𝕩: Failed to create process: %S", strerror(errno));
if(posix_spawnp(&pid, argv[0], &a, NULL, argv, environ) != 0) thrF("•SH: Failed to create process: %S", strerror(errno));
posix_spawn_file_actions_destroy(&a); // used now
shClose(p_in[0]); // close the useless pipes on this side
shClose(p_out[1]);
@ -1163,7 +1163,7 @@ static i32 sh_core(bool raw, B x, usz xia, B inObj, u64 iLen, B* s_outp, B* s_er
SGetU(x)
for (u64 i = 0; i < xia; i++) {
B c = GetU(x, i);
if (isAtm(c) || RNK(c)!=1) thrM("•SH𝕩: 𝕩 must be a list of strings");
if (isAtm(c) || RNK(c)!=1) thrM("•SH: 𝕩 must be a list of strings");
u64 len = utf16lenB(c);
TALLOC(WCHAR, wstr, len);
toUTF16(c, wstr);
@ -1214,7 +1214,7 @@ static i32 sh_core(bool raw, B x, usz xia, B inObj, u64 iLen, B* s_outp, B* s_er
if (iLen>0) { if (raw) free_chars(iBufRaw); else TFREE(iBuf); } // FREE_INPUT
TSFREE(arg);
if (dwResult != ERROR_SUCCESS) {
thrF("•SH𝕩: Failed to run command: %S", winErrorEx(dwResult));
thrF("•SH: Failed to run command: %S", winErrorEx(dwResult));
}
// prepare output
@ -1242,17 +1242,17 @@ static i32 sh_core(bool raw, B x, usz xia, B inObj, u64 iLen, B* s_outp, B* s_er
B inObj = bi_N;
bool raw = false;
if (!q_N(w)) {
if (!isNsp(w)) thrM("𝕨•SH𝕩: 𝕨 must be a namespace");
if (!isNsp(w)) thrM("•SH: 𝕨 must be a namespace");
inObj = ns_getC(w, "stdin");
if (!q_N(inObj) && !isArr(inObj)) thrM("𝕨•SH𝕩: Invalid stdin value");
if (!q_N(inObj) && !isArr(inObj)) thrM("•SH: Invalid stdin value");
B rawObj = ns_getC(w, "raw");
if (!q_N(rawObj)) raw = o2b(rawObj);
}
u64 iLen = q_N(inObj)? 0 : (raw? IA(inObj) : utf8lenB(inObj));
if (isAtm(x) || RNK(x)>1) thrM("𝕨•SH𝕩: 𝕩 must be a list of strings");
if (isAtm(x) || RNK(x)>1) thrM("•SH: 𝕩 must be a list of strings");
usz xia = IA(x);
if (xia==0) thrM("𝕨•SH𝕩: 𝕩 must have at least one item");
if (xia==0) thrM("•SH: 𝕩 must have at least one item");
B s_out, s_err;
i32 code = sh_core(raw, x, xia, inObj, iLen, &s_out, &s_err);
@ -1270,7 +1270,7 @@ static i32 sh_core(bool raw, B x, usz xia, B inObj, u64 iLen, B* s_outp, B* s_er
return m_hvec3(m_i32(code), s_outObj, s_errObj);
}
#else
B sh_c2(B t, B w, B x) { thrM("𝕨•SH𝕩: CBQN was compiled without <spawn.h>"); }
B sh_c2(B t, B w, B x) { thrM("•SH: CBQN was compiled without <spawn.h>"); }
#endif
B sh_c1(B t, B x) { return sh_c2(t, bi_N, x); }
@ -1426,19 +1426,19 @@ static CastType getCastType(B e, bool hasVal, B val) { // returns a valid type (
usz s; bool c;
if (isNum(e)) {
s = o2s(e);
if (s!=1 && s!=8 && s!=16 && s!=32 && s!=64) thrF("•bit._cast𝕩: unsupported width %s", s);
if (s!=1 && s!=8 && s!=16 && s!=32 && s!=64) thrF("•bit._cast: unsupported width %s", s);
c = hasVal? isCharArr(val) : 0;
} else {
if (!isArr(e) || RNK(e)!=1 || IA(e)!=2) thrM("•bit._cast𝕩: 𝕗 elements must be numbers or two-element lists");
if (!isArr(e) || RNK(e)!=1 || IA(e)!=2) thrM("•bit._cast: 𝕗 elements must be numbers or two-element lists");
SGetU(e)
s = o2s(GetU(e,0));
u32 t = o2c(GetU(e,1));
c = t=='c';
if (c ) { if (s!=8 && s!=16 && s!=32) { badWidth: thrF("•bit._cast𝕩: unsupported width %s for type '%c'", s, (char)t); } }
if (c ) { if (s!=8 && s!=16 && s!=32) { badWidth: thrF("•bit._cast: unsupported width %s for type '%c'", s, (char)t); } }
else if (t=='i') { if (s!=8 && s!=16 && s!=32) goto badWidth; }
else if (t=='u') { if (s!=1) goto badWidth; }
else if (t=='f') { if (s!=64) goto badWidth; }
else thrM("•bit._cast𝕩: type descriptor in 𝕗 must be one of \"iufnc\"");
else thrM("•bit._cast: type descriptor in 𝕗 must be one of \"iufnc\"");
}
return (CastType) { s, c };
@ -1495,14 +1495,14 @@ static B set_bit_result(B r, u8 rt, ur rr, usz rl, usz *sh) {
B bitcast_impl(B el0, B el1, B x) {
ur xr;
if (!isArr(x) || (xr=RNK(x))<1) thrM("•bit._cast𝕩: 𝕩 must have rank at least 1");
if (!isArr(x) || (xr=RNK(x))<1) thrM("•bit._cast: 𝕩 must have rank at least 1");
CastType xct = getCastType(el0, true, x);
CastType rct = getCastType(el1, false, m_f64(0));
usz* sh = SH(x);
u64 s=xct.s*(u64)sh[xr-1], rl=s/rct.s;
if (rl*rct.s != s) thrM("•bit._cast𝕩: incompatible lengths");
if (rl>=USZ_MAX) thrM("•bit._cast𝕩: output too large");
if (rl*rct.s != s) thrM("•bit._cast: incompatible lengths");
if (rl>=USZ_MAX) thrM("•bit._cast: output too large");
B r = convert(xct, x);
u8 rt = typeOfCast(rct);
if (rt==t_bitarr && (v(r)->refc!=1 || IS_SLICE(TY(r)))) {
@ -1522,12 +1522,12 @@ B bitcast_impl(B el0, B el1, B x) {
}
B bitcast_c1(Md1D* d, B x) { B f = d->f;
if (!isArr(f) || RNK(f)!=1 || IA(f)!=2) thrM("•bit._cast𝕩: 𝕗 must be a 2-element list (from‿to)");
if (!isArr(f) || RNK(f)!=1 || IA(f)!=2) thrM("•bit._cast: 𝕗 must be a 2-element list (from‿to)");
SGetU(f)
return bitcast_impl(GetU(f,0), GetU(f,1), x);
}
B bitcast_im(Md1D* d, B x) { B f = d->f;
if (!isArr(f) || RNK(f)!=1 || IA(f)!=2) thrM("•bit._cast𝕩: 𝕗 must be a 2-element list (from‿to)");
if (!isArr(f) || RNK(f)!=1 || IA(f)!=2) thrM("•bit._cast: 𝕗 must be a 2-element list (from‿to)");
SGetU(f)
return bitcast_impl(GetU(f,1), GetU(f,0), x);
}
@ -1787,12 +1787,12 @@ B indexOf_c2(B t, B w, B x);
GLOBAL bool fileInit;
B invalidFn_c1 (B t, B x) { thrM("Fn𝕩: Using an invalid function"); }
B invalidFn_c2 (B t, B w, B x) { thrM("𝕨Fn𝕩: Using an invalid function"); }
B invalidMd1_c1(Md1D* d, B x) { thrM("_Mod𝕩: Using an invalid 1-modifier"); }
B invalidMd1_c2(Md1D* d, B w, B x) { thrM("𝕨_Mod𝕩: Using an invalid 1-modifier"); }
B invalidMd2_c1(Md2D* d, B x) { thrM("_Mod_𝕩: Using an invalid 2-modifier"); }
B invalidMd2_c2(Md2D* d, B w, B x) { thrM("𝕨_Mod_𝕩: Using an invalid 2-modifier"); }
B invalidFn_c1 (B t, B x) { thrM("Using an invalid function"); }
B invalidFn_c2 (B t, B w, B x) { thrM("Using an invalid function"); }
B invalidMd1_c1(Md1D* d, B x) { thrM("Using an invalid 1-modifier"); }
B invalidMd1_c2(Md1D* d, B w, B x) { thrM("Using an invalid 1-modifier"); }
B invalidMd2_c1(Md2D* d, B x) { thrM("Using an invalid 2-modifier"); }
B invalidMd2_c2(Md2D* d, B w, B x) { thrM("Using an invalid 2-modifier"); }
static NOINLINE void initSysDesc() {
if (fileInit) return;

View File

@ -41,11 +41,11 @@ NORETURN NOINLINE void fatal(char* s) {
}
NOINLINE B c1F(B f, B x) { dec(x);
if (isMd(f)) thrM("_Mod𝕩: Calling a modifier");
if (isMd(f)) thrM("Calling a modifier");
return inc(VALIDATE(f));
}
NOINLINE B c2F(B f, B w, B x) { dec(w); dec(x);
if (isMd(f)) thrM("𝕨_Mod_𝕩: Calling a modifier");
if (isMd(f)) thrM("Calling a modifier");
return inc(VALIDATE(f));
}
NOINLINE void value_freeF(Value* x) { value_free(x); }
@ -54,15 +54,15 @@ void noop_visit(Value* x) { }
#if HEAP_VERIFY
void arr_visit(Value* x) { VISIT_SHAPE(x); }
#endif
NOINLINE B c1_bad(B f, B x) { thrM("Fn𝕩: This function can't be called monadically"); }
NOINLINE B c2_bad(B f, B w, B x) { thrM("𝕨Fn𝕩: This function can't be called dyadically"); }
NOINLINE B m1c1_bad(Md1D* d, B x) { thrM("_Mod𝕩: This 1-modifier can't be called monadically"); }
NOINLINE B m1c2_bad(Md1D* d, B w, B x) { thrM("𝕨_Mod𝕩: This 1-modifier can't be called dyadically"); }
NOINLINE B m2c1_bad(Md2D* d, B x) { thrM("_Mod_𝕩: This 2-modifier can't be called monadically"); }
NOINLINE B m2c2_bad(Md2D* d, B w, B x) { thrM("𝕨_Mod_𝕩: This 2-modifier can't be called dyadically"); }
NOINLINE B c1_bad(B f, B x) { thrM("This function can't be called monadically"); }
NOINLINE B c2_bad(B f, B w, B x) { thrM("This function can't be called dyadically"); }
NOINLINE B m1c1_bad(Md1D* d, B x) { thrM("This 1-modifier can't be called monadically"); }
NOINLINE B m1c2_bad(Md1D* d, B w, B x) { thrM("This 1-modifier can't be called dyadically"); }
NOINLINE B m2c1_bad(Md2D* d, B x) { thrM("This 2-modifier can't be called monadically"); }
NOINLINE B m2c2_bad(Md2D* d, B w, B x) { thrM("This 2-modifier can't be called dyadically"); }
NOINLINE B md_c1(B t, B x) { thrM("_Mod𝕩: Cannot call a modifier"); }
NOINLINE B md_c2(B t, B w, B x) { thrM("𝕨_Mod_𝕩: Cannot call a modifier"); }
NOINLINE B md_c1(B t, B x) { thrM("Cannot call a modifier"); }
NOINLINE B md_c2(B t, B w, B x) { thrM("Cannot call a modifier"); }
NOINLINE B arr_c1(B t, B x) { dec(x); return inc(t); }
NOINLINE B arr_c2(B t, B w, B x) { dec(w); dec(x); return inc(t); }

View File

@ -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);

View File

@ -20,7 +20,7 @@
!"˘: Result rank too large" % (02542)1˘ 021
!"⎉: Result rank too large" % (02542)1¯1 021
!"⎉: Result rank too large" % (1˜ 02042)50 1˜ 01002
!"⎉: Result rank too large (204 ≡ =𝕩, 200 ≡ =𝔽v)" % {𝕊:(2001)1}1 (2051)1
!"𝔽𝕘: Result rank too large (204 ≡ =𝕩, 200 ≡ =𝔽v)" % {𝕊:(2001)1}1 (2051)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"
@ -42,8 +42,8 @@
!"𝕨⊏𝕩: 𝕩 cannot be a unit" % (30)˘3
!"Expected integer, got 0.1" % 0.1˘3515
!"𝕨⊑𝕩: 𝕩 must be a list when 𝕨 is a number (3‿4 ≡ ≢𝕩)" % 5˘234
!">: Result rank too large (80 ≡ =𝕩, 205 ≡ =⊑𝕩)" % >80 (2001)<(2051)1
!"⎉: Result rank too large (195 ≡ =𝕩, 210 ≡ =𝔽v)" % >5 (2001)<(2051)1
!">𝕩: Result rank too large (80 ≡ =𝕩, 205 ≡ =⊑𝕩)" % >80 (2001)<(2051)1
!"𝔽𝕘: Result rank too large (195 ≡ =𝕩, 210 ≡ =𝔽v)" % >5 (2001)<(2051)1
!"𝕨∾𝕩: Lengths not matchable (⟨6⟩ ≡ ≢𝕨, 1‿1 ≡ ≢𝕩)" % ("abc""def")˘(3/)"a"
!"𝕨∾𝕩: Argument ranks must differ by 1 or less (0≡=𝕨, 2≡=𝕩)" % 1˘333
!"𝕨∾𝕩: Lengths not matchable (4‿2 ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % (3424)˘3335
@ -65,12 +65,12 @@
!"⊒𝕩: 𝕩 cannot have rank 0" % ˘"abcd"
!"∊𝕩: 𝕩 cannot have rank 0" % ˘"abcd"
!"𝕨⍋𝕩: 𝕨 must be sorted" % 021˘ 3412
!"𝕨`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨2⟩ ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (221)+`˘2230.4
!"𝕨`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨⟩ ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % 2+`˘333
!"´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % +´˘23318
!"𝕨´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % 1+´˘23318
!"˝𝕩: 𝕩 must have rank at least 1" % +˝˘˘1010100
!"˝𝕩: 𝕩 must have rank at least 1" % ˝¯2 239
!"𝕨𝔽`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨2⟩ ≡ ≢𝕨, 2‿3 ≡ ≢𝕩)" % (221)+`˘2230.4
!"𝕨𝔽`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨⟩ ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % 2+`˘333
!"𝔽´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % +´˘23318
!"𝕨𝔽´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % 1+´˘23318
!"𝔽˝𝕩: 𝕩 must have rank at least 1" % +˝˘˘1010100
!"𝔽˝𝕩: 𝕩 must have rank at least 1" % ˝¯2 239
{˝˘ (×´) 2+𝕩}¨ 2345 %% (×´)¨ 23,212,2125,21256
{˝˘ (2+𝕩)<"hi"}¨ 2345 %% (<"hi")¨ 23,212,2125,21256

View File

@ -8,9 +8,9 @@
!"•FFI: 𝕩 must be a list" % @•FFI @
!"•FFI: 𝕩 must be a list" % @•FFI 22<"a"
!"•FFI: Path must be a list of characters" % 12 •FFI """bqn_init"
!"Fn𝕩: This function can't be called monadically" % •FFI """bqn_init"
!"This function can't be called monadically" % •FFI """bqn_init"
@ •FFI{𝕊: 28•CurrentError@} """bqn_this symbol doesn't exist" %% "FFI: Failed to find symbol: "
!"FFI𝕩: Type must be a string" % @•FFI "hello"
!"FFI: Type must be a string" % @•FFI "hello"
!"FFI: Too many arguments" % @•FFI"""bqn_init"70000<"i32"
!"Type parser: Unexpected character '?'" % @•FFI"""bqn_init""?"
!"Type parser: expected number" % @•FFI"""bqn_init""["
@ -223,7 +223,7 @@
!"Expected integer, got character" % %USE WallocE {{𝕊al: p"i8" Al 1 p.Add '!'}}
!"(pointer).Sub: Unexpected argument type: character" % %USE WallocE {{𝕊al: p"i8" Al 1 p.Sub '!'}}
!"Expected non-negative integer, got character" % %USE WallocE {{𝕊al: p"i8" Al 1 p.Field '!'}}
!"Type parser𝕩: Pointer type must be a string" % %USE WallocE {{𝕊al: p"i8" Al 1 p.Cast '!'}}
!"Type parser: Pointer type must be a string" % %USE WallocE {{𝕊al: p"i8" Al 1 p.Cast '!'}}
!"Expected integer, got character" % %USE WallocE {{𝕊al: p"i8" Al 1 p.Read '!'}}
!"FFI: improper value for i8" % %USE WallocE {{𝕊al: p"i8" Al 1 p.Write '!'}}

View File

@ -16,7 +16,7 @@
!"Calling a modifier" % 4 {˜}˝1
!"Calling a modifier" % 4 {}`1
!"Calling a modifier" % {}¨1
!"𝕨_Mod_𝕩: Cannot call a modifier" % {˜}¨˜1
!"Cannot call a modifier" % {˜}¨˜1
4 {˜}˙´1 %% ˜
4 {˜}˙˝1 %% ˜
4 {}˙`1 %%

View File

@ -28,10 +28,10 @@
! {𝕩 2/𝕩} (0÷0)+, (0÷0)+
# comparison
w111 x121 {! (•Repr𝕩,": Expected equal shape prefix (1‿1 ≡ ≢𝕨, 1‿2 ≡ ≢𝕩)") w 𝕏(•CurrentError@) x}¨ =<>
w111 x121 wx <¨ {! (•Repr𝕩,": Expected equal shape prefix (1‿1 ≡ ≢𝕨, 1‿2 ≡ ≢𝕩)") w 𝕏(•CurrentError@) x}¨ =<>
w111 x21 {! (•Repr𝕩,": Expected equal shape prefix (1‿1 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)") w 𝕏(•CurrentError@) x}¨ =<>
w111 x21 wx <¨ {! (•Repr𝕩,": Expected equal shape prefix (1‿1 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)") w 𝕏(•CurrentError@) x}¨ =<>
w111 x121 {! ("𝕨",•Repr𝕩,"𝕩: Expected equal shape prefix (1‿1 ≡ ≢𝕨, 1‿2 ≡ ≢𝕩)") w 𝕏(•CurrentError@) x}¨ =<>
w111 x121 wx <¨ {! ("𝕨",•Repr𝕩,"𝕩: Expected equal shape prefix (1‿1 ≡ ≢𝕨, 1‿2 ≡ ≢𝕩)") w 𝕏(•CurrentError@) x}¨ =<>
w111 x21 {! ("𝕨",•Repr𝕩,"𝕩: Expected equal shape prefix (1‿1 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)") w 𝕏(•CurrentError@) x}¨ =<>
w111 x21 wx <¨ {! ("𝕨",•Repr𝕩,"𝕩: Expected equal shape prefix (1‿1 ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩)") w 𝕏(•CurrentError@) x}¨ =<>
!"Invalid comparison" % <˜{}
!"Invalid comparison" % ˜{}
!"Invalid comparison" % >˜{}
@ -61,28 +61,28 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe
(<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}¨ ×, ÷, , , , , |, , , ÷
{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 a4@ (LV a) {r•Repr𝕩 (!´) (r": Unexpected argument types") @ 0𝕏{𝕊: •CurrentError@} 𝕨 V a} +, ×, ÷, , , , , |, , , ÷
%USE var a4@ (LV a) {r•Repr𝕩 (!´) (r": Unexpected argument types") 0 0𝕏{𝕊: •CurrentError@} 𝕨 V a} -, ×, ÷, , , , , |, , , ÷
%USE var a40 (LV a) {r•Repr𝕩 (!´) (r": Unexpected argument types") @ 0𝕏{𝕊: •CurrentError@} 𝕨 V a} ×, ÷, , , , , |, , , ÷
%USE var a4@ (LV a) {r•Repr𝕩 (!´) ("𝕨"r"𝕩: Unexpected argument types") @ 0𝕏{𝕊: •CurrentError@} 𝕨 V a} +, ×, ÷, , , , , |, , , ÷
%USE var a4@ (LV a) {r•Repr𝕩 (!´) ("𝕨"r"𝕩: Unexpected argument types") 0 0𝕏{𝕊: •CurrentError@} 𝕨 V a} -, ×, ÷, , , , , |, , , ÷
%USE var a40 (LV a) {r•Repr𝕩 (!´) ("𝕨"r"𝕩: Unexpected argument types") @ 0𝕏{𝕊: •CurrentError@} 𝕨 V a} ×, ÷, , , , , |, , , ÷
%USE var a4@ (LV a) {r•Repr𝕩 (!´) (r": Unexpected argument types") (𝕨 V a) 0𝕏{𝕊: •CurrentError@} @} +, ×, ÷, , , , , |, , , ÷
%USE var a40 (LV a) {r•Repr𝕩 (!´) (r": Unexpected argument types") (𝕨 V a) 0𝕏{𝕊: •CurrentError@} @} -, ×, ÷, , , , , |, , , ÷
%USE var a4@ (LV a) {r•Repr𝕩 (!´) (r": Unexpected argument types") (𝕨 V a) 0𝕏{𝕊: •CurrentError@} 0} ×, ÷, , , , , |, , , ÷
%USE var a4@ (LV a) {r•Repr𝕩 (!´) ("𝕨"r"𝕩: Unexpected argument types") (𝕨 V a) 0𝕏{𝕊: •CurrentError@} @} +, ×, ÷, , , , , |, , , ÷
%USE var a40 (LV a) {r•Repr𝕩 (!´) ("𝕨"r"𝕩: Unexpected argument types") (𝕨 V a) 0𝕏{𝕊: •CurrentError@} @} -, ×, ÷, , , , , |, , , ÷
%USE var a4@ (LV a) {r•Repr𝕩 (!´) ("𝕨"r"𝕩: Unexpected argument types") (𝕨 V a) 0𝕏{𝕊: •CurrentError@} 0} ×, ÷, , , , , |, , , ÷
%USE var a4@ b4@ {r•Repr f𝕩 {(!´) (r": Unexpected argument types") (𝕨 V a) 0F{𝕊: •CurrentError@} 𝕩 V b}LV´ ab} +, ×, ÷, , , , , |, , , ÷
%USE var a40 b4@ {r•Repr f𝕩 {(!´) (r": Unexpected argument types") (𝕨 V a) 0F{𝕊: •CurrentError@} 𝕩 V b}LV´ ab} -, ×, ÷, , , , , |, , , ÷
%USE var a4@ b40 {r•Repr f𝕩 {(!´) (r": Unexpected argument types") (𝕨 V a) 0F{𝕊: •CurrentError@} 𝕩 V b}LV´ ab} ×, ÷, , , , , |, , , ÷
%USE var a4@ b4@ {r•Repr f𝕩 {(!´) ("𝕨"r"𝕩: Unexpected argument types") (𝕨 V a) 0F{𝕊: •CurrentError@} 𝕩 V b}LV´ ab} +, ×, ÷, , , , , |, , , ÷
%USE var a40 b4@ {r•Repr f𝕩 {(!´) ("𝕨"r"𝕩: Unexpected argument types") (𝕨 V a) 0F{𝕊: •CurrentError@} 𝕩 V b}LV´ ab} -, ×, ÷, , , , , |, , , ÷
%USE var a4@ b40 {r•Repr f𝕩 {(!´) ("𝕨"r"𝕩: Unexpected argument types") (𝕨 V a) 0F{𝕊: •CurrentError@} 𝕩 V b}LV´ ab} ×, ÷, , , , , |, , , ÷
!"𝕨-𝕩: Unexpected argument types" % 0-@
!"𝕨÷𝕩: Unexpected argument types" % 0÷@
!"+𝕩: Argument must consist of numbers" % +@
@, "abc", 1,2,+, {} {(!´) (": Argument contained non-number"˜•Repr 𝕩) 0𝕏{𝕊: •CurrentError@} 𝕨} -×÷|¬
!"Fn𝕩: This function can't be called monadically" % @
!"Fn𝕩: This function can't be called monadically" % @
@, "abc", 1,2,+, {} {(!´) ("𝕩: 𝕩 contained non-number"˜•Repr 𝕩) 0𝕏{𝕊: •CurrentError@} 𝕨} -×÷|¬
!"This function can't be called monadically" % @
!"This function can't be called monadically" % @
# 𝕨/𝕩
2301/4312 %% ¨6301201234534534591011
@ -170,15 +170,15 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄
%USE eqvar 12 _eqvar 55 %% 12
# >𝕩
!">: Result rank too large (200 ≡ =𝕩, 205 ≡ =⊑𝕩)" % > (2001)<(2051)1
!">: Incompatible element shapes (encountered shapes ⟨2⟩ and 4‿5)" % > ¨2, 45
!">: Incompatible element shapes (encountered shapes 2‿3 and ⟨4⟩)" % > ¨23, 4
!">: Incompatible element shapes (encountered shapes 2‿3 and 4‿5)" % > ¨23, 45
!">: Incompatible element shapes (encountered shapes 2‿0 and 4‿5)" % > ¨20, 45
!">: Incompatible element shapes (encountered shapes ⟨0⟩ and 4‿5)" % > ¨0, 45
!">: Incompatible element shapes (encountered shapes ⟨0⟩ and ⟨⟩)" % > ¨0,
!">: Incompatible element shapes (encountered shapes 2‿3 and ⟨⟩)" % > ¨23,
!">: Incompatible element shapes (encountered shapes 4‿5 and 4‿6)" % >234520,461
!">𝕩: Result rank too large (200 ≡ =𝕩, 205 ≡ =⊑𝕩)" % > (2001)<(2051)1
!">𝕩: Incompatible element shapes (encountered shapes ⟨2⟩ and 4‿5)" % > ¨2, 45
!">𝕩: Incompatible element shapes (encountered shapes 2‿3 and ⟨4⟩)" % > ¨23, 4
!">𝕩: Incompatible element shapes (encountered shapes 2‿3 and 4‿5)" % > ¨23, 45
!">𝕩: Incompatible element shapes (encountered shapes 2‿0 and 4‿5)" % > ¨20, 45
!">𝕩: Incompatible element shapes (encountered shapes ⟨0⟩ and 4‿5)" % > ¨0, 45
!">𝕩: Incompatible element shapes (encountered shapes ⟨0⟩ and ⟨⟩)" % > ¨0,
!">𝕩: Incompatible element shapes (encountered shapes 2‿3 and ⟨⟩)" % > ¨23,
!">𝕩: Incompatible element shapes (encountered shapes 4‿5 and 4‿6)" % >234520,461
!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes ⟨2⟩ and ⟨3⟩ and later higher-rank array)" % 11, 111, 1, 221
!"∾𝕩: Item trailing shapes must be equal (contained arrays with shapes 1‿4 and ⟨0⟩)" % 14"abcd",
><'a',1 %% 'a'1
@ -445,7 +445,7 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄
%USE eqvar a¯5+10 {1+𝕩 10}_eqvar a %% ¨ 5+10
%USE eqvar a¯5+10 {1+(𝕩{!𝕩10 𝕗}) 10}_eqvar a %% ¨ 5+10
!00, , "" 0 %% ,,
!"_Mod𝕩: Calling a modifier" % 1+{} 0
!"Calling a modifier" % 1+{} 0
!"⍟: 𝔾 contained non-number" % 1+1,,3 0
!"Expected integer, got 1.5" % 1+1.5 0
!"Integer out of range: 1e20" % 1+1e20 0
@ -455,8 +455,10 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄
!"⍟: 𝔾 contained non-integer (or integer was out of range)" % %USE evar {1+𝕩 0}_evar 1.5, 9
# ◶
!"◶𝕩: 𝕘 must have rank 1 when index is a number" % 1[12,34] 3
!"𝕨◶𝕩: 𝕘 must have rank 1 when index is a number" % "ab" [12,34] 3
!"𝔽◶𝕘𝕩: 𝕘 must have rank 1 when index is a number" % 1[12,34] 3
!"𝕨𝔽◶𝕘𝕩: 𝕘 must have rank 1 when index is a number" % "ab" [12,34] 3
!"𝕨𝔽◶𝕘𝕩: Index out of bounds of 𝕘" % 1 2- 3
!"𝔽◶𝕘𝕩: Index out of bounds of 𝕘" % 2- 3
!"𝕨⊑𝕩: Picking item at wrong rank (index 0‿0 in array of shape ⟨2⟩)" % +- 00 # shouldn't reference ⊑ but whatever
!"𝕨⊑𝕩: Picking item at wrong rank (index 1‿2 in array of shape ⟨3⟩)" % 1 ++- 01
10 +"ab""cd" ¯9 %% "cd"
@ -467,22 +469,39 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄
(1˜ 02032)50 1˜ 01002 %% 1501203/0202
!"⎉: Result rank too large" % (1˜ 02032)49 1˜ 01002
!"˘: Result rank too large" % ((2551)1)˘ 12
!"˘: Empty argument too large (0‿1000000000‿1000000000‿1000000000 ≡ ≢𝕩)" % 2 •internal.PureKeep˘ 01e91e91e90
!"˘: Empty argument too large (0‿1000000000‿1000000000‿1000000000 ≡ ≢𝕩)" % •internal.PureKeep˘ 01e91e91e90
!"⎉: Empty argument too large (0‿0‿1000000000‿1000000000‿1000000000 ≡ ≢𝕩)" % 2 •internal.PureKeep3 001e91e91e90
!"⎉: Empty argument too large (0‿0‿1000000000‿1000000000‿1000000000 ≡ ≢𝕩)" % •internal.PureKeep3 001e91e91e90
!"≍˘ 𝕩: Result rank too large (255≡=𝕩)" % ˘ (2551)1
!"≍⎉𝕘 𝕩: Result rank too large (255≡=𝕩)" % 100 (2551)1
!"𝔽˘: Incompatible result shapes (encountered shapes ⟨0⟩ and ⟨10⟩)" % {𝕩}˘ 410100
!"𝔽˘: Incompatible result shapes (encountered shapes ⟨0⟩ and ⟨10⟩)" % 3 {𝕩}˘ 410100
!"𝔽⎉𝕘: Incompatible result shapes (encountered shapes ⟨0⟩ and ⟨10⟩)" % {𝕩}1 410100
!"𝔽⎉𝕘: Incompatible result shapes (encountered shapes ⟨0⟩ and ⟨10⟩)" % 3 {𝕩}1 410100
# `
!"𝕨`𝕩: Shape of 𝕨 must match the cell of 𝕩 (2‿2 ≡ ≢𝕨, 3‿2‿3 ≡ ≢𝕩)" % (221)+`323
!"𝕨`𝕩: Shape of 𝕨 must match the cell of 𝕩 (2‿2 ≡ ≢𝕨, 3‿3‿2 ≡ ≢𝕩)" % (221)+`332
!"𝕨`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨⟩ ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % 2+`33
!"𝔽`𝕩: 𝕩 cannot have rank 0" % `0
!"𝕨𝔽`𝕩: Shape of 𝕨 must match the cell of 𝕩 (2‿2 ≡ ≢𝕨, 3‿2‿3 ≡ ≢𝕩)" % (221)+`323
!"𝕨𝔽`𝕩: Shape of 𝕨 must match the cell of 𝕩 (2‿2 ≡ ≢𝕨, 3‿3‿2 ≡ ≢𝕩)" % (221)+`332
!"𝕨𝔽`𝕩: Shape of 𝕨 must match the cell of 𝕩 (⟨⟩ ≡ ≢𝕨, 3‿3 ≡ ≢𝕩)" % 2+`33
# ´
!"´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % +´33
!"𝕨´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % 2+´33
!"𝔽´𝕩: 𝕩 must be a list (⟨⟩ ≡ ≢𝕩)" % +´0
!"𝔽´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % +´33
!"𝕨𝔽´𝕩: 𝕩 must be a list (3‿3 ≡ ≢𝕩)" % 2+´33
!"𝔽´𝕩: Identity not found" % •internal.Keep´
+´0 %% <0
×´0 %% <1
+´0 %% <<<0
×´0 %% <<<1
# ˝
!"𝔽˝𝕩: 𝕩 must have rank at least 1" % ˝0
!"𝔽˝𝕩: Identity not found" % •internal.Keep˝
# ⌜
!"𝕨⌜𝕩: Result rank too large (200≡=𝕨, 200≡=𝕩)" % +˜(2001)1
!"𝕨𝔽⌜𝕩: Result rank too large (200≡=𝕨, 200≡=𝕩)" % +˜(2001)1
# ˜
5˜˝ "ab" %% 5

View File

@ -12,8 +12,8 @@
! ´ t•path,"custom-name" •BQN"⟨•path‿•name‿•args ⋄ •state⟩" ! •path, "custom-name", t
! ´ t•path •BQN"⟨•path‿•name‿•args ⋄ •state⟩" ! •path, "", t
! ´ t •BQN"⟨•path‿•name‿•args ⋄ •state⟩" ! "", 1t
!"•BQN𝕩: Path must be a string" % 12 •BQN "2+2"
!"•BQN𝕩: Filename must be a string" % •path, 12 •BQN "2+2"
!"•BQN: Path must be a string" % 12 •BQN "2+2"
!"•BQN: Filename must be a string" % •path, 12 •BQN "2+2"
•path, "abc/def" •BQN "•name" %% "abc/def"
!"No path present for •path" % •BQN"•path"
!"No arguments present for •args" % •BQN"•args"
@ -28,8 +28,8 @@
!"•file.Chars: Using relative path with no absolute base path known" % f•BQN"•FChars" F "a"
# •ReBQN
!"REPL𝕩: Filename must be a string" % f•ReBQN{} •path, 12 F "2+2"
!"REPL𝕩: Path must be a string" % f•ReBQN{} 12 F "2+2"
!"REPL: Filename must be a string" % f•ReBQN{} •path, 12 F "2+2"
!"REPL: Path must be a string" % f•ReBQN{} 12 F "2+2"
f•ReBQN{} ! •path, "custom-name", "arg" •path,"custom-name", "arg" F "•state"
f•ReBQN {system"all"} F "•internal.Type ↕10" %% "i8arr"
@ -89,10 +89,10 @@ f←•ReBQN{primitives⇐⋈'÷'‿- ⋄ system⇐⟨"primitives", "foo"‿⋈,
!"Field named ""abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþabcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ𝕨𝕨⍉!0123456789"" not found" % {abc1 dÊF2}•ns.Get "ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞabcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ𝕨𝕨⍉!0123456789_"
{abc1 dÊF2 n103}•ns.Has¨ "abc", "ABC", "abC", "abc___", "DêF", "__D__Ê__F__", "àbc", "def", "", 0, "𝕨", "012", "n10", "n1_0" %% 11111100000011
´{}•ns.Has¨"abc123AEWQE___àÀ𝕨𝕩" %% 0
!"•ns.Has𝕩: 𝕩 must be a string" % {}•ns.Has ""
!"•ns.Has𝕩: 𝕩 must be a string" % {}•ns.Has 12
!"•ns.Get𝕩: 𝕩 must be a string" % {}•ns.Get ""
!"•ns.Get𝕩: 𝕩 must be a string" % {}•ns.Get 12
!"•ns.Has: 𝕩 must be a string" % {}•ns.Has ""
!"•ns.Has: 𝕩 must be a string" % {}•ns.Has 12
!"•ns.Get: 𝕩 must be a string" % {}•ns.Get ""
!"•ns.Get: 𝕩 must be a string" % {}•ns.Get 12
{m𝕩 {𝕩 m•ns.Get 𝕩}¨ •ns.Keys m {m•ns.Has𝕩}¨ "abcABC"}¨ {a1b10} {a'a'b23cde𝕩}"abc" %% "a",1,"b",0123456789,110110,"a",'a',"cde","abc",100100
@ -161,7 +161,7 @@ f←•ReBQN{primitives⇐⋈'÷'‿- ⋄ system⇐⟨"primitives", "foo"‿⋈,
!"•file.At: Path must be a list of characters" % •file.At 12
!"•file.At: Path must be a list of characters" % •file.At 12
!"•file.At: Path must be a list of characters" % "foo" •file.At 12
!"•file.At𝕩: 𝕨 must be a string" % 12 •file.At "foo"
!"•file.At: 𝕨 must be a string" % 12 •file.At "foo"
!"•file.List: Path must be a list of characters" % •file.List 12
!"•file.Bytes: Path must be a list of characters" % •file.Bytes 12
!"•file.Chars: Path must be a list of characters" % •file.Chars 12
@ -235,7 +235,11 @@ v←1 ⋄ ! •BQN∘•Repr⊸≡ ⟨+,1‿2,+¨,(+V)(V+V),2‿2⥊↕4⟩
# •Delay
t0•MonoTime@ ! 0.1•Delay 0.1 ! 0.1(•MonoTime@)-t0
# •_timed tested at perf.bqn
# •_timed tested more at perf.bqn
!"𝕨𝔽•_timed𝕩: 𝕨 must be an integer greater than 0" % 0 •_timed 2
!"Expected integer, got character" % @ •_timed 2
a1 a {𝕊: a+𝕩}•_timed 10 %% 11
a3 12 {𝕊: a+𝕩}•_timed 10 a %% 123
# •math
! ´0=|1e10×{(+´𝕩)-•math.Sum 𝕩}¨ 1000•rand.Range 0
@ -267,9 +271,9 @@ E←•internal.EEqual ⋄ {! (𝕏 4⥊0) E 𝕏 1↓¯1×π∾4⥊0}¨ (⊢∾
!"𝕨•math.GCD𝕩: Unexpected argument types" % 3 •math.GCD {+}
!"•math.Sin𝕩: 𝕩 contained non-number" % •math.Sin "foo"
!"•math.Log10𝕩: 𝕩 contained non-number" % •math.Log10 "foo"
!"𝕨•math𝕩.Atan2: Unexpected argument types" % 1 •math.Atan2 'a'
!"𝕨•math𝕩.Atan2⁼: Unexpected argument types" % 1 •math.Atan2 {}
!"𝕨•math𝕩.Atan2˜⁼: Unexpected argument types" % {} •math.Atan2˜ 'b'
!"𝕨•math.Atan2𝕩: Unexpected argument types" % 1 •math.Atan2 'a'
!"𝕨•math.Atan2⁼𝕩: Unexpected argument types" % 1 •math.Atan2 {}
!"𝕨•math.Atan2˜𝕩: Unexpected argument types" % {} •math.Atan2˜ 'b'
# •rand / •MakeRand
0 (•MakeRand 0).Range¨2 %%
@ -287,35 +291,35 @@ r←•MakeRand 1 ⋄ ! 1¨⊸≡ ∊{𝕊: r.Deal 1000}¨ ↕4
r•MakeRand 1 ! 1¨ {𝕊: 500 r.Deal 1000}¨ 4
# •bit
!"•bit._cast𝕩: 𝕩 must have rank at least 1" % 81 •bit._cast 123
!"•bit._cast: 𝕩 must have rank at least 1" % 81 •bit._cast 123
(10) {! (𝕨¯1) 1𝕩•bit._cast (𝕨×𝕩)1} 81632
%USE var {t𝕩18163264 1t? !¨ r{t•bit._cast 𝕩 V a}¨ LV a 128 r; @}¨ 44
%USE var {t𝕩18163264 !¨ r{t•bit._cast 𝕩 V a}¨ LV a4=128 r}¨ 44
! 101 816•bit._cast c02'a'+11 •rand.Range 26 ! 102 c
! 101 816•bit._cast c 2'a'+11 •rand.Range 26 ! 102 c
832•bit._cast 37 %% 100992003
!"•bit._cast𝕩: incompatible lengths" % 18•bit._cast 10
!"•bit._cast𝕩: incompatible lengths" % 832•bit._cast 20
!"•bit._cast𝕩: incompatible lengths" % 832•bit._cast 100
!"•bit._cast: incompatible lengths" % 18•bit._cast 10
!"•bit._cast: incompatible lengths" % 832•bit._cast 20
!"•bit._cast: incompatible lengths" % 832•bit._cast 100
!"•bit._cast𝕩: unsupported width 1073741824" % (2230)•bit._cast 0
!"•bit._cast𝕩: unsupported width 1125899906842624" % (2250)•bit._cast 0 %USZ64
!"•bit._cast: unsupported width 1073741824" % (2230)•bit._cast 0
!"•bit._cast: unsupported width 1125899906842624" % (2250)•bit._cast 0 %USZ64
!"Integer out of range: 1125899906842624" % (2250)•bit._cast 0 %USZ32
!"Integer out of range: 1.180591620717411e21" % (2270)•bit._cast 0
!"Integer out of range: ∞" % (2)•bit._cast 0
!"•bit._cast𝕩: unsupported width 12" % 112•bit._cast 110
!"•bit._cast𝕩: unsupported width 12" % 1232•bit._cast (12×32)0
!"•bit._cast𝕩: unsupported width 12" % 812•bit._cast (8×12)0
!"•bit._cast𝕩: unsupported width 0" % 032•bit._cast 1280
!"•bit._cast𝕩: unsupported width 0" % 80•bit._cast 1280
!"•bit._cast: unsupported width 12" % 112•bit._cast 110
!"•bit._cast: unsupported width 12" % 1232•bit._cast (12×32)0
!"•bit._cast: unsupported width 12" % 812•bit._cast (8×12)0
!"•bit._cast: unsupported width 0" % 032•bit._cast 1280
!"•bit._cast: unsupported width 0" % 80•bit._cast 1280
!"•bit._cast𝕩: unsupported width 16 for type 'f'" % 16'f',32•bit._cast 1280
!"•bit._cast𝕩: unsupported width 32 for type 'f'" % 32,32'f'•bit._cast 1280
!"•bit._cast𝕩: unsupported width 0 for type 'u'" % 0'u',32•bit._cast 1280
!"•bit._cast𝕩: unsupported width 8 for type 'u'" % 8'u',32•bit._cast 1280
!"•bit._cast𝕩: unsupported width 32 for type 'u'" % 8,32'u'•bit._cast 1280
!"•bit._cast𝕩: unsupported width 1 for type 'i'" % 8, 1'i'•bit._cast 1280
!"•bit._cast: unsupported width 16 for type 'f'" % 16'f',32•bit._cast 1280
!"•bit._cast: unsupported width 32 for type 'f'" % 32,32'f'•bit._cast 1280
!"•bit._cast: unsupported width 0 for type 'u'" % 0'u',32•bit._cast 1280
!"•bit._cast: unsupported width 8 for type 'u'" % 8'u',32•bit._cast 1280
!"•bit._cast: unsupported width 32 for type 'u'" % 8,32'u'•bit._cast 1280
!"•bit._cast: unsupported width 1 for type 'i'" % 8, 1'i'•bit._cast 1280
# •platform
Str {!=𝕩 !×𝕩 ! ´2=•Type¨𝕩} Str •platform.os Str •platform.cpu.arch Str •platform.bqn.impl_version Str •platform.environment
@ -362,7 +366,7 @@ Str ← {!=𝕩 ⋄ !×≠𝕩 ⋄ ! ∧´2=•Type¨𝕩} ⋄ Str •platform.o
# •internal.Keep
•internal.Keep 10 %% 10
!"𝕨Fn𝕩: This function can't be called dyadically" % 1 •internal.Keep 1
!"This function can't be called dyadically" % 1 •internal.Keep 1
# •internal.Refc
•internal.Refc •internal.Unshare 10 %% 1
a•internal.Unshare 10 b10<a ! 11 •internal.Refc a •internal.Keep b

View File

@ -18,7 +18,7 @@
((¯1+=)) 339 %% 33210543876
!"Expected integer, got function" % 1+((¯1+)˙)"ab"
!"𝕨⊑𝕩: 𝕨 must be a numeric array" % ((@,@,¯1+˙))"ab"
!"◶𝕩: 𝕘 must have rank 1 when index is a number" % (@,@,¯1+)"ab"
!"𝔽𝕘𝕩: 𝕘 must have rank 1 when index is a number" % (@,@,¯1+)"ab"