Path: utzoo!utgpu!attcan!uunet!husc6!bbn!uwmcsd1!ig!agate!eos!riacs!turing.arc.nasa.gov!nienart From: nienart@turing.arc.nasa.gov (john nienart) Newsgroups: comp.lang.lisp,comp.sys.ti.explorer Subject: Re: Tail Recursion Optimization Summary: Explorer doesn't stand alone. Keywords: TI CL, Sun CL Message-ID: <864@hydra.riacs.edu> Date: 12 Aug 88 18:15:48 GMT References: <12198@duke.cs.duke.edu> Sender: uucp@riacs.edu Reply-To: nienart@turing.arc.nasa.gov.UUCP (john nienart) Distribution: na Organization: NASA Ames Research Center Lines: 27 In article <12198@duke.cs.duke.edu> mps@duke.UUCP () writes: >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! [...] >Can anyone explain the reason for this? Are there other lisp compilers >out there that do not treat tail recursion iteratively? > > Michael P. Smith If I remember the Explorer correctly (I've been on Symbolics exclusively for 3 years now), I believe that there is a documented flag that you can set to make the compiler properly remove tail-recursion. I believe that the justification for the default behavior was that it improved debugging, because in the case of an infinite loop you could immediately see which function was the culprit. The Symbolics doesn't remove tail-recursion either, for the same reason, and there's no flag. --John John Nienart NASA Ames Research Center Internet: nienart@turing.arc.nasa.gov