1 (defpackage :sb-introspect
3 (:export "FUNCTION-ARGLIST" "VALID-FUNCTION-NAME-P"))
5 (in-package :sb-introspect)
7 ;; This is here as a discussion point, not yet a supported interface. If
8 ;; you would like to use the functions here, or you would like other
9 ;; functions to be here, join the debate on sbcl-devel
11 (defun valid-function-name-p (name)
12 "True if NAME denotes a function name that can be passed to MACRO-FUNCTION or FDEFINITION "
13 (and (sb-int:valid-function-name-p name) t))
15 (defun function-arglist (function)
16 "Given a function designator FUNCTION, return a description of its lambda list. Works for macros, simple functions and generic functions"
17 (cond ((valid-function-name-p function)
19 (or (macro-function function) (fdefinition function))))
20 ((typep function 'generic-function)
21 (sb-pcl::generic-function-pretty-arglist function))
23 (sb-impl::%simple-fun-arglist function))))