标准写法

控制流 / 条件语句 / if/else 语句

(defn get-latitude [] 90)

(def latitude (get-latitude))

;; if 恰好接受两个分支:then 和 else
(println (if (= latitude 0) "at the Equator" "not at the Equator"))

;; 一串 "else if" 写成 cond,由 :else 标明最后一个分支
(def location
  (cond
    (= latitude 0) "Equator"
    (= latitude 90) "north Pole"
    (= latitude -90) "south Pole"
    :else "not at the Equator or Pole"))
;; location is "north Pole"

(println "latitude" latitude "is" location)