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

From: Stefan Monnier <[email-masked]>
Date: Fri, 13 Aug 2021 01:17:23 -0400

Michael Heerdegen [2021-08-13 04:55:39] wrote:
> Stefan Monnier <[email-masked]> 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?

Of course, tho it does the same thing as just `[,a ,b], only
less efficiently.

        Stefan