mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-06 12:19:37 +00:00
* lisp/emacs-lisp/map.el: Improvements to the docstring of the pcase macro
This commit is contained in:
parent
6191003fcd
commit
8b87ecb77d
1 changed files with 9 additions and 8 deletions
|
@ -47,17 +47,18 @@
|
||||||
(pcase-defmacro map (&rest args)
|
(pcase-defmacro map (&rest args)
|
||||||
"Build a `pcase' pattern matching map elements.
|
"Build a `pcase' pattern matching map elements.
|
||||||
|
|
||||||
The `pcase' pattern will match each element of PATTERN against
|
ARGS is a list of elements to be matched in the map.
|
||||||
the corresponding elements of the map.
|
|
||||||
|
|
||||||
Extra elements of the map are ignored if fewer ARGS are
|
Each element of ARGS can be of the form (KEY PAT), in which case KEY is
|
||||||
given, and the match does not fail.
|
evaluated and searched for in the map. The match fails if for any KEY
|
||||||
|
found in the map, the corresponding PAT doesn't match the value
|
||||||
|
associated to the KEY.
|
||||||
|
|
||||||
ARGS can be a list of the form (KEY PAT), in which case KEY in an
|
Each element can also be a SYMBOL, which is an abbreviation of a (KEY
|
||||||
unquoted form.
|
PAT) tuple of the form ('SYMBOL SYMBOL).
|
||||||
|
|
||||||
ARGS can also be a list of symbols, which stands for ('SYMBOL
|
Keys in ARGS not found in the map are ignored, and the match doesn't
|
||||||
SYMBOL)."
|
fail."
|
||||||
`(and (pred mapp)
|
`(and (pred mapp)
|
||||||
,@(map--make-pcase-bindings args)))
|
,@(map--make-pcase-bindings args)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue