[r6rs-discuss] [Formal] Make unspecified return values of eq? / eqv? unspecified

Michael Sperber sperber at informatik.uni-tuebingen.de
Thu Jan 25 04:20:29 EST 2007


---
This message is a formal comment which was submitted to formal-comment at r6rs.org, following the requirements described at: http://www.r6rs.org/process.html
---

Submitter's name: Mike Sperber
Submitter's email address: sperber at deinprogramm dot de
Type of issue: Enhancement
Priority: Minor
R6RS component: Base language
Version of the report: 5.92
One-sentence summary of the issue: The specification of eq? and eqv?
  should allow portability-checking implementations

Full description of the issue:

In the current draft, the return value of `eq?' and `eqv?' isn't
specified for all combinations of arguments.  Yet, the return value is
constrained to be #t or #f.

This makes it easy to write unportable programs, for example by using
`eq?' to compare characters under the assumption that it's faster than
`char=?', or by using it to a number to assumed to be a fixnum with an
immediate representation that `eq?' handles.  As an implementation
must return #t or #f even when applied to arguments where the return is
unspecified, the draft does not permit an implementation that would
detect (some) unspecified cases and notify the programmer and/or user
in that case.

Suggestion:

Allow implementations to return other values than #t or #f for the
unspecified cases, and also allow them to abort the program or raise
an exception for those cases.




More information about the r6rs-discuss mailing list