all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 43836@debbugs.gnu.org
Subject: bug#43836: 27.1; Doc string of `alist-get'
Date: Tue, 6 Oct 2020 21:29:17 -0700 (PDT)	[thread overview]
Message-ID: <4fc793a7-df39-44e6-b718-7f477469f16f@default> (raw)
In-Reply-To: <87d01u929v.fsf@gnus.org>

> > 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.






      reply	other threads:[~2020-10-07  4:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 19:26 bug#43836: 27.1; Doc string of `alist-get' Drew Adams
2020-10-07  2:51 ` Lars Ingebrigtsen
2020-10-07  4:29   ` Drew Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4fc793a7-df39-44e6-b718-7f477469f16f@default \
    --to=drew.adams@oracle.com \
    --cc=43836@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.