LOOP REPEAT recognizes the type of the iterator variable

This commit is contained in:
Juan Jose Garcia Ripoll 2010-09-21 09:31:15 +02:00
parent 09ae1f43c0
commit 8046f644dd

View file

@ -1646,8 +1646,8 @@ collected result will be returned as the value of the LOOP."
(defun loop-do-repeat ()
(loop-disallow-conditional :repeat)
(let ((form (loop-get-form))
(type 'real))
(let* ((form (loop-get-form))
(type (if (fixnump form) 'fixnum 'real)))
(let ((var (loop-make-variable (gensym) form type)))
(push `(when (minusp (decf ,var)) (go end-loop)) *loop-before-loop*)
(push `(when (minusp (decf ,var)) (go end-loop)) *loop-after-body*)