user=> (nthrest (range 10) 5) (5 6 7 8 9)
Returns a lazy sequence of all but the first n items in coll.
Returns the nth next of coll, (seq coll) when n is 0.
Returns the value at the index. get returns nil if index out of bou
(defn nthrest "Returns the nth rest of coll, coll when n is 0." {:added "1.3" :static true} [coll n] (loop [n n xs coll] (if (and (pos? n) (seq xs)) (recur (dec n) (rest xs)) xs)))
This differs from clojure.core/drop in that it immediately drops the head of the seq, instead of doing so on the first call to first or seq.
Comments top
1 comment(s) for nthrest.
This differs from clojure.core/drop in that it immediately drops the head of the seq, instead of doing so on the first call to first or seq.