1.3.0 permalink Arrow_down_16x16

nthnext

clojure.core

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

1 Example top

  • user=> (nthnext (range 10) 3)
    (3 4 5 6 7 8 9)
    
    user=> (nthnext [] 3)
    nil
    
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:2745 top

(defn nthnext
  "Returns the nth next of coll, (seq coll) when n is 0."
  {:added "1.0"
   :static true}
  [coll n]
    (loop [n n xs (seq coll)]
      (if (and xs (pos? n))
        (recur (dec n) (next xs))
        xs)))
Vars in clojure.core/nthnext:
Used in 0 other vars

Comments top

No comments for nthnext. Log in to add a comment.