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

Full log


View this message in rfc822 format

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: 62067 <at> debbugs.gnu.org
Cc: Basil L. Contovounesios <contovob <at> tcd.ie>
Subject: bug#62067: 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 2 years and 100 days ago.

Previous Next


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