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

Re: [Scheme-reports] Signaled errors need not raise error objects



Note:  I meant to reply to the list, but replied directly to Alan instead.
I'm taking the liberty of posting his direct reply.

Alan Watson scripsit:

> > > If I understand correctly, when "an error is signaled" in the sense of
> > > §1.3.2, the object that is raised is not necessarily an error object in
> > > the sense of the error-object? procedure. So, in particular, an object
> > > could satisfy file-error? or read-error? but not error-object?. Is
> > > that deliberate?
> > 
> > Yes; error objects are user-raised standardized conditions, but there
> > can be any number of other types of conditions as well.
> 
> Yes. There are three portable methods to raise (initial) exceptions:
> (a) call the raise/raise-continuable procedure, (b) call the error
> procedure, and (c) do something that is required to "signal an error". I
> find it surprising that the exceptions raised by method (c) are not
> required to satisfy error-object?. I guess this is left over from
> R6RS. Oh, well.

No, it's quite deliberate.  The intention is that this minimal condition
system can be layered over any existing native condition system.  If an
implementation does not have a native equivalent of error objects, it
can provide them without any requirement that the already existing file
and read conditions are also error objects.  Instead, file-error? and
read-error? are just simple facades over the corresponding native
conditions.

In practice, most Scheme implementations provide SRFI 23, which means
they also have something which can be treated as error objects -- but
there is not any necessary connection between those and the file and
read conditions.

> > Arguably, {file,read}-error? should have been called
> > {file,read}-condition? instead.  Last-minute ideas tend to be flawed
> > in this way.

[Alan made no reply to this part of my posting]

-- 
John Cowan <cowan@x>             http://www.ccil.org/~cowan
Sir, I quite agree with you, but what are we two against so many?
    --George Bernard Shaw,
         to a man booing at the opening of _Arms and the Man_

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports