|
function make_counter()local x = 1return function() x = x + 1; return x; endend
function read()return xendfunction write()x = 1endSince neither of these have any declarations, I would hope that they would behave the same way with respect to the x variable -- either both local (which makes read() an error) or both global, but in a language with "nonlocal" then read() is global while write() is local.
_______________________________________________ lua-l mailing list -- lua-l@lists.lua.org To unsubscribe send an email to lua-l-leave@lists.lua.org