emacs-diffs
[Top][All Lists]
Advanced

[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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]