Commit 7e8af690 authored by Attila Lendvai's avatar Attila Lendvai
Browse files

Added first-time-p and first-iteration-p tests

darcs-hash:f9cc3e39001d6f290d63a72ddfb32a9b47382794
parent 377f3f8d
......@@ -974,6 +974,24 @@
(collect i)))
(1 -1 3 -1 5))
(deftest first-time-p.1
(iter (for i to 5)
(if (first-time-p) (collect -1))
(if (first-time-p) (collect -2))
(when (oddp i)
(if (first-time-p) nil (collect -1))
(collect i)))
(-1 -2 1 -1 3 -1 5))
(deftest first-iteration-p.1
(iter (for i to 5)
(if (first-iteration-p) (collect -1))
(if (first-iteration-p) (collect -2))
(when (oddp i)
(if (first-iteration-p) nil (collect -1))
(collect i)))
(-1 -2 -1 1 -1 3 -1 5))
(deftest collect.multiple.1
(iter (for i from 1 to 10)
(collect i into nums)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment