[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New assoc-let package
From: |
Ted Zlatanov |
Subject: |
Re: New assoc-let package |
Date: |
Thu, 04 Dec 2014 14:36:40 -0500 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (darwin) |
On Wed, 3 Dec 2014 23:40:14 +0000 Artur Malabarba <address@hidden> wrote:
AM> Simply put, the macro takes an alist and a body, and makes the data of
AM> the alist accessible by just writing the car of the desired cell
AM> preceded by a dot.
AM> For instance, the following:
AM> (assoc-let alist
AM> (if (and .title .body)
AM> .body
AM> .site))
AM> expands to
AM> (let ((.title (cdr (assoc 'title alist)))
AM> (.body (cdr (assoc 'body alist)))
AM> (.site (cdr (assoc 'site alist))))
AM> (if (and .title .body)
AM> .body
AM> .site))
I really, really like it. Like a `destructuring-bind' for alists.
Should it maybe use `lexical-let'?
I hope it can go into the core so it's available by default.
Ted
- New assoc-let package, Artur Malabarba, 2014/12/03
- Re: New assoc-let package,
Ted Zlatanov <=
- Re: New assoc-let package, Artur Malabarba, 2014/12/04
- Re: New assoc-let package, Ted Zlatanov, 2014/12/04
- Re: New assoc-let package, Artur Malabarba, 2014/12/05
- Re: New assoc-let package, Artur Malabarba, 2014/12/05
- Re: New assoc-let package, Christopher Schmidt, 2014/12/06
- Re: New assoc-let package, Artur Malabarba, 2014/12/06
- Re: New assoc-let package, Christopher Schmidt, 2014/12/06
- Re: New assoc-let package, Ted Zlatanov, 2014/12/07
- Re: New assoc-let package, Ted Zlatanov, 2014/12/05
- Re: New assoc-let package, Stefan Monnier, 2014/12/05