[R6RS] revised^1 exception vote list
Anton van Straaten
anton at appsolutions.com
Tue May 16 22:56:39 EDT 2006
This is an example what's known as "just-in-time voting" (10:56pm EDT).
* * *
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: must
raise an exception with
condition type: &implementation-restriction
2. If a procedure is passed an argument that is not of the
type specified by the R6RS (noting that, for the purpose
of this vote, list and alist are not considered types
because their definitions are complicated by concurrent
or interleaved side effects), then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &type
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: discuss
raise an exception with
condition type: &immutable
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: discuss
(Ideally, implementations should be required to detect syntax errors
early. I would vote "must" here, to handle the 'eval' case, but this
should not be interpreted as allowing an implementation to defer normal
syntax checking until runtime. I realize that defining "early" and
"runtime" might be challenging.)
raise an exception with
condition type: &syntax
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: discuss
(Similar to #4)
raise an exception with
condition type: &undefined-variable
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: must
raise an exception with
condition type: &letrec
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 in some
other context has not yet been defined, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
(Similar to #4)
raise an exception with
condition type: &undefined-variable
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: discuss
(Similar to #4)
raise an exception with
condition type: &immutable-variable
9. If no possible result of the number->string procedure
would satisfy its specification, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &result
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: abstain
raise an exception with
condition type: &no-infinities
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: abstain
raise an exception with
condition type: &no-nans
12. If the empty list is passed to the car procedure,
then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &pair
13. If the empty list is passed to the cdr procedure,
then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &pair
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: must
raise an exception with
condition type: &domain
15. If the argument to the length procedure is not a plausible
list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &list
16. If an argument to the append procedure is not a plausible
list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &list
17. If the last argument to the append procedure is not a
plausible list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: returns
raise an exception with
condition type: &list
18. If the argument to the reverse procedure is not a
plausible list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &list
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: must
raise an exception with
condition type: &non-negative-exact-integer
20. If the second argument to list-ref or list-tail is
n, and the first argument is not a plausible list
up to n, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &list
21. If the first argument to list-ref or list-tail is
not a plausible list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
raise an exception with
condition type: &list
22. If (1) there does not exist a natural number n such
that the second argument to memq, memv, or member
is the first Scheme value of a plausible prefix of
length n such that the last value xn of that prefix
has the first argument as its car at some time after
tn and before the procedure returns, and (2) the
second argument is not a plausible list, and (3)
there exists some natural number n such that the
second argument is not the first Scheme value of
any plausible prefix of length n, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
raise an exception with
condition type: &list
23. If (1) there does not exist a natural number n such
that the second argument to memq, memv, or member
is the first Scheme value of a plausible prefix of
length n such that the last value xn of that prefix
has the first argument as its car at some time after
tn and before the procedure returns, and (2) the
second argument is not a plausible list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
raise an exception with
condition type: &list
24. If the second argument to memq, memv, or member is
not a plausible list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
raise an exception with
condition type: &list
25. If (1) there does not exist a natural number n such
that the second argument to assq, assv, or assoc
is the first Scheme value of a plausible prefix of
length n such that every Scheme value x1 through xn
of that prefix is a pair, and xn has a pair as its
car at some time after tn, and at some time after
that the car of that pair is the first argument,
all before the procedure returns, and (2) the
second argument is not a plausible alist, and (3)
there exists some natural number n such that the
second argument is not the first Scheme value of
any plausible alist prefix of length n, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
raise an exception with
condition type: &alist
26. If (1) there does not exist a natural number n such
that the second argument to assq, assv, or assoc
is the first Scheme value of a plausible prefix of
length n such that every Scheme value x1 through xn
of that prefix is a pair, and xn has a pair as its
car at some time after tn, and at some time after
that the car of that pair is the first argument,
all before the procedure returns, and (2) the
second argument is a plausible list but not a
plausible alist, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
raise an exception with
condition type: &alist
27. If the second argument to assq, assv, or assoc is
not a plausible list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
raise an exception with
condition type: &list
28. 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: must
raise an exception with
condition type: &scalar-value
29. 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: must
raise an exception with
condition type: &non-negative-exact-integer
30. 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: must
raise an exception with
condition type: &implementation-restriction
31. 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: must
raise an exception with
condition type: &non-negative-exact-integer
32. 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: must
raise an exception with
condition type: &range
33. 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: must
raise an exception with
condition type: &range
34. If the second argument to substring is larger than
the third, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &incompatible
35. If the argument to list->string or list->vector is
not a plausible list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &list
36. If the argument to list->string is a plausible list,
but for every natural number n and for every plausible
prefix of that argument of length n there exists an i
such that for all times t such that ti < t < the time
of first return from list->string the car of xi is not
a character, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &domain
37. If the last argument to apply is not a plausible list,
then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &list
38. If any but the first argument to map or for-each is
not a plausible list, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &list
39. If two of the list arguments x and y to map or for-each
are plausible lists, but there does not exist a
natural number n such that x and y are both plausible
lists of length n, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &incompatible
40. If the argument to force is not a promise created by
delay, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &domain
41. 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: discuss
raise an exception with
condition type: &violation
42. 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: must
raise an exception with
condition type: &values
43. 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: discuss
raise an exception with
condition type: &violation
44. If the first argument to eval is not syntactically
correct, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &syntax
45. 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: must
raise an exception with
condition type: &eval-environment
46. If the first argument to eval is a definition, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
raise an exception with
condition type: &eval-definition
47. If the argument to null-environment or scheme-report-environment
is not one of the exact integers 5 or 6, then it
(must/should/may/might/returns/abstain/discuss)
Vote: discuss
(Something like Mike's eval proposal seems preferable)
raise an exception with
condition type: &domain
48. If interaction-environment is called, then it
(must/should/may/might/returns/abstain/discuss)
Vote: may
raise an exception with
condition type: &nonstandard
49. 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: must
(i.e. IIUC, i/o errors should generate i/o exceptions)
raise an exception with
condition type: &io
50. 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: must
raise an exception with
condition type: &file-does-not-exist
51. 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: must
raise an exception with
condition type: &file-exists
52. 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: discuss
(It could be acceptable to attempt to open the file, and return an &io
exception based on whatever the operating system returns, as opposed to
somehow independently detecting an invalid path.)
raise an exception with
condition type: &domain
53. 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: must
raise an exception with
condition type: &io
54. 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: must
raise an exception with
condition type: &lexical
55. 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: must
raise an exception with
condition type: &no-infinities
56. 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: must
raise an exception with
condition type: &no-nans
57. 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: must
raise an exception with
condition type: &implementation-restriction
58. 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: discuss
raise an exception with
condition type: &lexical
59. 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: discuss
raise an exception with
condition type: &lexical
60. If read encounters any other nonstandard external
representation, then it
(must/should/may/might/returns/abstain/discuss)
Vote: must
raise an exception with
condition type: &lexical
61. 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: must
raise an exception with
condition type: &incompatible
[end of vote list]
More information about the R6RS
mailing list