lua-users home
lua-l archive

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


> 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