diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-05-02 21:18:41 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-05-02 21:18:41 -0400 |
| commit | 3edb22d4a91a4246f9668c2c2fe75ec1b6b37aab (patch) | |
| tree | 18536003bf2e966f015d7441a14b29b52c0e6fd8 /src | |
| parent | 85e745dd832e5386bfa17e7c44e3192a1e8227ca (diff) | |
Better error messages for Replicate
Diffstat (limited to 'src')
| -rw-r--r-- | src/r1.bqn | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -299,15 +299,15 @@ Rotate ← ⟨"⌽" RepInd←(2⌊=∘⊣)◶{ 𝕨↩(0⊑⥊)⍟IsArray𝕨 - "𝕨/𝕩: Amounts to replicate must be natural numbers" ! Nat 𝕨 + "𝕨/𝕩: 𝕨 must consist of natural numbers" ! Nat 𝕨 e←r←𝕨 {e+↩r⋄1+𝕩}⍟{e=𝕨}˜`↕r×𝕩 }‿{ "𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩" ! 𝕩=≠𝕨 - "𝕨/𝕩: Amounts to replicate must be natural numbers" ! 1×´|∘⌊⊸=⌜𝕨 + "𝕨/𝕩: 𝕨 must consist of natural numbers" ! 1×´|∘⌊⊸=⌜𝕨 Ind 𝕨 }‿{ - "𝕨/𝕩: Replication argument must have rank 0 or 1" ! 0˙ + "𝕨/𝕩: Components of 𝕨 must have rank 0 or 1" ! 0˙ } Replicate←⟨"/" ((0<≠)×´(1=Type)⌜)∘⥊, 1,1 |
