lua-users home
lua-l archive

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


Russell: cut and pasted

Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
> function outer()
>>      local x = 0
>>      function inner()
>>              x = x + 1
>>              print(x)
>>      end
>>      inner() -- should print "1"
>>      return inner
>> end
>
> x = 12
> f = outer()
1
> f() -- what does this do?  runtime error?
2
> print(x) -- I assume this prints "12"
12