[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 8b87ecb: * lisp/emacs-lisp/map.el: Improvements t
From: |
Nicolas Petton |
Subject: |
[Emacs-diffs] emacs-25 8b87ecb: * lisp/emacs-lisp/map.el: Improvements to the docstring of the pcase macro |
Date: |
Wed, 03 Feb 2016 14:20:02 +0000 |
branch: emacs-25
commit 8b87ecb77dc8212e16be4ef8cb28fe2829f6877b
Author: Nicolas Petton <address@hidden>
Commit: Nicolas Petton <address@hidden>
* lisp/emacs-lisp/map.el: Improvements to the docstring of the pcase macro
---
lisp/emacs-lisp/map.el | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el
index ebef271..8786115 100644
--- a/lisp/emacs-lisp/map.el
+++ b/lisp/emacs-lisp/map.el
@@ -47,17 +47,18 @@
(pcase-defmacro map (&rest args)
"Build a `pcase' pattern matching map elements.
-The `pcase' pattern will match each element of PATTERN against
-the corresponding elements of the map.
+ARGS is a list of elements to be matched in the map.
-Extra elements of the map are ignored if fewer ARGS are
-given, and the match does not fail.
+Each element of ARGS can be of the form (KEY PAT), in which case KEY is
+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
-unquoted form.
+Each element can also be a SYMBOL, which is an abbreviation of a (KEY
+PAT) tuple of the form ('SYMBOL SYMBOL).
-ARGS can also be a list of symbols, which stands for ('SYMBOL
-SYMBOL)."
+Keys in ARGS not found in the map are ignored, and the match doesn't
+fail."
`(and (pred mapp)
,@(map--make-pcase-bindings args)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 8b87ecb: * lisp/emacs-lisp/map.el: Improvements to the docstring of the pcase macro,
Nicolas Petton <=