lua-users home
lua-l archive

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


> Date: Mon, 14 Apr 2014 08:46:54 -0700
> Subject: Re: Lua 5.3 Proposal: Bring back pack()/unpack() for storing
> >>
> > Wouldn't that be like...
> > n = select('#',...)
> > v = (select(2,...))
> >
> 
> Yes, that would be the current way you do that.  I think he's saying
> he wishes for sugar. :-)

Not at all! Implemented properly, this should be much more efficient,
particularly if there are a lot of varargs and you are processing them all
in a loop with repeated select(n, ...). Also it should be more efficient
than the other common idiom of using the vararg operator in a table
constructor.