[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [BUG] debug.getlocal does not pick up vararg
- From: Xavier Wang <weasley.wx@...>
- Date: Wed, 27 Jul 2016 14:54:57 +0800
2016-07-26 20:17 GMT+08:00 Dirk Laurie <dirk.laurie@gmail.com>:
> 2016-07-26 14:03 GMT+02:00 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
>> Here is a similar script that is easier to interpret:
>>
>> function f(a,b,...) for k=-4,4 do print(k,debug.getlocal(1,k)) end end
>> f(10,20,30,40,50)
>>
>> The output is below.
>> Your complaint is that 5.3.2 no longer shows "(*vararg)" and their values?
>
> Yes. It is totally redundant to say "Negative indices refer to vararg
> parameters; -1 is the first vararg parameter." when exactly the same
> result is returned whether or not the parameter is actually present.
>
because you doesn't really *use* the vararg, try this:
function f(a,b,...) for k=-4,4 do print(k,debug.getlocal(1,k)) end
local _ = ... end
f(10,20,30,40,50)
--
regards,
Xavier Wang.