Created
January 3, 2013 13:42
-
-
Save bouzuya/4443555 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; 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