1.0.24.5: SB-INTROSPECT: rename FUNCTION-ARGLIST to FUNCTION-LAMBDA-LIST
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 2 Jan 2009 14:24:03 +0000 (14:24 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 2 Jan 2009 14:24:03 +0000 (14:24 +0000)
 * Deprecate FUNCTION-ARGLIST.

 * Improve the docstring.

 * Original patch by Tobias Rittweiler.

NEWS
contrib/sb-introspect/sb-introspect.lisp
contrib/sb-introspect/test-driver.lisp
doc/manual/docstrings.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 6e7338b..e1ac562 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 ;;;; -*- 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
index 76b6452..d962f6c 100644 (file)
@@ -25,6 +25,7 @@
 (defpackage :sb-introspect
   (:use "CL")
   (:export "FUNCTION-ARGLIST"
 (defpackage :sb-introspect
   (:use "CL")
   (:export "FUNCTION-ARGLIST"
+          "FUNCTION-LAMBDA-LIST"
            "DEFTYPE-LAMBDA-LIST"
            "VALID-FUNCTION-NAME-P"
            "FIND-DEFINITION-SOURCE"
            "DEFTYPE-LAMBDA-LIST"
            "VALID-FUNCTION-NAME-P"
            "FIND-DEFINITION-SOURCE"
@@ -414,22 +415,30 @@ If an unsupported TYPE is requested, the function will return NIL.
     ;; 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
index 8762f2b..4c0ac1f 100644 (file)
@@ -7,12 +7,12 @@
 (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.
@@ -99,7 +99,7 @@
 ;;
 (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)))
index 1177d3d..86b1212 100644 (file)
@@ -388,7 +388,7 @@ there is no corresponding docstring."
                       (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*))
index 907579b..d53532f 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".)
 ;;; 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".)
-"1.0.24.4"
+"1.0.24.5"