diff --git a/core/iter.lisp b/core/iter.lisp index 196c702..4a87964 100644 --- a/core/iter.lisp +++ b/core/iter.lisp @@ -2000,7 +2000,7 @@ the body of the loop, so it must not contain anything that depends on the body." (seq-code (or seq-var sequence)) (step-var (unless (constant? by) (make-var-and-default-binding 'step :type 'fixnum))) - (step (or step-var by)) + (step (or step-var by 1)) (step-func (if (or downto downfrom above) '- '+)) (test-func (cond (to '>) ((or downto downfrom) '<) diff --git a/test/iter-test.lisp b/test/iter-test.lisp index f8c8c4c..8d0a30c 100644 --- a/test/iter-test.lisp +++ b/test/iter-test.lisp @@ -5,3 +5,7 @@ (cl:in-package #:rutils.test) (named-readtables:in-readtable rutils-readtable) +(deftest iter () + (should be equal '(#\a #\b #\c) + (iter (:for c :in-string "abc") + (:collect c))))