[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] fix/bug-3133-pcase-doc 82791b1 13/13: (docstring) move ‘F
From: |
Thien-Thi Nguyen |
Subject: |
[Emacs-diffs] fix/bug-3133-pcase-doc 82791b1 13/13: (docstring) move ‘FUN’ para after after logical pattern table; refine |
Date: |
Fri, 11 May 2018 12:50:53 -0400 (EDT) |
branch: fix/bug-3133-pcase-doc
commit 82791b1e7beba26e85f9e8c7e51db403a39ef2ca
Author: Thien-Thi Nguyen <address@hidden>
Commit: Thien-Thi Nguyen <address@hidden>
(docstring) move ‘FUN’ para after after logical pattern table; refine
---
lisp/emacs-lisp/pcase.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index b84f8ba..4cdde70 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -135,6 +135,14 @@ the pattern matches. A logical pattern can take one of
the forms:
(let PAT EXP) matches if EXP matches PAT.
(app FUN PAT) matches if FUN applied to EXPVAL matches PAT.
+FUN in `pred' and `app' can take one of the forms:
+ SYMBOL or (lambda ARGS BODY)
+ call it with one argument
+ (F ARG1 .. ARGn)
+ call F with ARG1..ARGn and EXPVAL as n+1'th argument
+So a FUN of the form SYMBOL is equivalent to (FUN).
+FUN can refer to variables bound earlier in the pattern.
+
On the other hand, a structural pattern specifies a template,
and allows for elements of that template to be either constants
or sub-patterns (of either category). A structural pattern
@@ -154,13 +162,6 @@ In the above example, the predicate is the logical-AND of:
Additional patterns can be defined using `pcase-defmacro'.
-The FUN argument in the `app' pattern may have the following forms:
- SYMBOL or (lambda ARGS BODY) in which case it's called with one argument.
- (F ARG1 .. ARGn) in which case F gets called with EXPVAL as
- the n+1'th argument.
-So a FUN of the form SYMBOL is equivalent to (FUN).
-FUN can refer to variables bound earlier in the pattern.
-
See Info node `(elisp) Pattern-Matching Conditional' in the
Emacs Lisp manual for more information and examples."
(declare (indent 1) (debug (form &rest (pcase-PAT body))))
- [Emacs-diffs] branch fix/bug-3133-pcase-doc created (now 82791b1), Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc 7b00deb 02/13: add @cindex entry for ‘backquote’, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc 0f42499 03/13: refine "value being matched" note, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc edae74f 09/13: (docstring) update elisp.info ref, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc dcb6d91 04/13: further refinement: introduce @var{expval}; GSR, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc 80ed201 07/13: (docstring) explode "ATOM"; flatten; zonk "match themselves" sentence, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc f927f6a 10/13: (docstring) move { 'VAL, KEYWORD, INTEGER, STRING } prior to SYMBOL, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc 82791b1 13/13: (docstring) move ‘FUN’ para after after logical pattern table; refine,
Thien-Thi Nguyen <=
- [Emacs-diffs] fix/bug-3133-pcase-doc c3d1896 12/13: (docstring) rework middle, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc fdbdb64 05/13: more @var{expval} insinuation, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc fa03d3a 06/13: (docstring) rewrite first para, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc dc67ead 08/13: (docstring) use ‘EXPVAL’ more, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc 1181796 01/13: do ‘s/UPattern/U-pattern/g’, ‘s/QPattern/Q-pattern/g’, Thien-Thi Nguyen, 2018/05/11
- [Emacs-diffs] fix/bug-3133-pcase-doc 9449c39 11/13: pxref ‘Lambda Expressions’, Thien-Thi Nguyen, 2018/05/11