lua-users home
lua-l archive

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


> 2) += and -= operators
>Vote: NO

I vote yes.  This is actually a huge thorn, IMO, and makes scripts much
more verbose than they need to be:

Table1.table2.table3.table4.value += 1

OR:

Table1.table2.table3.table4.value = Table1.table2.table3.table4.value +
1

OR:

local tempTable = Table1.table2.table3.table4
tempTable.value = tempTable.value + 1

I choose the first one.  Additionally, the first one allows the Lua VM
to make certain optimizations that make it WAY faster than #2 and even
faster than #3.

-Josh