[R6RS] exception vote list

dyb at cs.indiana.edu dyb at cs.indiana.edu
Wed May 10 12:41:17 EDT 2006


Here are my votes.

Issues:

- add under &defect:

    &values (improper number of values returned to continuation)

- replace &index under &incompatible with

    &range (index out of range)

- replace &index under &exact-integer with

    &non-negative-exact-integer

  (using &index for string and vector lengths is funny, and we should
  have something for them.  an alternative is to have &length as well
  as &index)

- add under &type

    &promise (not a promise, i.e., value returned by delay)

- add under &defect

    &letrec (violation of letrec or letrec* restriction)

  (an alternative is to rename &undefined => &unbound and add
  &undefined rather than &letrec under &defect)

- add under &syntax

    &immutable-variable (attempt to assign immutable variable)

- add under &io

    &file-exists
    &file-does-not-exist

--------

Exceptional situations not covered below:

- First argument to list-ref and list-tail not a proper list

  => discuss [See the discussion under #20.]

- Second argument of list-ref or list-tail out of range for first?

  => must &range

--------

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

    ["Must" or "should" implies that eval is required or encouraged to
    copy constants in programs constructed dynamically to some read-only
    area.  I would actually prefer that eval be discouraged from copying
    constants.  "May" is compatible with R5RS.]

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

    [I don't understand the intended model.  Would/can this be raised at
    compile/load time when no user exception handlers can possibly be
    defined (in portable code)?  (I assume this has nothing to do with
    eval, which is covered by #39.)  Or if we vote "must", must it be
    rasied at run time, so that an implementation must run programs
    containing syntax errors and hold off reporting them until run time?]

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

    [I don't understand how a definition refers to a variable.  I assume
    this is a redundant indirect mention of the expression(s) on the rhs
    of a definition.]

    [See also the discussion under #4.]
    
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: &letrec

    [rationale: this is not a syntax error]

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

    [What is meant by "has not yet been undefined"?]

    [See also the discussion under #4.]

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

    [See the discussion under #4.]

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

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

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

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

    [Note: anything other than "returns" is incompatible with r5rs.]

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

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

    ["Must" requires portions of the input to be traversed that don't
    otherwise need to be traversed.  "May" allows an implementation to
    crash in safe mode if the list is not well-formed.  I don't like
    either situation.]

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

    [See the discussion under #20.]

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

    [See the discussion under #20.]

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: 

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: 

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: 

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

    [How does this differ from #14?]

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

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

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: 

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

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: 

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

    Vote: must

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

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: 

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

    [This should depend on the continuation.]

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

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

    [Can we nail down what it does rather than considering it an error?]

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

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

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

    [Should "6" be "5"?]

    [Won't we flush these or relegate them to an r5rs compatibility library?]

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

    [Won't we flush this or relegate it to an r5rs compatibility library?]

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

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

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: &file-does-not-exist

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

    [Would be nice to give programmer options, e.g., truncate, remove,
    error, append.]

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: &file-exists

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

    [Syntax may depend on non-Scheme libraries that the programmer
    links with the program.]

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

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

    [I think "may" is essentially what we decided last week.]

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

    [What is the rationale for addressing this particular extension?]

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

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: 





More information about the R6RS mailing list