Subject: bug#75170: add-to-alist: new function

From: "Alfred M. Szmidt" <[email-masked]>
Date: Tue, 21 Jan 2025 06:34:55 -0500

>>>>> On Tue, 21 Jan 2025 05:33:50 -0500, "Alfred M. Szmidt" <[email-masked]> said:

       Alfred> Right, so why should map-foo care about such lists?  You're saying it
       Alfred> "expects" them to be alists, but if it gets another list that is not
       Alfred> an alist .. it fails.  That is the same behaviour as rest of Emacs,
       Alfred> no?

   Except that alist-get, assoc, etc donʼt fail (or at least: the
   resulting structure is more coherent than what map-put! produces).

I don't follow, your example with map-put! did not fail just strange
result, which is no different if you use alist/plist specific
functions on thigns that are not plists or alists.

map-put! cannot know if the thing it is stuff things into is a plist,
alist, list ... which is why this type of function can never really be
well behaved.  The alist/plist functions are specially named for that
reason.