0.8.4.13
authorDaniel Barlow <dan@telent.net>
Thu, 9 Oct 2003 13:50:34 +0000 (13:50 +0000)
committerDaniel Barlow <dan@telent.net>
Thu, 9 Oct 2003 13:50:34 +0000 (13:50 +0000)
 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.

contrib/sb-introspect/Makefile [new file with mode: 0644]
contrib/sb-introspect/sb-introspect.lisp [new file with mode: 0644]
version.lisp-expr

diff --git a/contrib/sb-introspect/Makefile b/contrib/sb-introspect/Makefile
new file mode 100644 (file)
index 0000000..9ebf1a4
--- /dev/null
@@ -0,0 +1,5 @@
+MODULE=sb-introspect
+include ../vanilla-module.mk
+
+test::
+       true
diff --git a/contrib/sb-introspect/sb-introspect.lisp b/contrib/sb-introspect/sb-introspect.lisp
new file mode 100644 (file)
index 0000000..8e9c9a9
--- /dev/null
@@ -0,0 +1,24 @@
+(defpackage :sb-introspect
+  (:use "CL")
+  (:export "FUNCTION-ARGLIST" "VALID-FUNCTION-NAME-P"))
+
+(in-package :sb-introspect)
+
+;; 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) 
+         (function-arglist
+         (or (macro-function function) (fdefinition function))))
+        ((typep function 'generic-function)
+         (sb-pcl::generic-function-pretty-arglist function))
+        (t
+         (sb-impl::%simple-fun-arglist function))))
+
index cfce20d..9f02057 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.4.12"
+"0.8.4.13"