For execution, the code is loaded into the RAM - and therefore it is modifiable - is it?. With some JIT compiler mind, the interpreter could after first lookup of a (long enough) variable (or function) referencing name override that name with a prefixed pointer. The prefix is some reserved byte(s) value which is telling the interpreter on subsequent interpretation that the lookup already happened. (May be there is no such special byte(s) left to make the interpreter recognize). Caveat: the delete of a variable becomes a bit tricky... and would thus not be allowed anymore.
© Espruino, powered by microcosm.
Report a problem