Basic constructor macro for expression-when structures.
(make-expression-when [:test <test>] [:then <then>] [:else <else>])
This is the usual way to construct expression-when structures. It simply conses together a structure with the specified fields.
This macro generates a new expression-when structure from scratch. See also change-expression-when, which can "change" an existing structure, instead.
This is an ordinary
Macro:
(defmacro make-expression-when (&rest args) (std::make-aggregate 'expression-when args '((:test) (:then) (:else)) 'make-expression-when nil))
Function:
(defun expression-when (test then else) (declare (xargs :guard (and (expressionp test) (expressionp then) (expressionp else)))) (declare (xargs :guard t)) (let ((__function__ 'expression-when)) (declare (ignorable __function__)) (b* ((test (mbe :logic (expression-fix test) :exec test)) (then (mbe :logic (expression-fix then) :exec then)) (else (mbe :logic (expression-fix else) :exec else))) (cons :when (list test then else)))))