aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-02-09 21:59:01 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-02-09 21:59:01 -0500
commitb2e7dbac083a003c93c4511dc9057651069f035f (patch)
tree25d3e07f9c3e50559efe7019410b9674049ce660 /src
parent81a2e6af3c62350be39fec75669839e3727cb628 (diff)
Fix Replicate when 𝕨 contains an enclosed number
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/r.bqn b/src/r.bqn
index 594f7a76..d70f51c4 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -513,7 +513,8 @@ JoinTo←∨○(1<=)◶(∾○⥊)‿{
} _fillBy_ IF
Rep ← Indices⊸⊏
-Replicate ← IsArray∘⊣◶{
+Replicate ← (0<=∘⊣)◶{
+ 𝕨↩(0⊑⥊)⍟IsArray𝕨
"/: Amounts to replicate must be natural numbers" ! Nat 𝕨
e←r←𝕨
({e+↩r⋄1+𝕩}⍟{e=𝕨}˜`↕r×≠𝕩) ⊏ 𝕩