[plt-scheme] #%app and tail recursion

From: John Clements (clements at brinckerhoff.org)
Date: Wed Jul 16 18:28:02 EDT 2003

On Wednesday, July 16, 2003, at 05:13  PM, Stefan Ottosson wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> Hi,
> I need to keep track of environments and when they are created. It 
> seems I
> can do this with #%app. But I also need to know when a procedure call 
> is
> tail recursive. Is there a way to tell when it is and isnt?

Have you looked into continuation marks?  If what you want is a 
mechanism to
track environments while preserving tail-cursion --- that is, 
environments attached
to frames that made tail-cursive calls should disappear --- then 
are your solution.

You wouldn't be implementing a debugger, would you?

See the docs for continuation marks, and my paper on the topic 
('Modeling an Algebraic Stepper,' available at 

And if you _are_ building a debugger, keep me posted!

john clements

Posted on the users mailing list.