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 abf7e6a 03/18: zonk "side-effectin


From: Thien-Thi Nguyen
Subject: [Emacs-diffs] fix/bug-31311-pcase-doc abf7e6a 03/18: zonk "side-effecting" Issue comment lines
Date: Tue, 15 May 2018 05:45:52 -0400 (EDT)

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

    zonk "side-effecting" Issue comment lines
---
 doc/lispref/control.texi | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index e5d2440..0b98e03 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -446,7 +446,6 @@ forms described for @var{predfun}, above.
 This is like @code{pred},
 except that it tests the result against @var{pattern},
 rather than against a boolean truth value.
address@hidden Issue: Same as below (side-effecting FUNCTION or PATTERN).
 
 @item (guard @var{boolean-expression})
 Matches if @var{boolean-expression} evaluates to address@hidden  This
@@ -456,28 +455,6 @@ previous U-patterns.  Typically used inside an @code{and} 
U-pattern, 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.
address@hidden What about side-effecting (ugh-lý :-D) BOOLEAN-EXPRESSION
address@hidden that mutates let-bound vars?  Any (dis-)guarantees?  Consider:
address@hidden
address@hidden (defun hmm (n)
address@hidden   (pcase n
address@hidden     ((and x (guard (< (decf x) 10)))
address@hidden      (list 'single-digit x))))
address@hidden
address@hidden (hmm 42) => nil
address@hidden (hmm 11) => nil
address@hidden (hmm 10) => (single-digit 10)
address@hidden (hmm 1)  => (single-digit 1)
address@hidden (hmm 0)  => (single-digit 0)
address@hidden
address@hidden Maybe there is some discussion of this already?
address@hidden Issue: Pick one:
address@hidden        - This is a design decision.  Document the limitation
address@hidden          (i.e., BOOLEAN-EXPRESSION SHOULD NOT be side-effecting).
address@hidden        - This is an unforseen case; behavior is based on the
address@hidden          implementation (‘cond’ + redundant ‘let*’ expansion)
address@hidden          and is considered {undefined, wontfix, futurefix}.
address@hidden          Leave undocumented for now.
 
 @item (let @var{pattern} @var{expr})
 Evaluates @var{expr} to get @var{exprval}
@@ -486,7 +463,6 @@ and matches if @var{exprval} matches @var{pattern}.
 @var{pattern} can bind symbols to values using the @var{symbol}
 U-pattern.  For example:
 @address@hidden((or `(key . ,val) (let val 5)) val)}}.)
address@hidden Issue: Same as above (side-effecting EXPRESSION).
 
 @item (or @var{pattern1} @address@hidden)
 Matches if one the argument U-patterns matches.  As soon as the first



reply via email to

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