[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal for exception handling
Richard Kelsey writes:
> I would like to offer a counter proposal as a reponse to Dan, Chris,
> and Kent's proposal for exception handling. An HTML version of their
> proposal is available as
>
> http://www.cs.indiana.edu/scheme-repository/doc.proposals.exceptions.html.
>
> My proposal is a response to their's; read their's first.
>
> What I am proposing is similar to the exception system used in
> Scheme 48. I think it more in keeping with the current Scheme report
> than the Indiana proposal, and it has the advantage of ensuring that
> exception handlers are dynamically bound. It also reduces the need
> for the with-handlers derived form, which I have left out.
Two exception handling mechanisms have been proposed. One
has a 2-page implementation (mostly syntax) and the other
fits quite neatly on the back of a postcard.
Both miss the point of having a standardised exception
system. An exception system is useful only if it is
integrated with the rest of the language.
If the proposal specifies some standard exceptions, and for
each place in R4RS that currently says `an error is
signalled' specifies what exception is raised in order to
signal that error, then the proposal would be useful.
I think it is also important to organise the exceptions into
some kind of standardized and extensible system, so a
handler could test for (or be bound to or otherwise become
associated with) some convienient set of exceptions. We
might, for example, want to have a special way of dealing
with unmounted media at a remote site, or transient network
problems, or we might be happy merely to know we have a
problem with opening the file.
Unless a proposal addresses the issues of how the system
exceptions are organized and which exceptions correspond to
which errors or conditions, it is not particularly useful
for writing portable robust programs. If you have no use of
some level of integration with the rest of the language you
have two proposals here that you can just load into your
system and go. Richard's is short and simple enough to type
in every time :-)