From 9c69404e3cdbe2114bc5cbb274cfaec13b1226c3 Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Sat, 29 Nov 2003 01:56:11 +0000 Subject: [PATCH] Added nil variable dspec for for-as-arithmetic. --- ansi-tests/loop1.lsp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ansi-tests/loop1.lsp b/ansi-tests/loop1.lsp index f68c7ec0..8b40115b 100644 --- a/ansi-tests/loop1.lsp +++ b/ansi-tests/loop1.lsp @@ -254,3 +254,43 @@ (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))) + +;;; 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)) + + -- GitLab