#162
Logical falsity and truth
 

Difficulty:Elementary
Topics:logic


In Clojure, only nil and false represent the values of logical falsity in conditional tests - anything else is logical truth.
test not run
(= __ (if-not false 1 0))
test not run
(= __ (if-not nil 1 0))
test not run
(= __ (if true 1 0))
test not run
(= __ (if [] 1 0))
test not run
(= __ (if [0] 1 0))
test not run
(= __ (if 0 1 0))
test not run
(= __ (if 1 1 0))


Code which fills in the blank: