magnars/dash.el — pull request #67 by rejeep (2014-01-23 17:48:11+00:00)
Title: Add functions -setq and -let.

Hey,

Sometimes I work with key/value lists and I have to do:

```lisp
(let ((list
'((foo "0.0.1")
(bar "0.0.2")
(baz "0.0.3")
(qux "0.0.4"))))
(-each list
(lambda (item)
(let ((name (car item))
(version (cadr item)))
(print name)
(print version)))))
```

With this change, I can now do:

```lisp
(let ((list
'((foo "0.0.1")
(bar "0.0.2")
(baz "0.0.3")
(qux "0.0.4"))))
(-each list
(lambda (item)
(-let (((name version) item))
(print name)
(print version)))))
```

This could be further extended with "pattern matching" support, like this:

```lisp
(-let (((_ &rest matches) (s-match "\\(.+\\)\\.\\(.+\\)" "foo.bar")))
(print matches))
```

What do you think?