* Based on patch by Stas Boukarev, lp#598374 and lp#581564.
* Handle output-stream designators in WRITE.
* Avoid name capture in WRITE-TO-STRING.
was non-negative. (lp#622958)
* bug fix: DOTIMES accepted literal non-integer reals. (lp#619393, thanks to
Roman Marynchak)
+ * bug fix: WRITE-TO-STRING compiler macro binding special variable names,
+ breaking code that tried to write the value of a printer control variable.
+ (lp#581564, thanks to Stas Boukarev)
+ * bug fix: WRITE compiler macro did not handle output stream designators
+ correctly. (lp#598374, thanks to Stas Boukarev)
changes in sbcl-1.0.42 relative to sbcl-1.0.41
* build changes
(once-only ((object object))
`(let ,(nreverse bind)
,@(when ignore `((declare (ignore ,@ignore))))
- (output-object ,object stream)
+ (output-object ,object (out-synonym-of stream))
,object))))
(defun prin1 (object &optional stream)
(push variable ignore))
(push (list variable value) bind)))
(if bind
- `(let ,(nreverse bind)
- ,@(when ignore `((declare (ignore ,@ignore))))
- (stringify-object ,object))
+ (once-only ((object object))
+ `(let ,(nreverse bind)
+ ,@(when ignore `((declare (ignore ,@ignore))))
+ (stringify-object ,object)))
`(stringify-object ,object))))
(defun prin1-to-string (object)
(assert (= 123 (funcall (compile nil (lambda ()
(write 123)))))))
+(with-test (:name :write/write-to-string-compiler-macro-lp/598374+581564)
+ (let ((test (compile nil
+ `(lambda (object &optional output-stream)
+ (write object
+ :stream output-stream)))))
+ (assert (equal "(HELLO WORLD)"
+ (with-output-to-string (*standard-output*)
+ (let ((list '(hello world)))
+ (assert (eq list (funcall test list)))))))
+ (assert (equal "12"
+ (with-output-to-string (*standard-output*)
+ (assert (eql 12 (funcall test 12)))))))
+ (let ((test (compile nil
+ `(lambda ()
+ (let ((*print-length* 42))
+ (write-to-string *print-length* :length nil))))))
+ (assert (equal "42" (funcall test)))))
+
;;; success
;;; 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".)
-"1.0.42.3"
+"1.0.42.4"