GNU bug report logs - #75170
add-to-alist: new function

Previous Next

Package: emacs;

Reported by: Roland Winkler <winkler <at> gnu.org>

Date: Sun, 29 Dec 2024 05:35:02 UTC

Severity: wishlist

Full log


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

From: "Alfred M. Szmidt" <ams <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: rpluim <at> gmail.com, winkler <at> gnu.org, monnier <at> gnu.org, 75170 <at> debbugs.gnu.org,
 eliz <at> gnu.org, acorallo <at> gnu.org
Subject: Re: bug#75170: add-to-alist: new function
Date: Tue, 21 Jan 2025 05:33:48 -0500
   "Alfred M. Szmidt" <ams <at> gnu.org> writes:

   >    map-put! does not work well with alists that are not 'proper':
   >
   >        ELISP> (setq x (list 1 '(2 . 3)))
   >        (1 (2 . 3))
   >
   > Why should it work on alists at all?  map-put! assumes a map (where is
   > this structure documented? I did not see anything in the Elisp
   > manual), not an alist.  Invalid alists will also not work on functions
   > that assume alists.

   According to M-x describe-package RET map RET:

   map.el provides generic map-manipulation functions that work on
   alists, plists, hash-tables, and arrays.  All functions are
   prefixed with "map-".

That seems like it cannot possibly work (or very complicated).  How do
you differetnate between a plist and alist?  Order in an alist is
important, but not in a plist.  Their syntax is exactly the same, how
can a insertion function work correctly for that?

The above sounds like it is also overloading the concept of
sequencess?




This bug report was last modified 143 days ago.

Previous Next


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