Skip to content

Instantly share code, notes, and snippets.

@Zariel
Created October 16, 2013 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zariel/7008302 to your computer and use it in GitHub Desktop.
Save Zariel/7008302 to your computer and use it in GitHub Desktop.
(defn- kvmap
[func hashmap]
(apply hash-map (flatten (map ((fn [[k v]] [k (func k v)])) hashmap))))
@Zariel
Copy link
Author

Zariel commented Oct 16, 2013

example

input := { host: "http://localhost/" }
func := function(key, val) {
return val + key
}
output := { host: "http://localhost/host" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment