[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (eq? eqv? eq?)
> Date: Mon, 11 Jan 1993 10:58:36 -0800
> From: Marc Feeley <email@example.com>
> what is the value of (let ((x 1)) (eq? x x)) ?
> I know that (eq? 1 1) is either #t or #f (because the two 1's may
> be different objects). But in the above, both references to
> "x" should return the same (i.e. identical) object.
My memory is that we didn't do this in the IEEE spec because we wanted to leave
open the possibility of lexical variables that were implemented with a type-
specific representation, such as unboxed floating point. Since escaping
variable references might get boxed more than once, we wanted to allow the
results to be only eqv? and not eq?.
The same argument applies, of course, to examples like this:
(let ((v (make-vector 2 3.0)))
(or (eq? (vector-ref v 0) (vector-ref v 0))
(eq? (vector-ref v 0) (vector-ref v 1))))
which I believe is allowed to return #f.