Basic constructor macro for pnumber-digit structures.
(make-pnumber-digit [:digit <digit>])
This is the usual way to construct pnumber-digit structures. It simply conses together a structure with the specified fields.
This macro generates a new pnumber-digit structure from scratch. See also change-pnumber-digit, which can "change" an existing structure, instead.
This is an ordinary
Macro:
(defmacro make-pnumber-digit (&rest args) (std::make-aggregate 'pnumber-digit args '((:digit)) 'make-pnumber-digit nil))
Function:
(defun pnumber-digit (digit) (declare (xargs :guard (characterp digit))) (declare (xargs :guard (dec-digit-char-p digit))) (b* ((digit (mbe :logic (acl2::char-fix digit) :exec digit))) (let ((digit (mbe :logic (if (dec-digit-char-p digit) digit #\0) :exec digit))) (cons :digit (list digit)))))