Update answer sheet for ClojureBridge-MN changes
This commit is contained in:
parent
37cc4ce04a
commit
b1ea905c57
@ -6,8 +6,8 @@
|
|||||||
true
|
true
|
||||||
true
|
true
|
||||||
false
|
false
|
||||||
"foo"
|
"hello"
|
||||||
"foo"
|
"hello"
|
||||||
3]}]
|
3]}]
|
||||||
|
|
||||||
["02_lists" {"__" [1 2 3 4 5
|
["02_lists" {"__" [1 2 3 4 5
|
||||||
@ -74,8 +74,8 @@
|
|||||||
:glory
|
:glory
|
||||||
4 6 :your-road
|
4 6 :your-road
|
||||||
1
|
1
|
||||||
:cocked-pistol
|
:bicycling
|
||||||
:say-what?]}]
|
"is that even exercise?"]}]
|
||||||
|
|
||||||
["08_higher_order_functions" {"__" [4 8 12
|
["08_higher_order_functions" {"__" [4 8 12
|
||||||
(* x x)
|
(* x x)
|
||||||
@ -135,9 +135,9 @@
|
|||||||
"___" [not]}]
|
"___" [not]}]
|
||||||
|
|
||||||
["14_destructuring" {"__" [":bar:foo"
|
["14_destructuring" {"__" [":bar:foo"
|
||||||
(format (str "First comes %s, "
|
(format (str "An Oxford comma list of %s, "
|
||||||
"then comes %s, "
|
"%s, "
|
||||||
"then comes %s with the baby carriage")
|
"and %s.")
|
||||||
a b c)
|
a b c)
|
||||||
(apply str
|
(apply str
|
||||||
(interpose " "
|
(interpose " "
|
||||||
@ -214,9 +214,9 @@
|
|||||||
{5 ["hello" "world"] 3 ["foo" "bar"]}
|
{5 ["hello" "world"] 3 ["foo" "bar"]}
|
||||||
{1 [{:name "Bob" :id 1}
|
{1 [{:name "Bob" :id 1}
|
||||||
{:last-name "Smith" :id 1}]
|
{:last-name "Smith" :id 1}]
|
||||||
2 [{:name "Mike" :id 2}]}
|
2 [{:name "Jennifer" :id 2}]}
|
||||||
nil
|
nil
|
||||||
{:naughty-list [{:name "Jimmy" :bad true}
|
{:naughty-list [{:name "Jimmy" :bad true}
|
||||||
{:name "Joe" :bad true}]
|
{:name "Joe" :bad true}]
|
||||||
:nice-list [{:name "Jack" :bad false}]}]}]
|
:nice-list [{:name "Jane" :bad false}]}]}]
|
||||||
]
|
]
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
"To categorize a collection by some function, use group-by."
|
"To categorize a collection by some function, use group-by."
|
||||||
(= __ (group-by count ["hello" "world" "foo" "bar"]))
|
(= __ (group-by count ["hello" "world" "foo" "bar"]))
|
||||||
|
|
||||||
|
|
||||||
"You can simulate filter + remove in one pass"
|
"You can simulate filter + remove in one pass"
|
||||||
(= (get-odds-and-evens [1 2 3 4 5])
|
(= (get-odds-and-evens [1 2 3 4 5])
|
||||||
((juxt filter remove) odd? [1 2 3 4 5])
|
((juxt filter remove) odd? [1 2 3 4 5])
|
||||||
@ -34,5 +33,5 @@
|
|||||||
(= __
|
(= __
|
||||||
(group-by #(if (:bad %) :naughty-list :nice-list)
|
(group-by #(if (:bad %) :naughty-list :nice-list)
|
||||||
[{:name "Jimmy" :bad true}
|
[{:name "Jimmy" :bad true}
|
||||||
{:name "Anna" :bad false}
|
{:name "Jane" :bad false}
|
||||||
{:name "Joe" :bad true}])))
|
{:name "Joe" :bad true}])))
|
||||||
|
Loading…
Reference in New Issue
Block a user