public
Created

find-new-members

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7
(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)))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.