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 1c84726 14/16: move ‘app’ to imme


From: Thien-Thi Nguyen
Subject: [Emacs-diffs] fix/bug-31311-pcase-doc 1c84726 14/16: move ‘app’ to immediately follow ‘pred’
Date: Sun, 13 May 2018 13:16:36 -0400 (EDT)

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

    move ‘app’ to immediately follow ‘pred’
    
    Since ‘app’ is conceptually very similar to ‘pred’, grouping
    them together helps maintain reader's train-of-thought "momentum".
---
 doc/lispref/control.texi | 20 ++++++++++----------
 lisp/emacs-lisp/pcase.el |  2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index a8f5387..739a675 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -440,6 +440,16 @@ In this example, the function is @code{=}, @var{n} is one, 
and
 the actual function call becomes: @address@hidden(= 42 @var{expval})}}.
 @end table
 
address@hidden (app @var{function} @var{upattern})
+Matches if @var{function} called on @var{expval} returns a
+value that matches @var{upattern}.
address@hidden can take one of the
+forms described for @var{predfun}, above.
+This is like @code{pred},
+except that it tests the result against @var{upattern},
+rather than against a boolean truth value.
address@hidden Issue: Same as below (side-effecting FUNCTION or UPATTERN).
+
 @item (guard @var{boolean-expression})
 Matches if @var{boolean-expression} evaluates to address@hidden  This
 allows you to include in a U-pattern boolean conditions that refer to
@@ -480,16 +490,6 @@ U-pattern.  For example:
 @address@hidden((or `(key . ,val) (let val 5)) val)}}.)
 @c Issue: Same as above (side-effecting EXPRESSION).
 
address@hidden (app @var{function} @var{upattern})
-Matches if @var{function} called on @var{expval} returns a
-value that matches @var{upattern}.
address@hidden can take one of the
-forms described for @var{predfun}, above.
-This is like @code{pred},
-except that it tests the result against @var{upattern},
-rather than against a boolean truth value.
address@hidden Issue: Same as above (side-effecting FUNCTION or UPATTERN).
-
 @item (or @var{upattern1} @address@hidden)
 Matches if one the argument U-patterns matches.  As soon as the first
 matching U-pattern is found, the rest are not tested.  For this reason,
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 79e00de..57a2952 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -129,9 +129,9 @@ the pattern matches.  A pattern can take one of the forms:
   (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.
+  (app FUN PAT)    matches if FUN called on EXPVAL matches PAT.
   (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)



reply via email to

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