From 22b8c6a91a89d0710db10e88f76ce0f2a245905d Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 7 Feb 2003 14:54:05 +0000 Subject: [PATCH] 0.7.12.26: 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 | 8 +++++--- src/code/sharpm.lisp | 4 ++-- tests/reader.impure.lisp | 18 ++++++++++++++++++ version.lisp-expr | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 5afb5e9..b6b2ec1 100644 --- 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 diff --git a/src/code/sharpm.lisp b/src/code/sharpm.lisp index 273a6a6..63e88d1 100644 --- a/src/code/sharpm.lisp +++ b/src/code/sharpm.lisp @@ -184,12 +184,12 @@ ;; 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)) diff --git a/tests/reader.impure.lisp b/tests/reader.impure.lisp index 84be1cf..214ca6f 100644 --- a/tests/reader.impure.lisp +++ b/tests/reader.impure.lisp @@ -41,5 +41,23 @@ (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 : 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) diff --git a/version.lisp-expr b/version.lisp-expr index 690b192..b7e9f6f 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4