X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Freader.impure.lisp;h=bb37bdf3a30d112534642a26cbc93c747b6e0284;hb=81e608991b9f616a412564b26186fa29933d814c;hp=8b60a5ded2ebd3f5e1598e90aab952f3a33c4c4c;hpb=20c0ab0df7e895d55ef79cfe815e3d58870703a3;p=sbcl.git diff --git a/tests/reader.impure.lisp b/tests/reader.impure.lisp index 8b60a5d..bb37bdf 100644 --- a/tests/reader.impure.lisp +++ b/tests/reader.impure.lisp @@ -58,6 +58,22 @@ (read-from-string "#1=[#1#]") (assert (eq (value res) res)) (assert (= pos 8))) +;;; much, much, later (in Feb 2007), CSR noticed that the problem +;;; still exists for funcallable instances. +(defclass funcallable-box (box sb-mop:funcallable-standard-object) () + (:metaclass sb-mop:funcallable-standard-class)) +(defun read-funcallable-box (stream char) + (declare (ignore char)) + (let ((objects (read-delimited-list #\} stream t))) + (unless (= 1 (length objects)) + (error "Unknown box reader syntax")) + (make-instance 'funcallable-box :value (first objects)))) +(set-macro-character #\{ 'read-funcallable-box) +(set-syntax-from-char #\} #\)) +(multiple-value-bind (res pos) + (read-from-string "#1={#1#}") + (assert (eq (value res) res)) + (assert (= pos 8))) ;;; CSR managed to break the #S reader macro in the process of merging ;;; SB-PCL:CLASS and CL:CLASS -- make sure it works