The Novelties of Lua 5.2 Roberto Ierusalimschy (pdf slideshow)
inf.puc-rio.br
inf.puc-rio.br
There's something to be said here about pragmatism versus purity. Maybe also a comparison with the recent posts about OO and Rails. I'm hand-waving. I mean to write something longer about this, but I'm still trying to decide what exactly I make of it.
http://www.lua.org/pil/27.3.3.html
Essentially, they are unbound variables that have to be reachable from the function by some mechanism, making it a closure.
Apologies if I've misunderstood anything here.
Because of the lexical scoping rules, local variables can
be freely accessed by functions defined inside their scope.
A local variable used by an inner function is called an
upvalue, or external local variable, inside the inner
function.
i.e., the external local variables the closure is closed on. And for C functions made available to Lua scripts: When a C function is created, it is possible to associate
some values with it, thus creating a C closure (see
lua_pushcclosure); these values are called upvalues and are
accessible to the function whenever it is called.
- http://www.lua.org/manual/5.2/manual.htmlStructured programming with go to statements (1974) by Donald E. Knuth (http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.103.6...)
A goto may jump to any visible label as long as it does not enter into the scope of a local variable.
This can be determined statically.
It jumps directly to the label, and can't skip forward over the declarations of variables that are in scope at the label.