range

functionsince v0.0-927 clojure.core/rangeEdit
(range)
(range end)
(range start end)
(range start end step)

Details:

Returns a lazy sequence of nums from start (inclusive) to end (exclusive), by step, where start defaults to 0, step to 1, and end to infinity.


See Also:


Source docstring:
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.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn range
  ([] (range 0 (.-MAX_VALUE js/Number) 1))
  ([end] (range 0 end 1))
  ([start end] (range start end 1))
  ([start end step]
   (cond
     (pos? step)
     (if (<= end start)
       ()
       (if (and (integer? start) (integer? end) (integer? step))
         (IntegerRange. nil start end step (range-count start end step) nil)
         (Range. nil start end step nil nil nil)))

     (neg? step)
     (if (>= end start)
       ()
       (if (and (integer? start) (integer? end) (integer? step))
         (IntegerRange. nil start end step (range-count start end step) nil)
         (Range. nil start end step nil nil nil)))

     :else
     (if (== end start)
       ()
       (repeat start)))))