From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: multi-eq hash tables
Date: Tue, 03 May 2022 20:58:02 +0200 [thread overview]
Message-ID: <87h766tpdx.fsf@gnus.org> (raw)
In-Reply-To: <jwv7d72mr6f.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 03 May 2022 14:12:40 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Maybe we should introduce something like:
>
> (define-hash-table-test shallow-equal
> (lambda (x1 x2) (while (and (consp x1) (consp x2) (eql (car x1) (car x2)))
> (setq x1 (cdr x1)) (setq x2 (cdr x2)))
> (equal x1 x2)))
> ...)
Yes, that would be excellent.
> and we could even improve the weakness support so that `key` used with
> such a hashtable would mean that as soon as one of the values in the
> key's list can be GC'd then the entry is removed.
>
> This way we could have our hash table such that entries are flushed by
> the GC when a terminal disappears or when one of the tool-bar-map
> objects dies (instead of the current code which prevents us from GC'ing
> the terminal objects and the old tool bar maps).
Hm, interesting... It's slightly niche, though.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2022-05-03 18:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <165159846589.6567.527908635296473829@vcs2.savannah.gnu.org>
[not found] ` <20220503172106.30B09C009A8@vcs2.savannah.gnu.org>
2022-05-03 18:12 ` multi-eq hash tables Stefan Monnier
2022-05-03 18:58 ` Lars Ingebrigtsen [this message]
2022-05-03 19:30 ` [External] : " Drew Adams
2022-05-03 19:42 ` How to use markers as keys in a hash map? (was: multi-eq hash tables) Stefan Monnier
2022-05-04 15:52 ` [External] : " Drew Adams
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=87h766tpdx.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.