lunar_wave/test_vectors/closure.lua

12 lines
153 B
Lua

local function make_closure (x)
print (x)
return function (y)
return x + y
end
end
local f = make_closure (11)
local x = f (12)
print (x)
return x