all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: expose XHASH [patch]
Date: Thu, 31 Mar 2016 17:52:51 -0400	[thread overview]
Message-ID: <jwvy48y2ufy.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: CAG7BparKZuRvtACRU2kPS9wyx3Yf4VgZ_LFjNZip5cGr1qkqxw@mail.gmail.com

> Please don't write that the example is stupid, it is just an
> example after all.

FWIW, I have bumped into various cases where I also needed to define
a hash for an equality function that's defined for example as (and (eq
(car x) (car y)) (eq (cdr x) (cdr y))).  Worse yet: you say that "sxhash
_will_ work" but in reality it won't if the objects are later modified
by side-effects.

See for example:

           (cl--generic-with-memoization
               ;; FIXME: Since the fields of `generic' are modified, this
               ;; hash-table won't work right, because the hashes will change!
               ;; It's not terribly serious, but reduces the effectiveness of
               ;; the table.
               (gethash (cons generic methods)
                        cl--generic-combined-method-memoization)

from cl-generic.el.  I wrote "It's not terribly serious", but IIRC there
can be cases where it causes real problems.

So a big "yes please" from me.


        Stefan




  reply	other threads:[~2016-03-31 21:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31 19:29 expose XHASH [patch] Paul Pogonyshev
2016-03-31 21:52 ` Stefan Monnier [this message]
2016-03-31 22:43 ` Paul Eggert
2016-04-01  9:44   ` Paul Pogonyshev
2016-04-02 11:52     ` Paul Pogonyshev
2016-04-08 16:08       ` Paul Pogonyshev
2016-04-08 18:10         ` Stefan Monnier
2016-04-08 18:37           ` Paul Pogonyshev
2016-04-08 18:44             ` Stefan Monnier
2016-04-08 19:24               ` Paul Pogonyshev
2016-04-08 20:51                 ` Stefan Monnier
2016-04-08 22:37                 ` Paul Eggert

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

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

  git send-email \
    --in-reply-to=jwvy48y2ufy.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.