[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, 06 Aug 2021 00:07:07 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> Yes, that's what I had in mind. Also for plain `pcase' I guess.
> Maybe we could use an explicit (gv PLACE) pattern that is like SYMBOL
> but compares/binds/sets the PLACE instead of the SYMBOL.
I don't see how that would work. `pcase` is designed to test and
extract data. It then makes that data available by giving it names
(local variables).
The SYMBOL pattern doesn't "set" that variable, it creates a fresh new
one, but that operation doesn't exist for gv places (the only thing we
can do there is get and set).
It would make sense for `pcase-setq`, of course, but for `pcase` I just
don't see how that would work (unless you'd want it to work like
`cl-letf`, but that's like dynamically scoped let so I think you'd
be hard pressed to find enough compelling use cases to justify it).
Stefan
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