store/[org.clojure/clojure "1.8.0"] clj::clojure.core/boolean

Official Documentation

Add notes
Arities
==================================================
   [x]

Docstring
==================================================
  Coerce to boolean

Source

(defn boolean
  "Coerce to boolean"
  {
   :inline (fn  [x] `(. clojure.lang.RT (booleanCast ~x)))
   :added "1.0"}
  [x] (clojure.lang.RT/booleanCast x))

Example 1

Edit
;; Everything except `false' and `nil' is true in boolean context.
(into {} (map #(vector % (boolean %)) [true false nil [] {} '() #{} ""]))
;; => {true true, false false, nil false, [] true, {} true, #{} true, "" true}

(clojure.pprint/pp)
;; > {true true,
;; >  false false,
;; >  nil false,
;; >  [] true,
;; >  {} true,
;; >  #{} true,
;; >  "" true}
;; => nil

Uses on crossclj