lua-users home
lua-l archive

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


> to my way of thinking "local a=b" and "local a; a=b"
> should always be equivalent.

Consider "local a=a". This would be useless in your interpretation but it's
actually a nice idiom for copying global or outer variables to local variables.

So, in "local a,b,c= A,B,C", the scope of a,b,c starts only after "C"
not after "=".

In other words, in the current interpretation you can implement what you want,
but not vice-versa. So Lua opts for flexibility in this case.
--lhf