Subject: Re: eval in tail-recursion position
From: (Rob Warnock)
Date: 1999/08/04
Newsgroups: comp.lang.scheme
Message-ID: <7o9101$>
<enoll@CSTP.UMKC.EDU> wrote:
| If there is a way for me to find the answer to this question for myself, 
| feel free to point me in that direction and I will appreciate it.....

Since it was easy enough to cut&paste, I went ahead and answered it
(see below), but the referenced document will be useful in the future...

| If eval appears in a tail-recursive location, will Scheme recurse or will it
| iterate?  In other words, will the existing environment be preserved for 
| execution after the eval completes or will it go away?

	R5RS Section 3.5 "Proper Tail Recursion"
	Certain built-in procedures are also required to perform tail
	calls. The first argument passed to apply and to call-with-
	current-continuation, and the second argument passed to
	call-with-values, must be called via a tail call. Similarly,
	eval must evaluate its argument as if it were in tail position
	within the eval procedure.


Rob Warnock, 8L-855
Applied Networking
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA