lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> 	Recently I've experimented adapting code of some libraries to
> work with all Lua 5.X versions and it was much less work than I expected.

For my C libraries, the work was very little. Here is a typicall example:

<  luaL_getmetatable(L,MYTYPE);
<  lua_setmetatable(L,-2);
>  luaL_setmetatable(L,MYTYPE);

<  lua_setglobal(L,MYNAME);
<  luaL_register(L,MYNAME,R);
>  luaL_setfuncs(L,R,0);

< require"random"
> local random=require"random"