Re: Updating repeated nested structures?

2017-10-10 Thread hitesh
It's not terse, but it is easier to follow. (defn flip [f x y] (f y x)) (defn update-nums [m f] (update m :qs (fn [x] (flip map x (fn [x] (update-in x [:nums] #(map f %))) ;; (update-nums m inc

Re: ref strange behavior

2016-08-23 Thread hitesh
Taking a quick look at this, I *think* the problem crops up in your tasks being a lazy sequence. Modify this (def tasks (ref (range 1 1000))) to this (def tasks (ref (doall (range 1 1000 Running that with your large endpoint was taking a lot of time, so I'd suggest running it wit

Re: Generate a million file from a template

2016-08-22 Thread hitesh
This looks like it's doing too much work to simply generate a random integer. Are you sure you want to build a lazy list of 999,000 integers and randomly select into it for every invocation? The garbage collector will be working overtime. (defn update-individual [json-string] (assoc-in json

Re: function args question

2008-12-05 Thread hitesh
Meikel & Jeff, Thank you. That really helped me get over the current hump. But as I encounter more, I'm realizing I need to learn a lot more about the Java interop. Thanks, - Hitesh --~--~-~--~~~---~--~~ You received this message because you are subs

function args question

2008-12-05 Thread hitesh
foo(a,b) puts a puts b end x = [1,2] foo *x 1 2 Any ideas? Thanks, Hitesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups