[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] eq? and eqv? for records
Taylan Ulrich Bayırlı/Kammer scripsit:
> The `eqv?' definition says that records are equivalent if denoting the
> same location and points to section 3.4, which explains that the notion
> of "storage being newly allocated" is what denotes the creation of
> objects with distinct locations, yet section 5.5 (<constructor name>
> point) doesn't use that phrase. In short, we base record equivalence
> semantics on their location, yet don't specify their location.
But 5.5 does say that each field of a record is a location. True,
it doesn't say a _distinct_ location, but I think that can be safely
inferred. From that, it follows that records of a non-empty type
are different in the sense of `eqv?` iff they are created by distinct
constructor invocations. A fortiori, they are distinct in the sense of
`eq?` as well. The standard leaves open what happens when comparing
records of the same empty type.
Note that this argument is quite independent of whether the fields have
mutators or not: they are still locations per 5.5.
--
Don't be so humble. You're not that great. John Cowan
--Golda Meir cowan@x
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports