|
Lua 5.0 beta does produce 1 2 12with the code below. Of course earlier versions of Lua will complain in various ways since they lack lexical scoping.
Fancy stuff. Russ On Monday, April 7, 2003, at 12:25 PM, RLake@oxfam.org.uk wrote:
Russell: cut and pasted Lua 5.0 Copyright (C) 1994-2003 Tecgraf, PUC-Riofunction outer()local x = 0 function inner() x = x + 1 print(x) end inner() -- should print "1" return inner endx = 12 f = outer()1f() -- what does this do? runtime error?2print(x) -- I assume this prints "12"12