[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Porting some Tilde Lua enhancements to LuaJIT and Lua 5.2
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 6 Jan 2012 13:16:42 -0200
> The Tilde debugger [1] adds the following code to ldebug.c:
>
> LUA_API int lua_getvararg (lua_State *L, const lua_Debug *ar, int n) {
> [...]
>
> I haven't made an attempt yet to port to Lua 5.2.
I guess Lua 5.2 already supports what you want:
http://www.lua.org/manual/5.2/manual.html#lua_getlocal
http://www.lua.org/manual/5.2/manual.html#pdf-debug.getlocal
The first parameter or local variable has index 1, and so on, until
the last active variable. Negative indices refer to vararg parameters;
-1 is the first vararg parameter
-- Roberto