Commit bdb71dea authored by Mark Oteiza's avatar Mark Oteiza

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.
parent 6519df8f
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment