bug-guile
[Top][All Lists]
Advanced

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

bug#14792: Error in manual "(guile-2) Object Properties"


From: Mark H Weaver
Subject: bug#14792: Error in manual "(guile-2) Object Properties"
Date: Tue, 16 Jul 2013 14:59:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi David,

David Kastrup <address@hidden> writes:

> Mark H Weaver <address@hidden> writes:
>
>> 'eqv?' is Scheme's fundamental "operational equivalence" predicate.
>> 'eq?' is just an ugly efficiency hack, a poor cousin of 'eqv?' that
>> fails in surprising ways.  No _correct_ program is ever broken by making
>> 'eq?' an alias to 'eqv?'.  Many programs contain subtle bugs because of
>> their inappropriate use of 'eq?'.
>>
>> What's the argument on the other side?  Is there a compelling reason to
>> use 'eq?' instead of 'eqv?' for object properties?
>
> object identity is checked by eq? and is conceptually different from
> value equality.

The Scheme standards don't support your view.  The _only_ difference
between 'eq?' and 'eqv?' is that 'eqv?' is well-defined on numbers and
characters, whereas 'eq?' is unspecified for those types.

Numbers and characters do not have any notion of "object identity",
apart from operational equivalence.  For all values where "object
identity" makes any sense at all, 'eqv?' does what you want.

     Regards,
       Mark





reply via email to

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