0.7.12.26:
authorChristophe Rhodes <csr21@cam.ac.uk>
Fri, 7 Feb 2003 14:54:05 +0000 (14:54 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Fri, 7 Feb 2003 14:54:05 +0000 (14:54 +0000)
fix #1# for STANDARD-OBJECT objects (as reported by Tony
Martinez on cll 2003-02-03)
... slightly sucky fix, yes; will probably need revisiting when
PCL goodness happens.

NEWS
src/code/sharpm.lisp
tests/reader.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 5afb5e9..b6b2ec1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1521,7 +1521,7 @@ changes in sbcl-0.7.13 relative to sbcl-0.7.12:
   * fixed a bug in DEFCLASS: classes named by symbols with no or
     unprintable packages can now be defined.
   * fixed a bug in RESTART-BIND: The :TEST-FUNCTION option had been
-    carelessly renamed to :TEST-FUN. (thanks to Robert E. Brown)
+    carelessly renamed to :TEST-FUN.  (thanks to Robert E. Brown)
   * fixed compiler failure related to checking types of functions.
     (reported by Robert E. Brown)
   * the compiler is now much more consistent in its error-checking
@@ -1531,6 +1531,10 @@ changes in sbcl-0.7.13 relative to sbcl-0.7.12:
     by ANSI to operate on sequences.
   * fixed a bug in the build procedure: documentation of SBCL-specific
     packages is now preserved and available in the final Lisp image.
+  * lifted FDEFINITION lookup out of loops in the implementation of
+    many list operations.  (thanks to Robert E. Brown)
+  * fixed a bug in the reader: the #n# reader macro now works for
+    objects of type STANDARD-OBJECT.  (reported by Tony Martinez)
   * fixed some bugs revealed by Paul Dietz' test suite:
     ** ARRAY-IN-BOUNDS-P now allows arbitrary integers as arguments,
        not just nonnegative fixnums;
@@ -1539,8 +1543,6 @@ changes in sbcl-0.7.13 relative to sbcl-0.7.12:
        freshly-consed result bit-array);
     ** ELT now signals an error on an invalid sequence index in safe
        code;
-  * lifted FDEFINITION lookup out of loops in the implementation of
-    many list operations (thanks to Robert E. Brown)
 
 planned incompatible changes in 0.7.x:
   * (not done yet, but planned:) When the profiling interface settles
index 273a6a6..63e88d1 100644 (file)
 ;; substitutes in arrays and structures as well as lists. The first arg is an
 ;; alist of the things to be replaced assoc'd with the things to replace them.
 (defun circle-subst (old-new-alist tree)
-  (cond ((not (typep tree '(or cons (array t) structure-object)))
+  (cond ((not (typep tree '(or cons (array t) structure-object standard-object)))
         (let ((entry (find tree old-new-alist :key #'second)))
           (if entry (third entry) tree)))
        ((null (gethash tree *sharp-equal-circle-table*))
         (setf (gethash tree *sharp-equal-circle-table*) t)
-        (cond ((typep tree 'structure-object)
+        (cond ((typep tree '(or structure-object standard-object))
                (do ((i 1 (1+ i))
                     (end (%instance-length tree)))
                    ((= i end))
index 84be1cf..214ca6f 100644 (file)
 (assert (raises-error? (read-from-string "1e1000") reader-error))
 (assert (raises-error? (read-from-string "1/0") reader-error))
 
+;;; Bug reported by Antonio Martinez on comp.lang.lisp 2003-02-03 in
+;;; message <b32da960.0302030640.7d6fc610@posting.google.com>: reading
+;;; circular instances of CLOS classes didn't work:
+(defclass box ()
+  ((value :initarg :value :reader value)))
+(defun read-box (stream char)
+  (declare (ignore char))
+  (let ((objects (read-delimited-list #\] stream t)))
+    (unless (= 1 (length objects))
+      (error "Unknown box reader syntax"))
+    (make-instance 'box :value (first objects))))
+(set-macro-character #\[ 'read-box)
+(set-syntax-from-char #\] #\))
+(multiple-value-bind (res pos)
+    (read-from-string "#1=[#1#]")
+  (assert (eq (value res) res))
+  (assert (= pos 8)))
+
 ;;; success
 (quit :unix-status 104)
index 690b192..b7e9f6f 100644 (file)
@@ -18,4 +18,4 @@
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.12.25"
+"0.7.12.26"