Skip to content

Instantly share code, notes, and snippets.

@bouzuya
Created January 3, 2013 13:42
Show Gist options
  • Select an option

  • Save bouzuya/4443555 to your computer and use it in GitHub Desktop.

Select an option

Save bouzuya/4443555 to your computer and use it in GitHub Desktop.
; java.util.Properties から Clojure の map への変換
; java.util.Properties -> Clojure map
; e.g. key1=val1 -> {:key1 val1}
(defn props->map
[^java.util.Properties props]
(let [names (enumeration-seq (.propertyNames props))
pairs (map (juxt keyword #(.getProperty props %)) names)]
(into {} pairs)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment