Skip to content
Snippets Groups Projects
Commit 9c69404e authored by pfdietz's avatar pfdietz
Browse files

Added nil variable dspec for for-as-arithmetic.

parent 96077476
No related branches found
No related tags found
No related merge requests found
...@@ -254,3 +254,43 @@ ...@@ -254,3 +254,43 @@
(deftest loop.1.49 (deftest loop.1.49
(loop for i from 1 to 5 for c upfrom #c(0 1) by 2 collect c) (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))) (#c(0 1) #c(2 1) #c(4 1) #c(6 1) #c(8 1)))
;;; The variable in the loop for-as-arithmetic clause
;;; can be a d-var-spec, so 'NIL' should mean don't bind anything
(deftest loop.1.50
(let ((i 0))
(loop for nil from 10 to 15 collect (incf i)))
(1 2 3 4 5 6))
(deftest loop.1.51
(let ((i 0))
(loop for nil from 10 below 15 collect (incf i)))
(1 2 3 4 5))
(deftest loop.1.52
(loop for nil from 10 to 0 collect 'a)
nil)
(deftest loop.1.53
(let ((i 0))
(loop for nil from 0 to 10 by 2 collect (incf i)))
(1 2 3 4 5 6))
(deftest loop.1.54
(let ((i 0))
(loop for nil from 1 to 4
for nil from 1 to 10 collect (incf i)))
(1 2 3 4))
(deftest loop.1.55
(let ((i 0))
(loop for nil from 5 downto 0 collect (incf i)))
(1 2 3 4 5 6))
(deftest loop.1.56
(let ((i 0))
(loop for nil from 5 above 0 collect (incf i)))
(1 2 3 4 5))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment