bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#34708: alist-get has unclear documentation


From: Phil Sainty
Subject: bug#34708: alist-get has unclear documentation
Date: Sun, 3 Mar 2019 13:15:37 +1300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

On 3/03/19 8:06 AM, Eric Abrahamsen wrote:
> Most definitely, this needs examples. I also agree that the REMOVE
> usage needs an example -- I made it work eventually, but it took a
> fair bit of experimentation.

Agreed.  I think the remove syntax is all but unreadable:

(setf (alist-get KEY LIST t t) t)

to remove items from LIST with key eq to KEY.

Unless accompanied by comments, I do not think that meaning obvious
at all.

This variant gives a better idea...

(setf (alist-get KEY LIST :remove :remove) :remove)

I struggle to imagine a scenario where I wouldn't use some more
explicit syntax for deletion, though; even when the decision to
remove or not is being arrived at dynamically.


-Phil






reply via email to

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