lua-users home
lua-l archive

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


I'm planning to translate the code like that:

m[i, j]         => __index(m, i, j)
m[i, j] = v    => __newindex(m, i, j, v)

Beware that translating multiple assignments might be trickier than it seems, if right-hand-side terms and/or __newindex methods have side effects:

foo, bar[i,j], bar[k,l] = f1(), f2()