Iterates over a numeric range.
(rn x)
is equivalent to (rn 0 x)
.
(rn x y z)
iterates from x
inclusive to y
exclusive, incrementing by z
each time.
(rn x #n z)
endlessly counts upwards or downwards from x
, incrementing the counter by
z
each time.
If any argument is a float, then the iterator will produce floats. Otherwise, it will produce integers.
If z
is less than 0
, iteration is finished when the counter is <=
y
. Otherwise,
iteration ends when the counter is >=
y
.
(prn (arr ..(rn 3))) ; prints (0 1 2)
(prn (arr ..(rn 0 3))) ; prints (0 1 2)
(prn (arr ..(rn 0 3 1.0))) ; prints (0.0 1.0 2.0)
(prn (arr ..(rn 2 14 3))) ; prints (2 5 8 11)
(prn (arr ..(rn 2 14 -1))) ; prints ()
(prn (arr ..(rn 2 2 -1))) ; prints ()
(prn (arr ..(rn 5 0 -1))) ; prints (5 4 3 2 1)