[Top][All Lists]

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

Re: [MIT-Scheme-devel] eqv? and eqv-hash disagree on empty vectors

From: Chris Hanson
Subject: Re: [MIT-Scheme-devel] eqv? and eqv-hash disagree on empty vectors
Date: Sat, 5 Nov 2016 02:29:31 -0700

I can understand why it acts that way, since two empty vectors are equivalent for all intents and purposes.

Either way, eqv? and eqv-hash must agree, so one of them has to be changed.

The eqv? of empty vectors seems to be false according to R7RS. Except that the section on eqv? is a little ambiguous around exactly this point, so maybe not.

On Fri, Nov 4, 2016 at 5:35 PM, Taylor R Campbell <address@hidden> wrote:
(let ((u (vector))
      (v (vector)))
  (list (list 'eq (eq? u v) (eq-hash u) (eq-hash v)
              (= (eq-hash u) (eq-hash v)))
        (list 'eqv (eqv? u v) (eqv-hash u) (eqv-hash v)
              (= (eqv-hash u) (eqv-hash v)))))
;Value 15: ((eq #f 107689176 107689168 #f) (eqv #t 107689176 107689168 #f))


Why do we treat empty vectors as eqv?  If we do, eqv-hash needs to be
made to agree.

MIT-Scheme-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]