bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49848: 27.2.50; map-merge plist return alist


From: Michael Heerdegen
Subject: bug#49848: 27.2.50; map-merge plist return alist
Date: Tue, 03 Aug 2021 23:59:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Rajeev N via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:

> (map-merge 'plist nil '(:a 1))
> expected: '(:a 1)
> got: '((:a . 1))

I can reproduce this behavior and consider it a bug.

The implementation of `map-merge' starts with an empty plist "RESULT"
(i.e., nil) and fills it like

      (map-do (lambda (key value)
                (setf (map-elt result key) value))
              (pop maps))

The setter of `map-elt' treats nil as empty alist (at the end, this is
decided by `map--plist-p' which doesn't consider nil a plist).

So the underlying problem is more general, maybe this is not the only
issue this ambiguity causes.

Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]