emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master bdb71de: Add clarification to if-let* docstring


From: Mark Oteiza
Subject: [Emacs-diffs] master bdb71de: Add clarification to if-let* docstring
Date: Wed, 13 Sep 2017 13:27:52 -0400 (EDT)

branch: master
commit bdb71dea4a478115bde5c8260f228613d6717157
Author: Mark Oteiza <address@hidden>
Commit: Mark Oteiza <address@hidden>

    Add clarification to if-let* docstring
    
    Also make its behaviour consistent with and-let* in that empty bindings
    results in success, not failure.
    * lisp/emacs-lisp/subr-x.el: Edit docstring, change else to then.
---
 lisp/emacs-lisp/subr-x.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index ba0ab6c..8d41f92 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -128,9 +128,10 @@ binding value is nil.  If all are non-nil, the value of 
THEN is
 returned, or the last form in ELSE is returned.
 
 Each element of VARLIST is a list (SYMBOL VALUEFORM) which binds
-SYMBOL to the value of VALUEFORM).
-An element can additionally be of the form (VALUEFORM), which is
-evaluated and checked for nil."
+SYMBOL to the value of VALUEFORM).  An element can additionally
+be of the form (VALUEFORM), which is evaluated and checked for
+nil; i.e. SYMBOL can be omitted if only the test result is of
+interest."
   (declare (indent 2)
            (debug ((&rest [&or symbolp (symbolp form) (sexp)])
                    form body)))
@@ -139,7 +140,7 @@ evaluated and checked for nil."
          (if ,(caar (last varlist))
              ,then
            ,@else))
-    `(let* () ,@else)))
+    `(let* () ,then)))
 
 (defmacro when-let* (varlist &rest body)
   "Bind variables according to VARLIST and conditionally eval BODY.



reply via email to

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