make unknown key reads properly error for cross-program reads
This commit is contained in:
parent
9326aa9572
commit
a2d90a2595
@ -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);
|
||||
|
||||
2
src/h.h
2
src/h.h
@ -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
|
||||
|
||||
7
src/ns.c
7
src/ns.c
@ -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");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user