summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/seq.el
diff options
context:
space:
mode:
authorNicolas Petton <nicolas@petton.fr>2015-10-14 09:37:59 +0200
committerNicolas Petton <nicolas@petton.fr>2015-10-14 09:40:10 +0200
commitb5e2d7495017e0d87de331f41838810b72730942 (patch)
treef94249685d0b4b65a6619b7d22b3baa492b19c22 /lisp/emacs-lisp/seq.el
parente668176e7d89e885902287da18c69297bf04fed3 (diff)
downloademacs-b5e2d7495017e0d87de331f41838810b72730942.tar.gz
Better docstrings in seq.el and map.el
* lisp/emacs-lisp/map.el: * lisp/emacs-lisp/seq.el: Improve the docstring for the pcase patterns.
Diffstat (limited to 'lisp/emacs-lisp/seq.el')
-rw-r--r--lisp/emacs-lisp/seq.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index a63447d3243..d7c9c74b2e0 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -71,13 +71,16 @@ Evaluate BODY with VAR bound to each element of SEQ, in turn.
,@body)
,(cadr spec)))
-(pcase-defmacro seq (&rest args)
+(pcase-defmacro seq (&rest patterns)
"pcase pattern matching sequence elements.
+
Matches if the object is a sequence (list, string or vector), and
-binds each element of ARGS to the corresponding element of the
-sequence."
+each PATTERN matches the corresponding element of the sequence.
+
+Supernumerary elements of the sequence are ignore if less
+PATTERNS are given, and the match does not fail."
`(and (pred seq-p)
- ,@(seq--make-pcase-bindings args)))
+ ,@(seq--make-pcase-bindings patterns)))
(defmacro seq-let (args seq &rest body)
"Bind the variables in ARGS to the elements of SEQ then evaluate BODY.