Subject: Re: tail recursion
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1998/10/28
Newsgroups: comp.lang.scheme
Message-ID: <716u24$12ho6@fido.engr.sgi.com>
Sascha Ziemann  <szi@aibon.ping.de> wrote:
+---------------
| is this a valid tail recursion?
| (let ((do-it (lambda (thing-to-do)
| 	       (thing-to-do))))
|   (let loop ()
|     (display ".")
|     (do-it loop)))
+---------------

Yes, but...

1. It's an infinite loop; it never terminates.

2. If you beta-reduce the application of "do-it" (and then eliminate
   the now-unused definition) you get the simpler equivalent form:

   (let loop ()
     (display ".")
     (loop))


-Rob

[p.s. Apologies in advance: Back from sabbatical 11/2/98, but
until then email may still get a "vacation" bounce message...]

-----
Rob Warnock, 8L-855		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
2011 N. Shoreline Blvd.		FAX: 650-964-0811
Mountain View, CA  94043	PP-ASEL-IA