lua-users home
lua-l archive

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


I'm not sure I see how any of those things are problems, particularly since it's just syntactic sugar for things you can already do and would still be even if I were suggesting that assignments become expressions (which I'm not), though I could point out that of other languages in the same family, Python has operate-and-assign as statements (but not expressions), and ECMAScript has them as expressions, and I don't think either has suffered from having them.

I think whatever problems those may be are less severe than any of the current alternatives to writing code like:

players[players].stats.kills.byWeaponType[weapon] += 1

.... which, given the current operators, requires either defining extra locals for what should be very simple operation, or putting a lengthy _expression_ on both sides of the assignment.

On Fri, Jul 30, 2010 at 1:47 AM, Pázmándi Attila <ejjeliorjarat@gmail.com> wrote:
It would be very good if the standard Lua interpreter would contain these operators, but I don't think it will be added. Check this: http://article.gmane.org/gmane.comp.lang.lua.general/38535/match=operator