Executes a body of code if a series of forms evaluates to non-
nil
, propagating the results of the forms through the body of code.
A variable whose value is used in the evaluation of body .
A form, which must evaluate to non-
nil
.
A body of code to be evaluated conditionally on the result of form .
The macro when-let* expands into nested when-let forms.
The bindings are evaluated in turn as long as each returns non-
nil
. If the last binding evaluates to non-
nil
,
body
is executed. Within the code
body
, each variable
var
is bound to the result of the corresponding form
form
.
(defmacro divisible (n &rest divisors)
`(when-let* ,(loop for div in divisors
collect (list (gensym)
(zerop (mod n div))))
t))