Skip to content

Commit

Permalink
Create a 'merge' test to join maps together. (functional-koans#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Futurile authored and trptcolin committed Sep 25, 2016
1 parent b31227c commit a455688
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/koans.clj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
false
"February"
1 "January"
:c 3
2010 2014 2018
"PyeongChang" "Sochi" "Vancouver"]}]

Expand Down
3 changes: 3 additions & 0 deletions src/koans/06_maps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
"You can also create a new version with an entry removed"
(= {__ __} (dissoc {1 "January" 2 "February"} 2))

"Create a new map by merging"
(= {:a 1 :b 2 __ __} (merge {:a 1 :b 2} {:c 3}))

"Often you will need to get the keys, but the order is undependable"
(= (list __ __ __)
(sort (keys { 2014 "Sochi" 2018 "PyeongChang" 2010 "Vancouver"})))
Expand Down

0 comments on commit a455688

Please sign in to comment.