Fork me on GitHub
#beginners
<
2016-04-23
>
thomasdeutsch08:04:09

is there a clojure function like zipmap, but will collect values in a seq, if the key is the same?

`[:a :b :a] [1 2 3]  =>  {:a [1 3] :b [2]}

thomasdeutsch09:04:49

zipmap-with-concat:

(->> (interleave coll-a (map (partial conj '()) coll-b))
                    (partition 2)
                    (map (partial apply hash-map))
                    (apply merge-with concat))

hoopes20:04:57

For unit testing, is there a best-of-breed to use with clojure.test for mocking/stubbing? I've found https://github.com/amitrathore/conjure , which looks like it serves my purpose, but was wondering if there's a newer thing out there everyone is using I wasn't privy to. (Or is with-redefs-fn all you really need?) I'm trying to stub out functions that talk to a database, so that I don't need an actual database to run tests. Thanks!

roberto20:04:18

I use conjure because that is the first lib I found

tmtwd21:04:18

what is the name for #’ in clojure?

tmtwd21:04:24

(trying to look up docs)

tom21:04:25

var-quote

tom21:04:39

I reckon you might get more info from http://clojuredocs.org/clojure.core/var and links to more info/terminology