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 bd79b06 15/18: add anchor/heading


From: Thien-Thi Nguyen
Subject: [Emacs-diffs] fix/bug-31311-pcase-doc bd79b06 15/18: add anchor/heading to examples; fix typo
Date: Tue, 15 May 2018 05:45:54 -0400 (EDT)

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

    add anchor/heading to examples; fix typo
---
 doc/lispref/control.texi | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index 98e917f..4787310 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -419,6 +419,9 @@ should all bind the same symbols.
 Matches if all the argument U-patterns match.
 @end table
 
address@hidden
address@hidden Example 1: Using @code{and}
+
 A common idiom is to write a pattern starting with @code{and},
 with one or more @var{symbol} sub-patterns providing bindings
 to the sub-patterns that follow (as well as to the body forms).
@@ -441,6 +444,9 @@ Lastly, @code{guard} matches if the boolean expression
 evaluates to address@hidden
 If all these sub-patterns match, @code{and} matches.
 
address@hidden
address@hidden Example 2: Reformulation with @code{pcase}
+
 Here is another example that shows how to reformulate a simple
 matching task from its traditional implementation
 (function @code{grok/traditional}) to one using
@@ -499,8 +505,7 @@ The pattern is @code{or}, which tries to match in turn its 
argument
 sub-patterns, first @code{and} (lines 2-7), then @code{let} (line 8),
 until one of them succeeds.
 
address@hidden TODO: add anchor (and maybe heading) above; add pxref here
-As in the previous example,
+As in the previous example (@pxref{pcase-example-1,,Example 1}),
 @code{and} begins with a @code{pred} sub-pattern to ensure
 the following sub-patterns work with an object of the correct
 type (string, in this case).  If @address@hidden(stringp @var{expval})}}
@@ -510,7 +515,7 @@ The next @code{pred} (lines 4-5) evaluates
 @address@hidden(string-match RX @var{expval})}}
 and matches if the result is address@hidden, which means
 that @var{expval} has the desired form: @code{key:NUMBER}.
-Again, failing this, @var{pred} fails and @code{and}, too.
+Again, failing this, @code{pred} fails and @code{and}, too.
 
 Lastly (in this series of @code{and} sub-patterns), @code{app}
 evaluates @address@hidden(match-string 1 @var{expval})}}



reply via email to

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