[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: upvalues
- From: Luiz Carlos de Castro Silveira Filho <luiz@...>
- Date: Thu, 7 Dec 2000 18:24:01 -0300
Hi
Why can't we use something like this in Lua ?
local a = 1
function b()
local c = function()
print(%%a)
end
end
It is surely strange, but by the upvalues definition (the constant value of
a variable in the moment the function was defined (right??)) shouldn't
constructions like this be possible ?
... or function c only gets defined when we call b ?
couldn't lua handle this automatically ?:
local a = 1
function b()
local a = %a
local c = function()
print(%a)
end
end