|
Given the code:It prints:
f = function ()
local o = 10
return
function(x) return x+o end
end
local o = 10
g = function ()
return
function(x) return x+o end
end
print(f(),f(),g(),g())
function: 0x2196ff0 function: 0x21965f0 function: 0x2196da0 function: 0x2196da0The problem: Why f() returns different functions while g() does not?
--Rodrigo Azevedo Moreira da Silva