lua-users home
lua-l archive

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

On Mon, May 2, 2011 at 3:04 PM, Krunal Rao <> wrote:
> Actually, even for tables (I tested only the case where they contained
> just matrix
> entries) LuaJIT optimize away the temporary in my simple benchmarks using the
> m[i][j] syntax.

That is very interesting - so then m[i][j] versus m[i,j] becomes a
'prettiness' thing ;)

Personally I prefer m[i][j] because it is consistent and clear.

m[i,j] would make sense if __index took an arbitrary number of 'keys'
but there are probably very good performance reasons why this will not

steve d.