Keyword arguments of a macro, in order, with their default values.
(macro-keyword-args mac wrld) → keyword-args
Starting from the full argument list of the macro,
first we find
Keyword arguments have one of the forms
See macro-keyword-args for an enhanced variant of this utility.
Function:
(defun macro-keyword-args-aux (args) (declare (xargs :guard (true-listp args))) (let ((__function__ 'macro-keyword-args-aux)) (declare (ignorable __function__)) (b* (((when (endp args)) nil) (arg (car args)) ((when (lambda-keywordp arg)) nil) (name (if (atom arg) arg (first arg))) (default (if (atom arg) nil (unquote (second arg))))) (acons name default (macro-keyword-args-aux (cdr args))))))
Function:
(defun macro-keyword-args (mac wrld) (declare (xargs :guard (and (symbolp mac) (plist-worldp wrld)))) (let ((__function__ 'macro-keyword-args)) (declare (ignorable __function__)) (b* ((all-args (macro-args mac wrld)) (args-after-&key (cdr (member-eq '&key all-args))) (keyword-args (macro-keyword-args-aux args-after-&key))) keyword-args)))