Basic constructor macro for enum-spec structures.
(make-enum-spec [:name? <name?>]
[:enumers <enumers>]
[:final-comma <final-comma>])
This is the usual way to construct enum-spec structures. It simply conses together a structure with the specified fields.
This macro generates a new enum-spec structure from scratch. See also change-enum-spec, which can "change" an existing structure, instead.
This is an ordinary
Macro:
(defmacro make-enum-spec (&rest args) (std::make-aggregate 'enum-spec args '((:name?) (:enumers) (:final-comma)) 'make-enum-spec nil))
Function:
(defun enum-spec (name? enumers final-comma) (declare (xargs :guard (and (ident-optionp name?) (enumer-listp enumers) (booleanp final-comma)))) (declare (xargs :guard t)) (b* ((name? (mbe :logic (ident-option-fix name?) :exec name?)) (enumers (mbe :logic (enumer-list-fix enumers) :exec enumers)) (final-comma (mbe :logic (bool-fix final-comma) :exec final-comma))) (cons name? (cons enumers final-comma))))