Hello,

I've been trying to figure out if I can get readable specialized arrays to work in SBCL, like
they work (by default) in CMUCL.

I've tried to write a package to do it, but I think that I hit the brick wall that PRINT-OBJECT can't
be redefined for built-in classes according to the ansi spec.

Is my understanding correct?  Is there any trick that can be used to get read/writable
specialized arrays in SBCL?

Many thanks!
J.Klein

PS - apologies for posting in sbcl-devel; the sbcl-help mailing list rejected my post after I signed up,
and I figured the readership is the same.


  =====================

My attempt at the writer function:

(defmethod print-object  ((a simple-array) stream)
  (format stream "#Z(~S ~S ~S"
          (array-element-type a) (array-dimensions a)
          :ROW-MAJOR-CONTENTS)
  (loop
     for i of-type fixnum below (array-total-size a)
     do
       (write-char #\space  stream)
       (write (row-major-aref a i)  :stream stream))
  (format stream ")"))
 


This works when called by itself, but

  (let ((ar (make-array 1 :element-type 'double-float))
         (*print-readably* t))
    (print ar))

 results in the error
  #<(simple-array double-float (1)) {10B93D37}> cannot be printed readably.