This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-16
Channels
- # admin-announcements (94)
- # aws (6)
- # beginners (8)
- # boot (303)
- # cider (5)
- # cljsrn (25)
- # clojure (82)
- # clojure-art (28)
- # clojure-chicago (2)
- # clojure-dev (2)
- # clojure-france (1)
- # clojure-japan (1)
- # clojure-my (1)
- # clojure-russia (78)
- # clojurescript (21)
- # clojurex (3)
- # dirac (1)
- # events (3)
- # funcool (5)
- # hoplon (12)
- # jobs (1)
- # ldnclj (2)
- # off-topic (49)
- # om (207)
- # proton (3)
- # re-frame (24)
- # reagent (45)
- # spacemacs (1)
- # yada (48)
hey @vanrysss haven't used hikaricp but if the pool is assigned to a top level var then at compile time- when the namespace is read and top level vars are evaluated- the pool will be instantiated and therefore may initiate connections to the db.
I'm having trouble understanding the destructuring in this function:
(defn split-sentence [{:keys [sentence]}]
(map (fn [word] {:word word}) (clojure.string/split sentence #"\s")))
I'm used to seeing the symbol on the right. I.e
[{assign-go :assign-from}]
as is demonstrated here: https://gist.github.com/john2x/e1dca953548bfdfb9844#maps
is ':keys' a function?hey @drewverlee see https://gist.github.com/john2x/e1dca953548bfdfb9844#shortcuts
:keys [sentence] means that calling (split-sentence {:sentence "The quick brown fox..."}) will result in the local symbol sentence being bound to "The quick brown fox...."
@jonahbenton, thanks! you answer plus reading (this)[https://programmers.stackexchange.com/questions/167882/understanding-clojure-keywords] helped me fine tune my understanding of keywords and destructuring:
super!