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