[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __index returns truncated to one, why?
- From: Duncan Cross <duncan.cross@...>
- Date: Thu, 10 Apr 2014 13:11:26 +0100
On Thu, Apr 10, 2014 at 12:33 PM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> On Thu, Apr 10, 2014 at 1:03 PM, Dirk Zoller <duz@sol-3.de> wrote:
>> Is there is a good technical reason for this truncation?
>
> It is in a very important part of the VM, and any extra work at this
> point is going to slow the usual case down. (By how much, I don't
> know.)
I just realised this could be another case for my old suggestion [1]
about '...' as a suffix operator which means, explicitly, "do not
truncate this list of values". My original suggestion was for function
call arguments, so:
func(a()..., b, c)
...would not truncate the return values of a(), as it normally would.
But another case could be for this case, so:
local a, b, c = t[1]...
...would be similarly explicit in its expansion of __index() return values.
Anyway, just an idea.
[1] http://lua-users.org/lists/lua-l/2009-08/msg00242.html
-Duncan
- References:
- __index returns truncated to one, why?, duz
- Re: __index returns truncated to one, why?, Dirk Laurie
- Re: __index returns truncated to one, why?, Andrew Starks
- Re: __index returns truncated to one, why?, steve donovan
- Re: __index returns truncated to one, why?, Dirk Zoller
- Re: __index returns truncated to one, why?, steve donovan