summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAdam Porter <adam@alphapapa.net>2020-03-09 13:01:32 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2021-07-30 17:23:32 -0400
commit44fe0043d3671676867f302865b15bc3d90217b9 (patch)
tree5f607b6a8df7bd6e52021fe746fd76154810dfd0 /doc
parentd9bc7dbefd88995d04b9843f521d82118265fecf (diff)
downloademacs-44fe0043d3671676867f302865b15bc3d90217b9.tar.gz
* lisp/emacs-lisp/cl-macs.el: Add cl-type pattern
* lisp/emacs-lisp/cl-macs.el: ((pcase-defmacro type)): Add 'cl-type' pattern. * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-cl-type): Add test. * doc/lispref/control.texi (pcase Macro): Update manual. With thanks to Stefan Monnier and Eli Zaretskii for their guidance.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/control.texi10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index 22b665bc931..5026d0a4d70 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -555,6 +555,16 @@ Two symbols to avoid are @code{t}, which behaves like @code{_}
Likewise, it makes no sense to bind keyword symbols
(@pxref{Constant Variables}).
+@item (cl-type @var{type})
+Matches if @var{expval} is of type @var{type}, which is a type
+descriptor as accepted by @code{cl-typep} (@pxref{cl-typep,,,cl,Common
+Lisp Extensions}). Examples:
+
+@lisp
+(cl-type integer)
+(cl-type (integer 0 10))
+@end lisp
+
@item (pred @var{function})
Matches if the predicate @var{function} returns non-@code{nil}
when called on @var{expval}. The test can be negated with the syntax