Subject: bug#34708: alist-get has unclear documentation

From: Eric Abrahamsen <[email-masked]>
Date: Tue, 05 Mar 2019 14:50:33 -0800

Michael Heerdegen <[email-masked]> writes:

> Eric Abrahamsen <[email-masked]> writes:
>
>> Thanks for spelling all this out! I guess my confusion is the
>> interaction of REMOVE with DEFAULT. Why does REMOVE only do anything
>> if the value being set is equal to the DEFAULT? If they are not equal,
>> REMOVE is ignored, and the value is set. How does that make sense?
>
> If you do (setf GV V) with some place expression GV and some value V,
> you expect that afterwards GV evaluates to V.
>
> If (setf (alist-get key alist nil 'remove) t) would remove the
> association of KEY,
>
>   (alist-get key alist nil 'remove)
>
> or
>
>   (alist-get key alist nil)
>
> would not eval to nil, although you have set the place to t.
>
> With other words: removing elements from an alist is something that
> doesn't fit 100% to place expressions, so the syntax and semantics you
> get are not 100% straightforward.  Not super sexy, but consistent.

Okay, I guess that makes sense, thanks. But we still need some more
examples in the docstring!