clojure-koans/src/koans/conditionals.clj

17 lines
403 B
Clojure
Raw Normal View History

2010-02-09 23:37:22 +00:00
(meditations
2010-05-07 02:56:43 +00:00
"You will face many decisions"
2010-02-09 23:37:22 +00:00
(= __ (if (false? (= 4 5)) :a :b))
"Some of them leave you no alternative"
(= __ (if (> 4 3) []))
"And in such a case you may have nothing"
2010-05-07 02:56:43 +00:00
(= nil (if (nil? __) [:a :b :c]))
"In others your alternative may be interesting"
(= :glory (if (not (empty? ())) :doom __))
"Or your fate may be sealed"
(= __ (if-not (zero? __) 'doom 'doom)))
2010-02-09 23:37:22 +00:00