Required arguments of a macro, in order.
(macro-required-args mac wrld) → required-args
The arguments of a macro form a list that
optionally starts with
After removing
See macro-required-args+ for an enhanced variant of this utility.
Function:
(defun macro-required-args-aux (args) (declare (xargs :guard (true-listp args))) (let ((__function__ 'macro-required-args-aux)) (declare (ignorable __function__)) (if (endp args) nil (b* ((arg (car args))) (if (lambda-keywordp arg) nil (cons arg (macro-required-args-aux (cdr args))))))))
Function:
(defun macro-required-args (mac wrld) (declare (xargs :guard (and (symbolp mac) (plist-worldp wrld)))) (let ((__function__ 'macro-required-args)) (declare (ignorable __function__)) (b* ((all-args (macro-args mac wrld))) (if (endp all-args) nil (if (eq (car all-args) '&whole) (macro-required-args-aux (cddr all-args)) (macro-required-args-aux all-args))))))