emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] fix/bug-3133-pcase-doc fa03d3a 06/13: (docstring) rewrite


From: Thien-Thi Nguyen
Subject: [Emacs-diffs] fix/bug-3133-pcase-doc fa03d3a 06/13: (docstring) rewrite first para
Date: Fri, 11 May 2018 12:50:51 -0400 (EDT)

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

    (docstring) rewrite first para
    
    - introduce ‘EXPVAL’ in first line
    - mention control flow in first line
    - expand
      - allude to iteration
      - mention ‘PATTERN’, "matches", ‘CODE’
      - describe return value in all cases
---
 lisp/emacs-lisp/pcase.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index ce148c9..5505760 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -108,8 +108,11 @@
 
 ;;;###autoload
 (defmacro pcase (exp &rest cases)
-  "Evaluate EXP and attempt to match it against structural patterns.
+  "Evaluate EXP to get EXPVAL; try passing control to one of CASES.
 CASES is a list of elements of the form (PATTERN CODE...).
+For the first CASE whose PATTERN \"matches\" EXPVAL,
+evaluate its CODE..., and return the value of the last form.
+If no CASE has a PATTERN that matches, return nil.
 
 A structural PATTERN describes a template that identifies a class
 of values.  For example, the pattern \\=`(,foo ,bar) matches any



reply via email to

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