#clojure log - Jun 24 2013

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:06 xpe: I'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

0:09 warpath_2k: !

0:09 list

0:11 xpe: into is close, maybe I can tweak it

0:12 rads: ,(seq (apply merge-with + (map #(apply hash-map %) [[:a 0.7] [:b 0.2] [:b 0.1]])))

0:12 clojurebot: ([:a 0.7] [:b 0.30000000000000004])

0:13 xpe: rads: cool!

0:13 I see the examples like it now on http://clojuredocs.org/clojure_core/clojure.core/merge-with

1:14 SegFaultAX: I think it's time to rebuild clojuredocs from the ground up.

1:20 Raynes: SegFaultAX: Let's do it.

1:20 And by "Let's" I mean "You"!

1:20 :D

1:25 SegFaultAX: Raynes: I'm studying the existing analyzer.

1:25 Raynes: I wonder if I could get a dump of the existing code samples from the current maintainer.

1:29 amalloy: SegFaultAX: clojuredocs has an api, so you could get that dump yourself afaik

1:30 SegFaultAX: amalloy: Orly? Cool, thanks for the tip!

1:56 derek_c: not 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

1:57 no error is returned. it's simply that the function used with `map` won't run

2:03 ah damn no

2:03 never mind it's caused by another issue

2:14 guys 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?

2:14 (do (map (fn [x] (println x)) (range 100)) (println "are you kidding me"))

2:15 only "are you kidding me" is printed

2:20 tsantos: derek_c: the first thing that springs to mind is that map returns a lazy sequence.

2:21 println isn't getting called unless the elements of the resulting sequence are accessed

2:21 derek_c: omg really?

2:22 tsantos: http://clojuredocs.org/clojure_core/1.2.0/clojure.core/map

2:22 derek_c: is there a strict version of map? I'm using map simply for some side-effects

2:23 tsantos: seems like you want looping semantics

Logging service provided by n01se.net