more proper error message for 1⌾((<⋈0)⊸⊑)↕5
This commit is contained in:
parent
13906efe44
commit
1ecc6b3918
@ -1400,7 +1400,9 @@ B pick_ucw(B t, B o, B w, B x) {
|
||||
}
|
||||
w = num_squeeze(mut_fcd(r, w));
|
||||
B rep = isArr(o)? incG(o) : c1(o, C2(select, incG(w), C1(shape, incG(x))));
|
||||
if (isAtm(rep) || !eqShape(w, rep)) thrF("𝔽⌾(a⊸⊑)𝕩: 𝔽 must return an array with the same shape as its input (expected %H, got %H)", w, rep);
|
||||
// error messages will need to get more non-trivial for deeper mismatches
|
||||
if (isAtm(rep)) thrM("𝔽⌾(nested⊸⊑)𝕩: 𝔽 must return an array with the same shape as its input (expected unit array, got atom)");
|
||||
if (!eqShape(w, rep)) thrF("𝔽⌾(nested⊸⊑)𝕩: 𝔽 must return an array with the same shape as its input (expected %H, got %H)", w, rep);
|
||||
return select_replace(U'⊑', w, x, rep, wia, xia, 1);
|
||||
}
|
||||
decG(w);
|
||||
|
||||
@ -174,6 +174,8 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄
|
||||
!"𝕨⊑𝕩: 𝕨 contained a non-integer" % ⟨0.1⟩⊑↕3
|
||||
!"𝕨⊑𝕩: 𝕨 contained a non-integer" % ⟨2⋆80⟩⊑↕3
|
||||
!"𝕨⊑𝕩: Leaf arrays in 𝕨 must have rank 1 (element: (1‿2⥊1‿2))" % %USE evar ⋄ (≍1‿2) {⟨𝕨⟩⊑𝕩}_evar ↕5‿5
|
||||
!"𝕨⊑𝕩: Leaf arrays in 𝕨 must have rank 1 (element: (<2))" % (<2)⊑↕3
|
||||
!"𝕨⊑𝕩: Leaf arrays in 𝕨 must have rank 1 (element: (<1))" % (<1)⊑"foo"‿"bar"‿"baz"
|
||||
%USE eqvar ⋄ 1‿2 ⊑_eqvar ↕5‿5 %% 1‿2
|
||||
|
||||
# >𝕩
|
||||
|
||||
@ -30,8 +30,15 @@
|
||||
|
||||
# ⊑
|
||||
!"𝔽⌾(a⊸⊑): Incompatible result elements" % 10‿20⌾(⟨1‿2,1‿2⟩⊸⊑) 4‿5⥊↕9
|
||||
!"𝔽⌾(a⊸⊑)𝕩: 𝔽 must return an array with the same shape as its input (expected ⟨2⟩, got ⟨3⟩)" % 10‿20‿30⌾(⟨1‿2,2‿1⟩⊸⊑) 4‿4⥊↕16
|
||||
!"𝔽⌾(a⊸⊑)𝕩: 𝔽 must return an array with the same shape as its input (expected ⟨2⟩, got ⟨3⟩)" % 1⊸∾⌾(⟨1‿2,2‿1⟩⊸⊑) 4‿4⥊↕16
|
||||
!"𝔽⌾(nested⊸⊑)𝕩: 𝔽 must return an array with the same shape as its input (expected ⟨2⟩, got ⟨3⟩)" % 10‿20‿30⌾(⟨1‿2,2‿1⟩⊸⊑) 4‿4⥊↕16
|
||||
!"𝔽⌾(nested⊸⊑)𝕩: 𝔽 must return an array with the same shape as its input (expected unit array, got atom)" % 1⌾((<⋈2)⊸⊑) ↕10
|
||||
!"𝔽⌾(nested⊸⊑)𝕩: 𝔽 must return an array with the same shape as its input (expected unit array, got atom)" % 1⌾((<1‿2)⊸⊑) 3‿3⥊↕9
|
||||
!"⁼: Inverse not found" % 1⌾((<⋈⋈2)⊸⊑) ↕10
|
||||
!"⁼: Inverse not found" % 1⌾((<⋈1‿2)⊸⊑) 3‿3⥊↕9
|
||||
!"⁼: Inverse not found" % (<1)⌾((<⟨1‿2,2‿1⟩)⊸⊑) 3‿3⥊↕9
|
||||
!"⁼: Inverse not found" % 3‿4⌾((<⟨1‿2,2‿1⟩)⊸⊑) 3‿3⥊↕9
|
||||
!"𝕨⊑𝕩: Leaf arrays in 𝕨 must have rank 1 (element: (<2))" % 1⌾((<2)⊸⊑) ↕10
|
||||
!"𝔽⌾(nested⊸⊑)𝕩: 𝔽 must return an array with the same shape as its input (expected ⟨2⟩, got ⟨3⟩)" % 1⊸∾⌾(⟨1‿2,2‿1⟩⊸⊑) 4‿4⥊↕16
|
||||
!"𝔽⌾(n⊸⊑)𝕩: reading out-of-bounds (n≡¯10, 3≡≠𝕩)" % 1⊸+⌾(¯10⊸⊑) ↕3
|
||||
!"𝕨⊑𝕩: 𝕨 contained list with mixed-type elements" % 'a'⌾(1‿'a'⊸⊑) 4‿5⥊↕9
|
||||
!"𝕨⊑𝕩: Indexing out-of-bounds (index 1‿5 in array of shape 4‿5)" % 'a'⌾(1‿5⊸⊑) 4‿5⥊↕9
|
||||
|
||||
Loading…
Reference in New Issue
Block a user