3 ms·
Lua uses a concept called "upvalues" to refer to variables from enclosing scopes. The main observation here seems to be that you can statically determine a uni
by haberman 11y ago
Lua uses a concept called "upvalues" to refer to variables from enclosing scopes. The main observation here seems to be that you can statically determine a unique index for all local variables in any enclosing scope. I'm not sure exactly how the details work in cases where there are sibling scopes, but anyway it seems like a useful concept and i am surprised the concept/terminology is not more common.
- ScottBurson 11y agoThis technique is very old -- it goes back at least to Pascal, IIRC, and probably to Algol 60. It certainly was used in Scheme implementations in the late 1970s. I haven't heard the term "upvalue" before, though.