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

Re: [Scheme-reports] file-error?, read-error?, and specificity of error objects

Andy Wingo scripsit:

> My suggestion would be to remove all mention of "file-error?" and
> "read-error?" from the report, and include in the larger report modules
> which specify certain errors from those procedures.

I reconstruct the reasoning of the WG thus:

First, we decided to accept the pragmatic wisdom of R5RS that only
certain exceptional situations were required to be signalable in all
implementations, namely when an input file cannot be opened as a port,
when an EOF is detected in the middle of a datum, and when an attempt
was made to create an unsupported type of environment.  To these we
added the fourth type, the simple error signaled by `error`.

The next idea was that if an error could be signaled, it could be trapped.
Finally, in order to be able to safely trap errors from a distance
and still determine which of the four known types of error condition was
involved, predicates that distinguished them were introduced.  In the
final vote, the environment-type predicate was omitted as insufficiently

> As it is, I think most implementations will (define (file-error? x) #t),

That doesn't conform: returning #f would do so, though at the expense
of utility.

John Cowan              cowan@x          http://www.ccil.org/~cowan
C'est la` pourtant que se livre le sens du dire, de ce que, s'y conjuguant
le nyania qui bruit des sexes en compagnie, il supplee a ce qu'entre eux,
de rapport nyait pas.               --Jacques Lacan, "L'Etourdit"

Scheme-reports mailing list