3 ms·
You may enjoy Common LISP's looping: it's a whole minilanguage where you can say stuff like (loop for i from 1 upto 10 ..) (loop for i from 1 below
by arh68 7y ago
You may enjoy Common LISP's looping: it's a whole minilanguage where you can say stuff like
(loop for i from 1 upto 10 ..)
(loop for i from 1 below 11 ..)
(loop for i from 10 downto 1 ..)
(loop for i from 10 above 0 ..)
(loop for i from 3.5 to 7.5 by 0.25 ..)
It does much more than that, I should mention; it's a whole mini-language/DSL (like format).
- kazinator 7y agoPlus loop has unspecified behaviors leading to nonportable code that OP might enjoy.
- gjm11 7y agoNot only may but do; I like Common Lisp a lot, and while some people complain that LOOP isn't lispy enough I personally do like it. But it doesn't have the elegance of just specifying the inequalities you want your loop variables to satisfy :-).