Luaf

Logo

Lua for learning and laufs

build status MIT License Go Reference Github

Upvalue Life-Cycle

Upvalues are an encapsulation concept that allows for values to be enclosed in a closure function. This allows for the value in parent scoped to be changed by a function that refers to it even outside of it’s original scope.

Parsing

Parsing has the job of identifying which values link to the above scopes.

Virtual Machine

In the virtual machine, upvalues are wrapped in a broker. This allows the value to come from the stack, if it is still in the stack. If the upvalue broker is closed however, the value is on the heap and the value is stored in the broker.