Created
September 22, 2011 00:53
-
-
Save bradlucas/1233763 to your computer and use it in GitHub Desktop.
find-new-members
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
(defn find-new-members | |
"Return the new people are only in the new-list but not in the current-list. | |
Both lists are lists of maps where they have at least :first_name and :last_name keys. | |
" | |
[current-list new-list] | |
(let [existing (set (remove #(nil? (second %)) (map (juxt :first_name :last_name) current-list)))] | |
(remove #(existing ((juxt :first_name :last_name) %)) new-list))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment