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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43836 in the body.
You can then email your comments to 43836 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43836
; Package
emacs
.
(Tue, 06 Oct 2020 19:27:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Drew Adams <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 06 Oct 2020 19:27:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The doc string is less clear in 27.1 than it was in 26.3.
Instead of saying that a generalized variable is involved, it says:
You can use `alist-get' in PLACE expressions. This will modify
an existing association (more precisely, the first one if
multiple exist), or add a new element to the beginning of ALIST,
destructively modifying the list stored in ALIST.
A user can a least look up "generalized variable" in Emacs 26. The
Emacs 27 version just refers to "PLACE expressions", which is unclear
and can't be looked up easily. And why is PLACE uppercase, which
indicates that it's something in the calling sequence or is otherwise
defined in the doc string somehow?
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?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43836
; Package
emacs
.
(Wed, 07 Oct 2020 02:52:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 43836 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
> The doc string is less clear in 27.1 than it was in 26.3.
>
> Instead of saying that a generalized variable is involved, it says:
>
> You can use `alist-get' in PLACE expressions. This will modify
> an existing association (more precisely, the first one if
> multiple exist), or add a new element to the beginning of ALIST,
> destructively modifying the list stored in ALIST.
>
> A user can a least look up "generalized variable" in Emacs 26. The
> Emacs 27 version just refers to "PLACE expressions", which is unclear
> and can't be looked up easily. And why is PLACE uppercase, which
> indicates that it's something in the calling sequence or is otherwise
> defined in the doc string somehow?
I've now reintroduced "generalized variable" and downcased PLACE in
Emacs 28.
> 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.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 07 Oct 2020 02:52:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.1, send any further explanations to
43836 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 07 Oct 2020 02:52:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#43836
; Package
emacs
.
(Wed, 07 Oct 2020 04:30:02 GMT)
Full text and
rfc822 format available.
Message #15 received at 43836 <at> debbugs.gnu.org (full text, mbox):
> > 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.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 04 Nov 2020 12:24:07 GMT)
Full text and
rfc822 format available.
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.