emacs-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: PGP signature


reply via email to

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