This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Ticket 391: Add predicates for R7RS signalled conditions

2012-10-07 03:57:52
WG1 - Core
cowan
major
cowan
fixed
source
closed
2012-05-13 11:37:39
defect

R7RS requires an error to be signalled (which means an exception is raised as if by raise) in the following circumstances:

  1. Trying to open for input or delete a file that does not exist or is otherwise inaccessible.
  2. Specifying an argument to scheme-report-environment that the implementation doesn't support. (It must support 7 and may support other values.)
  3. An EOF is encountered while read is in the middle of a datum.
  4. Using expt to raise zero to the power of a non-real number (alternatively an arbitrary number may be returned).

This proposal is to provide four standard predicates that identify these specific conditions, to be used in guard clauses or in with-exception handlers as a portable means of detecting these errors. Although these predicates may return #t on other objects, if one reports #t on an object, the others must report #f. Proposed names are file-error?, scheme-report-error?, read-error?, and expt-error? respectively.

descriptionR7RS requires an error to be signalled (which means an exception is raised as if by `raise`) in the following circumstances: 1. Trying to open for input or delete a file that does not exist or is otherwise inaccessible. 1. Specifying an argument to `scheme-report-environment` that the implementation doesn't support. (It must support 7 and may support other values.) 1. An EOF is encountered while `read` is in the middle of a datum. 1. Using `expt` to raise zero to the power of a non-real number. This proposal is to provide four standard predicates that identify these specific conditions, to be used in `guard` clauses or in `with-exception` handlers as a portable means of detecting these errors. Although these predicates may return `#t` on other objects, if one reports `#t` on an object, the others must report `#f`. Proposed names are `filename-error?`, `scheme-report-error?`, `read-error?`, and `expt-error?` respectively.R7RS requires an error to be signalled (which means an exception is raised as if by `raise`) in the following circumstances: 1. Trying to open for input or delete a file that does not exist or is otherwise inaccessible. 1. Specifying an argument to `scheme-report-environment` that the implementation doesn't support. (It must support 7 and may support other values.) 1. An EOF is encountered while `read` is in the middle of a datum. 1. Using `expt` to raise zero to the power of a non-real number (alternatively an arbitrary number may be returned). This proposal is to provide four standard predicates that identify these specific conditions, to be used in `guard` clauses or in `with-exception` handlers as a portable means of detecting these errors. Although these predicates may return `#t` on other objects, if one reports `#t` on an object, the others must report `#f`. Proposed names are `filename-error?`, `scheme-report-error?`, `read-error?`, and `expt-error?` respectively.
descriptionR7RS requires an error to be signalled (which means an exception is raised as if by `raise`) in the following circumstances: 1. Trying to open for input or delete a file that does not exist or is otherwise inaccessible. 1. Specifying an argument to `scheme-report-environment` that the implementation doesn't support. (It must support 7 and may support other values.) 1. An EOF is encountered while `read` is in the middle of a datum. 1. Using `expt` to raise zero to the power of a non-real number (alternatively an arbitrary number may be returned). This proposal is to provide four standard predicates that identify these specific conditions, to be used in `guard` clauses or in `with-exception` handlers as a portable means of detecting these errors. Although these predicates may return `#t` on other objects, if one reports `#t` on an object, the others must report `#f`. Proposed names are `filename-error?`, `scheme-report-error?`, `read-error?`, and `expt-error?` respectively.R7RS requires an error to be signalled (which means an exception is raised as if by `raise`) in the following circumstances: 1. Trying to open for input or delete a file that does not exist or is otherwise inaccessible. 1. Specifying an argument to `scheme-report-environment` that the implementation doesn't support. (It must support 7 and may support other values.) 1. An EOF is encountered while `read` is in the middle of a datum. 1. Using `expt` to raise zero to the power of a non-real number (alternatively an arbitrary number may be returned). This proposal is to provide four standard predicates that identify these specific conditions, to be used in `guard` clauses or in `with-exception` handlers as a portable means of detecting these errors. Although these predicates may return `#t` on other objects, if one reports `#t` on an object, the others must report `#f`. Proposed names are `file-error?`, `scheme-report-error?`, `read-error?`, and `expt-error?` respectively.
statusnewdecided

WG1 voted to adopt this proposal.

owneralexshinncowan
statusdecidedwriting
resolutionfixed
statuswritingclosed

WG1 adopted file-error? and read-error?. Expt-error? was defined away, and with the decision to relegate scheme-report-environment to the R5RS compatibility library only, it no longer made sense to try to catch this error.