[racket-dev] Changing call/cc

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Thu Aug 30 11:36:55 EDT 2012

On 2012-08-30 06:53:58 -0600, Matthew Flatt wrote:
> I think this combination of replacing both `call/cc' and `dynamic-wind'
> would be equivalent to a smaller change to the semantics of `call/cc',
> which is that it behaves as it does now if there's a shared
> `dynamic-wind' between the source and target continuations, but it
> behaves like your replacement `call/cc' if there's no intervening
> prompt (which addresses the reasoning problem). Also, implementing the
> change directly in the existing `call/cc' implementation sounds fairly
> easy to me.

Sam and I discussed this some more, and we think it sounds workable and
will go and try to add it to the Redex model and see what tests fail. We
were concerned about one thing though: it sounds like this would modify
the behavior of `call/cc` depending on whether or not you put a
`dynamic-wind` in your continuation.

That also means that a programmer who installs a `dynamic-wind` might
get fewer abort handlers run than expected, or perhaps gets *more* run
than expected since they either didn't install the `dynamic-wind` or
they passed the continuation out of the `dynamic-wind` to a different
context and invoked it there.

Is that a fair point or are we misunderstanding your proposed semantics?


Posted on the dev mailing list.