Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!lll-winken!lll-tis!ames!ncar!boulder!sunybcs!rutgers!mcnc!duke!romeo!mps
From: mps@romeo.cs.duke.edu (Michael P. Smith)
Newsgroups: comp.lang.lisp,comp.sys.ti.explorer
Subject: Tail Recursion Optimization
Keywords: TI CL, Sun CL
Message-ID: <12198@duke.cs.duke.edu>
Date: 12 Aug 88 03:04:05 GMT
Article-I.D.: duke.12198
Sender: news@duke.cs.duke.edu
Reply-To: mps@duke.UUCP ()
Distribution: na
Organization: Duke University CS Dept.; Durham, NC
Lines: 13

I made a discovery recently I found shocking: TI Common Lisp on the
Explorer does not properly treat tail recursion.  In fact, the
tail-recursive factorial ran out of push-down list (control stack)
before the naive-recursive version did! 

When I compiled and disassembled versions of the fibonacci function, the
tail-recursive and do-loop versions were virtually indistinguishable in
Sun Common Lisp, but the compiled and disassembled tail-recursive version
under TICL still had the recursive call.

Can anyone explain the reason for this?  Are there other lisp compilers
out there that do not treat tail recursion iteratively?

			Michael P. Smith