Details
-
Type:
Enhancement
-
Status:
Open
-
Priority:
Trivial
-
Resolution: Unresolved
-
Affects Version/s: Release 1.2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:All
Description
The range function's documentation does indicate the following usage:
(range 10 0 -1) -> (10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
Current doc:
Returns a lazy seq of nums from start (inclusive) to end
(exclusive), by step, where start defaults to 0, step to 1, and end
to infinity.
Suggestion:
Returns a lazy seq of nums from start (inclusive) to end
(exclusive), by step, where start defaults to 0, step to 1, and end
to infinity.
Its also possible to step down rather than up, for example counting
backwards from 10 by -1: (range 10 0 -1).
The current doc actually mentions the 'step' parameter briefly:
"[...] to end (exclusive), by step, where start [...]"
But as this might be easy to miss, an addition to the doc is still a good idea, I think.
My suggestion:
Returns a lazy seq of nums from start (inclusive) to end
(exclusive), by step, where start defaults to 0, step to 1, and end
to infinity. Step may be negative to count backwards.