[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: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 27 Jul 2016 14:14:38 -0300
> > 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