lua-users home
lua-l archive

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


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?

Here's why I'm asking: if it's the latter, then this:

a, b = 1, 2

Could mean either:

a = 1
b = 2

or

b = 2
a = 1

Which means that this:

os.execute_without_echo, os.execute = os.execute, os.execute_with_echo

Will either work or not, arbitrarily (it does seem to work in 5.1.4).

On Tue, Aug 9, 2011 at 6:04 PM, Javier Guerra Giraldez <javier@guerrag.com> wrote:
On Tue, Aug 9, 2011 at 5:58 PM, HyperHacker <hyperhacker@gmail.com> wrote:
> Given this and that Lua
> seems to be a stack-based language

it's not.

(on the current topic, I obviously agree with everybody that order of
assignment is undefined behavior, so can't be a bug)

--
Javier