Commit 346d8a63 authored by Daniel Barlow's avatar Daniel Barlow
Browse files

0.8.4.13

	 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.
parent b61003de
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
MODULE=sb-introspect
include ../vanilla-module.mk

test::
	true
+24 −0
Original line number Diff line number Diff line
(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))))
+1 −1
Original line number Diff line number Diff line
@@ -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"