Skip to content

Instantly share code, notes, and snippets.

@bradlucas
Created September 22, 2011 00:53
Show Gist options
  • Save bradlucas/1233763 to your computer and use it in GitHub Desktop.
Save bradlucas/1233763 to your computer and use it in GitHub Desktop.
find-new-members
(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