unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#62067: 29.0.60; 'map-insert' implementation for lists is problematic
@ 2023-03-09  7:48 Augusto Stoffel
  0 siblings, 0 replies; only message in thread
From: Augusto Stoffel @ 2023-03-09  7:48 UTC (permalink / raw)
  To: 62067; +Cc: Basil L. Contovounesios

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.





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-09  7:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09  7:48 bug#62067: 29.0.60; 'map-insert' implementation for lists is problematic Augusto Stoffel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).