[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pcase-setq (was: pcase-dolist)
From: |
Nicolas Petton |
Subject: |
Re: pcase-setq (was: pcase-dolist) |
Date: |
Mon, 12 Oct 2015 14:01:17 +0200 |
User-agent: |
Notmuch/0.19 (http://notmuchmail.org) Emacs/25.0.50.7 (x86_64-unknown-linux-gnu) |
Michael Heerdegen <address@hidden> writes:
> Hello, (@Stefan I hope you don't mind I CC'd you the second time today)
>
> I think a useful addition could be `pcase-setq' as an alternative to
> `destructuring-bind'.
I don't know if it that's what you are looking for, but seq.el has
`seq-let` and map.el has `map-let`, and they both use pcase.
(seq-let (a b (c &rest others)) '(1 2 [3 4 5 6])
(+ a b c))
(map-let (foo bar baz) '((foo . 1) (bar . 2))
(should (= foo 1))
(should (= bar 2))
(should (null baz)))
Nico
signature.asc
Description: PGP signature
Re: pcase-setq (was: pcase-dolist),
Nicolas Petton <=
- Semantic of pcase `seq' and `map' patterns (was: pcase-setq), Michael Heerdegen, 2015/10/12
- Re: Semantic of pcase `seq' and `map' patterns, Michael Heerdegen, 2015/10/12
- Re: Semantic of pcase `seq' and `map' patterns, Nicolas Petton, 2015/10/12
- Re: Semantic of pcase `seq' and `map' patterns, Michael Heerdegen, 2015/10/12
- Re: Semantic of pcase `seq' and `map' patterns, Michael Heerdegen, 2015/10/17
- Re: Semantic of pcase `seq' and `map' patterns, Nicolas Petton, 2015/10/17
Re: Semantic of pcase `seq' and `map' patterns (was: pcase-setq), Nicolas Petton, 2015/10/15
Re: pcase-setq, Michael Heerdegen, 2015/10/15