From cd866e1e45ce0f22bfacd25565ab912c06cb040f Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 6 Nov 2021 17:30:01 +0200 Subject: [PATCH] =?UTF-8?q?lazy=20fallback=20to=20runtime=20on=20=E2=88=BE?= =?UTF-8?q?=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/sfns.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/builtins/sfns.c b/src/builtins/sfns.c index 8bb4b0a3..6c3bd4cf 100644 --- a/src/builtins/sfns.c +++ b/src/builtins/sfns.c @@ -667,16 +667,16 @@ B join_c1(B t, B x) { B x0 = GetU(x,0); B rf; if(SFNS_FILLS) rf = getFillQ(x0); - if (isAtm(x0)) thrM("∾: Rank of items must be equal or greater than rank of argument"); + if (isAtm(x0)) goto base; // thrM("∾: Rank of items must be equal or greater than rank of argument"); usz ir = rnk(x0); usz* x0sh = a(x0)->sh; - if (ir==0) thrM("∾: Rank of items must be equal or greater than rank of argument"); + if (ir==0) goto base; // thrM("∾: Rank of items must be equal or greater than rank of argument"); usz csz = arr_csz(x0); usz cam = x0sh[0]; for (usz i = 1; i < xia; i++) { B c = GetU(x, i); - if (!isArr(c) || rnk(c)!=ir) thrF("∾: All items in argument should have same rank (contained items with ranks %i and %i)", ir, isArr(c)? rnk(c) : 0); + if (!isArr(c) || rnk(c)!=ir) goto base; // thrF("∾: All items in argument should have same rank (contained items with ranks %i and %i)", ir, isArr(c)? rnk(c) : 0); usz* csh = a(c)->sh; if (ir>1) for (usz j = 1; j < ir; j++) if (csh[j]!=x0sh[j]) thrF("∾: Item trailing shapes must be equal (contained arrays with shapes %H and %H)", x0, c); cam+= a(c)->sh[0]; @@ -701,6 +701,7 @@ B join_c1(B t, B x) { dec(x); return SFNS_FILLS? qWithFill(taga(ra), rf) : taga(ra); } + base: return c1(rt_join, x); } B join_c2(B t, B w, B x) {