[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] LuaMacro 2 - a lexical macro preprocessor for Lua
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 2 May 2011 15:13:34 +0200
On Mon, May 2, 2011 at 3:04 PM, Krunal Rao <krunal.rao78@gmail.com> 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
happen.
steve d.