From f452db1b51a5617b296e7e7e9bfb0ee3fcd58969 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Mon, 14 Jul 2008 20:36:42 +0000
Subject: [PATCH] Fix for Trac #17: LOOP NAMED NIL has no effect

code/loop.lisp:
o In LOOP-TRANSLATE, create block for loop named NIL by checking for
  the end of the list, not for NIL in the list.
o In LOOP-DO-NAMED, don't append NIL to *LOOP-NAMES* so we can create
  blocks named NIL.  (Why was this being done before?)

general-info/release-19f.txt:
o Update
---
 code/loop.lisp               | 15 ++++++++-------
 general-info/release-19f.txt |  2 ++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/code/loop.lisp b/code/loop.lisp
index c1b4af37c..7148e0f0b 100644
--- a/code/loop.lisp
+++ b/code/loop.lisp
@@ -49,7 +49,7 @@
 
 #+cmu
 (ext:file-comment
- "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/loop.lisp,v 1.27 2004/10/21 02:31:08 rtoy Exp $")
+ "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/loop.lisp,v 1.28 2008/07/14 20:36:42 rtoy Exp $")
 
 ;;;; LOOP Iteration Macro
 
@@ -1044,11 +1044,12 @@ collected result will be returned as the value of the LOOP."
 				    (*loop-destructuring-hooks* (first *loop-destructuring-hooks*))
 				    (t 'let))
 			     ,vars
-			     ,@(loop-build-destructuring-bindings crocks forms)))))))
-      (if *loop-names*
-	  (do () ((null (car *loop-names*)) answer)
-	    (setq answer `(block ,(pop *loop-names*) ,answer)))
-	  `(block nil ,answer)))))
+			      ,@(loop-build-destructuring-bindings crocks forms)))))))
+      (when *loop-names*
+	(do () (nil)
+	  (setq answer `(block ,(pop *loop-names*) ,answer))
+	  (unless *loop-names* (return nil))))
+      answer)))
 
 
 (defun loop-iteration-driver ()
@@ -1356,7 +1357,7 @@ collected result will be returned as the value of the LOOP."
     (when *loop-names*
       (loop-error "You may only use one NAMED clause in your loop: NAMED ~S ... NAMED ~S."
 		  (car *loop-names*) name))
-    (setq *loop-names* (list name nil))))
+    (setq *loop-names* (list name))))
 
 (defun loop-do-return ()
   (loop-pseudo-body (loop-construct-return (loop-get-form))))
diff --git a/general-info/release-19f.txt b/general-info/release-19f.txt
index bac1eb701..665ca1635 100644
--- a/general-info/release-19f.txt
+++ b/general-info/release-19f.txt
@@ -72,6 +72,8 @@ New in this release:
   * Trac Tickets:
     - #16: Read-time hash-table issue
       Fixed.
+    - #17: LOOP NAMED NIL has no effect
+      Fixed.
 
   * Other changes:
     - IS1, IS2, IS3, and IS4 are recognized character names for the
-- 
GitLab