all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Sebastián Monía" <seb.hoagie@outlook.com>
Cc: 34842@debbugs.gnu.org
Subject: bug#34842: 26.1; Alist documentation: let-alist
Date: Sun, 13 Oct 2019 01:32:04 +0200	[thread overview]
Message-ID: <87eezhh763.fsf@gnus.org> (raw)
In-Reply-To: <BN8PR04MB555503D4DD1283F20EAC7C578B4A0@BN8PR04MB5555.namprd04.prod.outlook.com> ("Sebastián Monía"'s message of "Wed, 13 Mar 2019 14:16:15 +0000")

Sebastián Monía <seb.hoagie@outlook.com> writes:

> The macro let-alist is too useful to work with JSON-parsed data for it to be
> missing from the docs.
>
> In the page
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html
> we should add some documentation about it. Below a suggestion.
>
> Thank you!
>
> — Macro: let-alist `value`
> Creates a binding for each symbol in the association list `value`, prefixed with
> dot. This is very useful when accessing several items in the same alist, and it's
> best understood through a simple example:
>
> (setq colors '((rose red) (lily white) (buttercup yellow)))
> (let-alist colors
>     (print .rose)
>     (print .buttercup))
>     ⇒ red
>     ⇒ yellow

Even though I question the usefulness of this macro (especially since it
doesn't nest well, so it seems just kinda ad-hoc), I've now documented
it along the lines you suggest.  Drew wanted the manual to describe more
fully the actual details behind the implementation, but I think that
doesn't add much clarity.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  parent reply	other threads:[~2019-10-12 23:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 14:16 bug#34842: 26.1; Alist documentation: let-alist Sebastián Monía
2019-03-13 15:16 ` Drew Adams
2019-03-13 16:30   ` Sebastián Monía
2019-03-13 17:51     ` Drew Adams
2019-03-14  4:47       ` Sebastián Monía
2019-10-12 23:32 ` Lars Ingebrigtsen [this message]
2019-10-13  2:03   ` Basil L. Contovounesios
2019-10-13  2:48     ` Lars Ingebrigtsen
2019-10-13  7:15       ` Eli Zaretskii
2019-10-13 12:38         ` Basil L. Contovounesios
2019-10-13 13:15           ` Eli Zaretskii
2019-10-13 12:17       ` Basil L. Contovounesios
2019-10-13 17:39         ` Lars Ingebrigtsen

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=87eezhh763.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=34842@debbugs.gnu.org \
    --cc=seb.hoagie@outlook.com \
    /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.