[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Fwd: Comments on draft 6 about call/cc

Andy Wingo scripsit:

> It is useful to distinguish exceptional exits from general nonlocal
> control flow.  R7RS should specify that the port is closed on
> exceptional exits, but not on other exits.  It is possible to implement
> this with exception handlers.

An exceptional exit is simply a non-local exit from an exception handler.
It's not particularly obvious when this is happening.

> How does this square with `guard', whose cond clauses are specified as
> being evaluated in the dynamic environment of the guard expression?  I
> still think this is an error.  Giving intervening dynamic-wind
> expressions a workout is not something I want to happen when exceptions
> are raised.

`Guard` works by capturing its continuation and setting a handler that
captures the continuation at the point of raise.  The guard continuation
is then restored, which gives us the outer dynamic environment, and the
cond-clauses are executed.  If we fall off the end of the cond-clauses,
the point-of-raise continuation is restored (giving us the inner dynamic
environment) and the condition object is reraised.

That you can cover for the plentiful            John Cowan
and often gaping errors, misconstruals,         http://www.ccil.org/~cowan
and disinformation in your posts                cowan@x
through sheer volume -- that is another misconception.  --Mike to Peter

Scheme-reports mailing list