From: Daniel Barlow <dan_b@us...> - 2003-10-09 13:50:39
Update of /cvsroot/sbcl/sbcl/contrib/sb-introspect
In directory sc8-pr-cvs1:/tmp/cvs-serv10979/contrib/sb-introspect
Added sb-introspect contrib to SBCL. Mostly for
experimentation at this stage: do not use this stuff in
client code unless you are willing to revisit it later, and
please do say if it does things differently than you wanted.
--- NEW FILE: Makefile ---
--- NEW FILE: sb-introspect.lisp ---
(:export "FUNCTION-ARGLIST" "VALID-FUNCTION-NAME-P"))
;; This is here as a discussion point, not yet a supported interface. If
;; you would like to use the functions here, or you would like other
;; functions to be here, join the debate on sbcl-devel
(defun valid-function-name-p (name)
"True if NAME denotes a function name that can be passed to MACRO-FUNCTION or FDEFINITION "
(and (sb-int:valid-function-name-p name) t))
(defun function-arglist (function)
"Given a function designator FUNCTION, return a description of its lambda list. Works for macros, simple functions and generic functions"
(cond ((valid-function-name-p function)
(or (macro-function function) (fdefinition function))))
((typep function 'generic-function)