diff --git a/ansi-tests/loop1.lsp b/ansi-tests/loop1.lsp index 37f9c75b2572e02013f3488745a37d97976099e3..f68c7ec00a0fed5caefafa4fc44f8d55f53df9a1 100644 --- a/ansi-tests/loop1.lsp +++ b/ansi-tests/loop1.lsp @@ -224,4 +224,33 @@ (deftest loop.1.43 (loop for x from 10 above 0 do nil finally (return x)) 1) -|# \ No newline at end of file +|# + +;;; The arithmetic loop form says the types are numbers, not +;;; reals, so arguably they should work on complexes (which are +;;; numbers.) Comparing these for termination could be problematic, +;;; but a clause without termination should work just fine. + +(deftest loop.1.44 + (loop for i from 1 to 5 for c from #c(0 1) collect c) + (#c(0 1) #c(1 1) #c(2 1) #c(3 1) #c(4 1))) + +(deftest loop.1.45 + (loop for i from 1 to 5 for c from #c(0 1) by 2 collect c) + (#c(0 1) #c(2 1) #c(4 1) #c(6 1) #c(8 1))) + +(deftest loop.1.46 + (loop for i from 1 to 5 for c downfrom #c(5 1) collect c) + (#c(5 1) #c(4 1) #c(3 1) #c(2 1) #c(1 1))) + +(deftest loop.1.47 + (loop for i from 1 to 5 for c downfrom #c(10 1) by 2 collect c) + (#c(10 1) #c(8 1) #c(6 1) #c(4 1) #c(2 1))) + +(deftest loop.1.48 + (loop for i from 1 to 5 for c upfrom #c(0 1) collect c) + (#c(0 1) #c(1 1) #c(2 1) #c(3 1) #c(4 1))) + +(deftest loop.1.49 + (loop for i from 1 to 5 for c upfrom #c(0 1) by 2 collect c) + (#c(0 1) #c(2 1) #c(4 1) #c(6 1) #c(8 1)))