lua-users home
lua-l archive

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


I'm not interested in taking sides on this, just plugging the lua-l archive :-).

After spending a while on this list, you notice that some issues come up repeatedly. As Rici points out there are subtle issues with optimizing the "+=" expressions. The Lua authors have already considered and commented on adding such expressions to Lua. Just go to the lua-l archive and type += in the search box.

If you are trying to make a convincing argument to the list, it can't hurt to check the archives for past discussions. It may save everyone some energy, or make your argument more effective. (Dynamic module thread take note!)

-John



Josh Jensen wrote:
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.



--
OpenPGP encrypted mail welcome.