[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.2 #... proposal and patch.
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 2 May 2011 11:06:52 +0200
On Mon, May 2, 2011 at 10:32 AM, Benoit Germain <email@example.com> wrote:
> #... is a faux-ami, much better understood as
> local a = ...
> local n = #a
There are two dimensions to any change in a language; efficiency and elegance.
This patch optimizes a rather particular case; unless select(i,...)
were similarly optimized, then I doubt that the even most sensitive of
tests would detect any difference. Mostly, we just use table.pack(...)
which is pretty fast, and would be faster than having to resort to
Elegance: I think #... pretends that ... is a variable, which it is
not. It is shorthand for a number of unnamed parameters and
semantically behaves just like 'a1,a2,a3' etc.