[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Compatibility with Lua 5.X
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 28 Feb 2012 13:40:49 -0300
> 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"