From 8b0d0399e4f139a2fb0c9d4f3e2f6cd65be44f7b Mon Sep 17 00:00:00 2001 From: dzaima Date: Thu, 16 Jan 2025 01:00:35 +0200 Subject: [PATCH] =?UTF-8?q?fix=20various=20F=E2=8C=BE(G=E2=8A=B8Specialize?= =?UTF-8?q?d)x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/md2.c | 2 +- test/cases/under.bqn | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/builtins/md2.c b/src/builtins/md2.c index 3ff981ff..05b38d26 100644 --- a/src/builtins/md2.c +++ b/src/builtins/md2.c @@ -179,7 +179,7 @@ B under_c2(Md2D* d, B w, B x) { B f=d->f; B g=d->g; } B before_uc1(Md2* t, B o, B f, B g, B x) { - if (!isFun(g)) return def_m2_uc1(t, o, f, g, x); + if (!isFun(g) || isCallable(f)) return def_m2_uc1(t, o, f, g, x); return TI(g,fn_ucw)(g, o, inc(f), x); } B before_im(Md2D* d, B x) { return isFun(d->g) && !isCallable(d->f)? TI(d->g,fn_ix)(d->g, inc(d->f), x) : def_m2_im(d, x); } diff --git a/test/cases/under.bqn b/test/cases/under.bqn index 95b6cafb..d018d836 100644 --- a/test/cases/under.bqn +++ b/test/cases/under.bqn @@ -6,6 +6,20 @@ # !% ⊢⌾(⊢¨) 4 # TODO enable # !% ⊢⌾(⊢˘) 4 # TODO enable +# ⌾(F⊸Op) +10⊸+⌾((2÷˜≢)⊸⊑) ↕10 %% 0‿1‿2‿3‿4‿15‿6‿7‿8‿9 +10⊸+⌾((2÷˜≢)⊑⊢) ↕10 %% 0‿1‿2‿3‿4‿15‿6‿7‿8‿9 +10⊸+⌾((↕2÷˜≠)⊸⊏) ↕10 %% 10‿11‿12‿13‿14‿5‿6‿7‿8‿9 +10⊸+⌾((2÷˜≠)⊸↑) ↕10 %% 10‿11‿12‿13‿14‿5‿6‿7‿8‿9 +10⊸+⌾((2÷˜≠)⊸⥊) ↕10 %% 10‿11‿12‿13‿14‿5‿6‿7‿8‿9 +10⊸+⌾((↕∘≠<2÷˜≠)⊸/) ↕10 %% 10‿11‿12‿13‿14‿5‿6‿7‿8‿9 +10⊸+⌾((2÷˜≠)⊸↓) ↕10 %% 0‿1‿2‿3‿4‿15‿16‿17‿18‿19 +(↕10)⊸+⌾((2÷˜≠)⊸⌽) 10×↕10 %% 5‿16‿27‿38‿49‿50‿61‿72‿83‿94 +⌽⌾((¯1+=)⊸⍉) 3‿3⥊↕9 %% 3‿3⥊2‿1‿0‿5‿4‿3‿8‿7‿6 +!"Expected integer, got function" % 1⊸+⌾((¯1+≠)˙⊑⊢)"ab" +!"⊑: 𝕨 must be a numeric array" % ⊢⌾((≠⊑⟨@,@,¯1+≠⟩˙)⊸⊑)"ab" +!"◶: 𝕘 must have rank 1 when index is a number" % ⊢⌾(≠◶⟨@,@,¯1+≠⟩⊸⊑)"ab" + # ⊑