Add case.

This commit is contained in:
Colin Jones and Mike Jansen 2011-04-29 15:34:17 -05:00
parent ff7623f2ad
commit 7408b164fc
4 changed files with 23 additions and 4 deletions

View File

@ -119,6 +119,7 @@ have any questions or want more direction before you start pitching in.
- Alex Robbins - Alex Robbins
- Jaskirat Singh Veen - Jaskirat Singh Veen
- Mark Simpson - Mark Simpson
- Mike Jansen
### Credits ### Credits

View File

@ -19,7 +19,6 @@ Pre and Post conditions of functions
Particular Functions Particular Functions
===== =====
vector-of vector-of
case
flatten flatten
frequencies frequencies
group-by group-by

View File

@ -1,3 +1,12 @@
(defn explain-defcon-level [exercise-term]
(case exercise-term
:fade-out :you-and-what-army
:double-take :call-me-when-its-important
:round-house :o-rly
:fast-pace :thats-pretty-bad
:cocked-pistol :sirens
:say-what?))
(meditations (meditations
"You will face many decisions" "You will face many decisions"
(= __ (if (false? (= 4 5)) (= __ (if (false? (= 4 5))
@ -8,7 +17,7 @@
(= __ (if (> 4 3) (= __ (if (> 4 3)
[])) []))
"And in such a case you may have nothing" "And in such a situation you may have nothing"
(= nil (if (nil? __) (= nil (if (nil? __)
[:a :b :c])) [:a :b :c]))
@ -26,5 +35,13 @@
"Or your fate may be sealed" "Or your fate may be sealed"
(= __ (if-not (zero? __) (= __ (if-not (zero? __)
'doom 'doom
'doom))) 'doom))
"In case of emergency, sound the alarms"
(= :sirens
(explain-defcon-level __))
"But admit it when you don't know what to do"
(= __
(explain-defcon-level :yo-mama)))

View File

@ -70,7 +70,9 @@
0 0
:glory :glory
4 6 :your_road 4 6 :your_road
''doom 0 ]} ''doom 0
:cocked-pistol
:say-what?]}
"higher_order_functions" {"__" [4 8 12 "higher_order_functions" {"__" [4 8 12
'(* x x) '(* x x)