bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#34842: 26.1; Alist documentation: let-alist


From: Lars Ingebrigtsen
Subject: bug#34842: 26.1; Alist documentation: let-alist
Date: Sun, 13 Oct 2019 01:32:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]