function | since v0.0-927 | clojure.core/next | Edit |
(next coll)
Returns a sequence of the items after the first and calls seq
on its argument.
Returns nil if coll
is empty.
(next [1 2 3])
;;=> (2 3)
(next [1 2])
;;=> (2)
(next [1])
;;=> nil
(next [])
;;=> nil
Returns a seq of the items after the first. Calls seq on its argument. If there are no more items, returns nil
(defn ^seq next
[coll]
(when-not (nil? coll)
(if (implements? INext coll)
(-next coll)
(seq (rest coll)))))