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

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

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

function args question

2008-12-05 Thread hitesh
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.com To unsubscribe from this group, send email to [EMAIL