GNU bug report logs - #56199
hash table equality predicate [PATCH]

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Fri, 24 Jun 2022 17:21:02 UTC

Severity: normal

Tags: patch

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56199 in the body.
You can then email your comments to 56199 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#56199; Package emacs. (Fri, 24 Jun 2022 17:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mattias Engdegård <mattiase <at> acm.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 24 Jun 2022 17:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: bug-gnu-emacs <at> gnu.org
Subject: hash table equality predicate [PATCH]
Date: Fri, 24 Jun 2022 19:19:54 +0200
[Message part 1 (text/plain, inline)]
Recently[1] a predicate for structural equality was requested that also recurses through hash tables.
It showed that Emacs doesn't even come with a way of comparing hash tables. Third-party implementations exist but if the code quoted in [2] is representative, perhaps it would make sense to add a `hash-table-equal-p` predicate?
Even implemented entirely in Lisp it would be an order of magnitude faster (and actually correct).

The attached code is not without flaws but provides a rough starting point.
(This is not meant as a strong argument for or against adding it in the first place.)

[hash-table-equal-p.diff (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]

--

[1] https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00444.html
[2] https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00553.html


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56199; Package emacs. (Fri, 24 Jun 2022 18:22:01 GMT) Full text and rfc822 format available.

Message #8 received at 56199 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 56199 <at> debbugs.gnu.org
Subject: Re: bug#56199: hash table equality predicate [PATCH]
Date: Fri, 24 Jun 2022 20:21:45 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> Even implemented entirely in Lisp it would be an order of magnitude
> faster (and actually correct).
>
> The attached code is not without flaws but provides a rough starting point.
> (This is not meant as a strong argument for or against adding it in
> the first place.)

I can't ever recall wanting to compare two hash tables for equality
(like, that's not what you use a hash table for), but since people have
apparently been reimplementing this a lot, then I'm for including it.

And the implementation looks nice.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply sent to Mattias Engdegård <mattiase <at> acm.org>:
You have taken responsibility. (Sat, 25 Jun 2022 16:57:02 GMT) Full text and rfc822 format available.

Notification sent to Mattias Engdegård <mattiase <at> acm.org>:
bug acknowledged by developer. (Sat, 25 Jun 2022 16:57:02 GMT) Full text and rfc822 format available.

Message #13 received at 56199-done <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 56199-done <at> debbugs.gnu.org
Subject: Re: bug#56199: hash table equality predicate [PATCH]
Date: Sat, 25 Jun 2022 18:56:27 +0200
24 juni 2022 kl. 20.21 skrev Lars Ingebrigtsen <larsi <at> gnus.org>:

> I can't ever recall wanting to compare two hash tables for equality
> (like, that's not what you use a hash table for)

No, you're right -- it's better to wait until there is a concrete need for it.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#56199; Package emacs. (Sun, 26 Jun 2022 14:33:02 GMT) Full text and rfc822 format available.

Message #16 received at 56199-done <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Mattias Engdegård <mattiase <at> acm.org>,
 Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 56199-done <at> debbugs.gnu.org
Subject: Re: bug#56199: hash table equality predicate [PATCH]
Date: Sun, 26 Jun 2022 14:30:13 +0000
I use database stored hashes where new edited and updated one shall be compared to the stored one.

This will become useful.


Jean




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 25 Jul 2022 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 326 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.