Skip to content

Instantly share code, notes, and snippets.

@w33tmaricich
Last active March 21, 2016 14:09
Show Gist options
  • Save w33tmaricich/e2a22d55284eaccc80d1 to your computer and use it in GitHub Desktop.
Save w33tmaricich/e2a22d55284eaccc80d1 to your computer and use it in GitHub Desktop.
clj: checks if all keys are contained within a map
(defn contains-keys?
"True if all keys are contained within the map"
[maps keywords]
(let [map-list maps
all-keys keywords]
(if (empty? all-keys)
true
(if (contains? map-list (first all-keys))
(recur map-list (rest all-keys))
false))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment