Re: New to Clojure

2011-06-08 Thread hci
I was in the same boat last year. My experience with Clojure started with Java interop, by writing Clojure code to solve some small problems using existing Java libraries. For example, I used Clojure to fetch and process application logs in a MySQL database and visualize the results with a Java gra

Re: Translating Java code with nested for loops

2011-06-28 Thread hci
How about this one? (defn calc [total-values daily-values] (map-indexed (fn [i daily] (* daily (reduce #(* %1 (inc (/ %2 100.0))) 1.0 (nthnext total- values (inc i) daily-values)) Happy coding. -huahai On Jun 28, 10:11 pm, Justin Kramer wrote: > Here's one wa