X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefboot.lisp;h=5035116178a441a09c29e8e0084a0bde53de1636;hb=015dc5f920a57c2e502eef3f54d91ac8fe225747;hp=b4c6c36415f4039cc2eae1a17a8e33b9f78e6a1c;hpb=ad0c59dd3e9a49777fce9790bf17f0a5ee7fbee6;p=sbcl.git diff --git a/src/code/defboot.lisp b/src/code/defboot.lisp index b4c6c36..5035116 100644 --- a/src/code/defboot.lisp +++ b/src/code/defboot.lisp @@ -326,15 +326,18 @@ ;;; destructuring mechanisms. (defmacro-mundanely dotimes ((var count &optional (result nil)) &body body) (cond ((numberp count) - `(do ((,var 0 (1+ ,var))) - ((>= ,var ,count) ,result) - (declare (type unsigned-byte ,var)) - ,@body)) - (t (let ((v1 (gensym))) - `(do ((,var 0 (1+ ,var)) (,v1 ,count)) - ((>= ,var ,v1) ,result) - (declare (type unsigned-byte ,var)) - ,@body))))) + `(do ((,var 0 (1+ ,var))) + ((>= ,var ,count) ,result) + (declare (type unsigned-byte ,var)) + ,@body)) + (t + (let ((c (gensym "COUNT"))) + `(do ((,var 0 (1+ ,var)) + (,c ,count)) + ((>= ,var ,c) ,result) + (declare (type unsigned-byte ,var) + (type integer ,c)) + ,@body))))) (defmacro-mundanely dolist ((var list &optional (result nil)) &body body) ;; We repeatedly bind the var instead of setting it so that we never