16 lines
276 B
Text
16 lines
276 B
Text
funcA = function(x)
|
|
return x * 10
|
|
end function
|
|
|
|
funcB = function(x)
|
|
return x + 5
|
|
end function
|
|
|
|
compose = function(f, g)
|
|
return function(x)
|
|
return f(g(x))
|
|
end function
|
|
end function
|
|
|
|
f = compose(@funcA, @funcB)
|
|
print f(3) // should be equal to (3+5)*10
|