Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!scramble.lm.com!news.math.psu.edu!news.cse.psu.edu!uwm.edu!vixen.cso.uiuc.edu!sdd.hp.com!apollo.hp.com!lf.hp.com!news.dtc.hp.com!hplntx!hplntx.hpl.hp.com!gjr
From: gjr@hplgr2.hpl.hp.com (Guillermo (Bill) J. Rozas)
Subject: Re: Question about properly tail recursive-ness
Sender: news@hpl.hp.com (HPLabs Usenet Login)
Message-ID: <GJR.96Apr26140834@hplgr2.hpl.hp.com>
In-Reply-To: shriram@mahasamatman.cs.rice.edu's message of 25 Apr 1996 14:23:13 -0500
Date: Fri, 26 Apr 1996 21:08:34 GMT
Reply-To: gjr@hpl.hp.com
References: <4lmiqb$deq@er5.rutgers.edu> <j7venpchzvi.fsf@mahasamatman.cs.rice.edu>
Nntp-Posting-Host: hplgr2.hpl.hp.com
Organization: Hewlett-Packard Laboratories, Palo Alto, CA
Lines: 21

In article <j7venpchzvi.fsf@mahasamatman.cs.rice.edu> shriram@mahasamatman.cs.rice.edu (Shriram Krishnamurthi) writes:

|   Anyway, there are two well-known schemes for implementing this.  One
|   is known as a trampoline.  (I fail to recall the names of the authors
|   of the original paper on this.)  Essentially, non-tail-recursive
|   function calls remain function calls in C.  Tail-recursive function
|   calls package up their arguments on the heap and return a pointer to
|   the function they want to call.  The receiver then calls the function
|   using the function pointer.  Thus, the "caller" (in the source) is
|   replaced by the callee, and tail-recursion is maintained.

I don't know what paper you are talking about here.  Perhaps you are
talking about the ML-to-C compiler paper that described such a
technique.

However, the Scheme implementation on top of MacLisp that was around
MIT in 1980 already used this technique.

If I recall correctly, Guy Steele's Rabbit thesis (1978) already
described it, since Rabbit compiled Scheme into MacLisp and achieved
tail recursion by this trick.
