lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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