68546f3e9f 2010-11-09 kinaba: def fib(x) 68546f3e9f 2010-11-09 kinaba: { 68546f3e9f 2010-11-09 kinaba: if( x < 2 ) { 1 } 68546f3e9f 2010-11-09 kinaba: else { fib(x-1) + fib(x-2) } 68546f3e9f 2010-11-09 kinaba: }; 68546f3e9f 2010-11-09 kinaba: 68546f3e9f 2010-11-09 kinaba: let upto = λ(n, f){ 68546f3e9f 2010-11-09 kinaba: if( n > 0 ){ upto(n-1,f) }; 68546f3e9f 2010-11-09 kinaba: f(n) 68546f3e9f 2010-11-09 kinaba: }; 68546f3e9f 2010-11-09 kinaba: 68546f3e9f 2010-11-09 kinaba: var compose = fun(f,g){ fun(x){f(g(x))} }; 68546f3e9f 2010-11-09 kinaba: var "<<" = compose; 68546f3e9f 2010-11-09 kinaba: 68546f3e9f 2010-11-09 kinaba: upto(16, print<<fib);