Skip to content

Commit

Permalink
1.0.3.19: the count argument in DOTIMES is known to be an integer
Browse files Browse the repository at this point in the history
 * Declaring it as such for the non-constant expansion of dotimes
   allows the inversion of >= to < kick in for the termination test.
  • Loading branch information
nikodemus committed Mar 3, 2007
1 parent 3842d88 commit 5830fef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions src/code/defboot.lisp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion version.lisp-expr
Expand Up @@ -17,4 +17,4 @@
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
"1.0.3.18"
"1.0.3.19"

0 comments on commit 5830fef

Please sign in to comment.