Closed o-santi closed 2 years ago
and there should be some way to read without unwrapping
good luck with that wihtout introducing formal proofs on Rust, heh.
thank you santi.
actually, we could introduce some kind of "pointer to memory" in such a way that when we mach on it would contain a name that always safely resolve to an arity, on the context of some runtime
.
let ptr = rt.get(loc);
match ptr {
Fun(fun) => fun.arity()
Ctr(ctr) => ctr.arity()
}
but it's just a vague ideia.
checking if function/constructor is defined when reading their arity. creating new runtime error CtrOrFunNotDefined (name subject to change). some places should never return none (and there should be some way to read without unwrapping, but this will suffice for now.