I want to make the most generic function and decided to go with keys as arguments.
I want to use allow-other-keys
since I want to use the function with any key.
Let me show you:
(defun myfunc (a &rest rest &key b &allow-other-keys)
;; Print A
(format t "A = ~a~%" a)
;; Print B if defined
(when b
(format t "B = ~a~%" b))
;; Here ... I want to print C or D or any other keys
;; ??
)
(myfunc "Value of A")
(myfunc "Value of A" :b "Value of B")
(myfunc "Value of A" :b "Value of B" :c "Value of C" :d "Value of D")
I know that rest
is the remaining args but it has an array. It does not bind values c
or d
or even build them like an associative list (i.e to do sth like (cdr (assoc 'c rest))
)
Do you have a clue or a solution ? Or maybe I am going in the wrong direction ?
Thanks in advance
getf
in my case. Thanks for your answer. – Kocher