You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
registerFns is equivalent to luaL_register. This function does exist in Lua 5.2 and 5.3, but only with the compatibility module defined.
From Lua 5.2 and on, the replacement function is luaL_newlib.
The semantics of the functions are different though. The register function can optionally assign all of the functions to a name that is then registered in the global package table.
The newlib function only adds the functions to a table. It is the programmers job to do something with that table.
I'm not sure what should be done here. Because this is all in the "auxiliary" library, we could in theory introduce our own function that provides the same behavior to all versions of Lua.
Oh, I didn't realize that. Actually I was using registerFns to do luaL_setfuncs. This is for registrating userdata object methods into the metatable. So that's the registerFns case where libname is null.
I guess adding an implementation of setFuncs from lib54.zig would be a good choice for Luau.
I just realized this is at least partially resolved as of #54.
I just tested and setFuncs now works fine in all versions of Lua. newLib does not work yet, but it is an easy fix if that is the case.
Now that all the lib files are combined I'm going to spend some time polishing the docs. #25 I'll take another look at this when I do a pass on the registration functions and see if there is anything more to be done here
what the title says
The text was updated successfully, but these errors were encountered: