[ create a new paste ] login | about

Link: http://codepad.org/uenukS80    [ raw code | output | fork ]

Lua, pasted on Jun 4:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function a(x)
	local b = x
	local c = function()
		print(b)
	end
	return c
end

t1 = a(1)
t2 = a(2)
t3 = a(3)

t3()
t2()
t1()


Output:
1
2
3
3
2
1


Create a new paste based on this one


Comments: