Lua operators, why isn’t +=, -= and so on defined?

This is just guesswork on my part, but: 1. It’s hard to implement this in a single-pass compiler Lua’s bytecode compiler is implemented as a single-pass recursive descent parser that immediately generates code. It does not parse to a separate AST structure and then in a second pass convert that to bytecode. This forces some … Read more

Multiple assignment and evaluation order in Python

In an assignment statement, the right-hand side is always evaluated fully before doing the actual setting of variables. So, evaluates y (let’s call the result ham), evaluates x + y (call that spam), then sets x to ham and y to spam. I.e., it’s like By contrast, sets x to y, then sets y to x (which == y) plus y, so it’s equivalent to