lunar_wave/test_vectors/closure.lua

16 lines
179 B
Lua
Raw Normal View History

local function make_closure ()
local x = 5
print "B"
return function ()
print "D"
return x
end
end
print "A"
local f = make_closure ()
print "C"
print (f ())
print "E"