Fork me on GitHub
#beginners
<
2017-05-30
>
chad02:05:12

I was wondering if anyone had any book suggestions for beginners to both Clojure and/or functional programming?

chad07:05:07

Awesome thanks :-) I'll check them out.

matan13:05:22

I have it a lot that I build a list of values in a let form, one value depending on the other, then push them into a map as a return value. I cannot create them directly in the map because one depends on the other ― and a map doesn't provide a way to refer back to previously defined keys of itself within the same initialization form (I think). So I build all values in a let form, then push them one by one into the map.

matan13:05:09

Short of my own solution, anything in clojure core for more conciseness and less ceremony?

ghadi14:05:25

@matan lift the structural duplication into a helper:

(let [average (fn [f rows]
                (divide-or-undef
                  (apply + (map f rows))
                  (count rows)))]
  {:recall (average :correct-vs-gold row-evaluations)
   ... ...
   })