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) {