Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
-- Compose two functions where each function is
|
||||
-- a script object with a call(x) handler.
|
||||
on compose(f, g)
|
||||
script
|
||||
on call(x)
|
||||
f's call(g's call(x))
|
||||
end call
|
||||
end script
|
||||
end compose
|
||||
|
||||
script sqrt
|
||||
on call(x)
|
||||
x ^ 0.5
|
||||
end call
|
||||
end script
|
||||
|
||||
script twice
|
||||
on call(x)
|
||||
2 * x
|
||||
end call
|
||||
end script
|
||||
|
||||
compose(sqrt, twice)'s call(32)
|
||||
-- Result: 8.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue