diff options
| author | Mark Oteiza | 2017-09-13 13:25:41 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2017-09-13 13:27:49 -0400 |
| commit | bdb71dea4a478115bde5c8260f228613d6717157 (patch) | |
| tree | 5fcc6f7485d7f0bb5fb9261f65d6a12b7867079c | |
| parent | 6519df8f5a10826f4a3203aa55da30bca25cb6f1 (diff) | |
| download | emacs-bdb71dea4a478115bde5c8260f228613d6717157.tar.gz emacs-bdb71dea4a478115bde5c8260f228613d6717157.zip | |
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.
| -rw-r--r-- | lisp/emacs-lisp/subr-x.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index ba0ab6cb4c7..8d41f9298b5 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 | |||
| 128 | returned, or the last form in ELSE is returned. | 128 | returned, or the last form in ELSE is returned. |
| 129 | 129 | ||
| 130 | Each element of VARLIST is a list (SYMBOL VALUEFORM) which binds | 130 | Each element of VARLIST is a list (SYMBOL VALUEFORM) which binds |
| 131 | SYMBOL to the value of VALUEFORM). | 131 | SYMBOL to the value of VALUEFORM). An element can additionally |
| 132 | An element can additionally be of the form (VALUEFORM), which is | 132 | be of the form (VALUEFORM), which is evaluated and checked for |
| 133 | evaluated and checked for nil." | 133 | nil; i.e. SYMBOL can be omitted if only the test result is of |
| 134 | interest." | ||
| 134 | (declare (indent 2) | 135 | (declare (indent 2) |
| 135 | (debug ((&rest [&or symbolp (symbolp form) (sexp)]) | 136 | (debug ((&rest [&or symbolp (symbolp form) (sexp)]) |
| 136 | form body))) | 137 | form body))) |
| @@ -139,7 +140,7 @@ evaluated and checked for nil." | |||
| 139 | (if ,(caar (last varlist)) | 140 | (if ,(caar (last varlist)) |
| 140 | ,then | 141 | ,then |
| 141 | ,@else)) | 142 | ,@else)) |
| 142 | `(let* () ,@else))) | 143 | `(let* () ,then))) |
| 143 | 144 | ||
| 144 | (defmacro when-let* (varlist &rest body) | 145 | (defmacro when-let* (varlist &rest body) |
| 145 | "Bind variables according to VARLIST and conditionally eval BODY. | 146 | "Bind variables according to VARLIST and conditionally eval BODY. |