Fwd: [plt-scheme] current-exception-handler

From: John Clements (clements at brinckerhoff.org)
Date: Tue Mar 25 08:08:48 EST 2003

Begin forwarded message:

> From: John Clements <clements at brinckerhoff.org>
> Date: Tue Mar 25, 2003  8:07:17  AM US/Eastern
> To: Eli Barzilay <eli at barzilay.org>
> Subject: Re: [plt-scheme] current-exception-handler
>
>
> On Tuesday, March 25, 2003, at 04:04  AM, Eli Barzilay wrote:
>
>>   For list-related administrative tasks:
>>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>> BTW#2: if continuation marks were mutable, wouldn't they be the same
>>        as parameters?
>
> No, because continuation marks capture the tail behavior of the 
> interpreter.  Consider the following two expressions:
>
> (with-continuation-mark 'key 'val
>  ((lambda (x) x)
>   (with-continuation-mark 'key 'val
>     (continuation-mark-set->list (current-continuation-marks) 'key))))
>
> => (val val)
>
> (with-continuation-mark 'key 'val
>  (with-continuation-mark 'key 'val
>    (continuation-mark-set->list (current-continuation-marks) 'key)))
>
> => (val)
>
> That is, in order to know whether one continuation mark stomps another 
> one, you need to know whether the one is in tail position w.r.t. the 
> other (including non-locally, e.g. lambda bodies are tail w.r.t. their 
> application sites).  The only way to implement this with other scheme 
> constructs would be essentially to duplicate the continuation at 
> runtime _and_ infer the behavior of the interpreter.
>
> john
>



Posted on the users mailing list.