From: Class Account
Subject: Number of recursion
Date: 
Message-ID: <23518@pasteur.Berkeley.EDU>
I am wondering how deep a Lisp recursive function should go.  What are the 
usual recursion depth most lisp implementation have?

I am writing a Common Lisp interpretor in C.  The run time stack size for the
interpretor is about 16k, and the depth of the Lisp recursive function call
is about 60.  Is it enough for most casual use of Lisp?  Are there ways to
improve the recursive depth besides increasing the run time stack?


-William
From: Class Account
Subject: Re: Number of recursion
Date: 
Message-ID: <23541@pasteur.Berkeley.EDU>
I thank many of you who sent email to me.  I really appreciate your suggestion.

I guess I didn't make myself clear.  The 16K stack is the C run-time stack.
60 levels is the number I get when I do the following:

(defun fact (n)
	(if (zerop n)
	    1
	    (* n (fact (1- n)))))

(fact 60) is the max number the interpreter would take.  I know where my
problem is now.  I am using, in a lazy way, the C recursive function call to
implement the Lisp recursive call, which exhausts the C run-time stack pretty
quick.

-William