From: Nikodemus Siivola Date: Wed, 12 Oct 2005 12:35:31 +0000 (+0000) Subject: 0.9.5.47: minor INSPECT & DESCRIBE improvements X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=c457d41e87e7ab27bb92f59f0e7839fe23b9d020;p=sbcl.git 0.9.5.47: minor INSPECT & DESCRIBE improvements * INSPECT on closures should not display the closure itself. * Refactor DESCRIBE to use %CLOSURE-VALUES too, and clean up printing of the source form when from lisp. * Amend bug 33 to reflect current state of affairs. --- diff --git a/BUGS b/BUGS index a9bd148..e8f41ef 100644 --- a/BUGS +++ b/BUGS @@ -94,6 +94,9 @@ WORKAROUND: And as long as we're wishing, it would be awfully nice if INSPECT could also report on closures, telling about the values of the bound variables. + Currently INSPECT and DESCRIBE do show the values, but showing the + names of the bindings would be even nicer. + 35: The compiler assumes that any time a function of declared FTYPE doesn't signal an error, its arguments were of the declared type. diff --git a/src/code/describe.lisp b/src/code/describe.lisp index 17aba76..1ec98ed 100644 --- a/src/code/describe.lisp +++ b/src/code/describe.lisp @@ -166,7 +166,7 @@ (:file (format s "~&~A~@:_ Created: " (namestring name)) (format-universal-time s (sb-c::debug-source-created source))) - (:lisp (format s "~&~S" name))))))))) + (:lisp (format s "~& ~S" (aref name 0)))))))))) ;;; Describe a compiled function. The closure case calls us to print ;;; the guts. @@ -210,11 +210,10 @@ (case (widetag-of x) (#.sb-vm:closure-header-widetag (%describe-fun-compiled (%closure-fun x) s kind name) - (format s "~@:_Its closure environment is:") - (pprint-logical-block (s nil) - (pprint-indent :current 8) - (dotimes (i (- (get-closure-length x) (1- sb-vm:closure-info-offset))) - (format s "~@:_~S: ~S" i (%closure-index-ref x i))))) + (format s "~&Its closure environment is:") + (loop for value in (%closure-values x) + for i = 0 then (1+ i) + do (format s "~& ~S: ~S" i value))) (#.sb-vm:simple-fun-header-widetag (%describe-fun-compiled x s kind name)) (#.sb-vm:funcallable-instance-header-widetag diff --git a/src/code/target-misc.lisp b/src/code/target-misc.lisp index a641538..65fe84d 100644 --- a/src/code/target-misc.lisp +++ b/src/code/target-misc.lisp @@ -57,9 +57,9 @@ (defun %closure-values (object) (declare (function object)) - (coerce (loop for index from 0 below (1- (get-closure-length object)) - collect (%closure-index-ref object index)) - 'simple-vector)) + (loop for index from 0 + below (- (get-closure-length object) (1- sb!vm:closure-info-offset)) + collect (%closure-index-ref object index))) (defun %fun-lambda-list (object) (%simple-fun-arglist (%fun-fun object))) diff --git a/version.lisp-expr b/version.lisp-expr index d1e1b02..2d286fc 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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.9.5.46" +"0.9.5.47"