lua-users home
lua-l archive

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


>I stumbled accross something I couldn't find an anwer to in the Lua
>manual. How is the bahavior of multiple assignments to the same
>variable defined, e.g.
>a,a = 1,2
>or
>t[1],t[1] = 1,2
>From tests, it seems like the values are assigned from right to left,
>overwriting the previous values (so a and t[1] is 1). However, since
>this is not described in the manuals, I fear that this behavior might
>not be stable. Or maybe someone can hint me where this behavior is
>described if I overlooked it.

http://www.lua.org/manual/5.1/manual.html#2.4.3