Function: forstep
Section: programming/control
C-Name: forstep
Prototype: vV=GGGI
Help: forstep(X=a,b,s,seq): the sequence is evaluated, X going from a to b
 in steps of s (can be a positive real number, an intmod for an arithmetic
 progression, or finally a vector of steps). If b is set to +oo the loop will
 not stop.
Doc: evaluates \var{seq}, where the formal variable $X$ goes from $a$ to $b$
 in increments of $s$. Nothing is done if $s>0$ and $a>b$ or if $s<0$
 and $a<b$. The $s$ can be

 \item a positive real number, preferably an integer: $X = a, a+s, a+2s\dots$

 \item an intmod \kbd{Mod(c,N)} (restrict to the corresponding arithmetic
 progression starting at the smallest integer $A \geq a$ and congruent to $c$
 modulo $N$): $X = A, A + N, \dots$

 \item a vector of steps $[s_1,\dots,s_n]$ (the successive steps in $\R^*$
 are used in the order they appear in $s$): $X = a, a+s_1, a+s_1+s_2, \dots$

 \bprog
 ? forstep(x=5, 10, 2, print(x))
 5
 7
 9
 ? forstep(x=5, 10, Mod(1,3), print(x))
 7
 10
 ? forstep(x=5, 10, [1,2], print(x))
 5
 6
 8
 9
 @eprog\noindent Setting $b$ to \kbd{+oo} will start an infinite loop; it is
 expected that the caller will break out of the loop itself at some point,
 using \kbd{break} or \kbd{return}.
