From 89289fe19a4a0aa9866f299855d17a00df21332d Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 3 Aug 2020 22:41:10 -0400 Subject: Make the complicated parts of Take conditional --- impl.bqn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/impl.bqn b/impl.bqn index caeab991..38ec5adf 100644 --- a/impl.bqn +++ b/impl.bqn @@ -217,9 +217,9 @@ JoinTo←∨○(1≠=)◶∾‿{ Take←{ T←{ ! Int 𝕨 - l←≠𝕩 - i←(l+1)|¯1⌈l⌊((𝕨<0)×𝕨+l)+↕|𝕨 - i⊏JoinTo⟜(1⊸Cell⥊Type)⍟(∨´l=i)𝕩 + l←≠𝕩 ⋄ n←𝕨<0 ⋄ e←l⌊r←|𝕨 ⋄ s←⟨r⟩ + i ← 𝕩{s∾↩c←1 Cell 𝕨⋄𝕩(×+⌜↕∘⊢)×´c}⍟(1≠=𝕩) (l-e)+⍟n ↕e + s ⥊ 𝕩{(⥊𝕩)n◶⟨∾,∾˜⟩(r-e)⥊Type𝕗}⍟(l