function myAdd(x, y)
return x + y
end
function myMul(x, y)
return x * y
end
local x, y = 20, 10
func = myAdd; local a = func(x, y)
func = myMul; local b = func(x, y)
print("myAdd : " .. a)
print("myMul : " .. b)
키워드 : anonymous function
Saturday, May 12, 2012
Lua의 function는 pointer 값처럼 사용 가능
Labels:
Lua
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment