drop

functionsince v0.0-927 clojure.core/dropEdit
(drop n)
(drop n coll)

Details:

Returns a lazy sequence of all but the first n items in coll.

Returns a stateful transducer when no collection is provided.


See Also:


Source docstring:
Returns a laziness-preserving sequence of all but the first n items in coll.
Returns a stateful transducer when no collection is provided.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn drop
  ([n]
   {:pre [(number? n)]}
     (fn [rf]
       (let [na (volatile! n)]
         (fn
           ([] (rf))
           ([result] (rf result))
           ([result input]
              (let [n @na]
                (vswap! na dec)
                (if (pos? n)
                  result
                  (rf result input))))))))
  ([n coll]
   {:pre [(number? n)]}
     (if (implements? IDrop coll)
       (or
         (if (pos? n)
           (-drop coll (Math/ceil n))
           (seq coll))
         ())
       (let [step (fn [n coll]
                    (let [s (seq coll)]
                      (if (and (pos? n) s)
                        (recur (dec n) (rest s))
                        s)))]
         (lazy-seq (step n coll))))))