add back native »

This commit is contained in:
dzaima 2021-05-01 22:35:07 +03:00
parent 76c3466c96
commit b31865b0f4
3 changed files with 10 additions and 8 deletions

View File

@ -20,10 +20,12 @@
// #define TIME // output runtime of every expression
// #define RT_PERF // time runtime primitives
#ifndef CATCH_ERRORS
#ifdef CATCH_ERRORS
#define PROPER_FILLS EACH_FILLS
#else
#undef EACH_FILLS
#define EACH_FILLS false
#define PROPER_FILLS false
#endif
#define rtLen 63
@ -121,7 +123,7 @@ int main() {
bool rtComplete[] = {
/* +-×÷⋆√⌊⌈|¬ */ 1,1,1,1,1,0,1,1,1,1,
/* ∧∨<>≠=≤≥≡≢ */ 1,1,1,1,1,1,1,1,1,1,
/* ⊣⊢⥊∾≍↑↓↕«» */ 1,1,0,1,0,0,0,0,0,0,
/* ⊣⊢⥊∾≍↑↓↕«» */ 1,1,0,1,0,0,0,0,0,1,
/* ⌽⍉/⍋⍒⊏⊑⊐⊒∊ */ 0,0,1,0,0,1,0,0,0,0,
/* ⍷⊔!˙˜˘¨⌜⁼´ */ 0,0,1,1,1,0,1,1,0,1,
/* ˝`∘○⊸⟜⌾⊘◶⎉ */ 0,1,1,1,1,1,0,1,0,0,

View File

@ -405,7 +405,10 @@ B shiftb_c1(B t, B x) {
usz ia = a(x)->ia;
if (ia==0) return x;
B xf = getFill(inc(x));
if (noFill(xf)) thrM("»: Argument didn't have a fill");
if (noFill(xf)) {
if (PROPER_FILLS) thrM("»: Argument didn't have a fill");
else xf = m_f64(0);
}
usz csz = arr_csz(x);
MAKE_MUT(r, ia);
@ -421,7 +424,6 @@ void shift_check(B w, B x) {
for (i32 i = 1; i < xr; i++) if (wsh[i+wr-xr] != xsh[i]) thrM("shift: Lengths not matchable");
}
B shiftb_c2(B t, B w, B x) {
// return c2(rt_shiftb, w, x);
if (!isArr(x) || rnk(x)==0) thrM("»: 𝕩 cannot be a scalar");
if (!isArr(w)) w = m_hunit(w); usz wia = a(w)->ia;
if (!isArr(x)) x = m_hunit(x); usz xia = a(x)->ia;

View File

@ -35,9 +35,7 @@ B glyph_c1(B t, B x) {
B fill_c1(B t, B x) {
B f = getFill(x);
if (noFill(f)) {
#if !defined(CATCH_ERRORS) || !EACH_FILLS
return m_f64(0);
#endif
if (!PROPER_FILLS) return m_f64(0);
thrM("No fill found");
}
return f;