{"id":6466,"date":"2017-08-01T11:41:00","date_gmt":"2017-08-01T15:41:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=6466"},"modified":"2017-08-01T11:46:23","modified_gmt":"2017-08-01T15:46:23","slug":"an-application-of-let-alist","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=6466","title":{"rendered":"An Application of <code>let-alist<\/code>"},"content":{"rendered":"<p> Since Emacs 25.1, Artur Malabarba&rsquo;s excellent <a href=\"http:\/\/endlessparentheses.com\/new-on-elpa-and-in-emacs-25-1-let-alist.html\">let-alist macro<\/a> has been a built-in feature of Emacs. As the name suggests, it&rsquo;s a way of dealing with alists. The idea is that instead of writing a series of <code>assq<\/code> and <code>cdr<\/code> statements, you just write <code>.tag<\/code> where <code>tag<\/code> is the <code>car<\/code> of an alist element. Malabarba&rsquo;s post gives an example of its use. <\/p>\n<p> There&rsquo;s a nice example of its use by T. V. Raman in <a href=\"https:\/\/emacspeak.blogspot.com\/2017\/07\/data-binding-in-emacs-lisp-let-alist.html\">a post about parsing the result of a json-read<\/a>. Most of the examples I&rsquo;ve seen use <code>json-read<\/code> to produce the alist, but the macro can, of course, be used with any alist. It can even handle nested alists as both Malabarba&rsquo;s and Raman&rsquo;s examples make clear. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since Emacs 25.1, Artur Malabarba&rsquo;s excellent let-alist macro has been a built-in feature of Emacs. As the name suggests, it&rsquo;s a way of dealing with alists. The idea is that instead of writing a series of assq and cdr statements, &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=6466\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-6466","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6466"}],"version-history":[{"count":2,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6466\/revisions"}],"predecessor-version":[{"id":6468,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6466\/revisions\/6468"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}