Returns a seq of the items after the first. Calls seq on its
argument. If there are no more items, returns nil.
user=> (next '(:alpha :bravo :charlie)) (:bravo :charlie) user=> (next (next '(:one :two :three))) (:three) user=> (next (next (next '(:one :two :three)))) nil
;; next is used in the recursive call. (This is a naive implementation for illustration only. Using `rest` is usually preferred over `next`.)
(defn my-map [func a-list]
(when a-list
(cons (func (first a-list))
(my-map func (next a-list)))))
(def
^{:arglists '([coll])
:tag clojure.lang.ISeq
:doc "Returns a seq of the items after the first. Calls seq on its
argument. If there are no more items, returns nil."
:added "1.0"
:static true}
next (fn ^:static next [x] (. clojure.lang.RT (next x))))
Comments top
No comments for next. Log in to add a comment.