Any value in Clojure is considered truthy unless it is false
or nil
. You can find the truthiness of a value with (boolean value)
. You can find the truthiness of a list of values using (or)
, which returns true
if any arguments are truthy, or (and)
which returns true
if all arguments are truthy.
=> (or false nil)
nil ; none are truthy
=> (and '() [] {} #{} "" :x 0 1 true)
true ; all are truthy
=> (boolean "false")
true ; because naturally, all strings are truthy