lua-users home
lua-l archive

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


On Thu, Apr 10, 2014 at 8:41 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> Suppose that the notation tbl[i,j,k] meant tbl[i],tbl[j],tbl[k], not
> as a syntactic sugar, but as genuine multiple indexing overridable
> by metamethods.

It's a cool idea - I should say, it's still a cool idea since there
has been at least one thread about it before:

http://lua-users.org/lists/lua-l/2010-10/msg00761.html

People were rather concerned about efficiency at the time - you do not
want to slow the language down for an occaisional convenience

Also, it makes particular sense when overridden by extended
metamethods, but what precisely does it mean in their absence?  That
tbl[i,j] is tbl[i][j]?  That's what I would expect from my old Fortran
days....