From b31865b0f452f64b5ab93bfbd3d38848c47efde5 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 1 May 2021 22:35:07 +0300 Subject: [PATCH] =?UTF-8?q?add=20back=20native=20=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.c | 8 +++++--- src/sfns.c | 6 ++++-- src/sysfn.c | 4 +--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main.c b/src/main.c index 345a8692..9abb77f1 100644 --- a/src/main.c +++ b/src/main.c @@ -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, diff --git a/src/sfns.c b/src/sfns.c index a417b20f..48948746 100644 --- a/src/sfns.c +++ b/src/sfns.c @@ -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; diff --git a/src/sysfn.c b/src/sysfn.c index 6b46825c..b3681fcd 100644 --- a/src/sysfn.c +++ b/src/sysfn.c @@ -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;