From 6a72b4832eb5b6f340cc7824157fd69666a6164e Mon Sep 17 00:00:00 2001 From: toy <toy> Date: Tue, 30 Jul 2002 16:40:28 +0000 Subject: [PATCH] From Alexey Dejneka via SBCL: o Declare WITH-introduced variables o Compound form must follow INITIALLY, FINALLY, DO. --- code/loop.lisp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/code/loop.lisp b/code/loop.lisp index 72c32da06..9b83625b0 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.11 2002/07/06 00:58:04 toy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/loop.lisp,v 1.12 2002/07/30 16:40:28 toy Exp $") ;;;; LOOP Iteration Macro @@ -1071,9 +1071,17 @@ collected result will be returned as the value of the LOOP." (loop-error "LOOP source code ran out when another token was expected."))) +(defun loop-get-compound-form () + (let ((form (loop-get-form))) + (unless (consp form) + (loop-error "Compound form expected, but found ~A." form)) + form)) + (defun loop-get-progn () - (do ((forms (list (loop-pop-source)) (cons (loop-pop-source) forms)) - (nextform (car *loop-source-code*) (car *loop-source-code*))) + (do ((forms (list (loop-get-compound-form)) + (cons (loop-get-compound-form) forms)) + (nextform (car *loop-source-code*) + (car *loop-source-code*))) ((atom nextform) (if (null (cdr forms)) (car forms) (cons 'progn (nreverse forms)))))) @@ -1213,6 +1221,7 @@ collected result will be returned as the value of the LOOP." (loop-declare-variable name dtype) (push (list name initialization) *loop-variables*)) (t (let ((newvar (loop-gentemp 'loop-destructure-))) + (loop-declare-variable name dtype) (push (list newvar initialization) *loop-variables*) ;; *LOOP-DESETQ-CROCKS* gathered in reverse order. (setq *loop-desetq-crocks* -- GitLab