Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Why is Ruby NOT tail recursive?

Reply
Thread Tools

Why is Ruby NOT tail recursive?

 
 
Laza
Guest
Posts: n/a
 
      03-01-2004
I have just been reading a chapter on how to implement tail-recursiveness
in Lisp, and it seems simple enough. Why does not Ruby do it?

Thanks,

-Laza
http://lazax.com/blog
 
Reply With Quote
 
 
 
 
Yukihiro Matsumoto
Guest
Posts: n/a
 
      03-01-2004
Hi,

In message "Why is Ruby NOT tail recursive?"
on 04/03/01, Laza <> writes:

|I have just been reading a chapter on how to implement tail-recursiveness
|in Lisp, and it seems simple enough. Why does not Ruby do it?

Just because it was too hard to implement tail recursion with the
current interpreter.

matz.


 
Reply With Quote
 
 
 
 
John Carter
Guest
Posts: n/a
 
      05-13-2004
On Mon, 1 Mar 2004, Laza wrote:

> I have just been reading a chapter on how to implement tail-recursiveness
> in Lisp, and it seems simple enough. Why does not Ruby do it?


It would be a nice to have, but on the other hand, converting a tail
recursive call to a while loop is usually a very easy refactoring to make
by hand.


John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email :
New Zealand

The universe is absolutely plastered with the dashed lines exactly one
space long.


 
Reply With Quote
 
Stephan Kämper
Guest
Posts: n/a
 
      05-13-2004
John Carter wrote:

> On Mon, 1 Mar 2004, Laza wrote:
>
>
>>I have just been reading a chapter on how to implement tail-recursiveness
>>in Lisp, and it seems simple enough. Why does not Ruby do it?

>
>
> It would be a nice to have, but on the other hand, converting a tail
> recursive call to a while loop is usually a very easy refactoring to make
> by hand.


That question might be a candidate for the FAQ, wouldn't it?
The answer is here:
http://blade.nagaokaut.ac.jp/cgi-bin...uby-talk/94033

Happy rubying

Stephan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tail Call Optimization (Tail Recursion) Terry Michaels Ruby 16 04-20-2011 11:37 AM
Why is this blowing the stack, thought it was tail-recursive... ssecorp Python 4 07-16-2008 12:44 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Ruby tail recursion Mark Ericson Ruby 16 12-19-2005 08:03 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57