224 |
(deftest loop.1.43 |
(deftest loop.1.43 |
225 |
(loop for x from 10 above 0 do nil finally (return x)) |
(loop for x from 10 above 0 do nil finally (return x)) |
226 |
1) |
1) |
|
|# |
|
227 |
|
|# |
228 |
|
|
229 |
|
;;; The arithmetic loop form says the types are numbers, not |
230 |
|
;;; reals, so arguably they should work on complexes (which are |
231 |
|
;;; numbers.) Comparing these for termination could be problematic, |
232 |
|
;;; but a clause without termination should work just fine. |
233 |
|
|
234 |
|
(deftest loop.1.44 |
235 |
|
(loop for i from 1 to 5 for c from #c(0 1) collect c) |
236 |
|
(#c(0 1) #c(1 1) #c(2 1) #c(3 1) #c(4 1))) |
237 |
|
|
238 |
|
(deftest loop.1.45 |
239 |
|
(loop for i from 1 to 5 for c from #c(0 1) by 2 collect c) |
240 |
|
(#c(0 1) #c(2 1) #c(4 1) #c(6 1) #c(8 1))) |
241 |
|
|
242 |
|
(deftest loop.1.46 |
243 |
|
(loop for i from 1 to 5 for c downfrom #c(5 1) collect c) |
244 |
|
(#c(5 1) #c(4 1) #c(3 1) #c(2 1) #c(1 1))) |
245 |
|
|
246 |
|
(deftest loop.1.47 |
247 |
|
(loop for i from 1 to 5 for c downfrom #c(10 1) by 2 collect c) |
248 |
|
(#c(10 1) #c(8 1) #c(6 1) #c(4 1) #c(2 1))) |
249 |
|
|
250 |
|
(deftest loop.1.48 |
251 |
|
(loop for i from 1 to 5 for c upfrom #c(0 1) collect c) |
252 |
|
(#c(0 1) #c(1 1) #c(2 1) #c(3 1) #c(4 1))) |
253 |
|
|
254 |
|
(deftest loop.1.49 |
255 |
|
(loop for i from 1 to 5 for c upfrom #c(0 1) by 2 collect c) |
256 |
|
(#c(0 1) #c(2 1) #c(4 1) #c(6 1) #c(8 1))) |