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