3 ms·
In Common Lisp, there is `unless' and `when' but they don't allow `else' branch. (when CONDITION BODY) (unless CONDITION BODY) The value of the statement
by gjadi 4y ago
In Common Lisp, there is `unless' and `when' but they don't allow `else' branch.
(when CONDITION
BODY)
(unless CONDITION
BODY)
The value of the statement is BODY or NIL if it wasn't executed.
I can't remember a time when it wasn't clear (though you can always build usage that are unclear).
- tsimionescu 4y agoI think they mainly exist because `if' otherwise requires a `progn' if you want more than one expression in the true branch.
- tmtvl 4y agoAnd using `cond' for 1 clause is a bit silly. (cond ((massivep building) (print-mass-warning building) (install-antigrav-module building)))