From f322dffab522a22c4f08be9dc7fd4a25178c9b1f Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Fri, 28 Jul 2006 15:50:02 +0000 Subject: [PATCH] evaluate limit expression once svn: r3868 --- collects/swindle/misc.ss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/collects/swindle/misc.ss b/collects/swindle/misc.ss index 78903066f0..892ca6da46 100644 --- a/collects/swindle/misc.ss +++ b/collects/swindle/misc.ss @@ -1842,8 +1842,9 @@ ;;>> (dotimes (i n) body ...) ;;> Loop `n' times, evaluating the body when `i' is bound to 0,1,...,n-1. (defsubst* (dotimes [i n] body0 body ...) - (let loop ([i 0]) - (when (< i n) body0 body ... (loop (add1 i))))) + (let ([n* n]) + (let loop ([i 0]) + (when (< i n*) body0 body ... (loop (add1 i)))))) ;;>> (dolist (x list) body ...) ;;> Loop with `x' bound to elements of `list'.