unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: Mark H Weaver <mhw@netris.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 20:46:29 +0200	[thread overview]
Message-ID: <877ggq9wca.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87li563396.fsf@tines.lan> (Mark H. Weaver's message of "Tue, 16 Jul 2013 11:59:01 -0400")

Mark H Weaver <mhw@netris.org> writes:

> I can easily think of many possible uses for this, e.g. for memoizing
> unary numeric functions, associating application-specific data
> structures with file descriptors or array indices, etc.
>
> Regardless, our manual has been telling people they could do this for a
> long time.  To make matters worse, those who have tried using
> object-properties have likely observed that it works as advertised.
> They probably don't realize that it will silently fail for large
> integers.

Fixing the documentation will not change the behavior.  So they are not
worse off than before.

> '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.

When calling a thing an "object property", it is not helpful when it
does not behave like one.

-- 
David Kastrup





  reply	other threads:[~2013-07-16 18:46 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 [this message]
2013-07-16 18:59         ` Mark H Weaver
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=877ggq9wca.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=14792@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=mhw@netris.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).