lua-users home
lua-l archive

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


Following codes:

function a()
local s = 0
local function b()
s = s + 1
print(s)
end
local function c()
s = s + 2
print(s)
end
return b,c
end

local b,c = a()
b()--output:1
c()--output:3

In these closures b and c, method lua_pushcclosure is invalid and cannot
be used.