Skip to content
Snippets Groups Projects
Commit 9cde4506 authored by rtoy's avatar rtoy
Browse files

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.
parent 25736499
No related branches found
No related tags found
No related merge requests found
......@@ -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*))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment