From: Jakub Hegenbart Date: 2005-12-17T07:28:53+09:00 Subject: Re: Ruby tail recursion Collins wrote: > I wouldn't really call it optimization (although I guess it is), it's more like implementing them in such a way that you get around the limitations of computer memory. (As opposed to just making them run faster or something.) It doesn't really have anything to do with efficiency in that sense. > Well, what about this, for example? http://big-oh.cs.hamilton.edu/~bailey/pubs/techreps/TR-2001-2.pdf Tail calls are essentialy safe GOTOs with argument passing, there is a potential for performance gain. ;-) But in Ruby, its benefits wouldn't be that noticeable, I guess...I kind of don't think that the programming style that Ruby encourages is a good candidate for tail call optimization. :-D That doesn't mean that a (fictional) Ruby implementation compiling to native code couldn't take advantage of some tail-call optimizable intermediate form, but the current implementation IMO doesn't need it. Jakub