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