On 10/5/06, Marcin 'Qrczak' Kowalczyk <qrczak_at_knm.org.pl> wrote:
> "Carl Eastlund" <cce_at_ccs.neu.edu> writes:
>
> >> What is an advantage of call/cc over a condition here?
> >
> > An exit operation based on exceptions could be caught and potentially
> > mishandled by intermediate exception handlers between the call to exit
> > and the top level of the program.
>
> The same is true wrt. call/cc: dynamic-wind.
Exactly, as I said. However, an arbitrary exception handler is not
written to capture or redirect normal flow control. Many programs may
write a "top-level" exception handler, for instance, that prints out
any uncaught exceptions. They do not expect this to intercept calls
to exit. The dynamic-wind procedure, on the other hand, does expect
to capture both normal and exceptional flow control.
> And it's good that it can be caught:
> - to free resources which have been associated with a region of code,
> - to reinterpret the context of a library which is not used in a
> standalone script.
>
> > It is also misleading to programmers to treat completion of the
> > program as an "exceptional" situation; program termination is a
> > normal occurrence and not a problem to be dealt with exceptionally.
>
> Terminology doesn't matter if the semantics is appropriate.
I disagree strongly.
> R6RS calls them "conditions" anyway.
True, I was calling them exceptions following another poster in this
thread. Nevertheless, so long as R6RS is consistent in using
"conditions" for abnormal program behavior, I believe they should not
be coopted for normal flow control.
--
Carl Eastlund
Received on Thu Oct 05 2006 - 17:50:41 UTC