first

functionsince v0.0-927 clojure.core/firstEdit
(first coll)

Details:

Returns the first item in coll and calls seq on its argument.

Returns nil when coll is nil.


Examples:

(first [1 2 3])
;;=> 1

(first [])
;;=> nil

See Also:


Source docstring:
Returns the first item in the collection. Calls seq on its
argument. If coll is nil, returns nil.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn first
  [coll]
  (when-not (nil? coll)
    (if (implements? ISeq coll)
      (-first coll)
      (let [s (seq coll)]
        (when-not (nil? s)
          (-first s))))))