Fork me on GitHub
#beginners
<
2016-01-16
>
dantsui06:01:34

(Edit: figured it out! :D)

jonahbenton16:01:18

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.

drewverlee16:01:08

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?

jonahbenton16:01:01

: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...."

drewverlee17:01:09

@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: