[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multi-eq hash tables
From: |
Lars Ingebrigtsen |
Subject: |
Re: multi-eq hash tables |
Date: |
Tue, 03 May 2022 20:58:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
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