lua-users home
lua-l archive

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

On Mon, May 10, 2010 at 2:26 AM, Juris Kalnins <> wrote:
>> Could x[] be syntactic sugar for x[#x+1] ?  ...
> Actually, it would be more powerful to have [] operator take arbitrary
> number of values, just like () does.

With these extensions, "t[f()] = 1" might have different meanings
depending on whether f() returns 0, 1, or > 1 values.

The existing ways to express matrix get/set syntax in Lua [1-2] are
either less efficient or less clean than m[a,b]=c .  Even with good
syntax, questions of efficiency remain though [3].

     "help to (slightly) modify Lua interpreter"
     "How do I get two dimensional array access notation for my
(matrix) userdata?"
     "matrix operations and temporary objects?"