lua-users home
lua-l archive

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


> Because the scope of "local yyy" doesn't begin until the next statement. 
> Makes things like this possible:
> 
> local temp = a + b
> local temp = temp * 2
> 
> Where as if they were the same the second line would throw a arithmetic on 
> nil error. (or even worse, that position may be entirely uninitialized).

And even the common idiom such as
	local print = print

The "print" on the right-hand side is the global one.