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