From: Martin Coxall Date: 2006-10-04T05:45:51+09:00 Subject: Re: "Succinctness is Power", by Paul Graham On 3 Oct 2006, at 21:32, Mariano Kamp wrote: > > On Oct 3, 2006, at 10:22 PM, Christian Neukirchen wrote: > >>> >>> Well ... Ruby has closures and continuations, but does it have >>> the third >>> hallmark of Scheme -- efficient tail recursion? >> >> Implementation detail. But I really wish it did... > > I was always wondering what this really means? Is it just the > transformation of recursive calls at the end of a method into loops > and therefore killing the stack overhead of recursions? Yes. Scheme doesn't really have any looping constructs. Schemers do it all recursively, which forces you to think in interesting ways about problems. But if you got a stack overflow every time you looped through a large collection, it could rapidly become... annoying. However, the tail-call optimization is just that- an optimization. An implementation detail. It's not a feature of the language per se, and could be added to Ruby without needing to make a single change to the language spec. In any case, if we really cared about VM efficiency, we wouldn't be Rubyists. ;p Martin