[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Forward declarations in modules
- From: Sam Roberts <sroberts@...>
- Date: Thu, 7 Sep 2006 17:10:17 -0700
On Fri, Sep 08, 2006 at 09:57:20AM +1000, Nick Gammon wrote:
> Yes I see what is happening, but the surprising thing is that local
> variables behave so much differently to other types of variables.
Surprise depends on your expectations, and that depends more on you
than lua!
Anyhow, the docs are pretty clear:
Notice that each execution of a local statement defines new local
variables.
- http://www.lua.org/manual/5.1/manual.html#2.6
The example shows multiple local variables being created with the same
name. Example does this with a for loop, and your example unrolls the
loop into consecutive local statements, but its the same thing
happening.
Cheers,
Sam