[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] fix/bug-31311-pcase-doc 46d5824 1/6: add blank line before
From: |
Thien-Thi Nguyen |
Subject: |
[Emacs-diffs] fix/bug-31311-pcase-doc 46d5824 1/6: add blank line before each @item in @table |
Date: |
Tue, 1 May 2018 05:18:10 -0400 (EDT) |
branch: fix/bug-31311-pcase-doc
commit 46d58247f16981c83bce1d2a61b4865b18a62aa4
Author: Thien-Thi Nguyen <address@hidden>
Commit: Thien-Thi Nguyen <address@hidden>
add blank line before each @item in @table
---
doc/lispref/control.texi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index adec632..9fedc19 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -335,21 +335,26 @@ A UPattern can have the following forms:
@item '@var{val}
Matches if the value being matched is @code{equal} to @var{val}.
+
@item @var{atom}
Matches any @var{atom}, which can be a keyword, a number, or a string.
(These are self-quoting, so this kind of UPattern is actually a
shorthand for @code{'@var{atom}}.) Note that a string or a float
matches any string or float with the same contents/value.
+
@item _
Matches any value. This is known as @dfn{don't care} or @dfn{wildcard}.
+
@item @var{symbol}
Matches any value, and additionally let-binds @var{symbol} to the
value it matched, so that you can later refer to it, either in the
@var{body-forms} or also later in the pattern.
+
@item (pred @var{predfun})
Matches if the predicate function @var{predfun} returns address@hidden
when called with the value being matched as its argument.
@var{predfun} can be one of the possible forms described below.
+
@item (guard @var{boolean-expression})
Matches if @var{boolean-expression} evaluates to address@hidden This
allows you to include in a UPattern boolean conditions that refer to
@@ -358,6 +363,7 @@ previous UPatterns. Typically used inside an @code{and}
UPattern, see
below. For example, @address@hidden(and x (guard (< x 10)))}} is a pattern
which matches any number smaller than 10 and let-binds the variable
@code{x} to that number.
+
@item (let @var{upattern} @var{expression})
Matches if the specified @var{expression} matches the specified
@var{upattern}. This allows matching a pattern against the value of
@@ -366,17 +372,20 @@ first argument to @code{pcase}. (It is called @code{let}
because
@var{upattern} can bind symbols to values using the @var{symbol}
UPattern. For example:
@address@hidden((or `(key . ,val) (let val 5)) val)}}.)
+
@item (app @var{function} @var{upattern})
Matches if @var{function} applied to the value being matched returns a
value that matches @var{upattern}. This is like the @code{pred}
UPattern, except that it tests the result against @var{upattern},
rather than against a boolean truth value. The @var{function} call can
use one of the forms described below.
+
@item (or @var{upattern1} @address@hidden)
Matches if one the argument UPatterns matches. As soon as the first
matching UPattern is found, the rest are not tested. For this reason,
if any of the UPatterns let-bind symbols to the matched value, they
should all bind the same symbols.
+
@item (and @var{upattern1} @address@hidden)
Matches if all the argument UPatterns match.
@end table
- [Emacs-diffs] branch fix/bug-31311-pcase-doc created (now e8dd2a7), Thien-Thi Nguyen, 2018/05/01
- [Emacs-diffs] fix/bug-31311-pcase-doc f870e5e 3/6: move UPattern and QPattern tables outside of @defmac pcase, Thien-Thi Nguyen, 2018/05/01
- [Emacs-diffs] fix/bug-31311-pcase-doc 32eee97 2/6: rewrite @item @var{atom}, Thien-Thi Nguyen, 2018/05/01
- [Emacs-diffs] fix/bug-31311-pcase-doc 46d5824 1/6: add blank line before each @item in @table,
Thien-Thi Nguyen <=
- [Emacs-diffs] fix/bug-31311-pcase-doc e8dd2a7 6/6: s/number/integer/ per feedback from Michael Heerdegen <address@hidden>, Thien-Thi Nguyen, 2018/05/01
- [Emacs-diffs] fix/bug-31311-pcase-doc 8929957 5/6: explode first address@hidden pcase’ para, Thien-Thi Nguyen, 2018/05/01
- [Emacs-diffs] fix/bug-31311-pcase-doc 702131a 4/6: add blank line before each @item in @table, Thien-Thi Nguyen, 2018/05/01