GNU bug report logs - #62067
29.0.60; 'map-insert' implementation for lists is problematic

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Thu, 9 Mar 2023 07:49:01 UTC

Severity: normal

Found in version 29.0.60

To reply to this bug, email your comments to 62067 AT debbugs.gnu.org.

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

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


Report forwarded to contovob <at> tcd.ie, bug-gnu-emacs <at> gnu.org:
bug#62067; Package emacs. (Thu, 09 Mar 2023 07:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Augusto Stoffel <arstoffel <at> gmail.com>:
New bug report received and forwarded. Copy sent to contovob <at> tcd.ie, bug-gnu-emacs <at> gnu.org. (Thu, 09 Mar 2023 07:49:01 GMT) Full text and rfc822 format available.

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

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60; 'map-insert' implementation for lists is problematic
Date: Thu, 09 Mar 2023 08:48:02 +0100
Consider, for instance:

  (map-insert '(:a 1) :a 2)
  => (:a 2 :a 1)

This result will confuse users and other libraries:

  (json-encode (map-insert '(:a 1) :a 2))
  => "{\"a\":2,\"a\":1}"

Not even map.el can really handle these return values correctly:

  (let (x)
    (map-do (lambda (k v) (if (eq k :a) (setq x v)))
          (map-insert '(:a old) :a 'new))
    x)
  => old

The alist implementation has similar issues.




This bug report was last modified 1 year and 42 days ago.

Previous Next


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