复杂条件

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

(def a 3)
(def b 5)
(def c 7)

;; and/or/not 是普通的前缀形式,and/or 可接受任意数量的参数,
;; 无需成对
(when (and (>= c a) (>= c b))
  (println "nothing is larger than c"))

(when (not (or (>= a b) (>= a c)))
  (println "a is the smallest"))

;; when 就是没有 else 分支的 if;
;; 比较链也能放进一次调用
(println "a < b < c is" (< a b c))

;; and/or 返回的是值,而不只是标志:
;; and 返回最后一个真值参数,or 返回第一个真值参数
(println "(or nil false c) is" (or nil false c))