Artifact 5b2c3c452aca5b18dd794ec5224325774e804146
- File
sample/fib.pmy
- 2010-11-24 12:14:00 - part of checkin [3ae09b8cbf] on branch trunk - changed if-then-else syntax (user: kinaba) [annotate]
def fib(x) { if x<2 then 1 else fib(x-1) + fib(x-2) }; let upto = fun(n, f){ if n > 0: upto(n-1,f); f(n) }; var compose = fun(f,g){ fun(x){f(g(x))} }; var "<<" = compose; upto(16, print<<fib);