aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-08-07 20:41:31 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-08-07 20:41:31 -0400
commit7bf2aa4054b8378a76dff63acdccbcdad91f68e6 (patch)
tree1bff7a2a2b11fa259bc80722fdcb0609768c7718 /src
parent532796eb397c8374e0546de9e4ab70c2955349f3 (diff)
BREAKING: Don't allow First of empty or reshaping empty to non-empty
Diffstat (limited to 'src')
-rw-r--r--src/r1.bqn7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 9052bc6e..b90b71b7 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -285,7 +285,7 @@ Select ← ⟨"⊏"
{(≠𝕩)⊸NormIndS⌜𝕨} ⊏ ⊢
{𝕩⊸NormIndS⌜𝕨}
⟩_multiAxis○ToArray
-First ← IsArray◶⟨⊢, (0<≠)◶⟨Fill,0⊸⊑⟩⥊⟩
+First ← IsArray◶⟨⊢, (0<≠)◶⟨"⊑𝕩: 𝕩 can't be empty"!0˙,0⊸⊑⟩⥊⟩
Reverse←{
"⌽𝕩: 𝕩 must have rank at least 1" ! 1≤=𝕩
@@ -621,9 +621,10 @@ Reshape←{
s↩p⊣◶⊢‿a¨s
{d∾↩(Fill d)⌜↕𝕩-n⋄n}⍟(n⊸<)⍟(3=t)lp×a
} s
- s⥊(0<n)◶{(<Fill𝕩)⊣⌜↕l}‿{
+ s⥊{
+ "𝕨⥊𝕩: Can't produce non-empty array from empty 𝕩" ! 0<n
l >⟜≠◶⟨↑, ⊣(⊢∾-⟜≠↑⊢)÷⟜2⊸{𝕨𝕊⟜(∾˜)⍟(>⟜≠)𝕩}⟩ 𝕩
- }_fillBy_⊢⍟(1-l=n)d
+ }_fillBy_⊢⍟(1-l=n) d
}
_group←{