2013-06-24
| 00: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 |
| 00:09 | warpath_2k | ! |
| 00:09 | warpath_2k | list |
| 00:11 | xpe | into is close, maybe I can tweak it |
| 00:12 | rads | ,(seq (apply merge-with + (map #(apply hash-map %) [[:a 0.7] [:b 0.2] [:b 0.1]]))) |
| 00:12 | clojurebot | ([:a 0.7] [:b 0.30000000000000004]) |
| 00:13 | xpe | rads: cool! |
| 00:13 | xpe | I see the examples like it now on http://clojuredocs.org/clojure_core/clojure.core/merge-with |
| 01:14 | SegFaultAX | I think it's time to rebuild clojuredocs from the ground up. |
| 01:20 | Raynes | SegFaultAX: Let's do it. |
| 01:20 | Raynes | And by "Let's" I mean "You"! |
| 01:20 | Raynes | :D |
| 01:25 | SegFaultAX | Raynes: I'm studying the existing analyzer. |
| 01:25 | SegFaultAX | Raynes: I wonder if I could get a dump of the existing code samples from the current maintainer. |
| 01:29 | amalloy | SegFaultAX: clojuredocs has an api, so you could get that dump yourself afaik |
| 01:30 | SegFaultAX | amalloy: Orly? Cool, thanks for the tip! |
| 01: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 |
| 01:57 | derek_c | no error is returned. it's simply that the function used with `map` won't run |
| 02:03 | derek_c | ah damn no |
| 02:03 | derek_c | never mind it's caused by another issue |
| 02:14 | derek_c | 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? |
| 02:14 | derek_c | (do (map (fn [x] (println x)) (range 100)) (println "are you kidding me")) |
| 02:15 | derek_c | only "are you kidding me" is printed |
| 02:20 | tsantos | derek_c: the first thing that springs to mind is that map returns a lazy sequence. |
| 02:21 | tsantos | println isn't getting called unless the elements of the resulting sequence are accessed |
| 02:21 | derek_c | omg really? |
| 02:22 | tsantos | http://clojuredocs.org/clojure_core/1.2.0/clojure.core/map |
| 02:22 | derek_c | is there a strict version of map? I'm using map simply for some side-effects |
| 02:23 | tsantos | seems like you want looping semantics |