Re: [Scheme-reports] eq? and eqv? for records John Cowan (17 Feb 2014 08:06 UTC)
Re: [Scheme-reports] eq? and eqv? for records Alex Shinn (17 Feb 2014 11:49 UTC)
Re: [Scheme-reports] eq? and eqv? for records taylanbayirli@gmail.com (17 Feb 2014 12:29 UTC)

Re: [Scheme-reports] eq? and eqv? for records John Cowan 17 Feb 2014 08:01 UTC

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@ccil.org

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports