Is it possible to find out the argument list of a function, given a function object (or a function\'s symbol) in common lisp?
This is different for each CL implementation but the Swank package (provides Slime which can show arglists in f.e. Emacs' minibuffer) wraps this up in a single function:
* (defun testfn (arg1 arg2 &key (arg3 :a)) (declare (ignore arg1 arg2 arg3)))
TESTFN
* (swank-backend:arglist #'testfn)
(ARG1 ARG2 &KEY (ARG3 :A))
This will also work for methods:
* (defmethod testmethod ((arg1 t) arg2 &key (arg3 :a)) (declare (ignore arg1 arg2 arg3)))
STYLE-WARNING: Implicitly creating new generic function TESTMETHOD.
#
* (swank-backend:arglist #'testmethod)
(ARG1 ARG2 &KEY (ARG3 :A))
The easiest way to get Swank is to use Quicklisp.