lua-users home
lua-l archive

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


On 13/07/2010, at 6:35 AM, Peter Cawley wrote:

> Wherever you see "function", a closure is created. Otherwise you
> wouldn't be able to set the environment of the resulting function
> without affecting other functions.

Thanks Peter!  That makes sense (in hindsight...).  In that case, does

function f()
 return function() end
end

f(); f(); f(); f(); f()

create more heap objects than

local function g() end
function f() return g end

f(); f(); f(); f(); f()

?

Geoff