[comp.lang.scheme] Tail recursion

plogan@mentorg.com (Patrick Logan) (02/18/91)

 >Date: 15 Feb 91 17:20:42 GMT
 >From: david carlton <carlton@husc10.harvard.edu>
 >
 >In article <harlan.666514120@copper> harlan@copper.ucs.indiana.edu (Pete Harlan) writes:
 >   Certainly a compiler for any language may perform tail-call
 >   optimization, and in this respect it is a language-independent issue.
 >
 >   However, when a *language*, rather than a compiler, guarantees an
 >   optimization, it opens the door for a programming style that might not
 >   be a portable program in the language if the optimization were not
 >   guaranteed.
 >
 >really?  the scheme semantics doesn't mention tail recursion anywhere
 >that i can tell, which would seem to imply that optimizing it out
 >doesn't change the actual meaning of a program.

Not implementing proper tail recursion does not change the semantics
of a program. But some programs that will run in an implementation
with proper tail recursion may not run in one without it. This is
especially a problem since it is common to implement loop control
structures using procedure calls.

I don't have the final IEEE standard, so I won't risk of mentioning
anything about requirements.

 >
 >david carlton
 >carlton@husc9.harvard.edu
 >
-- 
Patrick Logan, uunet!mntgfx!patrick_logan -or- patrick_logan@mentorg.com
Mentor Graphics Corp. 8500 SW Creekside, Beaverton, Oregon 97005-7191
=> Note that I have a new email address listed above!