lua-users home
lua-l archive

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

On 15.08.19 08:59, Michal Kottman wrote:
> See "Compound Assignment Operators (5.2)"
> in to try it out.

These patche demonstrate that it would be possible to have += operator in lua
and that there are others also needing this.

But I still do not understand why this is not included in official lua, since
this is a useful standard feature known from many languages that does IMHO fit
into the lua way of programming, especially because it does not hide assignment
in larger expressions like ++ operator would do. IMHO += is useful for a larger
range of application types that are typical use cases for scripting languages,
e.g. adhoc-quick-and-easy statistical analysis of large data files (log files,
tcpdump etc). Whereas features like <close> are IMHO nice to have features but
are not so often used in typical fire-and-forget scripting use cases, they are
IMHO more frequently used in larger applications that are running a longer time,
e.g. servers. But as I said, all this depends on the type of application, I bet
there are many type of applications where += would seldom be useful.

-- Oliver