[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: steve donovan <steve.j.donovan@...>
- Date: Mon, 14 Apr 2014 13:33:24 +0200
On Mon, Apr 14, 2014 at 1:28 PM, John Hind <john.hind@zen.co.uk> wrote:
> It would be neat if Lua could support indexing semantics on the vararg
> operator:
>
> n = #... -- number of varargs.
> v = ...[2] -- recover vararg by index.
Yes, because there wouldn't be the C call overhead of select(). On the
minus side, yet _another_ operation baked into the VM, with possible
degradation of overall performance. With dynamic language design,
this is a slipperly slope, down which (arguably) Python and Ruby have
gone down, making them a lot harder to implement really efficiently
(cf LuaJIT with comparable Python projects)