[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49809: [PATCH] Add macro 'pcase-setq'
From: |
Stefan Monnier |
Subject: |
bug#49809: [PATCH] Add macro 'pcase-setq' |
Date: |
Fri, 13 Aug 2021 01:17:23 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Michael Heerdegen [2021-08-13 04:55:39] wrote:
> 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?
Of course, tho it does the same thing as just `[,a ,b], only
less efficiently.
Stefan
- bug#49809: [PATCH] Add macro 'pcase-setq', (continued)
bug#49809: [PATCH] Add macro 'pcase-setq', Okam, 2021/08/06
- bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/06
- bug#49809: [PATCH] Add macro 'pcase-setq', Lars Ingebrigtsen, 2021/08/11
- bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/12
- bug#49809: [PATCH] Add macro 'pcase-setq', Okam, 2021/08/12
- bug#49809: [PATCH] Add macro 'pcase-setq', Stefan Monnier, 2021/08/12
- bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/12
- bug#49809: [PATCH] Add macro 'pcase-setq',
Stefan Monnier <=
- bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/13
bug#49809: [PATCH] Add macro 'pcase-setq', Stefan Monnier, 2021/08/07
bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/08
bug#49809: [PATCH] Add macro 'pcase-setq', Stefan Monnier, 2021/08/09
bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/09
bug#49809: [PATCH] Add macro 'pcase-setq', Stefan Monnier, 2021/08/12