make unknown key reads properly error for cross-program reads

This commit is contained in:
dzaima 2021-05-28 16:15:22 +03:00
parent 9326aa9572
commit a2d90a2595
3 changed files with 6 additions and 5 deletions

View File

@ -350,7 +350,7 @@ B cell_c1(B d, B x) { B f = c(Md1D,d)->f;
B r = c1(f, x);
return isAtm(r)? m_atomUnit(r) : r;
}
if (f.u == bi_lt.u) return toCells(x);
// if (f.u == bi_lt.u) return toCells(x); // TODO fix fills
usz cr = rnk(x)-1;
usz cam = a(x)->sh[0];
usz csz = arr_csz(x);

View File

@ -381,7 +381,7 @@ typedef struct TypeInfo {
BS2B getU; // like get, but doesn't increment result (mostly equivalent to `B t=get(…); dec(t); t`)
BB2B m1_d; // consume all args; (m, f)
BBB2B m2_d; // consume all args; (m, f, g)
BS2B slice; // consumes; create slice from given starting position; add ia, rank, shape yourself; may not actually be a Slice object
BS2B slice; // consumes; create slice from given starting position; add ia, rank, shape yourself; may not actually be a Slice object; preserves fill
B2B identity; // return identity element of this function; doesn't consume
BBB2B fn_uc1; // t,o, x→r; r≡O⌾( T ) x; consumes x

View File

@ -51,9 +51,10 @@ B ns_getU(B ns, B cNL, i32 nameID) {
i32 dID = d->expIDs[i];
if (dID>=0 && equal(dNLgetU(dNL, dID), cName)) return n->sc->vars[i];
}
}
for (i32 i = 0; i < dVarAm; i++) {
if (d->expIDs[i]==nameID) return n->sc->vars[i];
} else {
for (i32 i = 0; i < dVarAm; i++) {
if (d->expIDs[i]==nameID) return n->sc->vars[i];
}
}
thrM("No key found");
}