#clojure logs

2013-06-24

00:06xpeI'm about to write a custom reduce to do [[:a 0.7] [:b 0.2] [:b 0.1]] -> [[:a 0.7] [:b 0.3]] unless someone knows of a built-in for it
00:09warpath_2k!
00:09warpath_2klist
00:11xpeinto is close, maybe I can tweak it
00:12rads,(seq (apply merge-with + (map #(apply hash-map %) [[:a 0.7] [:b 0.2] [:b 0.1]])))
00:12clojurebot([:a 0.7] [:b 0.30000000000000004])
00:13xperads: cool!
00:13xpeI see the examples like it now on http://clojuredocs.org/clojure_core/clojure.core/merge-with
01:14SegFaultAXI think it's time to rebuild clojuredocs from the ground up.
01:20RaynesSegFaultAX: Let's do it.
01:20RaynesAnd by "Let's" I mean "You"!
01:20Raynes:D
01:25SegFaultAXRaynes: I'm studying the existing analyzer.
01:25SegFaultAXRaynes: I wonder if I could get a dump of the existing code samples from the current maintainer.
01:29amalloySegFaultAX: clojuredocs has an api, so you could get that dump yourself afaik
01:30SegFaultAXamalloy: Orly? Cool, thanks for the tip!
01:56derek_cnot sure if it's a bug or a feature, but I have this Java arraylist containing a number of WatchEvent(http://openjdk.java.net/projects/nio/javadoc/java/nio/file/WatchEvent.html), but apparently I can't use `map` on it
01:57derek_cno error is returned. it's simply that the function used with `map` won't run
02:03derek_cah damn no
02:03derek_cnever mind it's caused by another issue
02:14derek_cguys I'm totally confused. I have a `map` inside a `do`; the `map` maps on a list of integers and the function simply prints whatever is given... how come nothing is printed?
02:14derek_c(do (map (fn [x] (println x)) (range 100)) (println "are you kidding me"))
02:15derek_conly "are you kidding me" is printed
02:20tsantosderek_c: the first thing that springs to mind is that map returns a lazy sequence.
02:21tsantosprintln isn't getting called unless the elements of the resulting sequence are accessed
02:21derek_comg really?
02:22tsantoshttp://clojuredocs.org/clojure_core/1.2.0/clojure.core/map
02:22derek_cis there a strict version of map? I'm using map simply for some side-effects
02:23tsantosseems like you want looping semantics