From a4d62423bfe3c71420a6eef8bd702f4001991a9c Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 11 May 2004 07:31:36 +0000 Subject: [PATCH] 0.8.10.18: Merge patch for bogus LOOP warning (Nikodemus Siivola sbcl-devel 2004-05-01) ... and write a test case --- NEWS | 5 ++++- src/code/loop.lisp | 8 ++------ tests/loop.pure.lisp | 10 ++++++++++ version.lisp-expr | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 1ded01c..36f82cf 100644 --- a/NEWS +++ b/NEWS @@ -2420,8 +2420,11 @@ changes in sbcl-0.8.11 relative to sbcl-0.8.10: type. * fixed bug: SET-PPRINT-DISPATCH does not immediately resolve function name. (thanks to Nikodemus Siivola) - * fixed bug:: compile-time format string checker failed on + * fixed bug: compile-time format string checker failed on non-closed ~{. (reported by Thomas F Burdick) + * fixed bug: as reported by Kalle Olavi Niemitalo on #lisp IRC, + don't warn on legal loop code involving more than one aggregate + boolean. (thanks to Nikodemus Siivola) * optimization: rearranged the expansion of various defining macros so that each expands into only one top-level form in a :LOAD-TOPLEVEL context; this appears to decrease fasl sizes by diff --git a/src/code/loop.lisp b/src/code/loop.lisp index acabbf6..674c701 100644 --- a/src/code/loop.lisp +++ b/src/code/loop.lisp @@ -479,8 +479,8 @@ code to be loaded. (defvar *loop-after-epilogue*) ;;; the "culprit" responsible for supplying a final value from the -;;; loop. This is so LOOP-EMIT-FINAL-VALUE can moan about multiple -;;; return values being supplied. +;;; loop. This is so LOOP-DISALLOW-AGGREGATE-BOOLEANS can moan about +;;; disallowed anonymous collections. (defvar *loop-final-value-culprit*) ;;; If this is true, we are in some branch of a conditional. Some @@ -908,10 +908,6 @@ code to be loaded. (defun loop-emit-final-value (&optional (form nil form-supplied-p)) (when form-supplied-p (push (loop-construct-return form) *loop-after-epilogue*)) - (when *loop-final-value-culprit* - (loop-warn "The LOOP clause is providing a value for the iteration;~@ - however, one was already established by a ~S clause." - *loop-final-value-culprit*)) (setq *loop-final-value-culprit* (car *loop-source-context*))) (defun loop-disallow-conditional (&optional kwd) diff --git a/tests/loop.pure.lisp b/tests/loop.pure.lisp index febf5a7..408d18b 100644 --- a/tests/loop.pure.lisp +++ b/tests/loop.pure.lisp @@ -214,3 +214,13 @@ (let ((x 2d0)) (loop for d of-type double-float downfrom 10d0 to 0d0 by x collect d)) '(10d0 8d0 6d0 4d0 2d0 0d0))) + +(let ((fn (handler-case + (compile nil '(lambda () + (declare (special x y)) + (loop thereis (pop x) thereis (pop y)))) + (warning (c) (error "Warned: ~S" c))))) + (let ((x (list nil nil 1)) + (y (list nil 2 nil))) + (declare (special x y)) + (assert (= (funcall fn) 2)))) diff --git a/version.lisp-expr b/version.lisp-expr index ce981eb..3dbc98f 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".) -"0.8.10.17" +"0.8.10.18" -- 1.7.10.4