[R6RS] exception vote list
William D Clinger
will at ccs.neu.edu
Tue May 9 12:17:18 EDT 2006
Vote List for Classification of Exceptions
==========================================
The exception hierarchy itself does not lend itself to
a set of independent votes, so I will just list it for
reference and (once again) solicit any issues that need
to be discussed.
When you consider the list of situations and vote on
whether an exception must/should/may/might or must not
be raised, you will have an opportunity to suggest the
specific exception.
For each situation, please specify one of the following
votes:
must raise an exception
should raise an exception
may raise an exception
might raise an exception
return a value without raising an exception
you are abstaining because you don't care
you are abstaining to force further discussion
For voting, the classification above will be abbreviated
as must/should/may/might/returns/abstain/discuss.
Tentative Condition Hierarchy
=============================
Hierarchy is implied by indentation. For the most part,
conditions will acquire their meanings from the circumstances
in which they are raised, on which we are about to vote.
For a few conditions, I have added comments to suggest a
meaning.
&condition
&message
&warning
&serious
&error
&non-continuable ; handler wasn't expected to return
&implementation-restriction
&no-infinities ; cannot represent +inf.0, -inf.0
&no-nans ; cannot represent +nan.0, -nan.0, nan.0
&io
...
&violation
&nonstandard
&defect
&lexical
&syntax
&undefined ; reference or assignment to undefined variable
&domain
&type
&boolean
&symbol
&char
&vector
&procedure
&pair
&number
&complex
&real
&rational
&integer
&exact ; not an exact complex number
&exact-rational
&exact-integer
&index ; not an exact non-negative integer
&fixnum ; not an exact integer within fixnum range
&inexact ; not an inexact complex number
&inexact-real
&flonum ; not a flonum
&inexact-rational
&inexact-integer
&string
&port
&input-port
&output-port
&llobj ; not a list-like object (null or pair)
&list ; not a proper list
&alist ; some element is not a pair
&immutable
&incompatible ; arguments okay singly but not together
&index ; index out of range
&result ; result not well-defined
...
Instead of voting on this, please list issues that should be
discussed further:
Issues:
Review of Terminology
=====================
For the purposes of this vote, please assume that:
* "must raise an exception" means that, in safe mode,
implementations must detect the situation and raise an
exception.
* "should raise an exception" means that implementations
are encouraged, but not required, to detect the situation
and to raise an exception.
* "may raise an exception" means that implementations
are allowed, but not required or encouraged, to detect
the situation and to raise an exception.
* "might raise an exception" means that implementations
are allowed, but discouraged, to detect the situation
and to raise an exception.
* "returns a value" means that implementations are not
allowed to raise an exception even if they detect the
situation.
Votes
=====
For the votes whose number does not end in "a", the
allowed votes are:
must
should
may
might
returns
abstain
discuss
For the votes whose number ends in "a", please name
a condition type. If the condition type you name is
not one of the condition types listed above, please
write a one-line comment suggesting its purpose.
1. If an implementation is unable to perform an action or
return a value in a way compatible with the R6RS, then
it (must/should/may/might/returns/abstain/discuss).
Vote:
1a. If an exception is raised, it must be raised with a
condition of some type, e.g. &implementation-restriction.
If you prefer a different condition, please specify.
Specific condition:
2. If a procedure is passed an argument that is not of the
type specified by the R6RS, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
2a. If an exception is raised, it must be raised with a
condition of some type, e.g. &type.
If you prefer a different condition, please specify.
Specific condition:
3. If a side-effecting procedure (e.g. set-car!, set-cdr!,
vector-set!, string-set!) is passed an immutable object,
such as the value of a literal constant or the string
returned by symbol->string, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
3a. If an exception is raised, it must be raised with a
condition of some type, e.g. &immutable.
If you prefer a different condition, please specify.
Specific condition:
4. If a definition or expression is not syntactically
correct (e.g. (if x y z w) or (lambda (x x) x)),
then it (must/should/may/might/returns/abstain/discuss).
Vote:
4a. If an exception is raised, it must be raised with a
condition of some type, e.g. &syntax.
If you prefer a different condition, please specify.
Specific condition:
5. If a definition or expression refers to a variable
that is not bound within the library in which the
definition or expression appears, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
5a. If an exception is raised, it must be raised with a
condition of some type, e.g. &undefined.
If you prefer a different condition, please specify.
Specific condition:
6. If evaluation of a letrec or letrec* or an equivalent
sequence of internal definitions results violates the
letrec or letrec* condition, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
6a. If an exception is raised, it must be raised with a
condition of some type, e.g. &undefined.
If you prefer a different condition, please specify.
Specific condition:
7. If an assignment (set!) is executed, and the left
hand side of the assignment is not defined in the
library that contains the assignment, or has not
yet been defined, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
7a. If an exception is raised, it must be raised with a
condition of some type, e.g. &undefined.
If you prefer a different condition, please specify.
Specific condition:
8. If an assignment (set!) is executed, and the left
hand side of the assignment is immutable because
it was imported, or is defined in some environment
whose exported variables are immutable, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
8a. If an exception is raised, it must be raised with a
condition of some type, e.g. &immutable.
If you prefer a different condition, please specify.
Specific condition:
9. If no possible result of the number->string procedure
would satisfy its specification, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
9a. If an exception is raised, it must be raised with a
condition of some type, e.g. &result.
If you prefer a different condition, please specify.
Specific condition:
10. If the result of some arithmetic procedure is specified
to be an infinity that the implementation is unable to
represent, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
10a. If an exception is raised, it must be raised with a
condition of some type, e.g. &no-infinities.
If you prefer a different condition, please specify.
Specific condition:
11. If the result of some arithmetic procedure is specified
to be a NaN that the implementation is unable to
represent, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
11a. If an exception is raised, it must be raised with a
condition of some type, e.g. &no-nans.
If you prefer a different condition, please specify.
Specific condition:
12. If the empty list is passed to the car procedure,
then it
(must/should/may/might/returns/abstain/discuss).
Vote:
12a. If an exception is raised, it must be raised with a
condition of some type, e.g. &pair.
If you prefer a different condition, please specify.
Specific condition:
13. If the empty list is passed to the cdr procedure,
then it
(must/should/may/might/returns/abstain/discuss).
Vote:
13a. If an exception is raised, it must be raised with a
condition of some type, e.g. &pair.
If you prefer a different condition, please specify.
Specific condition:
14. If the appropriate composition of car and cdr operations
is not defined for the argument of one of the caar through
cddddr procedures, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
14a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
15. If the argument to the length procedure is not a list
(i.e. a proper list), then it
(must/should/may/might/returns/abstain/discuss).
Vote:
15a. If an exception is raised, it must be raised with a
condition of some type, e.g. &list.
If you prefer a different condition, please specify.
Specific condition:
16. If an argument to the append procedure is not a list
(i.e. a proper list), and the argument is not the last
argument, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
16a. If an exception is raised, it must be raised with a
condition of some type, e.g. &list.
If you prefer a different condition, please specify.
Specific condition:
17. If the last argument to the append procedure is not a
list, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
17a. If an exception is raised, it must be raised with a
condition of some type, e.g. &list.
If you prefer a different condition, please specify.
Specific condition:
18. If the argument to the reverse procedure is not a
list, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
18a. If an exception is raised, it must be raised with a
condition of some type, e.g. &list.
If you prefer a different condition, please specify.
Specific condition:
19. If some index argument to a procedure that requires
an index (e.g. list-ref, list-tail, vector-ref) is
not a non-negative exact integer, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
19a. If an exception is raised, it must be raised with a
condition of some type, e.g. &index.
If you prefer a different condition, please specify.
Specific condition:
20. If the second argument to memq, memv, or member is
not a list (i.e. a proper list), then it
(must/should/may/might/returns/abstain/discuss).
Vote:
20a. If an exception is raised, it must be raised with a
condition of some type, e.g. &list.
If you prefer a different condition, please specify.
Specific condition:
21. If the second argument to assq, assv, or assoc is
not a list (i.e. a proper list), then it
(must/should/may/might/returns/abstain/discuss).
Vote:
21a. If an exception is raised, it must be raised with a
condition of some type, e.g. &list.
If you prefer a different condition, please specify.
Specific condition:
22. If some element of the second argument to assq, assv,
or assoc is not a pair, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
22a. If an exception is raised, it must be raised with a
condition of some type, e.g. &alist.
If you prefer a different condition, please specify.
Specific condition:
23. If the argument to integer->char is not a Unicode
scalar value (i.e. is outside the range of Unicode
scalar values, or within the range of surrogates),
then it
(must/should/may/might/returns/abstain/discuss).
Vote:
23a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
24. If the first argument to make-string or make-vector
is not a non-negative exact integer, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
24a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
25. If the first argument to make-string or make-vector
is a non-negative exact integer that is larger than
some implementation-specific limit on the size of a
string or vector, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
25a. If an exception is raised, it must be raised with a
condition of some type, e.g. &implementation-restriction.
If you prefer a different condition, please specify.
Specific condition:
26. If the second argument to string-ref, vector-ref,
string-set!, or vector-set! is not a non-negative
exact integer, or the second or third argument to
substring is not a non-negative exact integer, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
26a. If an exception is raised, it must be raised with a
condition of some type, e.g. &index.
If you prefer a different condition, please specify.
Specific condition:
27. If the second argument to string-ref or vector-ref
is a non-negative exact integer that is larger than
the string-length or vector-length of the first
argument, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
27a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
28. If the second or third argument to substring is
a non-negative exact integer that is larger than
the string-length of the first argument, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
28a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
29. If the second argument to substring is larger than
the third, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
29a. If an exception is raised, it must be raised with a
condition of some type, e.g. &incompatible.
If you prefer a different condition, please specify.
Specific condition:
30. If the argument to list->string or list->vector is
not a list (i.e. not a proper list), then it
(must/should/may/might/returns/abstain/discuss).
Vote:
30a. If an exception is raised, it must be raised with a
condition of some type, e.g. &list.
If you prefer a different condition, please specify.
Specific condition:
31. If an element of the argument to list->string is not
a character, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
31a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
32. If the last argument to apply is not a list, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
32a. If an exception is raised, it must be raised with a
condition of some type, e.g. &list.
If you prefer a different condition, please specify.
Specific condition:
33. If any but the first argument to map or for-each is
not a list (i.e. not a proper list), then it
(must/should/may/might/returns/abstain/discuss).
Vote:
33a. If an exception is raised, it must be raised with a
condition of some type, e.g. &list.
If you prefer a different condition, please specify.
Specific condition:
34. If the list arguments to map or for-each are not
all of the same length, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
34a. If an exception is raised, it must be raised with a
condition of some type, e.g. &incompatible.
If you prefer a different condition, please specify.
Specific condition:
35. If the argument to force is not a promise created by
delay, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
35a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
36. If the escape procedure that is created by
call-with-current-continuation is called with zero
arguments or with more than one argument, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
36a. If an exception is raised, it must be raised with a
condition of some type, e.g. &violation.
If you prefer a different condition, please specify.
Specific condition:
37. If zero values or more than one value are returned
to a continuation that requires one value, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
37a. If an exception is raised, it must be raised with a
condition of some type, e.g. &violation.
If you prefer a different condition, please specify.
Specific condition:
38. If an escape procedure is used to escape from the
dynamic context of the before or after thunks passed
to a dynamic-wind, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
38a. If an exception is raised, it must be raised with a
condition of some type, e.g. &violation.
If you prefer a different condition, please specify.
Specific condition:
39. If the first argument to eval is not syntactically
correct, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
39a. If an exception is raised, it must be raised with a
condition of some type, e.g. &syntax.
If you prefer a different condition, please specify.
Specific condition:
40. If the second argument to eval is omitted or is not
one of the environments or things that R6RS explicitly
allows as the second argument to eval, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
40a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
41. If the first argument to eval is a definition, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
41a. If an exception is raised, it must be raised with a
condition of some type, e.g. &violation.
If you prefer a different condition, please specify.
Specific condition:
42. If the argument to null-environment or scheme-report-environment
is not the exact integer 6, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
42a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
43. If interaction-environment is called, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
43a. If an exception is raised, it must be raised with a
condition of some type, e.g. &nonstandard.
If you prefer a different condition, please specify.
Specific condition:
44. If any i/o procedure detects what would (in most other
languages/libraries) be considered an i/o error, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
44a. If an exception is raised, it must be raised with a
condition of some type, e.g. &io.
If you prefer a different condition, please specify.
Specific condition:
45. If call-with-input-file or open-input-file is asked
to open a file that doesn't seem to exist, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
45a. If an exception is raised, it must be raised with a
condition of some type, e.g. &io.
If you prefer a different condition, please specify.
Specific condition:
46. If call-with-output-file or open-output-file is asked
to open a file that seems already to exist, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
46a. If an exception is raised, it must be raised with a
condition of some type, e.g. &io.
If you prefer a different condition, please specify.
Specific condition:
47. If the string argument to call-with-input-file,
call-with-output-file, open-input-file, or
open-output-file is not a string of the form
that is used to name files on the executing
systems, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
47a. If an exception is raised, it must be raised with a
condition of some type, e.g. &domain.
If you prefer a different condition, please specify.
Specific condition:
48. If call-with-input-file, call-with-output-file,
open-input-file, or open-output-file is unable
to open a file for any other reason, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
48a. If an exception is raised, it must be raised with a
condition of some type, e.g. &io.
If you prefer a different condition, please specify.
Specific condition:
49. If read encounters an end-of-file in the middle of
parsing some external representation that is not yet
complete, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
49a. If an exception is raised, it must be raised with a
condition of some type, e.g. &lexical.
If you prefer a different condition, please specify.
Specific condition:
50. If read encounters the external representation of an
infinity (e.g. -inf.0 or +inf.0), and the implementation
is unable to represent the infinity, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
50a. If an exception is raised, it must be raised with a
condition of some type, e.g. &no-infinities.
If you prefer a different condition, please specify.
Specific condition:
51. If read encounters the external representation of an
NaN (e.g. +nan.0), and the implementation is unable to
represent the NaN, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
51a. If an exception is raised, it must be raised with a
condition of some type, e.g. &no-nans.
If you prefer a different condition, please specify.
Specific condition:
52. If read encounters the external representation of any
other number that the implementation is unable to
represent (e.g. a one followed by one million zeros
in a system that is unable to represent such large
numbers), then it
(must/should/may/might/returns/abstain/discuss).
Vote:
52a. If an exception is raised, it must be raised with a
condition of some type, e.g. &implementation-restriction.
If you prefer a different condition, please specify.
Specific condition:
53. If read encounters an external representation of the
form #!<symbol>, where <symbol> is a valid external
representation of a symbol, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
53a. If an exception is raised, it must be raised with a
condition of some type, e.g. &lexical.
If you prefer a different condition, please specify.
Specific condition:
54. If read encounters an external representation of the
form #{<datum>*}, where <datum>* is a sequence of
valid external representations, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
54a. If an exception is raised, it must be raised with a
condition of some type, e.g. &lexical.
If you prefer a different condition, please specify.
Specific condition:
55. If read encounters any other nonstandard external
representation, then it
(must/should/may/might/returns/abstain/discuss).
Vote:
55a. If an exception is raised, it must be raised with a
condition of some type, e.g. &lexical.
If you prefer a different condition, please specify.
Specific condition:
56. If the first argument to write, display, or write-char
cannot be output to its second argument (e.g. the first
argument to write-char is some weird Unicode character,
and the output port accepts only ASCII characters), then it
(must/should/may/might/returns/abstain/discuss).
Vote:
56a. If an exception is raised, it must be raised with a
condition of some type, e.g. &incompatible.
If you prefer a different condition, please specify.
Specific condition:
[end of vote list]
More information about the R6RS
mailing list