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