Get the value for a keyword argument like
(extract-keyword-from-args kwd args) is given
(extract-keyword-from-args :bar '(:foo 3 :bar 5 :baz 7)) --> (:bar . 5)
This function is mainly useful for writing macros that mix
Function:
(defun extract-keyword-from-args (kwd args) (declare (xargs :guard (keywordp kwd))) (cond ((atom args) nil) ((eq (car args) kwd) (if (consp (cdr args)) (cons (car args) (cadr args)) (er hard? 'extract-keyword-from-args "Expected something to follow ~s0." kwd))) (t (extract-keyword-from-args kwd (cdr args)))))