GNU bug report logs - #34708
alist-get has unclear documentation

Previous Next

Package: emacs;

Reported by: "Miguel V. S. Frasson" <mvsfrasson <at> gmail.com>

Date: Sat, 2 Mar 2019 04:52:01 UTC

Severity: minor

Done: Michael Heerdegen <michael_heerdegen <at> web.de>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 34708 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>, 34708 <at> debbugs.gnu.org
Subject: Re: bug#34708: alist-get has unclear documentation
Date: Sun, 3 Mar 2019 13:15:37 +1300
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





This bug report was last modified 6 years and 32 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.