lua-users home
lua-l archive

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


Mike Pall <mikelu-1108@mike.de> writes:

> Ross Andrews wrote:
>> By "order of assignment is undefined", does it mean that the order in which
>> values are put in variables is undefined, or the order in which the
>> right-hand side is evaluated is undefined?
>
> Actually both. The parallel assignment statement only guarantees
> that all expressions on the right-hand side are evaluated *before*
> any of the assignments are made.

Well, what about left-hand evaluations?

i, a[i] = 1, 2

a[i] = (function () i = i+1 end)()

-- 
David Kastrup