emacs-devel
[Top][All Lists]
Advanced

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

Re: map.el documentation


From: Arash Esbati
Subject: Re: map.el documentation
Date: Thu, 23 Jan 2025 14:45:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Robert Pluim <rpluim@gmail.com> writes:

> Thatʼs how (setf (a/plist-get ....)) works, yes.
>
> I could argue thatʼs a bug in the `list' method for `map-insert', it
> conses the new key/value onto the map, when it could just use the
> default method which does `map-put!' on a copy of the map.
>
> The only in-house usage of `map-insert' is in ert.el. I donʼt think
> making `map-insert' update an existing mapping would break anything
> there, but itʼs probably too late to change it now.

I agree, it is probably too late.  I could argue this an inaccuracy in
the docstrings.  It should just say what you said above: For an alist,
the new key/value is consed onto the map, for others, the current
mapping is overwritten, and relax the reference to `map-put!' a bit.
That should suffice, IMHO.

Maybe Someone™ who's touching the docstrings can consider this :-)

> In what way is it different? They both return a map where (map-elt map
> 'x) returns 3.

I was just looking at the return value and tried to streamline that with
the docstring.  My question was not about further processing of the
result.

Best, Arash



reply via email to

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