Source
(defun create-lisp-arglist (method args)
(let* ((no-out-args (remove-if (curry #'member :out) args))
(flags (remove-if (complement (curry #'member :flag))
no-out-args))
(has-keys (or flags
(some (lambda (exp) (eq (third exp) :key))
no-out-args)))
(std-args (mapcar (curry #'create-std-arg method)
(remove-if (funion (curry #'member :flag)
(curry #'member :const)
(curry #'member :key))
no-out-args))))
(if has-keys
(nconc (nconc1 std-args '&key)
(mapcar #'car ;;keywords
(remove-if-not (lambda (exp) (eq (third exp) :key))
no-out-args))
(mapcar #'keyword->symbol ;;flags
(remove-duplicates (mappend #'flag-exp-list flags)
:test #'eq)))
std-args)))
Source Context