lua-users home
lua-l archive

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

On 10/08/2011 0.41, Mike Pall wrote:
Lars Doelle wrote:
   The semantics of the composite assignment is inconsistent.

Not a bug. Assignment order is explicitly undefined in Lua:

I was about to reply to the OP saying almost the same, but I wanted to double check and browsed the manual and didn't find any mention to it.

I tried to recall where I did learn that the order of assignment and evaluation were undefined, but to no avail (I've never read the message above and its related thread before - BTW thanks for the pointer), but I'm almost sure it was a lingering information (PiL?, WIKI?).

Anyway, IMHO, a sentence about that would be an useful addition to the manual (when I was a real newbie of Lua, when I first saw the multiple assignment statement I was induced to think that a precise order of evaluation was guaranteed).


-- Lorenzo