Function: if-let*
if-let* is a macro defined in subr.el.gz.
Signature
(if-let* VARLIST THEN &rest ELSE)
Documentation
Bind variables according to VARLIST and evaluate THEN or ELSE.
Evaluate each binding in turn, as in let*, stopping if a
binding value is nil. If all are non-nil return the value of
THEN, otherwise the value of the last form in ELSE, or nil if
there are none.
Each element of VARLIST is a list (SYMBOL VALUEFORM) that binds 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. It can also be of the form SYMBOL, then the binding of SYMBOL is checked for nil.
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defmacro if-let* (varlist then &rest else)
"Bind variables according to VARLIST and evaluate THEN or ELSE.
Evaluate each binding in turn, as in `let*', stopping if a
binding value is nil. If all are non-nil return the value of
THEN, otherwise the value of the last form in ELSE, or nil if
there are none.
Each element of VARLIST is a list (SYMBOL VALUEFORM) that binds
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. It can also be of the form SYMBOL, then the binding of
SYMBOL is checked for nil."
(declare (indent 2)
(debug ((&rest [&or symbolp (symbolp form) (form)])
body)))
(if varlist
`(let* ,(setq varlist (internal--build-bindings varlist))
(if ,(caar (last varlist))
,then
,@else))
`(let* () ,then)))