Add cond; fix typo.

This commit is contained in:
Colin Jones 2010-11-03 20:38:20 -05:00
parent abcd170b34
commit fa90fc7e86
2 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,12 @@
:doom
__))
"You may have a multitude of possible paths"
(let [x 5]
(= :your_road (cond (= x __) :road_not_taken
(= x __) :another_road_not_taken
:else __)))
"Or your fate may be sealed"
(= __ (if-not (zero? __)
'doom

View File

@ -60,6 +60,7 @@
[]
0
:glory
4 6 :your_road
"'doom" 0 ]}
"higher_order_functions" {"__" [4 8 12
"(* x x)"
@ -87,7 +88,7 @@
:a :b :c :d
:c :d]
"___" ["multiply-by-5"]}
"factorial" {"__" ["(loop [n n acc 1]
"recursion" {"__" ["(loop [n n acc 1]
(if (zero? n)
acc
(recur (dec n) (* acc n))))"]}