[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua5.0 new "For" question
- From: "Peter Hill" <corwin@...>
- Date: Mon, 23 Dec 2002 08:00:22 -0000
> One way to get original lua 4 behaviour was
> local x=123
> local x = x
> f = function() return %x end
> x = 456
> print (f())
> Now this gives 123 with both lua 4 and 5 ...
Hmm. Something I don't understand here.
If I type in the above I get "nil" not "123". But if I wrap it in an extra
"do ... end" it works.
local x = x
f = function() return %x end
x = 456
That doesn't make sense to me.
I type the original one in again (redfining "f" once more) and now I get
"456". What's going on here? =:O