diff options
author | Earl Hyatt <okamsn@protonmail.com> | 2021-08-11 23:54:31 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-08-11 23:54:31 +0200 |
commit | 2f90fa19b8fdc70303232d389553afa524c72509 (patch) | |
tree | 1d544d5e950d09542eb78e41083c920af35a310e /doc | |
parent | 3b5f8ab0d06f6c39aaa716b6279c2ceb4bfc5b14 (diff) | |
download | emacs-2f90fa19b8fdc70303232d389553afa524c72509.tar.gz |
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).
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lispref/control.texi | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 5026d0a4d70..aacf66c5cf8 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -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 |