Basic constructor macro for schar-array structures.
(make-schar-array [:elemtype <elemtype>] [:elements <elements>])
This is the usual way to construct schar-array structures. It simply conses together a structure with the specified fields.
This macro generates a new schar-array structure from scratch. See also change-schar-array, which can "change" an existing structure, instead.
This is an ordinary
Macro:
(defmacro make-schar-array (&rest args) (std::make-aggregate 'schar-array args '((:elemtype) (:elements)) 'make-schar-array nil))
Function:
(defun schar-array (elemtype elements) (declare (xargs :guard (and (typep elemtype) (schar-listp elements)))) (declare (xargs :guard (and (type-case elemtype :schar) (consp elements)))) (let ((__function__ 'schar-array)) (declare (ignorable __function__)) (b* ((elemtype (mbe :logic (type-fix elemtype) :exec elemtype)) (elements (mbe :logic (schar-list-fix elements) :exec elements))) (let ((elemtype (mbe :logic (if (type-case elemtype :schar) elemtype (type-schar)) :exec elemtype)) (elements (mbe :logic (if (consp elements) elements (list (schar-from-integer 0))) :exec elements))) (cons :array (list elemtype elements))))))