call.
- this means that nested calls which use Lua in unrelated, black boxed
ways (and so don't pass around an *L) don't share a stack; when you
Get a new state, you're guaranteed an empty stack, and like function
dispatches, you can use absolute stack indexes starting from 1
- we don't have to track stack counts to sanity check it; it always starts
at 0, so just check that the stack is empty again on Release
- we maintain a pool of states, so Get() is still fast; we typically create
only a couple states
LoadingScreen is a variable that should be available to all loading
definitions. Param does this currently, but I'm redesigning that, and this
particular case doesn't fit. Conceptually, it really is a global (though
perhaps should be tucked away with an environment or something).
function f = cmd(a,b;c,d)
is equivalent to
function f = function(self, ...) self:a(b); self:c(d); end
This is equivalent to LuaHelpers::ParseCommandList, except:
- Commands are not lowercased. Do that yourself.
- The "parent" parameter is not included. Use self:GetParent().
- "+5" is not valid.
The benefits are:
- Better syntax checking. Running "luac" on the Lua files will do syntax
checking, and runtime syntax checks will find problems earlier.
- Easier optimization. Lua files can be compiled, and when using commands
this way, commands will be precompiled, too.
- Commands are compiled in the same scope, so upvalues work:
local foo = 10; y = cmd(x,foo);