This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-22
Channels
- # alda (1)
- # aws-lambda (23)
- # beginners (27)
- # boot (156)
- # business (2)
- # carry (4)
- # cider (1)
- # cljsjs (2)
- # cljsrn (29)
- # clojure (170)
- # clojure-austin (35)
- # clojure-czech (8)
- # clojure-dusseldorf (5)
- # clojure-italy (4)
- # clojure-nl (1)
- # clojure-quebec (2)
- # clojure-russia (45)
- # clojure-spec (49)
- # clojure-uk (12)
- # clojurescript (81)
- # component (5)
- # datomic (24)
- # devcards (26)
- # emacs (4)
- # hoplon (4)
- # jobs (1)
- # juxt (5)
- # leiningen (6)
- # luminus (14)
- # mount (26)
- # om (27)
- # om-next (2)
- # onyx (22)
- # pedestal (2)
- # planck (3)
- # proton (5)
- # re-frame (19)
- # reagent (2)
- # ring-swagger (60)
- # spacemacs (12)
- # specter (8)
- # untangled (119)
- # vim (61)
- # yada (36)
is there a better way to take a map with string keys and convert to keyword keys?
5 │ (defn props []
6 │ (let [file (io/file "field-map.properties")
7 │ data (p/load-from file)]
8 │ (zipmap (map keyword (keys data)) (vals data)) ))
{"two" "dos", "one" "uno", "three" "a long thing"}
is what would be in data
ahh ok
hmm so its not actually a map but a java.util.Properties object ...
playing in repl
a is my object
(clojure.walk/keywordize-keys (into {} a))
that works
ok thanks 🙂
ok i have another question
i am making a war file and handing it to a guy
that reads a properties file ... using clojurewerkz/propertied library ...
if I read the file and store into a variable
and compile to jar ....
will the var work ?
or will it contain the values it had when i first compiled ?
i guess i can try it
hmm i used clojure.walk by calling it fully qualified.. and when i make uberjar it complains
ok it works now 😉
and i answered my own questions 🙂
clojure is the most awesome language
open for any suggestions… a brief tour of clojure.. https://github.com/AustinClojure/workshop-docs/blob/add-basics/Pages/2-basics.md
mainly for a reference during the workshop