Basic constructor macro for value-struct structures.
(make-value-struct [:type <type>] [:components <components>])
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 '((:type) (:components)) 'make-value-struct nil))
Function:
(defun value-struct (type components) (declare (xargs :guard (and (identifierp type) (value-mapp components)))) (declare (xargs :guard t)) (let ((__function__ 'value-struct)) (declare (ignorable __function__)) (b* ((type (mbe :logic (identifier-fix type) :exec type)) (components (mbe :logic (value-map-fix components) :exec components))) (cons :struct (list type components)))))