I'm really new to Clojure, but I'm under the impression that reduce would be better than apply, since I assume that apply would reify the entire sequence at once, whereas reduce would consume the sequence one by one. Could someone more familiar with the implementation weigh in on this?
On Feb 21, 2010, at 4:25 PM, Michael Kohl wrote: > On Sun, Feb 21, 2010 at 9:41 PM, Aviad Reich <avi....@gmail.com> wrote: >> ANY comments will be great (including: this is all wrong - don't >> post it). > > FWIW since I'm not exactly an expert on idiomatic Clojure either, I'd > write h-mean like this: > > (defn h-mean [coll] > (/ (count coll) (apply + (map #(/ 1 %) coll)))) > > Michael > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en