0.8.10.55:
authorChristophe Rhodes <csr21@cam.ac.uk>
Thu, 27 May 2004 12:19:54 +0000 (12:19 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Thu, 27 May 2004 12:19:54 +0000 (12:19 +0000)
Two more ANSI printing fixes
... always print pathnames with #P"..." if that's possible
... delete old method (and FIXME comment) for logical-pathnames,
since SBCL is unlikely to regrow search-lists in their
CMUCL form
... provide ugly *print-readably*-compliant output format for
RANDOM-STATE objects

NEWS
src/code/target-pathname.lisp
src/code/target-random.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 1762350..f311ac1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2490,6 +2490,10 @@ changes in sbcl-0.8.11 relative to sbcl-0.8.10:
        in local calls.
     ** fixed non-pretty printing of arrays with *PRINT-RADIX* being
        true.
+    ** provided a readably-printable representation for RANDOM-STATE
+       objects.
+    ** ensured that pathnames, where they have a namestring, always
+       print using #P"..." syntax.
 
 planned incompatible changes in 0.8.x:
   * (not done yet, but planned:) When the profiling interface settles
index 28cfa41..5210a0f 100644 (file)
 
 (def!method make-load-form ((pathname pathname) &optional environment)
   (make-load-form-saving-slots pathname :environment environment))
-
-;;; The potential conflict with search lists requires isolating the
-;;; printed representation to use the i/o macro #.(logical-pathname
-;;; <path-designator>).
-;;;
-;;; FIXME: We don't use search lists any more, so that comment is
-;;; stale, right?
-(def!method print-object ((pathname logical-pathname) stream)
-  (let ((namestring (handler-case (namestring pathname)
-                     (error nil))))
-    (if (and namestring (or *read-eval* (not *print-readably*)))
-       (format stream "#.(CL:LOGICAL-PATHNAME ~S)" namestring)
-       (print-unreadable-object (pathname stream :type t)
-         (format
-          stream
-          "~_:HOST ~S ~_:DIRECTORY ~S ~_:NAME ~S ~_:TYPE ~S ~_:VERSION ~S"
-          (%pathname-host pathname)
-          (%pathname-directory pathname)
-          (%pathname-name pathname)
-          (%pathname-type pathname)
-          (%pathname-version pathname))))))
 \f
 ;;; A pathname is logical if the host component is a logical host.
 ;;; This constructor is used to make an instance of the correct type
index aa87cad..97acbf8 100644 (file)
 (def!method make-load-form ((random-state random-state) &optional environment) 
   (make-load-form-saving-slots random-state :environment environment))
 
+(def!method print-object ((state random-state) stream)
+  (if (and *print-readably* (not *read-eval*))
+      (error 'print-not-readable :object state)
+      (format stream "#S(~S ~S #.~S)"
+             'random-state
+             ':state
+             `(make-array 627 
+               :element-type 
+               '(unsigned-byte 32)
+               :initial-contents 
+               ',(coerce (random-state-state state) 'list)))))
+
 ;;; The state is stored in a (simple-array (unsigned-byte 32) (627))
 ;;; wrapped in a random-state structure:
 ;;;
index 6996167..08a23be 100644 (file)
@@ -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.8.10.54"
+"0.8.10.55"