From: David Masover Date: 2009-10-02T02:57:55+09:00 Subject: Re: SystemStackError: stack level too deep > how make it deeper? On Thursday 01 October 2009 05:05:13 am Simon Krahnke wrote: > * Tony Arcieri (05:25) schrieb: > > [Note: parts of this message were removed to make it a legal post.] > > > > On Wed, Sep 30, 2009 at 1:55 PM, Jason Roelofs wrote: > >> Rewrite it to not be recursive. > > > > That advice is about as useful as "Rewrite it in a language other than > > Ruby" Somehow, I think rewriting a tail-recursive algorithm to not be tail-recursive is much, much faster than translating the algorithm to another language, especially if it's part of a larger program. It is a bit like, when you go from C to Ruby, you learn to use each loops instead of for loops. An argument could be made that tail-recursion isn't idiomatic Ruby. > But it's the only answer there is. Unrecognized tail recursion will kill > every stack. Technically, it's not -- Ruby _can_ do tail recursion. It's just not trivial to turn on, not portable, and I believe disables some debugging features.