[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.3 Proposal: Bring back pack()/unpack() for storing varargs
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 14 Apr 2014 07:33:43 +0200
On Mon, Apr 14, 2014 at 3:34 AM, Coroutines <coroutines@gmail.com> wrote:
> I'd like to see pack()/unpack() added back for compressing a number of
> objects on the stack into a userdata and "unpacking" them to where a
> vararg might be expected.
Ah, but Lua never had pack()/unpack() like you describe - they were
just put into the table namespace.
That is, pack makes a table from varargs.
Are you thinking of the pack defined in that varargs library?
I can't see how existing pack can be made more efficient - the varargs
need to be stored, and a table is a natural container for them.