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