aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-24 21:55:45 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-24 21:55:45 -0400
commitb60fd36b9eb6b245c848502f388dc7f5b3f9131d (patch)
tree858876a54f894c9c3f5480af122ba87595c38100 /src
parenta717221a7dd2fb88ff9d5d07e221a83dc558b47d (diff)
Prevent nudge of empty array from requiring a fill
Diffstat (limited to 'src')
-rw-r--r--src/r1.bqn6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 2c52bea1..9052bc6e 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -551,12 +551,12 @@ ShiftCheck←{
ShiftBefore←{
n←𝕨 ShiftCheck 𝕩
m←n⌊l←≠d←⥊𝕩
- (≢𝕩) ⥊ (𝕨{(Fill𝕩)⌜↕𝕨}⟜𝕩⊘(↑⟜Deshape˜)m) ∾ (l-m)↑d
+ (≢𝕩) ⥊ (𝕨{(Fill𝕩)⌜↕𝕨}⍟(0<l)⟜𝕩⊘(↑⟜Deshape˜)m) ∾ (l-m)↑d
} _fillBy_ (⊢⊘IF)
ShiftAfter←{
n←𝕨 ShiftCheck 𝕩
- m←n⌊≠d←⥊𝕩
- (≢𝕩) ⥊ (m↓d) ∾ 𝕨{(Fill𝕩)⌜↕𝕨}⟜𝕩⊘(n⊸-⊸↓⟜Deshape˜)m
+ m←n⌊l←≠d←⥊𝕩
+ (≢𝕩) ⥊ (m↓d) ∾ 𝕨{(Fill𝕩)⌜↕𝕨}⍟(0<l)⟜𝕩⊘(n⊸-⊸↓⟜Deshape˜)m
} _fillBy_ (⊢⊘IF)
RangeCheck ← "↕𝕩: 𝕩 must consist of natural numbers"!Nat