mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Add a `pcase-setq' macro
* doc/lispref/control.texi (Destructuring with pcase Patterns): Document this macro. * lisp/emacs-lisp/pcase.el (pcase-setq): New macro. This macro is the 'setq' equivalent of 'pcase-let'. * test/lisp/emacs-lisp/pcase-tests.el (pcase-setq): Test this new macro. (bug#49809).
This commit is contained in:
parent
3b5f8ab0d0
commit
2f90fa19b8
4 changed files with 94 additions and 0 deletions
|
|
@ -1312,6 +1312,10 @@ element of @var{list}. The bindings are performed as if by
|
|||
up being equivalent to @code{dolist} (@pxref{Iteration}).
|
||||
@end defmac
|
||||
|
||||
@defmac pcase-setq pattern value@dots{}
|
||||
Assign values to variables in a @code{setq} form, destructuring each
|
||||
@var{value} according to its respective @var{pattern}.
|
||||
@end defmac
|
||||
|
||||
@node Iteration
|
||||
@section Iteration
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue