How can i get a lambda list specification of a some function parameters, or at least a number of arguments it takes?
For example:
(defun a (a b) )
(get-arg-list #'a) ;-> '(a b)
Common Lisp provides the function FUNCTION-LAMBDA-EXPRESSION which may be able to recover the source expression, which then includes the lambda list.
LispWorks has defined a function FUNCTION-LAMBDA-LIST which returns the arglist.
Many other implementations have some form of ARGLIST function in some internal package.
Many Common Lisp users use SLIME, a very clever editor extension for the GNU Emacs editor. It has a backend for Common Lisp called SWANK. The SWANK sources provide all kinds of interfaces to the various Common Lisp implementations, including getting the arglist of functions.
This is implementation specific, but this CLHS function might get you started - http://clhs.lisp.se/Body/f_descri.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With