From: Mikael Brockman Date: 2004-07-07T02:48:06+09:00 Subject: Re: Functional Ruby (Re: Why I don't use Ruby.) Joel VanderWerf writes: > Mikael Brockman wrote: >> In Scheme, sum would be: >> (define (sum xs) >> (if (null? xs) >> 0 >> (+ (car xs) (sum (cdr xs))))) > > Ruby doesn't optimize this tail recursion, but Scheme does. That's one > way Scheme could be said to be more "functional". There's no tail recursion in that function, but you have a point. TCO would be nice, but it's easy to perform the optimization manually. mikael