From 9cde45064c41367b9162c5db59e9d4b71b2b2a2c Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Mon, 9 May 2005 13:09:31 +0000
Subject: [PATCH] Use array-dimension instead of length when printing the
 length of a vector (to prevent confusion when the vector has a fill-pointer).

Also note if the vector is adjustable or not.
---
 code/describe.lisp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/code/describe.lisp b/code/describe.lisp
index d9cb926af..e6c982204 100644
--- a/code/describe.lisp
+++ b/code/describe.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/describe.lisp,v 1.43 2004/05/06 14:36:47 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/describe.lisp,v 1.44 2005/05/09 13:09:31 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -151,7 +151,8 @@
 	(element-type (array-element-type x)))
     (cond ((= rank 1)
 	   (format t "~&~S is a ~:[~;displaced ~]vector of length ~D." x
-		   (and (array-header-p x) (%array-displaced-p x)) (length x))
+		   (and (array-header-p x) (%array-displaced-p x))
+		   (array-dimension x 0))
 	   (if (array-has-fill-pointer-p x)
 	       (format t "~&It has a fill pointer, currently ~d"
 		       (fill-pointer x))
@@ -162,7 +163,9 @@
 	   (format t " array of rank ~A." rank)
 	   (format t "~%Its dimensions are ~S." (array-dimensions x))))
     (unless (eq t element-type)
-      (format t "~&Its element type is specialized to ~S." element-type))))
+      (format t "~&Its element type is specialized to ~S." element-type))
+    (unless (adjustable-array-p x)
+      (format t "~&It is adjustable."))))
 
 (defun describe-fixnum (x)
   (cond ((not (or *describe-verbose* (zerop *current-describe-level*))))
-- 
GitLab