0.9.4.24:
authorChristophe Rhodes <csr21@cam.ac.uk>
Fri, 2 Sep 2005 20:44:06 +0000 (20:44 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Fri, 2 Sep 2005 20:44:06 +0000 (20:44 +0000)
Make printing HASH-TABLEs with *READ-EVAL* = NIL signal
PRINT-NOT-READABLE.

NEWS
src/code/target-hash-table.lisp
tests/print.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 882bbad..b8a17a2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,9 @@ changes in sbcl-0.9.5 relative to sbcl-0.9.4:
     Linux kernels >= 2.6.12 that interfere with SBCL's memory maps. This
     workaround will only be in effect on systems with the proc filesystem
     mounted.
+  * bug fix: printing objects of type HASH-TABLE signals a
+    PRINT-NOT-READABLE error when *READ-EVAL* is NIL.  (reported by
+    Faré Rideau)
   * threads
     ** bug fix: parent thread now can be gc'ed even with a live
        child thread
index 138d39e..b98c33d 100644 (file)
 
 (def!method print-object ((hash-table hash-table) stream)
   (declare (type stream stream))
-  (cond ((not *print-readably*)
+  (cond ((or (not *print-readably*) (not *read-eval*))
          (print-unreadable-object (hash-table stream :type t :identity t)
            (format stream
                    ":TEST ~S :COUNT ~S"
                    (hash-table-test hash-table)
                    (hash-table-count hash-table))))
-        ((not *read-eval*)
-         (error "can't print hash tables readably without *READ-EVAL*"))
         (t
          (with-standard-io-syntax
           (format stream
index 8d22b9d..a54996e 100644 (file)
 ;;; Adam Warner's test case
 (assert (string= (format nil "~@F" 1.23) "+1.23"))
 
+(let ((table (make-hash-table)))
+  (setf (gethash 1 table) t)
+  (assert
+   (raises-error? (with-standard-io-syntax
+                    (let ((*read-eval* nil)
+                          (*print-readably* t))
+                      (with-output-to-string (*standard-output*)
+                        (prin1 table))))
+                  print-not-readable)))
+
 ;;; success
index 3f50e67..221fa69 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.9.4.23"
+"0.9.4.24"