[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: |
Sat, 07 Aug 2021 04:11:55 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Okam via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:
> +(defmacro pcase-setq (pat val &rest args)
> + "Assign values to variables by destructuring with `pcase'.
> +
> +\(fn PATTERN VALUE PATTERN VALUE ...)"
Can we maybe enhance the docstring a bit? I think we should at least
cover these points:
- The PATTERNs are normal `pcase' patterns, the VALUES are expressions.
- Evaluation happens sequentially as in `setq' (not in parallel)
- When a PATTERN doesn't match it's VALUE, the pair is silently skipped
(completely, no partial assignments are performed, AFAIU)
Maybe adding a simple example would not be too bad as well?
Thanks,
Michael.
- bug#49809: [PATCH] Add macro 'pcase-setq', Okam, 2021/08/01
- bug#49809: [PATCH] Add macro 'pcase-setq', Lars Ingebrigtsen, 2021/08/04
- 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 <=
- 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, 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