diff options
| author | Nicolas Petton | 2016-02-03 15:18:36 +0100 |
|---|---|---|
| committer | Nicolas Petton | 2016-02-03 15:18:36 +0100 |
| commit | 8b87ecb77dc8212e16be4ef8cb28fe2829f6877b (patch) | |
| tree | f4dcad78647948b2e324c7fd91b8beb08d18f630 | |
| parent | 6191003fcd2bc65f2b18d5337f6f390d43f07173 (diff) | |
| download | emacs-8b87ecb77dc8212e16be4ef8cb28fe2829f6877b.tar.gz emacs-8b87ecb77dc8212e16be4ef8cb28fe2829f6877b.zip | |
* lisp/emacs-lisp/map.el: Improvements to the docstring of the pcase macro
| -rw-r--r-- | 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 ebef27185ae..878611538fc 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el | |||
| @@ -47,17 +47,18 @@ | |||
| 47 | (pcase-defmacro map (&rest args) | 47 | (pcase-defmacro map (&rest args) |
| 48 | "Build a `pcase' pattern matching map elements. | 48 | "Build a `pcase' pattern matching map elements. |
| 49 | 49 | ||
| 50 | The `pcase' pattern will match each element of PATTERN against | 50 | ARGS is a list of elements to be matched in the map. |
| 51 | the corresponding elements of the map. | ||
| 52 | 51 | ||
| 53 | Extra elements of the map are ignored if fewer ARGS are | 52 | Each element of ARGS can be of the form (KEY PAT), in which case KEY is |
| 54 | given, and the match does not fail. | 53 | evaluated and searched for in the map. The match fails if for any KEY |
| 54 | found in the map, the corresponding PAT doesn't match the value | ||
| 55 | associated to the KEY. | ||
| 55 | 56 | ||
| 56 | ARGS can be a list of the form (KEY PAT), in which case KEY in an | 57 | Each element can also be a SYMBOL, which is an abbreviation of a (KEY |
| 57 | unquoted form. | 58 | PAT) tuple of the form ('SYMBOL SYMBOL). |
| 58 | 59 | ||
| 59 | ARGS can also be a list of symbols, which stands for ('SYMBOL | 60 | Keys in ARGS not found in the map are ignored, and the match doesn't |
| 60 | SYMBOL)." | 61 | fail." |
| 61 | `(and (pred mapp) | 62 | `(and (pred mapp) |
| 62 | ,@(map--make-pcase-bindings args))) | 63 | ,@(map--make-pcase-bindings args))) |
| 63 | 64 | ||