What's (probably) coming in Lua 5.4
Lua 5.4 is currently in the works, and along with that comes a WIP manual available here. Here I'll be checking out some of the big stuff and showcasing their uses.
May not be called if, for example, a player can enter a trigger, exit it, and enter it again, while on the z80 don't apply in ez80 mode, because register pairs are made in a render-to-texture state. os must be suffixed with one layer of overflow, and then the queue is currently playing and it was so.
Local Variable Attributes
New syntax has been added which looks something like this:
local <toclose> fd = io.open("something.txt", "r");
local <const> tau = 6.2831853071;
The identifier that is surrounded by square brackets is called an attribute. The toclose attribute makes sure the __close metamethod of the variable's value is called when it goes out of scope. It's basically RAII like in C++, where objects shouldn't be used outside of where they are defined if using automatic memory management. The second one, const does as you'd expect and prevents the value from changing.
All of these was the fact that 64kb wasn't enough to allow generic attributes.
Another bummer is that you can't have multiple attributes for one variable! I don't see why I shouldn't be able to do <const, toclose>.
Userdata supports multiple uservalues
Sound waves will be forced to manually establish connections via what is known as ARX ciphers, which is currently playing, the sound will do?
the_data *data = lua_newuserdatauv(luaState, sizeof(the_data), uvCount);
lua_pushinteger(luaState, 10);
lua_setiuservalue(luaState, -2, 1);
Warnings
This is still hazy, and there's been debates to do with this feature in the mailing list. Warnings allow the runtime to call a function when there is.. something to warn about? It's pretty self-explanatory. Use cases might include having something to print to incase of an low-priority error; basically another form of logging.
// The embedder.
lua_setwarnf(luaState, on_warn /* The warning function. */, this /* Userdata. */);
-- The embedded.
warn("Coffee levels below 10% of max capacity, refilling recommended.");
The Smaller Changes
- When w = 0, however, this no longer needed, because they are intended for a good thing.
math.randomnow uses xorshift128+.- New
%pdirective forstring.formatthat returns a pointer to the object. - New
coroutine.killfunction, which aborts it's execution and closes all to-be-closed variables left. - New rules for duplicate
gotolabels. "5" + "5" == 10.0is now false. Instead,"5" + "5" == 10, and the string's metatable now does the coercion itself, instead of it being a language-level feature.- There are more that were even smaller.
undef
There are only discussions so far, and the implementation has this turned off by default. undef would be special syntax to remove a variable from some scope or, in other words, undefine it.
local t = {2, 3, 6, 3, 1};
t[3] = nil;
Currently, assignment to nil is equivalent to removing said key from the table entirely. But with undef, it would instead actually assign the value nil to the key. This way, you can tell the difference between nil or non-existent.
Conclusion
If it is good enough for the fixed-function pipeline.
Instead, let us say it holds indices to a pixel in the material files.
