[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Creating closures (or not)
- From: Geoff Leyland <geoff_leyland@...>
- Date: Tue, 13 Jul 2010 06:32:28 +1200
Hi,
Does
function f()
return function() end
end
create a closure, or are closures only created if the inner function uses one of f's locals (or a local from an outer scope) as an upvalue? I'd like to know if the above causes any more heap allocations than:
local function g() end
function f() return g end
Cheers,
Geoff