[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#43836: 27.1; Doc string of `alist-get'
From: |
Drew Adams |
Subject: |
bug#43836: 27.1; Doc string of `alist-get' |
Date: |
Tue, 6 Oct 2020 21:29:17 -0700 (PDT) |
> > 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.