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