[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __index returns truncated to one, why?
- From: Javier Guerra Giraldez <javier@...>
- Date: Thu, 10 Apr 2014 12:26:43 -0500
On Thu, Apr 10, 2014 at 11:41 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> And that's exactly the point - even experienced users of the language
> would not know what to expect, because there _could_ be a magic
> metamethod.
>
> -1 for this one, it really causes confusion.
IMHO, all this is because there's no real tuple value type, and we're
treating the varargs '...' and multiple return values as some "almost
a tuple" thing. but it's not the same thing.
a real tuple type, with destructuring assingments, would solve all
this in a simple and transparent way. but replacing varargs with a
tuple or list, and multiple return values with returning a tuple just
to be immediately destructured might have a serious performance
impact, likely from a huge increase in object allocation (except if
you're using LuaJIT and Mike's magic banishes all those temporary
objects from existence)
--
Javier
- 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
- Re: __index returns truncated to one, why?, Duncan Cross
- Re: __index returns truncated to one, why?, Sean Conner
- Re: __index returns truncated to one, why?, Thiago L.
- Re: __index returns truncated to one, why?, steve donovan