From: Christophe Rhodes Date: Thu, 27 May 2004 12:19:54 +0000 (+0000) Subject: 0.8.10.55: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=235c8f10a2d6b6f34e0122aa2b4ac57c74e3a484;p=sbcl.git 0.8.10.55: 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 --- diff --git a/NEWS b/NEWS index 1762350..f311ac1 100644 --- 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 diff --git a/src/code/target-pathname.lisp b/src/code/target-pathname.lisp index 28cfa41..5210a0f 100644 --- a/src/code/target-pathname.lisp +++ b/src/code/target-pathname.lisp @@ -58,27 +58,6 @@ (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 -;;; ). -;;; -;;; 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)))))) ;;; A pathname is logical if the host component is a logical host. ;;; This constructor is used to make an instance of the correct type diff --git a/src/code/target-random.lisp b/src/code/target-random.lisp index aa87cad..97acbf8 100644 --- a/src/code/target-random.lisp +++ b/src/code/target-random.lisp @@ -21,6 +21,18 @@ (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: ;;; diff --git a/version.lisp-expr b/version.lisp-expr index 6996167..08a23be 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"