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