GNU bug report logs -
#43836
27.1; Doc string of `alist-get'
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Tue, 6 Oct 2020 19:27:02 UTC
Severity: minor
Tags: fixed
Found in version 27.1
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> > It's also not clear how _adding_ a new element to the beginning of ALIST
> > destructively modifies it. Does it really mean setting the car of ALIST
> > to a different element, not adding an element?
>
> The example that follows on clarifies what's meant here.
Not really. Not clear to me what's meant.
The first example adds (b . 2) to the front of the
alist. OK. But does it destructively modify the
list? Or does `foo' just point to a new list (new
cons) whose cdr is the old list?
(I'm sure that some operations with `alist-get' do
modify list structure. But I don't see how adding
an element to the front of the list does that.)
And how do you add an element (b . 3) to the front
of an alist that has an element (b . 2)? An alist
can have multiple elements with the same key.
Sorry, but just what the behavior is for a place
expression that uses `alist-get' isn't clear to me
from that doc string, at all.
I have the same questions for the description at
(elisp) `Association Lists'.
This is apparently a useful function, and a bit
complex. I suspect the doc isn't doing it justice,
but not understanding the actual behavior I can
only wonder.
This bug report was last modified 4 years and 311 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.