Basic constructor macro for name-indexed structures.
(make-name-indexed [:string <string>] [: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 '((:string) (:index)) 'make-name-indexed nil))
Function:
(defun name-indexed (string index) (declare (xargs :guard (and (stringp string) (natp index)))) (declare (xargs :guard t)) (let ((__function__ 'name-indexed)) (declare (ignorable __function__)) (b* ((string (mbe :logic (str-fix string) :exec string)) (index (mbe :logic (nfix index) :exec index))) (cons :indexed (list string index)))))