emacs-devel
[Top][All Lists]
Advanced

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

Re: map-put! and (setf (map-elt ...) ..) on lists


From: Stefan Monnier
Subject: Re: map-put! and (setf (map-elt ...) ..) on lists
Date: Tue, 18 Dec 2018 08:56:04 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> map-put!:
>>
>>  Associate KEY with VALUE in MAP and return VALUE.
>>  If KEY is already present in MAP, replace the associated value
>>  with VALUE.

Not sure which version you were looking at, but what I see is:

      "Associate KEY with VALUE in MAP.
    If KEY is already present in MAP, replace the associated value
    with VALUE.
    This operates by modifying MAP in place.
    If it cannot do that, it signals the `map-not-inplace' error.
    If you want to insert an element without modifying MAP, use `map-insert'."

> As I said, I like Stefan's approach, but if everybody else dislike it,
> and if you think it's not idiomatic Elisp, then let's change the name.
>
> Stefan, would it be ok with you?

As I said, I like Scheme's ! convention, but I really don't care very
much about the name: I think normal code should never call this function
directly and should use `(setf (map-elt ...) ..)` instead anyway!
So, even a longwinded name would be perfectly fine.


        Stefan



reply via email to

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