From: ·······@ziplip.com
Subject: #'write
Date: 
Message-ID: <DVEIGNAKDYOIOJOHBUMGENIPIFGKECBRAGELKPEA@ziplip.com>
Are there options or special variables that will make WRITE
print arrays completely (including fill-pointer and other stuff) ?

From: Kent M Pitman
Subject: Re: #'write
Date: 
Message-ID: <sfwhe4luyco.fsf@shell01.TheWorld.com>
········@ziplip.com" <·······@ziplip.com> writes:

> Are there options or special variables that will make WRITE
> print arrays completely (including fill-pointer and other stuff) ?

*print-readably* might do it in some implementations, but is not required to.
From: Barry Margolin
Subject: Re: #'write
Date: 
Message-ID: <jTu_a.61$mD.0@news.level3.com>
In article <········································@ziplip.com>,
·······@ziplip.com <·······@ziplip.com> wrote:
>Are there options or special variables that will make WRITE
>print arrays completely (including fill-pointer and other stuff) ?

No.  I'd expect DESCRIBE to display all the attributes, although the
specification of DESCRIBE is vague enough that it's not required.

-- 
Barry Margolin, ··············@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: james anderson
Subject: Re: #'write
Date: 
Message-ID: <3F3A8E62.A30CA193@setf.de>
········@ziplip.com" wrote:
> 
> Are there options or special variables that will make WRITE
> print arrays completely (including fill-pointer and other stuff) ?

the following is non-conformant, but it may help you find out what you need.

(defparameter *x* (make-array 10 :adjustable t :fill-pointer 0))
*X*
? *x*
#()
? (inspect *)
#<INSPECTOR-WINDOW "#()" #x81DA436>
? (defMethod print-object ((array vector) (stream t))
    (if (or (adjustable-array-p array) (array-has-fill-pointer-p array))
      (print-unreadable-object (array stream :type t :identity t)
        (write-char (if (adjustable-array-p array) #\* #\!) stream)
        (when (array-has-fill-pointer-p array) (format stream "~d/" (length array)))
        (format stream "~d[...]" (array-dimension array 0)))))
#<STANDARD-METHOD PRINT-OBJECT (VECTOR T)>
? *x*
#<(VECTOR T 0) *0/10[...] #x81D0606>
?
From: Kent M Pitman
Subject: Re: #'write
Date: 
Message-ID: <sfwd6f9uyan.fsf@shell01.TheWorld.com>
james anderson <··············@setf.de> writes:

> ········@ziplip.com" wrote:
> > 
> > Are there options or special variables that will make WRITE
> > print arrays completely (including fill-pointer and other stuff) ?
> 
> the following is non-conformant, but it may help you find out what you need.
> 
> (defparameter *x* (make-array 10 :adjustable t :fill-pointer 0))
> *X*
> ? *x*
> #()
> ? (inspect *)
> #<INSPECTOR-WINDOW "#()" #x81DA436>
> ? (defMethod print-object ((array vector) (stream t))
>     (if (or (adjustable-array-p array) (array-has-fill-pointer-p array))
>       (print-unreadable-object (array stream :type t :identity t)
>         (write-char (if (adjustable-array-p array) #\* #\!) stream)
>         (when (array-has-fill-pointer-p array) (format stream "~d/" (length array)))
>         (format stream "~d[...]" (array-dimension array 0)))))
> #<STANDARD-METHOD PRINT-OBJECT (VECTOR T)>
> ? *x*
> #<(VECTOR T 0) *0/10[...] #x81D0606>
> ?

Right, except for the fact that you're not allowed to (re)define standard
methods on standard classes.
From: james anderson
Subject: Re: #'write
Date: 
Message-ID: <3F3B21AD.6E3B8630@setf.de>
Kent M Pitman wrote:
> 
> james anderson <··············@setf.de> writes:
> 
> > ········@ziplip.com" wrote:
> > >
> > > Are there options or special variables that will make WRITE
> > > print arrays completely (including fill-pointer and other stuff) ?
> >
> > the following is non-conformant, but it may help you find out what you need.
> >
> > (defparameter *x* (make-array 10 :adjustable t :fill-pointer 0))
> > *X*
> > ? *x*
> > #()
> > ? (inspect *)
> > #<INSPECTOR-WINDOW "#()" #x81DA436>
> > ? (defMethod print-object ((array vector) (stream t))
> >     (if (or (adjustable-array-p array) (array-has-fill-pointer-p array))
> >       (print-unreadable-object (array stream :type t :identity t)
> >         (write-char (if (adjustable-array-p array) #\* #\!) stream)
> >         (when (array-has-fill-pointer-p array) (format stream "~d/" (length array)))
> >         (format stream "~d[...]" (array-dimension array 0)))))
> > #<STANDARD-METHOD PRINT-OBJECT (VECTOR T)>
> > ? *x*
> > #<(VECTOR T 0) *0/10[...] #x81D0606>
> > ?
> 
> Right, except for the fact that you're not allowed to (re)define standard
> methods on standard classes.

even though the description of print-object allows the user to write methds on
their own classes only, i've always presumed that 11.1.2.1.2 would permit the
user to specialize the stream and go from there. whereby, the function may not
be called with the original stream. thus the provision "may".
but then it doesn't obey the protocol for printer control variables either.
yet another reason for the provision "the following is non-conformant".


...