Basic constructor macro for branch structures.
(make-branch [:condition <condition>] [:action <action>])
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 '((:condition) (:action)) 'make-branch nil))
Function:
(defun branch (condition action) (declare (xargs :guard (and (expressionp condition) (expressionp action)))) (declare (xargs :guard t)) (let ((__function__ 'branch)) (declare (ignorable __function__)) (b* ((condition (mbe :logic (expression-fix condition) :exec condition)) (action (mbe :logic (expression-fix action) :exec action))) (list (cons 'condition condition) (cons 'action action)))))