From b3c2d3f197e40f639ed8c7a073688389ca4ee5f7 Mon Sep 17 00:00:00 2001 From: toy <toy> Date: Wed, 20 Nov 2002 16:15:39 +0000 Subject: [PATCH] DOLIST was not properly establishing a tagbody for the body, as shown by the gcl ANSI test suite. Use the version from SBCL. --- code/macros.lisp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/code/macros.lisp b/code/macros.lisp index 0cafaeb5b..d91f6bb5b 100644 --- a/code/macros.lisp +++ b/code/macros.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.79 2002/11/01 17:41:53 toy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.80 2002/11/20 16:15:39 toy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -1563,16 +1563,20 @@ ;;; don't want to use IGNORABLE on what might be a special var. ;;; (defmacro dolist ((var list &optional (result nil)) &body body) - (let ((n-list (gensym))) - `(do ((,n-list ,list (cdr ,n-list))) - ((endp ,n-list) - ,@(if result - `((let ((,var nil)) - ,var - ,result)) - '(nil))) - (let ((,var (car ,n-list))) - ,@body)))) + (multiple-value-bind (forms decls) + (parse-body body nil nil) + (let ((n-list (gensym))) + `(do* ((,n-list ,list (cdr ,n-list))) + ((endp ,n-list) + ,@(if result + `((let ((,var nil)) + ,var + ,result)) + '(nil))) + (let ((,var (car ,n-list))) + ,@decls + (tagbody + ,@forms)))))) (defmacro do (varlist endlist &body (body decls)) -- GitLab