[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: |
Thu, 12 Aug 2021 08:13:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Lars Ingebrigtsen <larsi@gnus.org> writes:
> > 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 hope that this is even true in all cases.
> > I'd expect a behavior like that of `pcase-let`, instead.
>
> ... because I have no opinion here, really -- behaving like `pcase-let'
> would be good, but on the other hand, the current behaviour also kinda
> sorta makes sense.
Here is something else that is odd:
(let ((a 17)
(b 17)
(x 17))
(pcase-setq (or `((,a) [(,b)])
x)
'((1) [(2)]))
(list a b x)) ;; ==> (1 2 nil)
The first `or' branch matches, nevertheless is the binding of `x' being
set to (a totally unrelated value) nil which doesn't make much sense.
Michael.
- bug#49809: [PATCH] Add macro 'pcase-setq', (continued)
- bug#49809: [PATCH] Add macro 'pcase-setq', Stefan Monnier, 2021/08/04
- bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/04
- bug#49809: [PATCH] Add macro 'pcase-setq', Stefan Monnier, 2021/08/05
- bug#49809: [PATCH] Add macro 'pcase-setq', Stefan Monnier, 2021/08/05
- bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/05
- bug#49809: [PATCH] Add macro 'pcase-setq', Stefan Monnier, 2021/08/06
- bug#49809: [PATCH] Add macro 'pcase-setq', Michael Heerdegen, 2021/08/06
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 <=
- 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, 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