lua-users home
lua-l archive

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


> Using local with assignment is 
> syntactic sugar for a local declaration followed by an assignment. 

Not really.
	local a=a+1
creates a new local named "a" whose initial value is 1 plus the value of
the global "a" (or a local "a" declared before).

The point is that in "local a=<expression>", the scope of the (new) name
"a" only begins after the expression.
--lhf