Re: Extend debug.getlocal() to get varargs.

  • From: 云风 <cloudwu@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 20 Sep 2012 10:28:03 +0800

Thanks Mike :) Could you support "nparams" and "isvararg" in debug.getinfo ?
So that we can get the function's param name by debug.getlocal. It's
useful for meta programming.

2012/9/19 Mike Pall <mike-1209@xxxxxxxxxx>:
> Scott Lembcke wrote:
>> Lua 5.2 extended debug.getlocal() with the ability to get vararg
>> parameters using negative indices.
>
> I've just added this extension to LuaJIT git HEAD.
>
> Ditto for the change in Lua 5.2 where debug.getlocal() accepts a
> Lua function instead of a level and returns the parameter names.
> On the C side this corresponds to lua_getlocal(L, NULL, n) with
> the Lua function on top of the Lua stack.
>
> --Mike
>



-- 
http://blog.codingnow.com

Other related posts: