GNU bug report logs - #27057
26.0.50; Equal defstruct objects not recognized in puthash

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Wed, 24 May 2017 15:41:02 UTC

Severity: normal

Tags: confirmed

Merged with 26639

Found in version 26.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

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 27057 in the body.
You can then email your comments to 27057 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#27057; Package emacs. (Wed, 24 May 2017 15:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 24 May 2017 15:41:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Equal defstruct objects not recognized in puthash
Date: Wed, 24 May 2017 11:39:56 -0400
Package: Emacs
Version: 26.0.50

It looks like the new records-based code introduced a bug in the way
records are handled as keys in hash-tables when the test is `equal`:

    (progn
      (cl-defstruct sm-foo a b)
      (setq sm-hash (make-hash-table :test 'equal))
      (puthash (make-sm-foo :a 4 :b 6) "test1" sm-hash)
      (puthash (make-sm-foo :a 4 :b 6) "test2" sm-hash)
      (hash-table-count sm-hash))

this code return 2 here instead of 1.  Lars, could you take a look at it?


        Stefan




Merged 26639 27057. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Wed, 24 May 2017 15:48:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27057; Package emacs. (Wed, 24 May 2017 15:57:04 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 27057-done <at> debbugs.gnu.org, 26639-done <at> debbugs.gnu.org
Cc: Lars Brinkhoff <lars <at> nocrew.org>, Michael Albinus <Michael.Albinus <at> gmx.de>
Subject: Re: bug#27057: 26.0.50;
 Equal defstruct objects not recognized in puthash
Date: Wed, 24 May 2017 11:56:25 -0400
>     (progn
>       (cl-defstruct sm-foo a b)
>       (setq sm-hash (make-hash-table :test 'equal))
>       (puthash (make-sm-foo :a 4 :b 6) "test1" sm-hash)
>       (puthash (make-sm-foo :a 4 :b 6) "test2" sm-hash)
>       (hash-table-count sm-hash))
>
> this code return 2 here instead of 1.

This should be fixed now,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27057; Package emacs. (Wed, 24 May 2017 16:03:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <Michael.Albinus <at> gmx.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Lars Brinkhoff <lars <at> nocrew.org>, 27057-done <at> debbugs.gnu.org,
 26639-done <at> debbugs.gnu.org
Subject: Re: bug#27057: 26.0.50;
 Equal defstruct objects not recognized in puthash
Date: Wed, 24 May 2017 18:02:01 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

Hi Stefan

>> this code return 2 here instead of 1.
>
> This should be fixed now,

Thanks. But for Tramp, I'll keep the list type, due to backward compatibility.

>         Stefan

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 22 Jun 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 361 days ago.

Previous Next


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