From: Michael Heerdegen <michael_heerdegen@web.de>
To: 49848@debbugs.gnu.org
Cc: rajeev.jnk@sivalik.com
Subject: bug#49848: 27.2.50; map-merge plist return alist
Date: Tue, 03 Aug 2021 23:59:14 +0200 [thread overview]
Message-ID: <877dh2qjf1.fsf@web.de> (raw)
In-Reply-To: <87o8ae71yv.fsf@hm.sivalik.com> (Rajeev N. via's message of "Tue, 03 Aug 2021 19:38:48 +0000")
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.
next prev parent reply other threads:[~2021-08-03 21:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-03 19:38 bug#49848: 27.2.50; map-merge plist return alist Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-03 21:59 ` Michael Heerdegen [this message]
2021-08-03 22:45 ` Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-04 0:41 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-04 0:45 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-04 7:47 ` Lars Ingebrigtsen
2021-08-05 2:47 ` Michael Heerdegen
2021-08-05 2:55 ` Michael Heerdegen
2021-08-05 10:48 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-14 10:35 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877dh2qjf1.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=49848@debbugs.gnu.org \
--cc=rajeev.jnk@sivalik.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).