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