#clojure log - Jun 13 2012

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

0:00 muhoo: hahaa

0:00 devn: amalloy: im aware. but you have to admit, as a dependency it is the kitchen sink

0:00 amalloy: *shrug*

0:00 i don't see why i would care

0:00 mstump: is there an easier way to pass a hash as keyword args than (apply fn (apply concat h))?

0:00 devn: amalloy: lol

0:00 clojurebot: amalloy: therfor I return [previous] if rest is empty

0:01 muhoo: but useful itself doesn't pull in much does it?

0:01 amalloy: pulls in zero

0:01 muhoo: tools.macro? that's it?

0:01 amalloy: oh, not zero anymore

0:01 i guess

0:01 but yes, very little

0:01 devn: amalloy: "i dont see why i would care"

0:01 i mean, come on dude

0:01 amalloy: sorry bro

0:01 muhoo: so why not? my big worry when pulling in stuff, is that it will cause hairballness

0:01 amalloy: if having "several files" in your dependency bothers you, use someone else's lib

0:02 devn: amalloy: what im telling you is that i do.

0:02 amalloy: cool

0:02 gfredericks: devn: fork it then

0:02 amalloy: i have no interest in converting you

0:02 devn: rather, i dont use someone else's lib. i dont use a lib

0:02 amalloy: you dont have to be all "fuck off" about it

0:02 muhoo: wow, cranky tonight in #clojure

0:02 brehaut: O_o

0:04 TimMc: I ended up writing org.timmc/handy, but that was because I didn't like the choice of maven coordinates and package names in useful. :-P

0:04 devn: im going to make "useless"

0:04 gfredericks: devn: I think he ought to have the right to contribute something without hand-wringing over its usage

0:04 devn: it will contain most of my own code

0:04 amalloy: devn: you "cringe" at thinking of using useful, you tell me i have to admit it's the kitchen sink, lol when i say i don't care, and tell me to "come one, dude". you can have some fuck-off if you ask for it

0:05 * devn burpsd

0:05 devn: burps*

0:05 amalloy: you're reading too much into what im saying

0:07 amalloy: im sorry if you took that the wrong way. i think other people probably feel similarly. useful is useful, but for me personally i end up just pulling out the fns I actually want. i realize why you dont want to maintain a contrib-like set of repos. that's crazy.

0:08 cmajor7: what is "the way" to submit/validate a form in clojurescript?

0:08 dnolen: cmajor7: I don't see how it would be any different than JS

0:09 adu: cmajor7: I've been wondering that myself

0:10 gfredericks: devn: https://github.com/fredericksgary/clojure-useless

0:10 I'll give you commit rights

0:10 devn: gfredericks: hahaha

0:11 gfredericks: well played, sir.

0:11 gfredericks: ah there's even a function there already

0:11 (comp first list)

0:12 and somebody's watching it. I'm setting you up for success.

0:12 devn: gfredericks: oo oo! I've got one!

0:12 (defn not-empty? (complement empty?))

0:13 gfredericks: open an issue so we can discuss whether or not to call it nempty?

0:14 devn: gfredericks: that might go on for weeks

0:14 gfredericks: hammock-driven development sometimes does

0:14 devn: how about: not-hollow?

0:15 gfredericks: also I'd like some appropriate implementation for a function called naughty?

0:16 cmajor7: dnolen: I mostly do backend, so I only have ideas on how to do it in JS (e.g. via jquery form plugin, etc.). but I was thinking maybe there is a cool clojure(script) way of doing it (e.g. there is a noir way doing it https://gist.github.com/1103146, which is quite nicer than "just javascript", but misses "remotes"), there is also a way to bind events via jayq (e.g. (jq/bind

0:16 …)), but it is all bits and pieces, hence was wondering what is a "clojurescript" way of doing it.. e.g. ( deform (…) )

0:16 gfredericks: (defn naughty? [m] (->> m keys (map type) distinct count (< 1)))

0:17 devn: gfredericks: if it's passed a form i think you should just flatten the form, map str, and check for instances of "do.*\s"

0:18 brehaut: gfredericks: type? really?

0:18 dnolen: cmajor7: I'm sure there's an opportunity for an idiomatic lib here - until then - the JS way is the probably your best bet.

0:18 devn: brehaut: haha, im now full on belly laughing. "type? seriously? wtf?"

0:19 nevermind this is going in the "useless" library

0:19 cmajor7: dnolen: thank you. so if it is indeed the "JS way", would you recommend go with a "jquery form plugin" or there is another known standard JS way?

0:20 devn: amalloy: btw, please shake my hand. it is going to be awkward when we see eachother at the next conj if you still hold a grudge. i dont to get shanked.

0:20 dont want to*

0:20 dnolen: cmajor7: many examples on the web. jQuery form plugin works too.

0:21 devn: dnolen: does mentorship on gsoc work the same as it used to? there's the mid-term stipend pending mentor approval, yeah?

0:21 dnolen: there's going to be a little bit of The Art of the Propagator in core.logic's approach to cKanren ...

0:21 devn: haven't heard anything about that.

0:23 devn: dnolen: oh, well it used to be that students would work for half the summer, and then their mentor would say yes or no to whether or not the student continued on GSoC the rest of the summer. google paid me when i was accepted, and then at midterm. i didnt know if that was still the way it worked.

0:24 dnolen: devn: no idea, I'm sure I'll hear about it some point.

0:25 devn: dnolen: fair enough, was just interested because i think some sort of progress update for the community on GSoC progress at some point would be cool

0:26 dnolen: devn: all the projects are GitHub. I'm students will make announcements of their own here and there.

0:26 devn: a short informal summary or formal if the student feels up to it, etc.

0:26 dnolen: fair enough, just saying this in the spirit of making people in the community aware of all the awesome happening as a result of GSoC

0:47 dnolen: CLJS gets :refer support in :require

0:50 tomoj: I never knew clj had :refer support

0:51 amalloy: tomoj: as of 1.4

0:59 zubair: Hi everyone

1:14 devn: zubair: hi!

3:11 tomoj: what is expected of an ISequential?

3:11 just ISeqable plus some semantics?

3:22 noidi: tomoj, IIRC sequentials are ordered whereas seqables may offer a sequential view of an unordered collection

3:23 tomoj: ok, that's the "semantics" bit, but as for actual interface just ISeqable?

3:24 what is reduce-kv for?

3:25 noidi: it seems to be just a tag interface https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Sequential.java

3:25 tomoj: e.g. how could you ever get clojure.core.reducers.map to use its [ret k v] version?

3:26 noidi: yeah, so the actual interface requirements are conventional

3:26 noidi: https://github.com/clojure/clojure/blob/master/changes.md

3:26 "reduce-kv reduces an associative collection."

3:28 tomoj: yeah..

3:28 I guess my real question is, why do the defcurried operators have reduce-kv cases?

3:28 they seem impossible to use

3:29 noidi: sorry, can't help you there

3:29 I'm not familiar with reducers

4:22 amalloy: tomoj: clojure.core/reduce-kv calls through to the kv-reduce protocol function

4:22 clojure.core.reducers/reduce checks to see whether the input collection is a map, then calls either kv-reduce or coll-reduce

4:22 so those are two ways in which the kv versions can be invoked

4:32 ro_st: how do i copy some keys by name to another map?

4:32 (into {} (magic-word source-map))

4:33 amalloy: &(doc select-keys)

4:33 lazybot: ⇒ "([map keyseq]); Returns a map containing only those entries in map whose key is in keys"

4:33 ro_st: select-keys. thank you

4:34 weird. for some reason, emacs thinks that 'k' is the beginning of a chord, and it won't let me simply enter a k into the buffer

4:34 amalloy: ro_st: C-h k k

4:34 ro_st: says it's undefined!

4:35 when i press k, minibuffer shows 'k-'

4:35 stupid thing

4:36 i wish desktop-mode would remember all my windows and frames

4:36 tomoj: amalloy: example?

4:36 amalloy: ro_st: what about: M-: (key-binding (kbd "k"))

4:37 tomoj: r/map returns something that doesn't implement IKVReduce

4:37 amalloy: should show you the function the key is bound to even if it's a prefix key

4:38 tomoj: that looks like an oversight in 'folder and 'reducer to me, but i'm not sure

4:38 ro_st: amalloy: sorry, what should i do?

4:38 amalloy: ro_st: never mind, i was probably wrong. it doesn't seem to work for me

4:39 ro_st: only place i can see (kbd "k") anywhere in my .emacs.d is in magit's config

4:40 tomoj: hmm, if they implemented IKVReduce you'd get it if you explicitly called reduce-kv, I guess

4:40 amalloy: tomoj: right, i think that's the intended use case

4:41 ro_st: shift-K works as it should. it's just lower-case k

4:41 double you tee eff ?!

4:43 tomoj: I wonder how multireducers would work given kv reduce

4:45 borkdude: what does the number of people in an IRC channel mean: #clojure has more than #java, #noir has more than #struts - does this mean is becoming more popular, or there are more difficulties working with it? ;)

4:50 ivan: borkdude: the causality leading to idling in a channel is surely more complicated than that

4:50 ro_st: amalloy: it was a yasnippet which had "keybinding" as the keybinding.

4:53 borkdude: ivan what do you think might be the cause to idling?

4:54 ivan: something like: freenode user, aware of Clojure, aware of #clojure, (thinks #clojure is worth logging or viewing || might have Clojure question)

4:55 the ability or will to run a persistent IRC client also affects the numbers

5:01 muhoo: it would be fun to figure out what proportion of irc clients idling are on linode or aws

5:22 Chiron_: Hi, I want to read a large file and process line by line . I'm using line-seq but it the resource consumption is high

5:22 any idea how to process large text files in clojure?

5:23 Raynes: Chiron_: line-seq is lazy. The only reason the resource consumption would be high would be if you're holding the whole thing in memory.

5:24 Chiron_: (time (with-open [rdr (java.io.BufferedReader. sql-reader)] (let [seq (line-seq rdr)] (count seq))))

5:30 Raynes: Chiron_: count realizes the whole seq.

5:30 Try that with (reduce (fn [n _] (inc n)) 0 seq) instead of the count call.

5:34 ro_st: why would a map serialise to json as #<BufferedInputStream java.io.BufferedInputStream@5505aa49> instead of as a literal map?

5:34 in this case, the map i'm constructing as {:success (func that calls monger's save)}

5:34 that func returns true inside the try and false inside the catch

5:36 Chiron_: ok, will try it. thanks!

5:49 amalloy: Raynes: count only realizes the whole seq at once if you're hanging onto the head somewhere else - it throws away as it goes, like any good citizen

5:51 Chiron_: so any better way to handle big files in Clj? especially when a lot (really a lot) of Strings are going to be created due the processing?

6:07 TEttinger: OK, I have a friend who wants to implement Ruby-style prototype OOP and Mixins... in Clojure, with macros

6:07 has anyone already done this?

6:09 wow, a 2-letter username. nice work, _Vi

6:10 ro_st: for fun, or because CLJ doesn't give him what he wants?

6:10 TEttinger: ro_st, because he is used to Ruby and I think would be porting ruby code

6:11 _Vi: TEttinger, 1. Offtopic is it, 2. "Not the name makes noble man, but the man makes noble name".

6:11 ro_st: i should think it'd be better to learn idiomatic clojure and do it properly

6:11 that way when no ruby folks are left and new clojure peeps come on, they're comfy

6:11 TEttinger: ro_st, yeah, you are probably right

6:12 Bronsa`: or you can mimic that with `defprotocol`,`deftype`,`extend` and a hash map.

6:12 TEttinger: Bronsa`, I knew extend would be part of it!

6:12 great

6:47 ro_st: when i call a function myself, i get back the map i'm expecting. when a compojure handler calls it and the json middleware serialises it, it's a #<BufferedInputStream java.io.BufferedInputStream@54657f7f>. why?

6:53 broquaint: Can you paste the relevant code to refheap/gist, ro_st?

6:54 ro_st: this is doing it for me: (PUT "/foo" {json :json-params} {:body {:success true}})

6:55 it's like it's passing back some sort of deferred instead of the generated json

6:56 it's wrap-json-response's fault

6:57 or, rather, the issue is somewhere in that middleware

7:26 what's the easiest way to prepare string data for use by a ring handler in the repl?

7:26 i've been sending it a :body with a string value, and now reading the ring spec i see it wants an InputStream instead

7:31 clgv: ro_st: afaik, you can use strings and InputStreams. I used strings generated from hiccup and an InputStream for a chart generated with incanter

7:33 cshell: spit?

7:34 I use slurp to read from the InputStream to String so I think spit is the opposite

7:39 kaini: Hi, I have written a little program that generates minesweeper fields. Would you critisize the code and especially tell me, if I have abused any feature or violated a good practise: https://gist.github.com/e31bbacc1c60155187b2 thanks

7:41 cshell: looks fine to me

7:42 kaini: ok thanks :)

7:43 ro_st: clgv, cshell: turns out ring-middleware-format expects an InputStream, as per the ring spec (it slurps it). also turns out that ring.util.test has (string-input-stream str)

7:44 so now my in-repl ring testing fn is https://www.refheap.com/paste/3118

7:45 clgv: kaini: you can use (pos? bombs_left) for (> bombs_left 0)

7:48 kaini: clgv, ok

7:49 clgv: kaini: you cold omit the loop-recur in gen-field by using (into #{} (repeatedly bomb_count (Coord. ...)). you shoud also write bomb-count instead of bomb_count

7:49 ro_st: what's the paredit spell for swapping the depths of the current form with its immediate parent form?

7:49 {:foo (fn [sd] sdf)} becomes (fn [sd] {:foo sdf})

7:51 kaini: clgv, I didn't know this functions - I'll take a look at them

7:51 ro_st: pretty sure i saw someone talking about how you can do that

7:55 clgv: kaini: `neighbour-coords` can be rewritten with `map* statements such that you only need to mention (Coord. ...) a single time and you can avoid mentioning x,y all the time

7:55 I meant: map not map*

7:55 casperc: I'm wondering, what is the best way to create a dynamic sql query in clojure? clojure.data.jdbc doesn't seem to allow it

7:56 Bronsa: korma?

7:56 clgv: kaini: ##(doseq [x (range w) y (range h)] [x y])

7:56 lazybot: java.lang.RuntimeException: Unable to resolve symbol: w in this context

7:57 casperc: maybe, is that any good?

7:57 clgv: kaini: ##(doseq [x (range 5) y (range 10)] [x y])

7:57 lazybot: ⇒ nil

7:57 clgv: kaini: ##(doseq [x (range 5) y (range 10)] (print [x y]))

7:57 lazybot: ⇒ [0 0][0 1][0 2][0 3][0 4][0 5][0 6][0 7][0 8][0 9][1 0][1 1][1 2][1 3][1 4][1 5][1 6][1 7][1 8][1 9][2 0][2 1][2 2][2 3][2 4][2 5][2 6][2 7][2 8][2 9][3 0][3 1][3 2][3 3][3 4][3 5][3 6][3 7][3 8][3 9][4 0][4 1][4 2][4 3][4 4][4 5][4 6][4 7][4 8][4 9]nil

7:57 ro_st: casperc: sqlkorma.com

7:57 works beautifully

7:58 clgv: kaini: so you can write print-field like (doseq [y (range h) x (range w)] (print-cell field (Coord. x y)))

7:59 casperc: thanks, i'll give korma a try :)

7:59 borkdude: korma r0xx0r

7:59 clgv: kaini: your code would get clearer if you omitted the defrecords but just use vector of vectors instead for representing the field

8:08 kaini: clgv, what exactly is the difference between conj and into?

8:09 clgv: kaini: ##(conj [] 1)

8:09 lazybot: ⇒ [1]

8:09 clgv: kaini: ##(conj #{} 1)

8:09 lazybot: ⇒ #{1}

8:09 clgv: kaini: ##(into #{} (range 10))

8:09 lazybot: ⇒ #{0 1 2 3 4 5 6 7 8 9}

8:10 kaini: ##(conj #{} (range 10))

8:10 lazybot: ⇒ #{(0 1 2 3 4 5 6 7 8 9)}

8:10 kaini: i see

8:10 Bronsa: into is essentialy (partial reduce conj)

8:11 Chousuke: except faster :)

8:11 conj adds an element to a collection, into puts a sequence of elements into a collection

8:12 Bronsa: afaik into IS reduce conj, implemented with transients

8:13 $source into

8:13 lazybot: into is http://is.gd/sTYtkj

8:13 kaini: In simple words: conj = add, into = addAll?

8:15 borkdude: wtf, why is user.dir set to /Applications/eclipse/Eclipse.app/Contents/MacOS in Eclipse

8:30 clgv: borkdude: in CCW?

8:31 borkdude: clgv well in an app I run on Tomcat, nothing clojure related

8:36 clgv: why is defn set to a macro like this: (. (var defn) (setMacro)) and not like that (def ^{:macro true} let ...)?

8:37 Bronsa: the compiler doesnt propagate on :macro metadata

8:40 clgv: but setMacro does obviously the same: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Var.java#L250

8:44 raghu: it seems 4clojure.com is down

8:47 clgv: raghu: yeah Error 502 here as well

8:50 Bronsa: clgv this trivial patch i wrote some time ago does that, maybe i should open a ticket in jira http://sprunge.us/bWcc

8:54 * Olsen_ tips hat

8:54 Olsen_: Hello all...

8:54 Anyone else noticed that 4clojure.com is down..?

8:55 borkdude: again?

8:55 cshell: It must be running Play!, lol!

8:55 Olsen_: Yeah, well I just got back to my machine and the site is dead as a doornail - nginx 502 Bad Gateway page instead of the site

8:56 clgv: Bronsa: ah right. well, so the initial lowlevel let has the :macro true only for documentation if it doesnt do anything?

8:57 Bronsa: well, setMacro sets :macro true

8:58 clgv: Bronsa: yeah but on the variable. the lowlevel let I quoted from the begining of clojure.core has that :macro true on the symbol in the def-statement

9:03 borkdude: cshell do you mean the play! framework?

9:03 cshell: yeah, i was just trying to make fun of scala :)

9:04 Olsen_: C'mon now, there's no need to make fun of Scala when there are languages like Java and C# to take a pop at cshell ;-)

9:04 borkdude: why would Scala be better than C#?

9:05 cshell: lol

9:05 Olsen_: lol

9:05 kreig1: or ruby

9:05 or common lisp!

9:05 Olsen_: Aww c'mon kreig1 Ruby is FUN at least!

9:05 ;-)

9:06 borkdude: fun-tional programming, without C-syntax

9:07 funny programming

9:07 Olsen_: borkdude: That's about the size of it, aye ;-)

9:08 I don't suppose the people behind 4clojure.com hang out in here, do they - I mean they might want to know that their sire is boned, and I would like to do some more of the problems! ;-)

9:09 borkdude: I bet the people in #haskell speak the same way about clojure ;-)

9:10 Olsen_: borkdude: Really? All 6 of them..? ;-)

9:10 clgv: Olsen_: Raynes is frequently here afaik

9:10 cshell: haha

9:10 borkdude: Olsen_ 845… wow ;)

9:10 cshell: Raynes was on earlier, is he working on 4clojure?

9:10 clgv: yeah. his clojail is working there

9:11 bhenry: what's the newest de facto standard for starting a new noir/jayq/fetch/etc project?

9:11 clgv: lein-noir?

9:12 Olsen_: borkdude: I tai fit back - that's an amazing number of people for an IRC channel...

9:12 borkdude: (That's supposed to read "I take it back)

9:12 bhenry: clgv it looks like cljs-template, but i didn't know if that was at a current state with all ibdknox's projects

9:12 borkdude: Olsen_ yeh

9:14 clgv: bhenry: thats probably new with lein2 then?

9:40 timvisher: is there any way to get the debugger thrown automatically when i hit an exception to behave like when i intentionally break with swank.core/break?

9:42 clgv: timvisher: you can approximate it with (try ... (catch Throwable t (break))) but you still have to put that at a suspicious location

9:43 timvisher: clgv: :(

9:44 clgv: timvisher: I dont know if the java debugging interface has tools to catch an exception as soon as it is thrown

9:44 gtrak: how do I get every odd element of a seq?

9:44 timvisher: gtrak: you mean every other element or only odd numbers?

9:44 gtrak: yea, every other

9:45 Vinzent: map-indexed + filter

9:45 clgv: timvisher: have you seen http://georgejahad.com/clojure/cdt.html ?

9:45 gtrak: ah

9:45 'map-indexed' is not yet at hand for me

9:45 Olsen_: grak: (fn [coll] (let [evens(filter even? coll) odds(filter odd? coll)] odd))

9:46 clgv: gtrak: take-nth

9:46 gtrak: Olsen_: that's the values

9:46 Olsen_: gtrak: Where "coll" is the collection that you are passing in

9:46 gtrak: gotcha

9:46 oh, take-nth is perfect

9:46 clgv: &(take-nth 2 (range 10))

9:46 lazybot: ⇒ (0 2 4 6 8)

9:47 clgv: &(take-nth 2 (rest (range 10)))

9:47 lazybot: ⇒ (1 3 5 7 9)

9:47 Olsen_: gtrak: take-nth would work too...

9:47 ;-)

9:47 Vinzent: hm, indeed

9:48 timvisher: clgv: i have but hadn't had time to get into it yet

9:48 gtrak: map-indexed and take-nth..... neato

9:48 clgv: timvisher: seems it can do some magic

9:49 Vinzent: btw, I wonder why there is map-indexed and keep-indexed instead of just indexed

9:49 clgv: Vinzent: function arity

9:49 Vinzent: clgv, what?

9:49 TimMc: ditto

9:51 clgv: Vinzent: map-indexed and keep-indexed take funtions with two arguments, index and value. `indexed` would create something like a seq of vectors which is only one argument so you would have to do (map (fn [[i v]] ...) (indexed coll)) instead of (map (fn [i v] ...) coll) - thats my explanation ;)

9:52 second map should be a map-indexed

9:52 TimMc: Hmm. I suppose map-indexed doesn't involve allocation whereas indexed would.

9:52 clgv: yep

9:54 Vinzent: clgv, well, yes, but so what? :)

9:54 TimMc, ah, so the reason is Perfomance - accepted.

10:15 cshell: Is there better way to validate that a string is neither nil or empty than using ,(and (not nil? " ") (empty (clojure.string/trim " "))?

10:15 oops, sorry, it's empty?

10:15 but i figure there must me a more concise, idiomatic way that i'm unaware of

10:16 ro_st: so you want to validate that a string is not nil or empty

10:16 regex?

10:16 cshell: right

10:16 clojurebot: Sometimes people have a problem, and decide to solve it with regular expressions. Now they have two problems.

10:16 cshell: LOL

10:16 ro_st: -grin-

10:16 what happens if you regex a nil?

10:16 cshell: I think you'd get a npe?

10:17 ro_st: ,(re-find #"[^\s]" nil)

10:17 clojurebot: #<NullPointerException java.lang.NullPointerException>

10:17 ro_st: ,(re-find #"[^\s]" (str nil))

10:17 clojurebot: nil

10:17 Vinzent: cshell, there was empty? for strings somewhere

10:17 cshell: ,(str nil)

10:17 clojurebot: ""

10:17 cshell: ,(empty? nil)

10:17 clojurebot: true

10:17 ro_st: -grin-

10:18 cshell: ,(empty? " ")

10:18 clojurebot: false

10:18 ro_st: ,(doc empty?)

10:18 clojurebot: "([coll]); Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x))"

10:18 cshell: ah here we go

10:18 Vinzent: it's clojure.string/blank?

10:18 cshell: ,(clojure.string/blank? nil)

10:18 clojurebot: true

10:18 cshell: ,(clojure.string/blank? " ")

10:18 clojurebot: true

10:18 ro_st: yup

10:19 cshell: Yeah, that's it - thanks guys

10:23 ro_st: i love how little code i'm writing. busy building json rest service on top of mongo database

10:24 cshell: Very nice - for work or for personal?

10:24 ro_st: for work

10:24 foxdonut: ro_st: but is it web scale?

10:25 ro_st: last couple weeks was the code that converts sql data to mongo

10:25 and now it's the (massively) simpler rest api on top

10:25 yup, web scale

10:26 advice hugely welcome :-)

10:26 foxdonut: http://www.youtube.com/watch?v=b2F-DItXtZs

10:27 ro_st: guiding principle at the moment is as simple as possible. no internal state between requests. no session state - it's all in mongo, and we'll move stuff to redis or memcached as we start requiring ram caches

10:28 you don't like mongo? :-)

10:28 foxdonut: ro_st: I've nothing against mongo, really. I just find that clip hilarious.

10:29 ro_st: oh right

10:29 Olsen_: I love that video

10:29 foxdonut: I see it as more about fanboys chanting about a tech without understanding it, rather than mongo specifically.

10:30 Olsen_: foxdonut: Absolutely

10:31 nsxt__: can i shard /dev/null in clojure?

10:31 Olsen_: "is /dev/null web scale?" I f*cking love that moment...

10:32 ro_st: -grin-

10:34 sorry foxdonut i didn't realise you were trying to have a mement there

10:36 foxdonut: ro_st: huh?

10:36 Olsen_: impotence mismatch

10:36 ro_st: a meme-moment, a meme-ment, a mement

10:37 Olsen_: foxdonut: *giggle*

10:40 TimMc: I lost it here: "Do you even know what sharding is?" "Shards are the secret ingredient in the web scale sauce!"

10:41 Olsen_: TimMc: Oh Hell yeah!

10:41 TimMc: Come on, we've all met someone who speaks this way - it's a very well observed piece, no?

10:42 TimMc: Yes, although it could use less swearing.

10:42 Seemed gratuitous, and didn't work well with the text-to-speech.

10:43 Olsen_: TimMc: Granted, but at the same time I am a dreadful curser (sometimes), so I don't judge...

10:46 * ro_st is listening to it. laughing

10:59 uvtc: Is subvec the customary way to insert an item into a vector, like so:

10:59 ,(println (concat (subvec [:a :b :c] 0 1) ["X"] (subvec [:a :b :c] 1)))

10:59 clojurebot: (:a X :b :c)

11:00 uvtc: ?

11:02 gfredericks: uvtc: what do you expect?

11:03 a vector?

11:03 oh whoops didn't see your prior question :)

11:03 uvtc: I meant to ask, what is the typical way to insert an item into a given location in a vector. Doesn't matter if I get a seq.

11:04 gfredericks: uvtc: there's no performant way to insert into a vector

11:04 I suppose using into on the first vector might be the best thing

11:04 subvecs might be counterintuitive...I don't know the details

11:06 uvtc: gfredericks, thanks. subvec seems intuitive enough (to me).

11:06 gfredericks: I mean its performance characteristics

11:06 if you're not worried about performance I think just dealing with seqs and calling (vec) at the end would be fine. If you really do need vectors.

11:08 uvtc: gfredericks, No, I don't really need vectors. And hadn't yet considered perf. I just thought it was a common enough thing, to want to insert an item into a mutable list (or vector), and wanted to know the customary way to do it in Clojure.

11:08 S11001001: uvtc: not common at all; over a couple years of professional clojure programming, I did it once

11:09 Bronsa: uvtc: it seems i was wrong before

11:09 S11001001: otoh I called map about a million times, and mapcat about half that, take what you will

11:09 Bronsa: user=> (defn ^:macro f [&form &env])

11:09 #'user/f

11:09 user=> f

11:09 CompilerException java.lang.RuntimeException: Can't take value of a macro: #'user/f, compiling:(NO_SOURCE_PATH:0)

11:09 uvtc: S11001001, Interesting. Will keep that in mind.

11:10 Bronsa, hi, perhaps you meant someone else?

11:10 Bronsa: wasnt it you who asked about :macro metadata?

11:11 S11001001: uvtc: the ideal structure for arbitrary insertion/deletion is a map, rather than vector; depending on your structure, a map may suit you better

11:11 uvtc: Bronsa, no.

11:11 Bronsa: then sorry, i am mistaken.

11:11 uvtc: Bronsa, haha. n/p :)

11:13 S11001001: but arbitrarily-positioned insertions into a list are often the early forcing of ordering decisions that could be done lazily, instead, once the whole sequence is accumulated in arbitrary order by sticking elements on beginning or end, whichever's convenient. Accumulating into a map yields similar capabilities

11:13 uvtc: S11001001, thanks.

11:15 S11001001, will keep in mind that I can often put off ordering today what I can order tomorrow. :)

11:25 TimMc: uvtc: Just be aware that subvec creates a window onto the original vector, which may interfere with GC.

11:31 uvtc: TimMc, ah, right. I see in the docs it says that the resulting vec shares structure with the original.

11:33 TimMc, S11001001 thanks again.

11:34 edoloughlin: Is there a way to list all dependencies in Leiningen? I've got something in my project that depends on clojure-1.2.0, which isn't available anymore...

11:36 TimMc: edoloughlin: lein1 or lein2?

11:36 edoloughlin: TimMc: 1.7.1

11:48 ro_st: edoloughlin: you'll want to use an exclusion for clojure on that dependency, so that it doesn't try to satisfy it and happily accepts the clojure present in your project

11:49 i can't find an example now but i'm sure one of the 450 ppl here can show you :-)

11:50 edoloughlin: Thanks. I'll look it up.

11:50 S11001001: I thought this was the channel for the common lisp web browser

12:13 timvisher: anyone who cares about wrap-json-params care to give me some thoughts on my modifications? https://github.com/timvisher/ring-json-params/blob/master/src/ring/middleware/json_params.clj

12:14 also, is there some difference in the way lein2 works with deps? I can't seem to get it to download anything unless I do something else

12:18 jsabeaudry: timvisher, I was under the impression that cheshire was a preferrable choice to clj-json, not sure if that is still the case however

12:18 ezyang: Hey guys, anyone here run Clojure under Azul?

12:18 dakrone: timvisher: don't use clj-json

12:20 TimMc: edoloughlin: GOt Maven? lein pom and then mvn dependency:tree

12:20 tmarble: dakrone: what do propose instead ov clj-json (cheshire)?

12:20 dakrone: tmarble: cheshire

12:21 tmarble: dakrone: will check out, thx

12:21 ezyang: We're getting a NoSuchFieldException 'close' for clojure/core.clj in the initializer

12:34 puredanger: hey all. got a question I can't figure out. defrecord says you can override methods of Object and I can see that works with (for example) toString. However, if I try to do that with hashCode, that seems to conflict with the generated hashCode and I get a ClassFormatError with a duplicate method.

12:35 I can understand why this might be disallowed (for value semantics of records) but just wanted to make sure that this is a non-solution

12:35 If so, I will fall back to deftype

12:36 dnolen: puredanger: my experience is that you'll run into issues with defrecord if you need to customize Object methods.

12:37 hyPiRion: dnolen: Is that statement true for toString too?

12:37 dnolen: hyPiRion: that may be the exception. At one point core.logic tried to use defrecord, but it was too much of a hassle.

12:38 puredanger: my issue was specific to wanting to customize equals and hashCode

12:39 timvisher: jsabeaudry, dakrone: i was only using it because it was what was already being used. Doesn't hurt me at all to use cheshire instead. I'm not familiar enough with both of them to know why, but I've heard the same

12:40 puredanger: thx

12:43 hyPiRion: What mean of my server to crash when I'm active on IRC.

12:43 anyway, https://github.com/clojure/clojure/blob/master/src/clj/clojure/core_deftype.clj#L160 seems to be the issue with overriding equals and hashCode

12:44 records don't implement toString, which seems to make it an exception.

12:48 puredanger: hyPiRion: yeah, I'd say the docstring should really say toString as the only Object method that can be overridden

12:48 actually I guess clone is the other possibility, not that that would make much sense

12:48 TimMc: puredanger: Return "this"? :-P

12:48 puredanger: :)

12:54 lhk: hi

12:55 what types of applications is clojure best for. I'm interested in functional programming but apart from processing data, I just dont see, how its better than imperative/object oriented

12:55 ohpauleez: lhk: What types of applications do you typically develop?

12:55 amalloy: do you have any applications that don't involve processing data?

12:56 technomancy: amalloy: in particular, processing lists

12:56 I've heard List Processing is going to be huge.

12:56 amalloy: someone should write a language to make it easier

12:56 * technomancy nods sagely

12:56 ohpauleez: glomming on that point: A web app - you take a request, process it, generate new data (a response) and return it. Good web apps are stateless (aside from persisted stated in a data store - and now all web systems need that)

12:58 lhk: I guess id have to divide what ive done so far in two groups: for the uni and as a hobby. At the university all the - very small - programs ive hacked together where meant to implement a specific algorithm, or calculate something. Most of them ran on the command line. As a hobby Ive spend most of my time with visualizers and small tools. All of them relied heavily on GUIs and IO

12:59 ohpauleez: lhk: I don't have experience with Clojure's tooling around Java Swing, but there are great libraries for declaratively building UIs and visualizations for ClojureScript (in the browser)

13:00 S11001001: lhk: did you use any data structures not directly related to IO?

13:00 lhk: i assume that for mathematical purposes a language like clojure would be a real treat. But how would i program a stateless GUI ?

13:00 ohpauleez: Clojure is a great general language, very well designed, and carefully crafted (basically, like a delicious beer)

13:00 xeqi: lhk: you'd prolly just use java binding for that, perhaps with seesaw

13:00 lhk: S11001001: sure. All the usual arrays, lists, heaps, stacks, ...

13:02 TimMc: lhk: It's not that the GUI is stateless; rather, that the state is managed.

13:02 ohpauleez: lhk: Imagine separating the logical construction of a GUI, from the data that it represents

13:02 lhk: ohpauleez: that sounds like mvc

13:04 ohpauleez: true, but imagine if you could step away from the raw construction of the view

13:04 and have it be declarative - like SQL

13:04 http://www.infoq.com/presentations/Statistical-Graphics-ClojureScript

13:05 and all the other reasons everyone else here has said

13:05 Watching Rich's talks on state and identity might help as well

13:08 nDuff: lhk: You might find the Ants demo interesting as something fairly simple but with a lot of GUI code and state that actually changes. https://www.refheap.com/paste/3099

13:09 lhk: ...the talk that goes with it is http://blip.tv/clojure/clojure-concurrency-819147

13:10 hyPiRion: lhk: What would you like to program in the future? I think you should base yourself around that.

13:10 For instance, if you like to program eco-friendly microcontrollers, then Clojure isn't the best fit.

13:11 ohpauleez: hyPiRion: …. *yet*

13:11 mattmoss: IM-GUI might be closer to stateless gui: http://www.johno.se/book/imgui.html

13:11 ohpauleez: :)

13:11 mattmoss: and http://mollyrocket.com/forums/viewforum.php?f=10

13:11 hyPiRion: ohpauleez: Bold statement you got there.

13:12 ohpauleez: With Clojure soon being able to run on Lua - not that bold

13:12 mattmoss: Keep in mind the IMGUI fans on molly-rocket are generally dealing with C++ and building guis in opengl (game devs), so it might be some work to translate that kind of stuff into clojure. Removing ids, etc.

13:13 Hodapp: ohpauleez: Clojure might soon be able to run on Lua?

13:14 ohpauleez: Technically ClojureScript, but yes, that's the plan

13:14 dnolen: Hodapp: raph_ami1rd is working on it for Google Summer of Code, specifically we want to see how well CLJS performs under LuaJIT

13:15 Hodapp: given the numbers we're seeing under V8, I suspect the LuaJIT numbers will be quite good.

13:16 hyPiRion: ohpauleez: Is eLua good for _eco-friendly_ microcontrollers?

13:16 ohpauleez: I'm with dnolen on that - LuaJIT is extremely fast; last I checked the fastest JIT for a dynamic language/platform pair

13:16 hyPiRion: no idea

13:17 nDuff: hyPiRion: I read "eco-friendly" as "low-power enough to run off of solar with a small battery buffer", so... probably?

13:17 ohpauleez: dnolen: total side note - I almost have arbitrary namespace injection for my workers put together

13:17 which means I can make a future-like interface

13:18 dnolen: hyPiRion: ohpauleez: I don't personally expect Clojure to be great for embedded applications this year - but technology changes at a pretty fast clip. who knows?

13:19 ohpauleez: for sure, I was mostly making a tongue-in-cheek statement. But yeah, it's anyones guess - new tech, new projects

13:19 dnolen: ohpauleez: interesting.

13:19 hyPiRion: nDuff: Ah. I mean "eco-friendly" as in programmed to use the least amount of power. Perhaps "eco-friendly" is a bit vague.

13:22 Hodapp: and for the record, there are plenty of ARM chips that handle JVM bytecode natively.

13:22 however, for a small CPU, I'd really think some other Lisp might be a betterfit.

13:22 better fit*

13:26 hyPiRion: dnolen: I think the whole thing boils down to whether we're able to create a sufficiently smart Clojure-compiler, or whether we're able to design faster embedded systems.

13:30 S11001001: Hodapp: ISLISP, then?

13:33 Hodapp: ISLISP, CLISP, Scheme, I dunno

13:36 * nDuff has certainly seen some very aggressively-optimized scheme compilers.

13:38 Hodapp: nDuff: I'm more thinking of ones that *run* in a small footprint

13:38 tbaldridge: A clojure on LuaJIT is going to be a good starting point for embeded systems. The Lua VM is so simple there's not much of a memory overhead

13:39 But then again you have to define what "small" footprint is. Clojure-Py normally uses about 1/2 the memory of Clojure on the JVM. It still clocks in at about 50MB for a repl (ish)

13:41 * technomancy saw Leiningen running on a beagleboard at clojurewest

13:41 dnolen: hyPiRion: given the rate of change around embedded technologies - I'm betting on faster embedded systems.

13:42 eck: i've run leiningen on my raspberry pi. it's *really* slow though.

13:42 i am excited about clojure on lua

13:48 TimMc: eck: Then I'll be able to run Clojure on my camera!

13:48 eck: hooray!

13:51 ndimiduk: has clojure.contrib's profile tool been forward-ported?

13:52 tbaldridge: dnolen: is there a repo for the GSOC stuff with pluggable backends? I'd like to track the changes and figure out how I can integrate them with clojure-py

14:33 ystael: I don't suppose there's any way to get an AOT-compiled defrecord to generate a class with a package name different from the namespace in which the defrecord occurs?

14:33 ("No and you are stupid to want that" may be a reasonable answer :))

14:39 muhoo: when heroku config:add says "restarting app", does it mean it is physically shutting down the jvm and restarting it all over again, i.e. running main?

14:39 technomancy: muhoo: yeah

14:39 muhoo: perfect, thanks

14:47 * technomancy wonders how hard it would be to get clojure apps to respect SIGHUP

14:47 technomancy: I guess that wouldn't help since the env vars are fixed

14:51 amalloy: ystael: no. if you want it in a different package, put it in a different package

14:53 technomancy: respect it how? i've never totally understood what the expected response to a SIGHUB is

14:53 *HUP

14:54 nDuff: ...for daemons, the convention is "reread your configuration files and apply changes to the running configuration"

14:55 technomancy: amalloy: simulate a restart, near as I can tell

14:56 it would make sense for clojure apps that read config from disk, but not from the environment

14:57 huh; supposedly sighup typically causes interactive process to terminate

14:58 amalloy: technomancy: right, because the modem hung up

14:59 technomancy: heh

14:59 I guess that makes sense, but it's still hilarious

14:59 amalloy: i always understood it as a slightly less severe SIGINT

14:59 "your owner has abandoned you - dare you go on?

14:59 S11001001: does rereading environment make sense?

15:00 technomancy: S11001001: I don't think it can change

15:00 redinger: Alan Dipert was playing with that a little while back: https://github.com/alandipert/reconfig

15:00 I don't actually know how complete it is

15:00 technomancy: S11001001: maybe there's some deep magic to make it happen with crazy posix calls

15:00 redinger: huh; interesting

15:01 duck11231: being able to catch SIGHUP to force a config reload would be nice

15:01 S11001001: so a clojure app that failed to reread environment could hardly be faulted :)

15:02 tbaldridge: dnolen: is there a repo for the GSOC stuff with pluggable backends? I haven't been able to find the repo anywhere

15:02 dnolen: tbaldridge: there's no separate repo - I'm pulling in raph_ami1rd as I get them.

15:02 amalloy: technomancy: useful has a function that uses undocumented, unsupported class sun.misc.Signal to handle signals. dunno which JVMs it works on

15:03 tbaldridge: dnolen: so if I look at the main clojurescript repo that's the current state of things?

15:03 dnolen: tbaldridge: some notes here - needs more feedback

15:03 tbaldridge: http://dev.clojure.org/display/design/ClojureScript+pluggable+backends

15:04 tbaldridge: k thanks, I'll take a look

15:05 brainproxy: with enlive, is there a shortcut for using attr= with multiple values, e.g. (h/attr= :attr foo bar baz)

15:05 i.e. such that :attr will match on foo or bar or baz

15:09 technomancy: amalloy: cool

15:09 duck1123: how bad is it to use sun.* classes? That's normally discouraged, right?

15:10 technomancy: depends on the context; probably not a good idea in libraries.

15:10 amalloy: yes. tbh i have no idea why it's in useful

15:10 duck1123: I might add SIGHUP handling to my app to reload the config.clj file

15:11 technomancy: considering startup time is such a big complaint with clojure it seems like it's worth looking at

15:11 amalloy: ∀x, useful has a function that does x in a questionable way

15:14 nDuff: Is there a way to get paredit to treat {} in a manner similar to how it does () and []?

15:14 thearthur: nDuff: it does for me in emacs24

15:14 nDuff: what editor?

15:14 nDuff: thearthur: emacs23

15:15 wkelly: also works for me in emacs24

15:15 Chousuke: it should work in 23 as well

15:15 thearthur: nDuff: It worked very well with the old edition of the emacs starter kit, though I have to say that 24 is much more fun

15:15 Chousuke: maybe you have an old or misconfigured version of paredit

15:15 llasram: I needed to have a slime-repl-mode hook which does (set-syntax-table clojure-mode-syntax-table)

15:15 and I needed to (define-key slime-repl-mode-map "{" 'paredit-open-curly)

15:17 * nDuff pokes around... looks like he's running paredit-20 package from ELPA.

15:17 nDuff: llasram: ...hmm; I'll give those a try.

15:18 dnolen: pretty sweet use of the CLJS analyzer output, http://github.com/jonase/scape/blob/master/src/scape/emitter.clj

15:18 technomancy: nDuff: it might do that already in clojure-mode but not slime

15:20 impomatic: Hi :-) What's the Clojure equivalent to K&R "The C Programming Language"? Something concise and to the point.

15:20 scottj: impomatic: the website

15:20 devn: impomatic: programming clojure IMO fits that description fairly well

15:21 if you're asking for a book recommendation

15:21 nDuff: Programming Clojure is probably the thickest Clojure book I have

15:21 amalloy: scottj: what website? clojure.org is not something i generally recommend to people since it never gets updated

15:21 nDuff: it's _good_, but I'm not sure I'd describe it as concise and focused on the language itself.

15:22 mhanson: What about Joy of CLojure?

15:22 nDuff: (certainly goes into more about the surrounding ecosystem)

15:22 AimHere: Joy of Clojure is fairly concise

15:22 thearthur: i introduce people to 4clojure.org first

15:22 dnolen: impomatic: it's pretty easy to be concise and to the point about C (and still not actually explain how to write sensible C code). I would get the new O'Reilly book.

15:22 thearthur: errr 4clojure.com

15:22 * nDuff is a very big fan of Joy of Clojure (which *is* concise), but not sure it's equivalent to K&R in the intended-to-be-a-complete-description sense.

15:23 nDuff: ...K&R is quite the set of shoes to fill.

15:23 sproc: pair

15:23 nDuff: err, yes.

15:24 dnolen: impomatic: the O'Reilly book is the only one that really assumes you have existing OOP experience, and is a good tooling reference which is critical.

15:24 impomatic: you can waste hours on web trying to figure out basic stuff.

15:24 nDuff: impomatic: What's your priority? Is it more important that it be short, that it be self-contained, or that it give a very strong high-level overview (but may leave you to go elsewhere for details)?

15:24 impomatic: Has anyone read the Clojure section in "Seven Languages in Seven Weeks"?

15:24 * nDuff agrees with dnolen that the O'Reilly book does a much better job of teaching tooling than anything else.

15:25 devn: ill double what dnolen said about recommending the oreilly book, but when i thought of K&R I thought: Joy of Clojure or Programming Clojure due to the size of those books

15:25 dnolen: impomatic: that's probably close to useless.

15:26 impomatic: nDuff: basically to be short and as complete as possible and assume just basic programming experience.

15:26 devn: impomatic: short and complete are at odds there, no?

15:26 nDuff: impomatic: ...but "complete" in what sense?

15:27 impomatic: If you aren't ready to do real-world boots-on-the-ground work without understanding the surrounding tools as well as the language, a book that is nothing but a complete overview of the language won't get you where you need to be.

15:27 impomatic: and a book that's a complete overview of the language but which doesn't explain the rationale can leave you trying to write ${OTHER_LANGUAGE} code in Clojure, which is horrible.

15:28 impomatic: IMHO, the rationale is the #1 most important thing, which is why I tend to prefer to start with Joy of Clojure, but there's a lot of personal preference there.

15:28 devn: that's one reason why i would suggest joy of clojure as a companion to whatever book you decide to get

15:28 scottj: amalloy: neither does K&R (get updated) :)

15:29 nDuff: Oof.

15:29 * nDuff was confusing Programming Clojure with Clojure Programming (the latter being the ORL book that's not thin, but very complete)

15:30 scottj: nDuff: yeah, perhaps best to refer to them as pragprog and o'reilly books

15:30 nDuff: Was wondering why people were recommending it for concision :)

15:31 scottj: or halloway and emerick books

15:56 timvisher: any way to tell lein2 to avoid using a proxy for a particular repository?

15:59 java needs pac file support badly…

16:00 kreig1: pac?

16:00 clojurebot: single-segment namespaces are unsupported. (foo instead of foo.core) they may work in a few circumstances, but you shouldn't rely on them.

16:01 timvisher: https://en.wikipedia.org/wiki/Proxy_auto-config

16:01 very popular in the windows corporate networks of the world

16:02 gerunddev: Anyone have a mixed Java / Clojure project, using 1.7, and building with clojure-maven-plugin?

16:07 gtrak: ~anyone gerunddev

16:07 clojurebot: no, anyone is a funny thing.

16:07 gtrak: ~anyone

16:07 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

16:08 llasram: gerunddev: All my mixed Java / Clojure dev is driven from Leiningen

16:09 gerunddev: I'm adding Clojure to a project that already is invested in maven, java 1.7, and a number of related tools. So far all well except calling Java classes from my Clojure code.

16:10 technomancy: timvisher: I don't think aether supports setting proxies on a per-repo basis

16:10 gerunddev: I get Unsupported version exceptions, which seems to indicate my Clojure code is getting compiled as a version other than 1.7.

16:10 timvisher: technomancy: boo. corporate networks suck hard…

16:10 technomancy: this is true

16:10 gtrak: gerunddev: there's no clojure 1.7?

16:10 technomancy: you can't use the same proxy for all repos?

16:11 gerunddev: I get it when using clojure-maven-plugin, not with zi.

16:11 timvisher: nope

16:11 some are direct traffic, some are through one proxy, others through another

16:11 it's a mess

16:11 nDuff: gtrak: err, "I read that as with a JVM version other than 1.7"

16:11 s/"I read that as /I read that as "/

16:12 gtrak: gerunddev: ahh, if your class-files are compiled as 1.7 classes, and clojure isn't, yea that's' a problem I think

16:12 timvisher: it'd be awesome if pacparser could be used

16:12 in theory, then, we'd be able to get around a lot of this stuff in a typical corporate environment

16:13 but who's got the time to do that

16:13 technomancy: in my experience that kind of stuff is usually done by the people feeling the pain =)

16:13 people with low pain tolerance

16:14 timvisher: maybe we will then, because it affects us at every turn, no matter what language we're using

16:15 hugod: gerunddev: is there a reason for using clojure-maven-plugin over zi?

16:16 gtrak: gerunddev: looks like the clojure plugin forks a process to compile the clojure, I bet you could add some hook in there

16:16 nDuff: zi?

16:16 clojurebot: unzip-with is http://paste.lisp.org/display/76458,1/raw

16:16 gtrak: https://github.com/talios/clojure-maven-plugin/blob/develop/src/main/java/com/theoryinpractise/clojure/AbstractClojureCompilerMojo.java

16:16 * nDuff (as a fellow user of clojure-maven-plugin) is curious

16:16 hugod: nDuff: https://github.com/pallet/zi

16:17 nDuff: Oooh.

16:17 gtrak: zi: "The goals use a non-forked execution model – they are executed within the maven process itself, which should make it faster."

16:17 clj_newb: Hi, is there a framework to monitor connections?

16:18 gtrak: linux?

16:18 clj_newb: Ideally I'd like to set it like a proxy and process the data

16:18 clojurebot: http://www.assembla.com/wiki/show/clojure/Datatypes

16:18 lazybot: Assembla is deprecated. Use http://dev.clojure.org

16:18 technomancy: oh snap!

16:18 gtrak: haha

16:18 S11001001: bots scolding bots

16:18 gerunddev: :hugod I would like to use test-with-junit for use in a build system.

16:18 gtrak: clj_newb: wireshark

16:19 clj_newb: well, I mean like a java agent in clojure, or a proxy (in clojure as well), but thanks

16:19 gtrak: ah, I know there's some faker thing for ring, and clj-http too

16:20 nDuff: clj_newb: ...what kind of proxy? SOCKS? ...?

16:20 clj_newb: socket ideally

16:20 thanks gtrak I'll dig in google

16:20 technomancy: you can wrap a stream in a FilterInputStream and do arbitrary things with it

16:21 gerunddev: :gtrak Thanks I'll look into that fork.

16:21 clj_newb: great technomancy, I was wondering if there was something done already

16:22 hugod: gerunddev: oh, ok - should be simple enough to add a task to zi to do that, but I have little incentive to do it myself

16:23 gtrak: gerunddev: I wasn't recommending the fork specifically, it's just the first thing I googled

16:23 the first thing when I googled *

16:24 I imagine there's a parameter you have to pass somewhere to make it right

16:25 but is that the case in java, that 1.6 code can't call into 1.7 code?

16:25 gerunddev: :gtrak I had been looking at ClojureCompilerMojo and ClojureRunTestWithJunitMojo, the abstract class seems like a better place to start. Perhaps it's calling a property I have set wrong, etc.

16:26 gtrak: it seems like it's not your fault, but something not yet implemented

16:27 gerunddev: :gtrak Yes it throws an error like: "Unsupported major.minor version 51.0

16:27 "

16:27 gtrak: https://groups.google.com/forum/?fromgroups#!topic/clojure-dev/cjG2nVvNJBE apparently clojure classes have a version of 49

16:28 ah, gerunddevso check this: http://www.java.net/node/664117 perhaps your maven process is calling an older java version by accident?

16:30 nDuff: gerunddev: I'd expect that hugod's zi would work so long as Maven is running with the 1.7 JVM, being non-forking.

16:30 gtrak: also, are you using java 1.7 features? you can specify a compatibility level on the java-side

16:32 gerunddev: gtrak: I do have both java 1.6 and 1.7 so misconfiguration is likely. I am using the new try syntax of 1.7.

16:32 gtrak: ah

16:33 gerunddev: nDuff: Yes zi worked fine, but doesn't have an export of junit format test results.

16:35 gtrak: gerunddev: I just checked, with jdk7 and lein my AOT classes are still compiled as version 49..

16:35 nDuff: gtrak: Does that matter? Unless you want Clojure to use JDK7 features in the _bytecode_...

16:35 gtrak: right... not sure

16:36 but I wonder if the classes can reference newer ones?

16:36 i'll ask on ##java

16:36 gerunddev: gtrak: That is really interesting, 1.7 should be 51.

16:36 cemerick: and now gtrak has two problems

16:36 nDuff: gtrak: they certainly can.

16:37 gtrak: ah

16:37 cemerick: the bytecode version is determined by what generates the bytecode; in this case, Clojure.

16:37 or, actually, the rev of ASM that Clojure includes.

16:38 gtrak: so... it's the java process not being able to load the newer classes, not another incompatibility

16:39 gerunddev: So in my case the newer code is java compiled with 1.7. I get the exception calling it from my clojure code.

16:39 gtrak: are there any examples of 1.7-only libraries we can try clojure against?

16:39 shrijeet: Seeking recommendation for a book, I am just starting . Can program in java fairly well. What do you guys think of http://pragprog.com/book/shcloj2/programming-clojure

16:40 dnolen: shrijeet: I recommend the O'Reilly one.

16:40 nDuff: shrijeet: The O'Reilly book is probably the most complete if you want something that covers the full toolchain and tools

16:40 puchacz: which one?

16:40 nDuff: Clojure Programming

16:40 shrijeet: http://www.clojurebook.com/ this I guess

16:41 puchacz: thx

16:41 shrijeet: nDuff: thank dnolen: thank you too

16:41 nDuff: shrijeet: Joy of Clojure is also very good, though Clojure Programming tries to cover the same ground as well (and, indeed, lists it as a source of inspiration)

16:41 clj_newb: This might not be the right place, but does anyone know which java environment variable must be set to change the default socket factory

Logging service provided by n01se.net