Created
February 4, 2010 20:59
-
-
Save puredanger/295099 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; What function can I put as FOO here to yield true | |
; Tried: hash-set, conj, concat | |
(defn mergeMatches [propertyMapList] | |
"Take a list of maps and merges them combining values into a set" | |
(reduce #(merge-with FOO %1 %2) {} propertyMapList)) | |
(def in | |
(list | |
{:a 1} | |
{:a 2} | |
{:a 3} | |
{:b 4} | |
{:b 5} | |
{:b 6} )) | |
(def out | |
{ :a #{ 1 2 3} | |
:b #{ 4 5 6} }) | |
; this should return true | |
(= (mergeMatches in) out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment