- Initial support for Lua 5.4 and 5.5.
- The former lua-stdlib
strictmodule, has moved tostd.strictto avoid confusion with the original PUC-Rio strict.lua. The base module now looks for it there.
Initial release, now separated out from lua-stdlib.
Objects and Modules are no longer conflated - what you get back from a
require "std.prototype.something"is now ALWAYS a module:localobject=require"std.prototype.object"assert (object.type (object) =="Module")
And the modules that provide objects have a new
prototypefield that contains the prototye for that kind of object:localObject=object.prototypeassert (object.type (Object) =="Object")
For backwards compatibility, if you call the module with a constructor table, the previous recommended way to disambiguate between a module and the object it prototyped, that table is passed through to the module's object prototype.
Now that we have proper separation of concerns between module tables and object prototype tables, the central
std.prototype.object.mapfieldsinstantiation function is much cleaner and faster.We used to have an object module method,
std.object.type, which often got imported using:localprototype=require"std.object".type
So we renamed it to
std.object.prototypeto avoid a name clash with thetypesymbol, and subsequently deprecated the earlier equivalenttypemethod; but that was a mistake, because core Lua providestype, andio.type(and in recent releases,math.type). So now, for orthogonality with core Lua, we're going back to usingstd.prototype.object.type, because that just makes more sense. Sorry!
You can now derive other types from
std.prototype.setby passing a_typefield in the init argument, just like the other table argument objects.In-order iteration with
__pairsmetamethod has been reinstated. There were no spec examples, and the implementation mysteriously went missing in a previous round of refactoring.
Deprecated methods and functions have all been removed.
std.treeis nowstd.prototype.trieand defines a Trie object, not a Tree object. The implementation has been a Radix Tree (aka Trie) all along.Objects no longer honor mangling and stripping
_functionstables from objects during instantiation, instead move your actual object into the moduleprototypefield, and add the module functions to
the parent table returned when the module is required.