From: Ceri Storey Date: 2004-05-15T06:44:13+09:00 Subject: Re: Recursion depth On Sat, May 15, 2004 at 05:20:14AM +0900, Kevin Bullock wrote: > Why is it that guile can handle such recursion but Ruby can't? Is it > that guile is implemented with iterative recursion in mind, and so > optimizes for it better? In scheme, iteration is almost always defined as tail-recursion. Ergo, the interpreter / compiler must be able to transform tail-calls into a goto-like statement, so instead of pushing a new stack frame and then calling the function, the current stack frame is replaced with that of the called function. Sadly, ruby currently doesn't implement this, although I'd expect it'd be one of those features ear-marked for the RITE VM. -- Ceri Storey