[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [scheme-reports-wg1] The history of EQV? on numbers

On Mar 23, 2012, at 5:26 PM, John Cowan wrote:

> In R6RS, operational equivalence is restored as the criterion, though
> the name is not used.  Rational numbers are eqv? iff they are = and
> have the same exactness.  Otherwise, they are eqv? if they are =;
> they are not eqv? if they are operationally distinguishable or have
> different exactness.  They are indeterminate otherwise.

Here is what R6RS says about eqv?

5.10 Storage model

An object fetched from a location, by a variable reference or by a procedure such as car, vector-ref, or string-ref, is equivalent in the sense of eqv? (section 11.5) to the object last stored in the location before the fetch.



(let* ((x (/ 0.0 0.0))
       (y (cons x x)))
  (eqv? x (car y))) => #t


(let* ((x (/ 0.0 0.0))
       (y (cons x x)))
  (eqv? (cdr x) (car y))) => #t

Is there some statement like this in the current draft of R7RS?

This seems to imply that "pointer equality" => "eqv? equality", since

((lambda (x)
   (let ((y (cons x x)))
     (eqv? x (car y))))
 z) => #t

for any object z (even if z is a NaN).