emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] fix/bug-31311-pcase-doc 352c1de 12/16: (docstring) small r


From: Thien-Thi Nguyen
Subject: [Emacs-diffs] fix/bug-31311-pcase-doc 352c1de 12/16: (docstring) small refinements
Date: Sun, 13 May 2018 13:16:35 -0400 (EDT)

branch: fix/bug-31311-pcase-doc
commit 352c1defb16b20954b514006f8d72769d0c185c0
Author: Thien-Thi Nguyen <address@hidden>
Commit: Thien-Thi Nguyen <address@hidden>

    (docstring) small refinements
    
    specifically
    - realign table; untabify
    - for ‘let’, use ‘EXPR’ (avoid ambiguity w/ arg ‘EXP’)
    - zonk "So a FUN..." (interesting, but...)
    - expand list of bound var beneficiaries to include
      BOOLEXP, EXPR, subseq PAT
---
 lisp/emacs-lisp/pcase.el | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index fd405d6..79e00de 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -118,28 +118,29 @@ A `pcase' pattern expands, in essence, to a predicate 
function
 to call on EXPVAL.  When the return value of that call is non-nil,
 the pattern matches.  A pattern can take one of the forms:
 
-  _            matches anything.
-  \\='VAL              matches if EXPVAL is `equal' to VAL.
-  KEYWORD      shorthand for \\='KEYWORD
-  INTEGER      shorthand for \\='INTEGER
-  STRING       shorthand for \\='STRING
-  SYMBOL       matches anything and binds it to SYMBOL.
-                If a SYMBOL is used twice in the same pattern
-                the second occurrence becomes an `eq'uality test.
-  (or PAT...)  matches if any of the patterns matches.
-  (and PAT...) matches if all the patterns match.
-  (pred FUN)   matches if FUN called on EXPVAL returns non-nil.
-  (guard BOOLEXP)      matches if BOOLEXP evaluates to non-nil.
-  (let PAT EXP)        matches if EXP matches PAT.
-  (app FUN PAT)        matches if FUN called on EXPVAL matches PAT.
+  _                matches anything.
+  \\='VAL             matches if EXPVAL is `equal' to VAL.
+  KEYWORD          shorthand for \\='KEYWORD
+  INTEGER          shorthand for \\='INTEGER
+  STRING           shorthand for \\='STRING
+  SYMBOL           matches anything and binds it to SYMBOL.
+                   If a SYMBOL is used twice in the same pattern
+                   the second occurrence becomes an `eq'uality test.
+  (or PAT...)      matches if any of the patterns matches.
+  (and PAT...)     matches if all the patterns match.
+  (pred FUN)       matches if FUN called on EXPVAL returns non-nil.
+  (guard BOOLEXP)  matches if BOOLEXP evaluates to non-nil.
+  (let PAT EXPR)   matches if EXPR matches PAT.
+  (app FUN PAT)    matches if FUN called on 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.
+
+FUN, BOOLEXP, EXPR, and subsequent PAT can refer to variables
+bound earlier in the pattern by a SYMBOL pattern.
 
 Additional patterns can be defined using `pcase-defmacro'.
 



reply via email to

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