unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: David Kastrup <dak@gnu.org>
Cc: 14792@debbugs.gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: bug#14792: Error in manual "(guile-2) Object Properties"
Date: Tue, 16 Jul 2013 14:59:28 -0400	[thread overview]
Message-ID: <874nbu2uwf.fsf@tines.lan> (raw)
In-Reply-To: <877ggq9wca.fsf@fencepost.gnu.org> (David Kastrup's message of "Tue, 16 Jul 2013 20:46:29 +0200")

Hi David,

David Kastrup <dak@gnu.org> writes:

> Mark H Weaver <mhw@netris.org> 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	other threads:[~2013-07-16 18:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04 18:03 bug#14792: Error in manual "(guile-2) Object Properties" David Kastrup
2013-07-05 16:37 ` Mark H Weaver
2013-07-06 21:21   ` Ludovic Courtès
2013-07-16 15:59     ` Mark H Weaver
2013-07-16 18:46       ` David Kastrup
2013-07-16 18:59         ` Mark H Weaver [this message]
2013-07-16 19:30           ` David Kastrup
2013-07-16 19:52             ` Mark H Weaver
2013-07-16 20:01               ` David Kastrup
2013-07-16 18:53       ` Ludovic Courtès
2013-07-27 21:19 ` bug#14792: Actually, this discussion is moot David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874nbu2uwf.fsf@tines.lan \
    --to=mhw@netris.org \
    --cc=14792@debbugs.gnu.org \
    --cc=dak@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).