lua-users home
lua-l archive

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


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