bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49809: [PATCH] Add macro 'pcase-setq'


From: Michael Heerdegen
Subject: bug#49809: [PATCH] Add macro 'pcase-setq'
Date: Fri, 13 Aug 2021 04:55:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> >   (pcase-setq (or `((,a) [(,b)])
> >                   x)
> >               '((1) [(2)]))
> >   (list a b x)) ;; ==> (1 2 nil)
>
> If you want to do different things depending on which pattern matches
> you should use `pcase` rather than `pcase-setq` (or `pcase-let` for
> that matter).

Is using a pattern like

   (or `[,a ,b] `[,a ,b ,_])

ok?


Michael.





reply via email to

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