change error messages in ◶
This commit is contained in:
parent
8542ba071d
commit
336f986986
@ -140,8 +140,8 @@ B pick_c2(B t, B w, B x);
|
|||||||
B cond_c1(Md2D* d, B x) { B f=d->f; B g=d->g;
|
B cond_c1(Md2D* d, B x) { B f=d->f; B g=d->g;
|
||||||
B fr = c1iX(f, x);
|
B fr = c1iX(f, x);
|
||||||
if (isNum(fr)) {
|
if (isNum(fr)) {
|
||||||
if (isAtm(g)||RNK(g)!=1) thrM("◶: 𝕘 must have rank 1");
|
if (isAtm(g)||RNK(g)!=1) thrM("◶: 𝕘 must have rank 1 when index is a number");
|
||||||
usz fri = WRAP(o2i64(fr), IA(g), thrM("◶: 𝔽 out of bounds of 𝕘"));
|
usz fri = WRAP(o2i64(fr), IA(g), thrM("◶: Index out of bounds of 𝕘"));
|
||||||
return c1(IGetU(g, fri), x);
|
return c1(IGetU(g, fri), x);
|
||||||
} else {
|
} else {
|
||||||
B fn = C2(pick, fr, inc(g));
|
B fn = C2(pick, fr, inc(g));
|
||||||
@ -153,8 +153,8 @@ B cond_c1(Md2D* d, B x) { B f=d->f; B g=d->g;
|
|||||||
B cond_c2(Md2D* d, B w, B x) { B g=d->g;
|
B cond_c2(Md2D* d, B w, B x) { B g=d->g;
|
||||||
B fr = c2iWX(d->f, w, x);
|
B fr = c2iWX(d->f, w, x);
|
||||||
if (isNum(fr)) {
|
if (isNum(fr)) {
|
||||||
if (isAtm(g)||RNK(g)!=1) thrM("◶: 𝕘 must have rank 1");
|
if (isAtm(g)||RNK(g)!=1) thrM("◶: 𝕘 must have rank 1 when index is a number");
|
||||||
usz fri = WRAP(o2i64(fr), IA(g), thrM("◶: 𝔽 out of bounds of 𝕘"));
|
usz fri = WRAP(o2i64(fr), IA(g), thrM("◶: Index out of bounds of 𝕘"));
|
||||||
return c2(IGetU(g, fri), w, x);
|
return c2(IGetU(g, fri), w, x);
|
||||||
} else {
|
} else {
|
||||||
B fn = C2(pick, fr, inc(g));
|
B fn = C2(pick, fr, inc(g));
|
||||||
|
|||||||
@ -281,6 +281,15 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨•Repr𝕩,": Expe
|
|||||||
%USE tvar ⋄ a←¯5+↕10 ⋄ !¨ (⋈¨ 5+↕10)⊸≡¨ {1+⍟𝕩 ⋈10}_tvar a
|
%USE tvar ⋄ a←¯5+↕10 ⋄ !¨ (⋈¨ 5+↕10)⊸≡¨ {1+⍟𝕩 ⋈10}_tvar a
|
||||||
%USE tvar ⋄ a←¯5+↕10 ⋄ !¨ (⋈¨ 5+↕10)⊸≡¨ {1+⍟(𝕩{!𝕩≡⋈10 ⋄ 𝕗}) ⋈10}_tvar a
|
%USE tvar ⋄ a←¯5+↕10 ⋄ !¨ (⋈¨ 5+↕10)⊸≡¨ {1+⍟(𝕩{!𝕩≡⋈10 ⋄ 𝕗}) ⋈10}_tvar a
|
||||||
|
|
||||||
|
# ◶
|
||||||
|
!"◶: 𝕘 must have rank 1 when index is a number" % 1◶[1‿2,3‿4] 3
|
||||||
|
!"◶: 𝕘 must have rank 1 when index is a number" % "ab" ⊢◶[1‿2,3‿4] 3
|
||||||
|
!"⊑: Picking item at wrong rank (index 0‿0 in array of shape ⟨2⟩)" % ⊢◶+‿- 0‿0 # shouldn't reference ⊑ but whatever
|
||||||
|
!"⊑: Picking item at wrong rank (index 1‿2 in array of shape ⟨3⟩)" % 1 +◶+‿-‿⊢ 0‿1
|
||||||
|
10 +◶"ab"‿"cd" ¯9 %% "cd"
|
||||||
|
⟨⋈1,⋈2,⋈0⟩◶"ab"‿"cd"‿1 @ %% "cd"‿1‿"ab"
|
||||||
|
|
||||||
|
|
||||||
# ˘ & ⎉
|
# ˘ & ⎉
|
||||||
≢ (1⥊˜ 0∾203⥊2)⎉50 1⥊˜ 0∾100⥊2 %% 1‿50‿1‿203/0‿2‿0‿2
|
≢ (1⥊˜ 0∾203⥊2)⎉50 1⥊˜ 0∾100⥊2 %% 1‿50‿1‿203/0‿2‿0‿2
|
||||||
!"⎉: Result rank too large" % (1⥊˜ 0∾203⥊2)⎉49 1⥊˜ 0∾100⥊2
|
!"⎉: Result rank too large" % (1⥊˜ 0∾203⥊2)⎉49 1⥊˜ 0∾100⥊2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user