[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: |
Sat, 07 Aug 2021 11:42:09 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> Added with others. Do you think that the added tests are sufficient?
The new code looks OK to me. Just one thing, tho:
> + (should (equal (list nil nil)
> + (let (a b)
> + (pcase-setq `(,a ,b) nil)
> + (list a b))))
The result is the same whether `pcase-setq` assigns nil or doesn't touch
the vars, so this test is not very effective. I'd rather do:
(should (equal (list nil nil)
(let ((a 'unset)
(b 'unset))
(pcase-setq `(,a ,b) nil)
(list a b))))
But Michael points out that it seems your code won't perform the
assignment if the pattern doesn't match, which I find to be an
odd behavior.
I'd expect a behavior like that of `pcase-let`, instead.
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, 2021/08/13
- bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/13
- bug#49809: [PATCH] Add macro 'pcase-setq',
Stefan Monnier <=
- 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