1.0.40.1: fix return value of WRITE
authorGabor Melis <mega@hotpop.com>
Fri, 16 Jul 2010 07:42:22 +0000 (07:42 +0000)
committerGabor Melis <mega@hotpop.com>
Fri, 16 Jul 2010 07:42:22 +0000 (07:42 +0000)
Used to return NIL when the compiler macro for the constant keyword
argument case triggered.

Add test.

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

diff --git a/NEWS b/NEWS
index 5c8ffd9..5877845 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,7 @@
 ;;;; -*- coding: utf-8; fill-column: 78 -*-
+changes in sbcl-1.0.41 relative to sbcl-1.0.40:
+  * bug fix: WRITE always returns the correct value
+
 changes in sbcl-1.0.40 relative to sbcl-1.0.39:
   * bug fix: readdir now works on :inode64 darwin builds (lp#592897)
   * bug fix: Name conflicts between symbols passed as arguments to a single
index 4676332..0e989ca 100644 (file)
         (push (list variable value) bind)))
     (unless (assoc 'stream bind)
       (push (list 'stream '*standard-output*) bind))
-    `(let ,(nreverse bind)
-       ,@(when ignore `((declare (ignore ,@ignore))))
-       (output-object ,object stream))))
+    (once-only ((object object))
+      `(let ,(nreverse bind)
+         ,@(when ignore `((declare (ignore ,@ignore))))
+         (output-object ,object stream)
+         ,object))))
 
 (defun prin1 (object &optional stream)
   #!+sb-doc
index 70f7872..37e5936 100644 (file)
                   (read-from-string
                    (write-to-string *random-state*)))))
 
+(with-test (:name :write-return-value)
+  (assert (= 123 (funcall (compile nil (lambda ()
+                                         (write 123)))))))
+
 ;;; success
index 1a7b3ab..6c9b510 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".)
-"1.0.40"
+"1.0.40.1"