From 02db89a9bca4efb776d792952741772a111b0468 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Fri, 23 Dec 2011 19:41:39 +0100 Subject: [PATCH] The macro expander for DOLIST uses only LET, not SETQ. This way the type declarations are not incompatible with the initial values of the loop. --- src/cmp/cmpopt.lsp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/cmp/cmpopt.lsp b/src/cmp/cmpopt.lsp index c8b925fa3..c216e40ba 100644 --- a/src/cmp/cmpopt.lsp +++ b/src/cmp/cmpopt.lsp @@ -182,15 +182,16 @@ list-var `(the cons ,list-var)))) `(block nil - (let* ((,list-var ,expression) - ,var) - (declare ,@declarations) + (let* ((,list-var ,expression)) (si::while ,list-var - (setq ,var (first ,typed-var)) - ,@body + (let ((,var (first ,typed-var))) + (declare ,@declarations) + ,@body) (setq ,list-var (rest ,typed-var))) - ,(when output-form `(setq ,var nil)) - ,output-form))))) + ,(when output-form + `(let ((,var nil)) + (declare ,@declarations) + ,output-form))))))) ) ;;;