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

Storage model error?



Section 3.5 of R4RS says:

  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? to the object last stored in the location before the fetch.
           ^^^^

Isn't this an error?  Equivalence should be in the sense of EQ?,
otherwise the procedures EQ? (and ASSQ, MEMQ) are useless.  For
example, the result of

  (let ((x 5)) (eq? x x))

can be either #t or #f because any reference to a variable can return
a different (in the sense of EQ?) value (here, different 5's).

Now I understand why (eq? 5 5) should be unspecified but in the above
example there is only one source for the value x, so whatever that value
is I would like eq? to return true.


Marc