* Deprecate FUNCTION-ARGLIST.
* Improve the docstring.
* Original patch by Tobias Rittweiler.
;;;; -*- coding: utf-8; fill-column: 78 -*-
changes in sbcl-1.0.25 relative to 1.0.24:
;;;; -*- coding: utf-8; fill-column: 78 -*-
changes in sbcl-1.0.25 relative to 1.0.24:
+ * incompatible change: SB-INTROSPECT:FUNCTION-ARGLIST is deprecated, to be
+ removed later. Please use SB-INTROSPECT:FUNCTION-LAMBDA-LIST instead.
* new feature: SB-INTROSPECT:DEFTYPE-LAMBDA-LIST allows retrieval of
DEFTYPE lambda lists. (thanks to Tobias Rittweiler)
* improvement: reading from a TWO-WAY-STREAM does not touch the output
* new feature: SB-INTROSPECT:DEFTYPE-LAMBDA-LIST allows retrieval of
DEFTYPE lambda lists. (thanks to Tobias Rittweiler)
* improvement: reading from a TWO-WAY-STREAM does not touch the output
(defpackage :sb-introspect
(:use "CL")
(:export "FUNCTION-ARGLIST"
(defpackage :sb-introspect
(:use "CL")
(:export "FUNCTION-ARGLIST"
"DEFTYPE-LAMBDA-LIST"
"VALID-FUNCTION-NAME-P"
"FIND-DEFINITION-SOURCE"
"DEFTYPE-LAMBDA-LIST"
"VALID-FUNCTION-NAME-P"
"FIND-DEFINITION-SOURCE"
;; FIXME there may be other structure predicate functions
(member self (list *struct-predicate*))))
;; FIXME there may be other structure predicate functions
(member self (list *struct-predicate*))))
-;;; FIXME: maybe this should be renamed as FUNCTION-LAMBDA-LIST?
(defun function-arglist (function)
(defun function-arglist (function)
+ "Deprecated alias for FUNCTION-LAMBDA-LIST."
+ (function-lambda-list function))
+
+(define-compiler-macro function-arglist (function)
+ (sb-int:deprecation-warning 'function-arglist 'function-lambda-list)
+ `(function-lambda-list ,function))
+
+(defun function-lambda-list (function)
"Describe the lambda list for the extended function designator FUNCTION.
"Describe the lambda list for the extended function designator FUNCTION.
-Works for special-operators, macros, simple functions,
-interpreted functions, and generic functions. Signals error if
-not found"
+Works for special-operators, macros, simple functions, interpreted functions,
+and generic functions. Signals an error if FUNCTION is not a valid extended
+function designator."
(cond ((valid-function-name-p function)
(cond ((valid-function-name-p function)
- (function-arglist (or (and (symbolp function)
- (macro-function function))
- (fdefinition function))))
+ (function-lambda-list (or (and (symbolp function)
+ (macro-function function))
+ (fdefinition function))))
((typep function 'generic-function)
(sb-pcl::generic-function-pretty-arglist function))
#+sb-eval
((typep function 'sb-eval:interpreted-function)
(sb-eval:interpreted-function-lambda-list function))
((typep function 'generic-function)
(sb-pcl::generic-function-pretty-arglist function))
#+sb-eval
((typep function 'sb-eval:interpreted-function)
(sb-eval:interpreted-function-lambda-list function))
- (t (sb-kernel:%simple-fun-arglist (sb-kernel:%fun-fun function)))))
+ (t
+ (sb-kernel:%simple-fun-arglist (sb-kernel:%fun-fun function)))))
(defun deftype-lambda-list (typespec-operator)
"Returns the lambda list of TYPESPEC-OPERATOR as first return
(defun deftype-lambda-list (typespec-operator)
"Returns the lambda list of TYPESPEC-OPERATOR as first return
(with-compilation-unit (:source-plist (list :test-outer "OUT"))
(load (compile-file (merge-pathnames "test.lisp" *load-pathname*))))
(with-compilation-unit (:source-plist (list :test-outer "OUT"))
(load (compile-file (merge-pathnames "test.lisp" *load-pathname*))))
-(assert (equal (function-arglist 'cl-user::one)
+(assert (equal (function-lambda-list 'cl-user::one)
'(cl-user::a cl-user::b cl-user::c)))
'(cl-user::a cl-user::b cl-user::c)))
-(assert (equal (function-arglist 'the)
+(assert (equal (function-lambda-list 'the)
'(sb-c::value-type sb-c::form)))
'(sb-c::value-type sb-c::form)))
-(assert (equal (function-arglist #'(sb-pcl::slow-method cl-user::j (t)))
+(assert (equal (function-lambda-list #'(sb-pcl::slow-method cl-user::j (t)))
'(sb-pcl::method-args sb-pcl::next-methods)))
(let ((source (find-definition-source #'cl-user::one)))
'(sb-pcl::method-args sb-pcl::next-methods)))
(let ((source (find-definition-source #'cl-user::one)))
(sb-profile:unprofile cl-user::one)
(sb-profile:unprofile cl-user::one)
-;;;; Check correctness of FUNCTION-ARGLIST.
+;;;; Check correctness of FUNCTION-LAMBDA-LIST.
-(assert (equal (function-arglist 'cl-user::one)
+(assert (equal (function-lambda-list 'cl-user::one)
'(cl-user::a cl-user::b cl-user::c)))
'(cl-user::a cl-user::b cl-user::c)))
-(assert (equal (function-arglist 'the)
+(assert (equal (function-lambda-list 'the)
'(sb-c::value-type sb-c::form)))
;;; Check wrt. interplay of generic functions and their methods.
'(sb-c::value-type sb-c::form)))
;;; Check wrt. interplay of generic functions and their methods.
;;
(multiple-value-bind (required optional restp rest keyp keys allowp
auxp aux morep more-context more-count)
;;
(multiple-value-bind (required optional restp rest keyp keys allowp
auxp aux morep more-context more-count)
- (sb-int:parse-lambda-list (function-arglist #'xuuq))
+ (sb-int:parse-lambda-list (function-lambda-list #'xuuq))
(assert (equal required '(gf.a gf.b)))
(assert (null optional))
(assert (and restp (eql rest 'gf.rest)))
(assert (equal required '(gf.a gf.b)))
(assert (null optional))
(assert (and restp (eql rest 'gf.rest)))
(defmethod kroolz (r1 r2 &optional opt &aux aux)
(declare (ignore r1 r2 opt aux))
'kroolz)
(defmethod kroolz (r1 r2 &optional opt &aux aux)
(declare (ignore r1 r2 opt aux))
'kroolz)
-(assert (equal (function-arglist #'kroolz) '(r1 r2 &optional opt)))
+(assert (equal (function-lambda-list #'kroolz) '(r1 r2 &optional opt)))
;;;; Test finding a type that isn't one
(assert (not (find-definition-sources-by-name 'fboundp :type)))
;;;; Test finding a type that isn't one
(assert (not (find-definition-sources-by-name 'fboundp :type)))
(cond ((or key optional) (car x))
(t (clean (car x))))
(clean (cdr x) :key key :optional optional))))))
(cond ((or key optional) (car x))
(t (clean (car x))))
(clean (cdr x) :key key :optional optional))))))
- (clean (sb-introspect:function-arglist (get-name doc))))))))
+ (clean (sb-introspect:function-lambda-list (get-name doc))))))))
(defun documentation< (x y)
(let ((p1 (position (get-kind x) *ordered-documentation-kinds*))
(defun documentation< (x y)
(let ((p1 (position (get-kind x) *ordered-documentation-kinds*))
;;; 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".)
;;; 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".)