68546f3e9f 2010-11-09 kinaba: def fib(x) 68546f3e9f 2010-11-09 kinaba: { 3ae09b8cbf 2010-11-24 kinaba: if x<2 then 1 else fib(x-1) + fib(x-2) 68546f3e9f 2010-11-09 kinaba: }; 68546f3e9f 2010-11-09 kinaba: 3ae09b8cbf 2010-11-24 kinaba: let upto = fun(n, f){ 3ae09b8cbf 2010-11-24 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);