--- Mirian Crzig Lennox <mirian / cosmic.com> wrote:
> Greetings, Ruby hackers!
> 
> I have a small implementation question: does Ruby support tail
> recursion optimisation a la Scheme?  e.g, if I write the following:
> 
> 	  def factorial x
> 	    fail if x < 1
> 	    (x == 1) ? x : x * factorial(x - 1)
> 	  end
> 
> Am I going to get at most one stack frame or zillions?

zillions, depending on x, I believe.

=====
--

Yahoo IM: michael_s_campbell

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/