[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Lua 5.3 Proposal: Bring back pack()/unpack() for storing
- From: "John Hind" <john.hind@...>
- Date: Mon, 14 Apr 2014 17:54:24 +0100
> 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.