Artifact 8a19e45bd42355a9a6f710eb288eec0bb198e457
- File
sample/fib.pmy
- 2010-11-09 15:19:20 - part of checkin [68546f3e9f] on branch trunk - several samples (user: kinaba) [annotate]
def fib(x)
{
if( x < 2 ) { 1 }
else { fib(x-1) + fib(x-2) }
};
let upto = λ(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);