Re: [beginner] help understand this function

2017-03-20 Thread Luis P. Mendes
Thanks Walter! sábado, 18 de Março de 2017 às 21:19:10 UTC, Walter van der Laan escreveu: > > The value of 'maps' can be, for example; [{:lat 1 :lng 4} {:lat 2 :lng 3}]. > > If you enter (min [{:lat 1 :lng 4} {:lat 2 :lng 3}]) in the repl the > result will be {:lat 1 :lng 3} > > If you replace 'm

Re: [beginner] help understand this function

2017-03-18 Thread Walter van der Laan
The value of 'maps' can be, for example; [{:lat 1 :lng 4} {:lat 2 :lng 3}]. If you enter (min [{:lat 1 :lng 4} {:lat 2 :lng 3}]) in the repl the result will be {:lat 1 :lng 3} If you replace 'min' by its definition you get; (min [{:lat 1 :lng 4} {:lat 2 :lng 3}]) => (zipmap [:lat :lng] (

[beginner] help understand this function

2017-03-18 Thread Luis P. Mendes
Hi, I'm reading `Clojure for the Brave and True` book, at chapter 6 . I don't completely understand this function: (defn comparator-over-maps [comparison-fn ks] (fn [maps] (zipmap ks (map (fn [k] (apply compariso