[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [UNANTICIPATED SIDE EFFECT] debug.getlocal does not pick up vararg (Was: [BUG]
- From: Xavier Wang <weasley.wx@...>
- Date: Thu, 28 Jul 2016 10:22:19 +0800
2016-07-28 1:14 GMT+08:00 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
>> > 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)
>>
>> Thanks to this insight of yours, I have changed the subject line.
>
> We changed that because main chunks are always vararg, but seldom use
> varargs. But main chunks also are seldom called multiple times, so maybe
> optimizing their calls is not relevant, after all.
>
> -- Roberto
>
So best way is to document it? I just think this optimize somewhat
real reasonable.
--
regards,
Xavier Wang.