Basic constructor macro for value-struct structures.
(make-value-struct [:tag <tag>] [:members <members>] [:flexiblep <flexiblep>])
This is the usual way to construct value-struct structures. It simply conses together a structure with the specified fields.
This macro generates a new value-struct structure from scratch. See also change-value-struct, which can "change" an existing structure, instead.
This is an ordinary
Macro:
(defmacro make-value-struct (&rest args) (std::make-aggregate 'value-struct args '((:tag) (:members) (:flexiblep)) 'make-value-struct nil))
Function:
(defun value-struct (tag members flexiblep) (declare (xargs :guard (and (identp tag) (member-value-listp members) (booleanp flexiblep)))) (declare (xargs :guard (consp members))) (let ((__function__ 'value-struct)) (declare (ignorable __function__)) (b* ((tag (mbe :logic (ident-fix tag) :exec tag)) (members (mbe :logic (member-value-list-fix members) :exec members)) (flexiblep (mbe :logic (acl2::bool-fix flexiblep) :exec flexiblep))) (let ((members (mbe :logic (if (consp members) members (list (member-value-fix :irrelevant))) :exec members))) (cons :struct (list tag members flexiblep))))))