You're viewing version 1.2.0 of first. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

first

clojure.core

  • (first coll)
Returns the first item in the collection. Calls seq on its
argument. If coll is nil, returns nil.

2 Examples top

  • user=> (first '(:alpha :bravo :charlie))
    :alpha
  • user=> (first nil)
    nil
    user=> (first [])
    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:48 top

(def
 ^{:arglists '([coll])
   :doc "Returns the first item in the collection. Calls seq on its
    argument. If coll is nil, returns nil."
   :added "1.0"}
 first (fn first [coll] (. clojure.lang.RT (first coll))))
Vars in clojure.core/first: fn
Used in 141 other vars (expand)
find-protocol-impl == some second letfn cond zipmap assoc! last butlast ->> concat conj assoc doto map when-first destructure to-array-2d ns reductions ffirst comp dissoc! < reduce interleave -> str bean = case > fnext >= <= take-while nfirst pr disj take-nth take every? dissoc disj! dir-fn union intersection print-stack-trace join assert-expr combine make-map get-cell add-tuples is-query-var? is-var? build-literal deferror ns-decl? comment? as-str maybe-atomize as-str operation fibs parse-trim ns-vars with-reader with-writer defmonadfn pprint-map pprint-simple-list pprint-defn pprint-condp buffer-length pprint-simple-code-list pprint-cond compile-format pprint-binding-form pprint-vector select reductions find-first reductions find-first update-or-insert-values dochars defst dochars assert-expr xml1-> minus div solve get-series dynamic-scatter-plot dynamic-xy-plot to-vect combine-with infix-to-prefix make-matrix transform-with matrix-map read-dataset property-descriptor get-property-class get-by-pattern read-git-origin read-components should-body pop-optional-args quit-dr union html-snippet intersection eval-from-control interactive-eval pprint-eval locals-for-emacs position with-env-locals eval-and-grab-output interactive-eval-region format-restarts-for-emacs find-first who-calls dispatch-event arglist-for-echo-area delimited-compound-prefix-match-acronym? inspect-in-emacs get-pid with-swank-io user-file-position fake user-file-position ssh-sftp-cmd memfn-varargs with-ssh-agent expand-and-quote cartesian-product

Comments top

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