diff --git a/src/builtins/arithm.c b/src/builtins/arithm.c index 49dcf344..e82783a9 100644 --- a/src/builtins/arithm.c +++ b/src/builtins/arithm.c @@ -83,7 +83,7 @@ B add_c1(B t, B x) { } B sub_c2(B,B,B); #define SUB_BODY(FEXPR) return sub_c2(t, m_f64(0), x); -#define NOT_BODY(FEXPR) x = squeeze_numTry(x, &xe); return xe==el_bit? bit_negate(x) : C2(sub, m_f64(1), x); +#define NOT_BODY(FEXPR) x = squeeze_numTry(x, &xe, SQ_ANY); return xe==el_bit? bit_negate(x) : C2(sub, m_f64(1), x); GC1i("-", sub, -v, el_bit, bit_sel(x,m_f64(0),m_f64(-1)), SUB_BODY) GC1i("|", stile, fabs(v), el_bit, x, STILE_BODY) diff --git a/src/builtins/cells.c b/src/builtins/cells.c index 3407be3d..c09b5015 100644 --- a/src/builtins/cells.c +++ b/src/builtins/cells.c @@ -730,7 +730,7 @@ NOINLINE B for_cells_SA(B f, B w, B x, ur xcr, ur xr, u32 chr) { // w⊸F⎉xcr if (isArr(w) && xcr==1) { if (!TI(w,arrD1)) { u8 xe; - w = squeeze_numTry(w, &xe); + w = squeeze_numTry(w, &xe, SQ_ANY); if (xe==el_B) break; } assert(xr > 1); diff --git a/src/builtins/group.c b/src/builtins/group.c index d2806ef6..c211dc63 100644 --- a/src/builtins/group.c +++ b/src/builtins/group.c @@ -280,7 +280,7 @@ B group_c2(B t, B w, B x) { ur xr = RNK(x); if (isArr(w) && RNK(w)==1 && xr>=1) { u8 we = TI(w,elType); - if (!elInt(we)) w = squeeze_numTry(w, &we); + if (!elInt(we)) w = squeeze_numTry(w, &we, SQ_ANY); if (elInt(we)) { usz wia = IA(w); usz* xsh = SH(x); diff --git a/src/builtins/scan.c b/src/builtins/scan.c index a9050145..fe53db9c 100644 --- a/src/builtins/scan.c +++ b/src/builtins/scan.c @@ -337,7 +337,7 @@ B scan_c1(Md1D* d, B x) { B f = d->f; if (xe==el_i32) { i32* xp=i32any_ptr(x); for (usz i=1; i= 6 * (u64)n && isPervasiveDy(f)) return scan_arith(f, m_f64(0), x, SH(x)); diff --git a/src/builtins/select.c b/src/builtins/select.c index 8a4ea717..6a32fdb4 100644 --- a/src/builtins/select.c +++ b/src/builtins/select.c @@ -230,7 +230,7 @@ B select_c2(B t, B w, B x) { decG(w); u8 w0e = TI(w0,elType); if (elNum(w0e)) return C2(select, w0, x); - w0 = squeeze_numTry(w0, &w0e); + w0 = squeeze_numTry(w0, &w0e, SQ_MSGREQ(SQ_NUM)); if (elNum(w0e)) return C2(select, w0, x); w = m_vec1(w0); } @@ -372,7 +372,7 @@ B select_c2(B t, B w, B x) { // else fallthrough - want to do integer 𝕨 if possible } case el_B: case el_c8: case el_c16: case el_c32: { - w = squeeze_numTry(w, &we); + w = squeeze_numTry(w, &we, SQ_MSGREQ(SQ_NUM)); if (RANDOMIZE_HEURISTICS && we==el_f64) goto generic_l; // avoid infinite loop if (elNum(we)) goto retry; goto def_xf_base; @@ -952,7 +952,7 @@ B select_rows_B(B x, ux csz, ux cam, B inds) { // consumes inds,x; ⥊ inds⊸ } u8 ie = TI(inds,elType); if (csz<=2? ie!=el_bit : csz<=128? ie>el_i8 : !elInt(ie)) { - inds = squeeze_numTry(inds, &ie); + inds = squeeze_numTry(inds, &ie, SQ_BEST); if (!elInt(ie)) goto generic; } void* ip = tyany_ptr(inds); @@ -1023,7 +1023,7 @@ B select_ucw(B t, B o, B w, B x) { } else { we = TI(w,elType); if (!elInt(we)) { - w = squeeze_numTry(w, &we); + w = squeeze_numTry(w, &we, SQ_MSGREQ(SQ_NUM)); if (!elNum(we)) goto def; } } diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index bfe4cd23..b32f9a00 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -1207,7 +1207,7 @@ NOINLINE B rotate_highrank(bool inv, B w, B x) { if (wia==0) { r=x; goto decW_ret; } u8 we = TI(w,elType); if (!elNum(we)) { - w = squeeze_numTry(w, &we); + w = squeeze_numTry(w, &we, SQ_NUM); if (!elNum(we)) thrF("𝕨⌽%U𝕩: 𝕨 contained non-number", INV); } bool origF64 = we==el_f64; diff --git a/src/builtins/slash.c b/src/builtins/slash.c index 9e835aec..eeb1b091 100644 --- a/src/builtins/slash.c +++ b/src/builtins/slash.c @@ -577,7 +577,7 @@ B slash_c1(B t, B x) { usz xia = IA(x); B r; u8 xe = TI(x,elType); - if (xe!=el_bit && s<=xia) x = squeeze_numTry(x, &xe); + if (xe!=el_bit && s<=xia) x = squeeze_numTry(x, &xe, SQ_NUM); if (xe==el_bit) { r = where(x, xia, s); } else if (RARE(xia > (usz)I32_MAX+1)) { @@ -630,7 +630,7 @@ B slash_c2(B t, B w, B x) { if (isArr(w)) { we = TI(w,elType); if (!elInt(we)) { - w = squeeze_numTry(w, &we); + w = squeeze_numTry(w, &we, SQ_MSGREQ(SQ_NUM)); if (!elNum(we)) goto base; } ur wr = RNK(w); @@ -670,7 +670,7 @@ B slash_c2(B t, B w, B x) { if (xl>6 || (xl<3 && xl!=0)) goto arrW_base; if (s<=wia) { if (s==0) { r = zeroCells(x); goto decWX_ret; } - w = squeeze_numTry(w, &we); + w = squeeze_numTry(w, &we, SQ_NUM); if (we==el_bit) goto wbool; } // s≠0 now @@ -1021,7 +1021,7 @@ B slash_im(B t, B x) { break; } case el_c8: case el_c16: case el_c32: case el_B: { - x = squeeze_numTry(x, &xe); + x = squeeze_numTry(x, &xe, SQ_NUM); if (elNum(xe)) goto retry; B* xp = TO_BPTR(x); for (usz i=0; ientsAA[TI(w,elType)*8 + xe]; goto newEnt; @@ -189,7 +189,7 @@ NOINLINE B dyArith_SA(DyTableSA* table, B w, B x) { case el_i8: if (wa==( u8)wa) { e=&table->ents[el_i8 ]; width=0; type=t_c8arr; goto f1; } else goto cwiden_i8; case el_i16: if (wa==(u16)wa) { e=&table->ents[el_i16]; width=1; type=t_c16arr; goto f1; } else goto cwiden_i16; case el_i32: e=&table->ents[el_i32]; width=2; type=t_c32arr; goto f1; - case el_f64: x=squeeze_numTry(x, &xe); if (xe!=el_f64) goto newXEc; else goto rec; + case el_f64: x=squeeze_numTry(x, &xe, SQ_CHR); if (xe!=el_f64) goto newXEc; else goto rec; case el_c8: if (wa==( u8)wa) { e=&table->ents[el_c8 ]; width=0; type=t_i8arr; goto f1; } goto cwiden_c8; // TODO check for & use unsigned w case el_c16: if (wa==(u16)wa) { e=&table->ents[el_c16]; width=1; type=t_i16arr; goto f1; } goto cwiden_c16; case el_c32: e=&table->ents[el_c32]; width=2; type=t_i32arr; goto f1; @@ -288,7 +288,7 @@ static NOINLINE B or_SA(B t, B w, B x) { f64 wf = o2fG(w); return bit_sel(x, m_f64(bqn_or(wf, 0)), m_f64(bqn_or(wf, 1))); } - x = squeeze_numTry(x, &xe); + x = squeeze_numTry(x, &xe, SQ_NUM); if (xe==el_bit) goto bitsel; if (!elNum(xe)) return arith_recd(or_c2, w, x); x = toF64Any(x);