Поток управления / Условные операторы / Операторы if/else

(def n -42)

;; Clojure has no ternary operator and needs none: if is an expression,
;; it already gives back the value of the chosen branch
(def classify (if (pos? n) "positive" "negative"))
;; classify is "negative"

(println "number" n "is" classify)

;; so an if can stand anywhere a value can
(println (str "abs of " n " is " (if (neg? n) (- n) n)))

;; when the else branch is nil, "when" says the same thing shorter
(println "negative?" (when (neg? n) "yes"))