GNU bug report logs - #38375
26.3.50; map-contains-key can't detect nil

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Mon, 25 Nov 2019 21:33:43 UTC

Severity: normal

Found in version 26.3.50

Done: Michael Heerdegen <michael_heerdegen <at> web.de>

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 38375 in the body.
You can then email your comments to 38375 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#38375; Package emacs. (Mon, 25 Nov 2019 21:33:44 GMT) Full text and rfc822 format available.

Acknowledgement sent to Damien Cassou <damien <at> cassou.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 25 Nov 2019 21:33:44 GMT) Full text and rfc822 format available.

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

From: Damien Cassou <damien <at> cassou.me>
To: bug-gnu-emacs <at> gnu.org
Cc: Nicolas Petton <nicolas <at> petton.fr>
Subject: 26.3.50; map-contains-key can't detect nil
Date: Mon, 25 Nov 2019 18:15:34 +0100
The code below inserts the pair (nil, 'value) in a hash table. I expect
`map-contains-key' to return t when passed the key nil as argument.

(ert-deftest test-map-contains-key-with-nil-has-key-in-hashtable ()
  (let ((map (make-hash-table :test 'equal)))
    (puthash nil 'value map)
    (should (map-contains-key map nil))))

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38375; Package emacs. (Mon, 25 Nov 2019 23:23:02 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Damien Cassou <damien <at> cassou.me>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 38375 <at> debbugs.gnu.org
Subject: Re: bug#38375: 26.3.50; map-contains-key can't detect nil
Date: Tue, 26 Nov 2019 00:22:07 +0100
[Message part 1 (text/plain, inline)]
On Mon, Nov 25, 2019 at 10:38 PM Damien Cassou <damien <at> cassou.me> wrote:

> The code below inserts the pair (nil, 'value) in a hash table. I expect
> `map-contains-key' to return t when passed the key nil as argument.

It does in 27.0.50:

ELISP> (let ((map (make-hash-table :test 'equal)))
         (puthash nil 'value map)
         (map-contains-key map nil))
t
ELISP>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38375; Package emacs. (Mon, 25 Nov 2019 23:35:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Damien Cassou <damien <at> cassou.me>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 38375 <at> debbugs.gnu.org
Subject: Re: bug#38375: 26.3.50; map-contains-key can't detect nil
Date: Tue, 26 Nov 2019 00:34:27 +0100
Damien Cassou <damien <at> cassou.me> writes:

> The code below inserts the pair (nil, 'value) in a hash table. I expect
> `map-contains-key' to return t when passed the key nil as argument.
>
> (ert-deftest test-map-contains-key-with-nil-has-key-in-hashtable ()
>   (let ((map (make-hash-table :test 'equal)))
>     (puthash nil 'value map)
>     (should (map-contains-key map nil))))

This should have been fixed in master with commit 1691a5109
"*lisp/emacs-lisp/map.el: Make the functions generic".  Could you please
check?

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38375; Package emacs. (Tue, 26 Nov 2019 15:13:02 GMT) Full text and rfc822 format available.

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

From: Damien Cassou <damien <at> cassou.me>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 38375 <at> debbugs.gnu.org
Subject: Re: bug#38375: 26.3.50; map-contains-key can't detect nil
Date: Tue, 26 Nov 2019 16:12:27 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> This should have been fixed in master with commit 1691a5109
> "*lisp/emacs-lisp/map.el: Make the functions generic".  Could you please
> check?

I agree, it is fixed in master.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill




Reply sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
You have taken responsibility. (Tue, 26 Nov 2019 15:45:02 GMT) Full text and rfc822 format available.

Notification sent to Damien Cassou <damien <at> cassou.me>:
bug acknowledged by developer. (Tue, 26 Nov 2019 15:45:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Damien Cassou <damien <at> cassou.me>
Cc: 38375-done <at> debbugs.gnu.org, Nicolas Petton <nicolas <at> petton.fr>
Subject: Re: bug#38375: 26.3.50; map-contains-key can't detect nil
Date: Tue, 26 Nov 2019 16:44:15 +0100
Damien Cassou <damien <at> cassou.me> writes:

> I agree, it is fixed in master.

Ok, closing.  Nonetheless, thanks for reporting.

Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Dec 2019 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 235 days ago.

Previous Next


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