1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 02:51:31 -08:00

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.
This commit is contained in:
Nicolas Petton 2015-10-14 09:37:59 +02:00
parent e668176e7d
commit b5e2d74950
2 changed files with 15 additions and 8 deletions

View file

@ -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.