function | since v0.0-927 | clojure.core/boolean | Edit |
(boolean x)
Return false
if x
is false or nil. Otherwise return true
. This is the
truthiness condition used by if
expressions.
(boolean 1)
;;=> true
(boolean 0)
;;=> true
(boolean nil)
;;=> false
Coerce to boolean
(defn boolean
[x]
(cond
(nil? x) false
(false? x) false
:else true))