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 #50 received at 34708 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 34708 <at> debbugs.gnu.org
Subject: Re: bug#34708: alist-get has unclear documentation
Date: Mon, 04 Mar 2019 09:16:46 -0800
On 03/04/19 17:38 PM, Michael Heerdegen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> I think it would be nice to have an example that shows both a common
>> use-case (as an accumulator), and how to use REMOVE. I started off with
>> the accumulator part:
>>
>> (let (word word-freq)
>>   (while (setq word (pop word-list))
>>     (cl-incf (alist-get word word-freq 0 #'equal) 1)))
>>
>> But so far haven't come up with a non-contrived way to work REMOVE in
>> there...
>
> And I guess you didn't really want to specify a function as REMOVE arg,
> right?

Don't you think it's confusing enough already? :)

Though maybe there could be a second example showing "advanced topics in
REMOVE".

While we're here, you mentioned up-thread that REMOVE isn't intuitive if
you don't understand what the DEFAULT arg is doing. Obviously I don't
understand that: would you elaborate?

Thanks,
Eric




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.