Anonymous user
Y combinator: Difference between revisions
m
→{{header|Tailspin}}: syntax update
m (→{{header|Tailspin}}: syntax update) |
|||
Line 4,727:
// YCombinator is not needed since tailspin supports recursion readily, but this demonstrates passing functions as parameters
templates combinator
templates makeStep
$ -> stepper
end makeStep
$ -> makeStep
end combinator
templates factorial
templates seed
<=0> 1 !
<>
$ * ($ - 1 -> next) !
end seed
$ -> combinator
end factorial
Line 4,747:
templates fibonacci
templates seed
<..1> $ !
<>
($ - 2 -> next) + ($ - 1 -> next) !
end seed
$ -> combinator
end fibonacci
|