From 01b1ee3637e847c9bc950a5fb527250e92894532 Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 9 Jul 2024 01:59:19 +0300 Subject: [PATCH] =?UTF-8?q?make=20=E2=8A=A2=C2=A8=20more=20consistent=20wi?= =?UTF-8?q?th=20other=20PureIdentFn=C2=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit incl. making ⊢¨ not leak xf under EACH_FILLS --- src/builtins/md1.c | 5 ++++- test/cases/prims.bqn | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/builtins/md1.c b/src/builtins/md1.c index d5b92b35..e9590467 100644 --- a/src/builtins/md1.c +++ b/src/builtins/md1.c @@ -43,7 +43,10 @@ B each_c1(Md1D* d, B x) { B f = d->f; if (isAtm(x)) r = m_hunit(c1(f, x)); else if (isFun(f)) { u8 rtid = v(f)->flags-1; - if (rtid==n_ltack || rtid==n_rtack) return x; + if (rtid==n_ltack || rtid==n_rtack) { + if (EACH_FILLS) decG(xf); + return EACH_FILLS || TI(x,arrD1) || IA(x)==0? x : any_squeeze(withFill(x, bi_noFill)); + } r = eachm_fn(f, x, c(Fun,f)->c1); } else { usz ia = IA(x); diff --git a/test/cases/prims.bqn b/test/cases/prims.bqn index 5d422dc1..bd77a2d4 100644 --- a/test/cases/prims.bqn +++ b/test/cases/prims.bqn @@ -271,6 +271,7 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe ⊢¨ {a←𝕩 ⋄ 2‿3‿1⥊𝕩} 6⥊<"a" %% 2‿3‿1⥊<"a" ⊢¨ {a←𝕩 ⋄ 2‿3⥊⥊𝕩} 2‿3⥊<"a" %% 2‿3⥊<"a" ⊢¨ 2‿3⥊<"a" %% 2‿3⥊<"a" +%USE tvar ⋄ {•Repr∘𝕩⍟¬⊸! (⊢¨ ≡○(10⊸↑) •internal.PureKeep¨) 𝕩}_tvar¨ ⟨⊔↕2, ⊔↕0, ↕5, ↕0, "hello", ""⟩ # ⊔ !"⊔: ≠𝕨 must be either ≠𝕩 or one bigger (2≡≠𝕨, 3≡≠𝕩)" % 0‿0⊔↕3