nthnext

added
1.0

ns
clojure.core

type
function

(nthnext coll n)

Returns the nth next of coll, (seq coll) when n is 0.

                (nthnext (range 10) 3)
;;=> (3 4 5 6 7 8 9)

(nthnext [] 3)
;;=> nil

(nthnext [1 2 3 4 5 6 7] 4)
;;=> (5 6 7)


            
                ;; drop is also similar, but different 
(nthnext (range 10) 5)   ;;=> (5 6 7 8 9)
(drop    5 (range 10))   ;;=> (5 6 7 8 9)

;; here is a case where the results differ
(nthnext [] 3)  ;;=> nil
(drop    3 [])  ;;=> ()   ; a lazy sequence