fix ⟨1.5⟩ ⊏ "ab"‿"cd"

This commit is contained in:
dzaima 2024-03-25 16:04:33 +02:00
parent a94903cb12
commit ac069134c3
2 changed files with 5 additions and 1 deletions

View File

@ -338,7 +338,8 @@ B select_c2(B t, B w, B x) {
MUTG_INIT(rm);
for (; i < wia; i++) {
B cw = GetU(w, i); // assumed number from previous squeeze
usz c = WRAP(o2i64(cw), xn, { badw=o2fG(cw); goto bad1; });
if (!q_i64(cw)) { bad_cw: badw=o2fG(cw); goto bad1; }
usz c = WRAP(o2i64G(cw), xn, goto bad_cw; );
mut_copyG(rm, i*csz, x, csz*c, csz);
}
r = a(withFill(mut_fv(rm), xf));
@ -347,6 +348,7 @@ B select_c2(B t, B w, B x) {
bad1:;
mut_pfree(rm, i*csz);
if (!q_fi64(badw)) expI_f64(badw);
thrF("⊏: Indexing out-of-bounds (%f∊𝕨, %s≡≠𝕩)", badw, xn);
}

View File

@ -122,6 +122,8 @@ a←↕2 ⋄ ! "e" ≡ (↕10){b←a‿a‿a‿a‿a‿a‿a‿a‿a‿a ⋄
!"⊏: 𝕩 cannot be a unit" % <"a"
!"⊏: 𝕩 cannot be a unit" % <5
!"⊏: 𝕩 cannot be an atom" % 5
!"Expected integer, got 1.5" % 1.5 "ab""cd"
!"⊏: Indexing out-of-bounds (10∊𝕨, 2≡≠𝕩)" % 10 "ab""cd"
# 𝕨⊑𝕩
!"⊑: 𝕨 contained a non-integer" % 0.13