[R6RS] exception vote list

Michael Sperber sperber at informatik.uni-tuebingen.de
Wed May 10 09:07:04 EDT 2006


Thanks for the hard work on this, Will!

Issues: 

- I suggest augmenting the hierarchy as follows:

  &domain
    &values

  for conditions signifying that there was an arity mismatch in a call
  to `values' between the call and its continuation.  (The placement
  is questionable---maybe it should move one level up.)

- I suggest augmenting the hierarchy as follows

  &condition
    &eval

  for conditions raised by code evaluated by `eval'.  The condition
  type has a field `condition' which contains the real condition.
  Moreover, I suggest specifying `eval' such that any exceptions the
  code being evaluated raises become &eval conditions, with the `real'
  condition couched inside.

- I suggest augmenting the hierarchy as follows

  &type
    &promise
  
  &exact-integer
    &scalar-value

  with the obvious meanings.  (See below.)

- I suggest augmenting the hierarchy as follows:

  &implementation-restrictiuon
    &string-size
    &vector-size

  with the obvious meanings (See below.)

- I suggest renaming the first condition type named `&index' (there
  are two) to `&non-negative-exact-integer'.

- I suggest augmenting the condition hierarchy as follows:

  &domain
    &eval-environment
    &eval-definition

  with the obvious meanings (See below.)

- I'd like to offer the condition hierarchy in SRFI 79 as an
  alternative to the one presented here.  (It's really an
  elaboration.)  Moreover, I'd like to defer the discussion of the
  I/O-related conditions to the discussion on I/O.  Therefore, I've
  voted "discuss later" in those instances.

- I'm assuming this discussion is only about safe mode for the time
  being: the terminology review mentions the term only for "must raise
  an exception."

- A lot of questions ask for the behavior when an argument is not a
  proper list.  I've mostly voted "should [1]" here, meaning:

  * must raise an exception if any of the pairs representing the list
    contains something other than the empty list or a pair
  * should raise an exception if the list contains a cycle

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

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: must

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: must

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: must

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: must

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: must

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: discuss [really "must" but I'm unsure what "not yet"
    means]

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: must

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: must

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: must

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: must

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: must

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: must

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: must

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: should [1]

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: should [1]

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:may

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: should [1]

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: must

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: &non-negative-exact-integer

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: should [1]

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: should [1]

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: must

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: must

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: &scalar-value

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: must

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: &non-negative-exact-integer

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: must

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: &string-size, &vector-size

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: must

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: &non-negative-exact-integer

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: must

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: &index

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: must

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: &index

29.  If the second argument to substring is larger than
    the third, then it
    (must/should/may/might/returns/abstain/discuss).

    Vote: must

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: &index

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: should [1]

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: must

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: &char

32.  If the last argument to apply is not a list, then it
    (must/should/may/might/returns/abstain/discuss).

    Vote: should [1]

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: should [1]

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: must

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: must

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: &promise

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: discuss

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: should

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: &values

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: returns [or rather, does its job according to the semantics]

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: must

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: should

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: &eval-environment

41.  If the first argument to eval is a definition, then it
    (must/should/may/might/returns/abstain/discuss).

    Vote: must

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: &eval-definition

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: abstain [I'm assuming these procedures will be dropped]

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: abstain

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: discuss later

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: discuss later

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: discuss later

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: discuss later

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: discuss later

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: must

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: must

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: must

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: must

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: may

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: discuss

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: must

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: discuss later

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: 

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



More information about the R6RS mailing list