From a7f04616aa9d77ba780a2a6cf6c78b250b1d4a07 Mon Sep 17 00:00:00 2001 From: Gabor Melis Date: Fri, 16 Jul 2010 07:42:22 +0000 Subject: [PATCH] 1.0.40.1: fix return value of WRITE Used to return NIL when the compiler macro for the constant keyword argument case triggered. Add test. --- NEWS | 3 +++ src/code/print.lisp | 8 +++++--- tests/print.impure.lisp | 4 ++++ version.lisp-expr | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 5c8ffd9..5877845 100644 --- 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 diff --git a/src/code/print.lisp b/src/code/print.lisp index 4676332..0e989ca 100644 --- a/src/code/print.lisp +++ b/src/code/print.lisp @@ -193,9 +193,11 @@ (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 diff --git a/tests/print.impure.lisp b/tests/print.impure.lisp index 70f7872..37e5936 100644 --- a/tests/print.impure.lisp +++ b/tests/print.impure.lisp @@ -479,4 +479,8 @@ (read-from-string (write-to-string *random-state*))))) +(with-test (:name :write-return-value) + (assert (= 123 (funcall (compile nil (lambda () + (write 123))))))) + ;;; success diff --git a/version.lisp-expr b/version.lisp-expr index 1a7b3ab..6c9b510 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4