#clojure log - May 05 2010

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

0:01 alexyk: technomancy: what does :namespaces expect? ['a 'b] ?

0:07 technomancy: alexyk: like that but with no quotes

0:07 I think

0:07 I don't really do AOT much

0:08 slyphon: hmm

0:08 alexyk: ah

0:08 slyphon: it'd be nice to be able to have some control over the threadpool agents used

0:09 use differnt pools for different tasks

0:14 alexyk: technomancy: if I do want to have a structure src/main/clojure/com/blah/file.clj, as in maven, can I teach lein to go there?

0:18 jkkramer: slyphon: re your cron question, i came across this today: http://github.com/stuarthalloway/orolo/blob/master/src/orolo/periodically.clj

0:18 slyphon: oh, nuts

0:18 1.2 probably

0:19 jkkramer: i'll make a note of this though

0:19 jkkramer: yeah, uses protocols

0:21 slyphon: hrm, could probably be done w/o protocols

0:21 since i don't need the JMX goop

0:22 jkkramer: slyphon: looks like there's an older version based on 1.1 -- http://github.com/stuarthalloway/orolo/blob/2848ddb63ee3bd635e56c0fbd1e46a558bee6c52/src/orolo/periodically.clj

0:22 * technomancy digs libraries named with adjectives

0:22 technomancy: alexyk: I think you can set :source-path in project.clj

0:23 alexyk: kk

0:23 technomancy: hugod: hey, I am getting exceptions without stacktraces on your hyperdoc branch; have you tried it since the changes in clojure 1.2?

0:24 eslick: Anyone having trouble with recent changes to 1.2?

0:24 hugod: technomancy: I haven't tried it recently

0:24 technomancy: eslick: it's certainly confused a number of people

0:25 hugod: I did merge the compile-file branch though; seems to work great

0:26 alexyk: technomancy: the clojure-protobuf project wants to run proto compiler to generate Java. How can I stick that into lein?...

0:26 technomancy: I'm not sure what that is

0:26 hugod: technomancy: I saw. Thanks!

0:27 alexyk: technomancy: basically google protobuf compiler taking a spec and generating java. Then that java is used in clojure. ant does it with an exec step...

0:28 technomancy: alexyk: I see. you can write custom lein tasks that call out to the ant exec api no problem

0:28 alexyk: see http://github.com/antoniogarrote/lein-javac for an example

0:30 alexyk: cool

0:40 replaca: technomancy: oh, maybe if I just split the autodoc in two and have a really lightweight plugin that gathers the parameters and executes a separate instance of clojure that has all the actual stuff. It would be pretty easy to make the plugin version independent.

0:40 technomancy: replaca: also an option

0:40 replaca: this is basically what I do to manage the various version of clojure itself

0:40 technomancy: replaca: the cost/benefit tradeoff is really going to depend on how many people stick with 1.1 though

0:41 replaca: (which would mean in the end we'll be going three layers deep)

0:41 well, hopefully 1.2 isn't the end of the road

0:41 technomancy: replaca: look into the eval-in-project function in leiningen/compile.clj for one way to do that

0:41 true

0:41 replaca: technomancy: ahh, thanks for the pointer

0:59 slyphon: hrm

1:00 it's undocument that *agent* is set to the current agent when the send-off fn is running

1:00 undocumented*

1:00 is that on purpose? i.e. should one not rely on that behavior?

1:06 imran_sr: clojure newbie here. I've slurp* 'ed a multiline file to a string, and am trying to re-seq a pattern against it. I'm trying to match across multiple lines, but the pattern stops at line boundaries. Is there some kind of re flag I can put into the pattern to make it match across multiple lines?

1:06 (thought I might just jump in ask, rather than ask to ask ... )

1:06 hiredman: yeah, you have to read the javadocs for Pattern

1:06 (there is a flag, but I forget)

1:07 imran_sr: I've been looking through http://java.sun.com/docs/books/tutorial/essential/regex/ , but I don't see anything (blindness on my part could be a factor here!)

1:07 sexpbot: "Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)"

1:08 imran_sr: hiredman: I'll check out the javadocs for util.regex

1:09 hiredman: I think it's on Pattern

1:10 http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#MULTILINE

1:10 sexpbot: "Pattern (Java Platform SE 6)"

1:11 imran_sr: hiredman: thanks mate. Was looking at that page while you said that :)

1:12 so I embed (?m) into the pattern

1:17 hiredman: hmm, still not working. Do I use it like this? #"(?m)my_re_pattern"

1:17 tomoj: I want a pair of giant parentheses I can wield

1:17 hiredman: ,(re-find #"(?m)foo\nbar" "foo\nbar")

1:17 clojurebot: "foo\nbar"

1:18 imran_sr: (re-seq #"(?m)........" <a multiline string>)

1:18 hiredman: ,(re-find #"(?m)......." "foo\nbar")

1:18 clojurebot: nil

1:18 hiredman: ,(re-find #"(?m)......" "foo\nbar")

1:18 clojurebot: nil

1:18 imran_sr: hey, is that clojurebot evaluating expressions? :)

1:18 hiredman: ,(re-find #"(?m).*\n.*" "foo\nbar")

1:18 clojurebot: "foo\nbar"

1:18 hiredman: yes

1:19 imran_sr: :)

1:19 hiredman: I'm pretty sure this whole multiline regex thing has been done before, but maybe chouser was here

1:20 ,(re-find #"(?m)....." "foo\nbar")

1:20 clojurebot: nil

1:20 hiredman: ,(re-find #"(?m)....." "foo")

1:20 clojurebot: nil

1:20 hiredman: ,(re-find #"(?m)..." "foo")

1:20 clojurebot: "foo"

1:20 hiredman: ,(re-find #"(?m)....." "foo\nb")

1:20 clojurebot: nil

1:20 imran_sr: hiredman: nope, not working

1:21 hmmm

1:21 hiredman: "Note that by default, the dot matches all characters except line break characters. So the .* in the above example will only match to the end"

1:21 we all so need the DOTALL flag, whatever that is

1:22 ,(re-find #"(?ms)....." "foo\nb")

1:22 clojurebot: "foo\nb"

1:22 imran_sr: .(re-find #"(?md)foo" "fo\no")

1:23 hiredman: ,(= "," ".")

1:23 clojurebot: false

1:25 imran_sr: .(re-find #"(?md)foo" "a \nfoo b")

1:26 hiredman: ,(= \, \.)

1:26 clojurebot: false

1:28 imran_sr: hiredman: thanks a lot for your help :) . I've gotten the flags I needed (and more importantly, I know where to go next time I need to check something similar).

1:29 uberjar: do you guys remember a week ago when I told you about my Oracle conspiracy theory.. the one where Oracle is going to put the JRE behind a $90 pay-wall ? Well they are getting closer and closer to it.

1:29 ""In a somewhat surprising move (and without any notification to customers), Oracle shut down public access to firmware downloads. I learned this the hard way when I contacted Oracle customer service almost two weeks ago. Yes, it took 13 days for me to get access to the firmware download for systems under the standard warranty (i.e. less than a year old)."

1:30 each week they put something else that was public behind a pay wall.. they started with solaris..

1:32 I hope you all can get used to OpenJDK :)

1:37 tomoj: hmm

1:37 wouldn't there be riots?

1:38 mass panic?

1:48 uberjar: yes

1:48 well in theory they would only put new version of the JRE behind the pay wall

1:48 so it wouldn't be a massive panic all at once

1:49 just a slow growing disguist

1:49 disgust

1:50 it's sort of like how politics works.. you don't make changes all at once you do it slowly over time so people don't freak out.. like boiling a frog

1:50 slyphon: oh good god

1:51 they're messing with people who bought sun hardware

1:51 not java developers

1:51 *huge* difference in the markets

1:53 uberjar: you never know.. is all I'm sayin.. you never know :)

1:53 slyphon: FUD

1:55 argh

1:55 * slyphon needs deftype

2:06 LauJensen: Good Morning all

2:10 zmila: rainy morning

2:12 LauJensen: Does Brian Carper hang out here?

2:52 uberjar: These two strings walk into a bar and sit down. The bartender says, "So what'll it be?"

2:52 The first string says, "I think I'll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy owmc63^Dz x.xvcu"

2:52 "Please excuse my friend," the second string says, "He isn't null-terminated."

2:55 tomoj: :D

3:10 unfo-: lol\0

3:12 LauJensen: Im getting a failure trying to fetch

3:12 Downloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from central


3:12 Anybody else having that issue?

3:13 (ie., didnt have it yesterday, came after flushing .m2)

3:14 If anybody cares to test, try "mv ~/.m2 ~/.m3 && git clone http://github.com/ztellman/penumbra.git && cd penumbra && lein deps && mv ~/.m3 ~/.m2 && cd .. && rm -rf penumbra/"

3:14 I may have over complicated, but that should be traceless on your system

3:15 $ping repo1.maven.org

3:15 sexpbot: Command not found. No entiendo lo que estás diciendo.

3:15 LauJensen: I think I definately overcomplicated, seems maven-central is down

3:17 maravillas: i was able to download it fine with an otherwise empty project

3:18 LauJensen: maravillas: can you ping repo1.maven.org ?

3:18 maravillas: looks up from here

3:18 LauJensen: ah it just came back up I see

3:18 maravillas: :)

3:19 LauJensen: Thanks for digging in though :)

3:19 maravillas: np

3:29 LauJensen: hugod: ping

3:52 zmila: how to add doc-string to a def?

3:53 ,(def the-rules #^{:doc "the rules"} [ [] ,,, [] ])

3:53 clojurebot: DENIED

4:00 unfo-: i lol'd at that :D

4:14 zmila: i'm in the top 5th of clojurians at Project Euler :) heh

4:20 jowag: is there some idiom for (not (nil? x)) ? or this is the correct way to check for non-nil values

4:20 _ato: jowag: just x

4:21 tomoj: eh

4:21 _ato: if you need a boolean:

4:21 jowag: yep, I need a boolean

4:21 _ato: ,(boolean 1)

4:21 clojurebot: true

4:21 _ato: ,(boolean nil)

4:21 clojurebot: false

4:21 tomoj: ,(boolean false)

4:21 clojurebot: false

4:21 tomoj: false is a non-nil value

4:22 unless you're looking for truthy values..

4:22 having booleans around kinda sucks I guess

4:22 _ato: well yeah if you really mean non-nil rather than truthy there's not nothing better than (not (nil? ...))

4:24 jowag: thank you

4:36 tomoj: whoa

4:37 ,'''foo

4:37 clojurebot: (quote (quote foo))

4:37 tomoj: ,```foo

4:37 clojurebot: (clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list (quote sandbox/foo))))

4:37 tomoj: I feel like I might have understood that at one point

4:37 but not tonight

4:40 if you (count (flatten `'`'`'`'foo)) is 261

4:54 ,`````[]

4:54 clojurebot: (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/list)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list (quote clojure.core/s

4:56 tomoj: hmm

4:56 ,``````[]

4:56 clojurebot: java.lang.StackOverflowError

4:56 tomoj: weird, I get: java.lang.ClassFormatError: Invalid method Code length 162261 in class file user$eval__7

4:59 LauJensen: in enlive, the clone-for makes sense when replicating an element, but how do I add a tag to each element, ie (clone-for [x xs] (-> (set-attr :href href) (add [:img {:src src}]))) ?

5:08 jowag: I'm trying to prevent concurrent access to InputStream object, is using "locking" macro a good approach, or should I use something else?

5:10 LauJensen: jowag: wrap it in an atom

5:14 jowag: LeuJensen: but swap! may retry, so I cannot read from InputStream inside swap!

5:20 LauJensen: good point

5:20 jowag: would dosync+ensure not work? Thats a lock in itself

5:23 jowag: LauJensen: I don't know, dosync still may retry even if using ensure. Another possibility I was thinking about was to read from InputStream inside agent. concurrent send-offs are possible, but agent will execute tasks sequentially

5:28 LauJensen: I think locks might be the way to go, as you're looking to do concurrency with an object that has side-effects. Clojures semantics are all wrappers around immutable things

5:29 Chousuke: jowag: use an agent if you can, but I suppose there's nothing wrong with the locking macro either if nothing else works.

5:31 jowag: ok thank you, one more thing, what should I use as a monitor in a locking macro? I've found some example which uses an atom as a monitor object.

5:31 Chousuke: any object will do

5:32 you could use the InputStream itself as the monitor I guess.

5:35 jowag: hmm, interesting

6:15 cschreiner: Why wont this work? (lambda () (interactive) (mark-defun) (kill-region))

6:15 * cschreiner wrong channel

6:19 defn: :)

6:21 * defn needs a way to filter the output from those beastly ,````[] thingamajigs

6:21 defn: ,`[]

6:21 clojurebot: []

6:21 defn: ,``[]

6:21 clojurebot: (clojure.core/apply clojure.core/vector (clojure.core/seq (clojure.core/concat)))

6:21 defn: ,```[]

6:21 clojurebot: (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/apply)) (clojure.core/list (quote clojure.core/vector)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat))))))))))

6:45 eliantor: hi

6:51 question: suppose I want to extend a java type with IObj, how do I share metadata among meta and withMeta? is it possible to do that with extend or I must use a proxy?

7:11 powr-toc: Does anyone know how to get slime-connect to redirect system output from other threads to my slime repl?

7:12 it turns out (slime-redirect-inferior-output) only works for M-x slime, not M-x slime-connect (where you don't get an inferior lisp buffer

7:18 _ato: powr-toc: maybe try running this in the repl you want the output to go to: (alter-var-root #'*out* (fn [_] *out*))

7:24 powr-toc: _ato: hmmm nice trick... but it doesn't seem to work for java libraries using System.out

7:25 hmm maybe I can call System/setErr

7:27 _ato: yeah, not sure what you can set it to though

7:28 powr-toc: yeah, not sure how to convert a PrintWriter to a PrintStream

7:32 ivenkys: gents question - i am using xml-seq to read the contents of an xml doc , however i am unable to treat it as a map in the REPL , is it because the REPL doesn't know the "datatype" of the sequence or am i way off, any suggestions to understand this better ?

7:34 powr-toc: ivenkys: does it not return a seq of maps?

7:35 ivenkys: powr-toc: seq of maps .. hmm , i might have missed a paren,,, let me check

7:36 powr-toc: ivenkys: I think each tag is effectively described as a map

7:38 ivenkys: powr-toc: yup - you are right - map of sequences . sorry abt the newb question

7:38 * ivenkys off to get the dunce cap

7:38 ivenkys: powr-toc: thanks

7:43 powr-toc: no probs

7:43 top tip: functions with the word seq in them usually return sequences ;-)

7:44 or operate on them

7:46 cemerick: Is it the case that protocol fns cannot be rebound?

7:48 illustration: https://gist.github.com/31dcb5bd2cacb7ef29ad

8:29 jfields: is there a function to return the value from a map or a specified default if one is not found?

8:29 chouser: ,(get {:a 1} :b :not-found)

8:29 clojurebot: :not-found

8:30 chouser: ,({:a 1} :b :not-found)

8:30 clojurebot: :not-found

8:30 chouser: ,(:b {:a 1} :not-found)

8:30 clojurebot: :not-found

8:30 chouser: jfields: a few. :-)

8:30 jfields: oh, that was obvious, sorry :)

8:41 chouser: cemerick: protocol methods have call-site caching magic that is defeating the dynamic binding

8:41 the var is indeed rebound, but the call site was already compiled to point to the protocol method

8:41 cemerick: chouser: I figured.

8:41 Oh, maybe your latest post is relevant?

8:42 chouser: hm... not sure

8:42 cemerick: hrm, probably not. call-site caching != direct var linking

8:50 dfa2: which version of git I should use on windows?

8:51 (the most recent msysgit release is in 2009, it is good?)

8:52 forgive me, solved :)

9:03 jfields: there doesn't seem to be a way to set a default for (get-in {:a {:b 1}} [:a :b]) though

9:04 carkh: but, why are you putting nils in your maps anyways ?

9:04 jfields: I'm not, but sometimes I need to ask for keys that don't exist. e.g. (get-in {:a {:b 1}} [:c :b])

9:05 carkh: so if it returns nil, then you know there was nothing there

9:05 since you know that you don't put nil in there

9:05 jfields: sure, so (or (get-in {:a {:b 1}} [:c :b]) :default) is the best plan then?

9:05 carkh: but why do you need that :default return value ? nil is pretty usefull in itself

9:06 but yes, when you do need a default value, or is the way to go

9:22 basilar: heyup, new here... quick question...

9:22 is there a reason why when destructuring maps, the k/v pair has to be in reverse order {v :k} as opposed to when creating them {:k v}?

9:25 stuarthalloway: basilar: otherwise {:keys [a b c]} wouldn't work

9:25 and, btw, :keys eliminates a ton of explicit k/v destructures

9:27 basilar: cheers, that makes perfect sense.

9:40 AWizzArd: stuarthalloway: does Lancet have dependencies, such as ant/maven?

9:44 stuarthalloway: AWizzArd: it is build on Ant

9:44 ivenkys: AWizzArd: it depends on Ant

9:44 stuarthalloway: and, I should mention, unsupported

9:48 AWizzArd: ok

9:56 cemerick: is it the case that enlive transformations are lazy now?

10:11 lpetit: hello, would a keen mind help an outdated clojure follower understand what is behind the laconic sentence "last var wins" ?

10:13 chouser: lpetit: previously, 'use'ing a var with the same name from two different namespaces was a compile-time exception.

10:13 Now it is a warning, and whichever one is pull in last wins.

10:19 alexyk: let the varest var win

10:20 lpetit: chouser: ok, the last var is "reinterned" in the ns, something like this ?

10:20 spariev: alexyk: or, should we say, (let [(varest? var) :win]) :)

10:20 * fogus last var wins... the latest Clojure t-shirt

10:21 alexyk: survival of the latest

10:22 lpetit: chouser: if this is a new var that is added, it means that code previous to the new "use" will use the "previous var" (and so a function fA), while code after the new "use" will use the "new var" (and so a function fB) ?

10:22 stuarthalloway: I am about to send a long email to the mailing list

10:22 lpetit: stuarthalloway: yes ?

10:22 stuarthalloway: I like "last var wins" but the shortest accurate statement is ...

10:23 "attempting to define or refer a var that is already referred from another namespace causes a *warning*, not an *error*"

10:23 alexyk: last var warns :)

10:23 to err is human; to warn is divine

10:24 lpetit: chouser, stuarthalloway: and what is the rationale for this move ?

10:24 cgrand: but isn't "last var wins" the road to more :use without :only?

10:26 lpetit: "(use 'ns1) (shared-fn-name ...) (use 'ns2) (shared-fn-name ...) (use 'ns1 (shared-fn-name ...) " ;)

10:27 stuarthalloway: cgrand: no, you will want to eliminate the warnings

10:34 just posted to the mailing list. I have 15-20 minutes to hang here and discuss if anyone has suggestions/questions/comments/rotten tomatoes

10:36 chouser: I like the all-caps single quote. :-)

10:37 stuarthalloway: nice writeup, thanks.

10:40 stuarthalloway: chouser: does it scare you that you can now (more easily) disregard vars in core?

10:40 arohner: stuarthalloway: I like the solution

10:40 chouser: hm, I don't *feel* scared.

10:42 cgrand: stuarthalloway: let imagine that someone wrote (ns lib (:use lib1) (:use lib2)), no conflicts. In a subsequent release lib2 introduces a var which shadows one of lib1... this isn't the same problem as an additive change to core. Should last-var-wins be restricted to clojure.* ?

10:42 chouser: no, I'm pretty sure I like it. You can do this sort of thing in python with no warning at all. This is a good compromise.

10:42 stuarthalloway: cgrand: in that scenario they get a warning

10:43 chouser: cgrand: unrecommended use of two naked :uses, and Clojure's still gracious enough to warn. Ignorinng both the naked :use advice *and* the warning signs them up for whatever hurt is coming...

10:43 stuarthalloway: chouser: right

10:44 ...and, if they know it is safe, they can continue to get shit done and fix the warning tomorrow

10:44 or work with the lib provider to do so

10:44 chouser: the only reason it's even come up for clojure.core is because we implicit naked use that all the time

10:44 ...despite my earnest attempts to talk people out of it.

10:45 s450r1: could the last-var-wins policy be configurable?

10:45 stuarthalloway: s450r:1: I proposed that too

10:45 arohner: s450r1: what advantage would that provide?

10:45 stuarthalloway: and, in fact, it is an interesting motivating case for a condition system

10:45 chouser: ,(require '[clojure.core :as core])

10:45 clojurebot: nil

10:45 chouser: ,(core/prn (core/get {::a 1} ::a))

10:45 clojurebot: 1

10:45 chouser: :-)

10:46 replaca: stuarthalloway: do you want me to take that pprint doc on clojure.org ticket since it's really an autodoc ticket?

10:46 s450r1: arohner: you could use last-var-wins during development and then turn it off when testing something you want to release to double-check

10:47 stuarthalloway: configuring it back to an error might ease the minds of uptight folks: warn during beta, err during release

10:47 s450r1: but on balance, not worth the complexityu

10:47 adding a mutable setting to double-protect against people that won't heed warnings doesn't feel very Clojurish

10:47 cgrand: stuarthalloway & chouser: I know I'll get a warning, I'm just afraid a general last-var-wins policy will encourage sloppy uses of :use

10:47 stuarthalloway: replaca: yes please

10:48 replaca: stuarthalloway: k

10:48 chouser: the printing of the warning could be done by a clojure.core fn such that paranoid folks could alter-var-root to make it throw

10:48 stuarthalloway: replaca: my only question was does the clojure repos need to have the doc directory for pprint's sake. It's in there, and if it needs to stay that's cool

10:48 chouser: and the cliff-jumping sort could make all the warnings disappear.

10:49 ...all without adding the complexity of a real config option.

10:49 stuarthalloway: cgrand: we should make sure that the style guide in assembla strictly forbids naked use

10:49 and we should make sure to call it "naked use", good use of negative connotations

10:50 fogus_: Hmmmm.. I guess it depends on your view of nakedness

10:50 chouser: fogus_: that's why we don't call it "nude use"

10:50 stuarthalloway: chouser: good luck getting rhickey to go to even that trouble on behalf of the foolish :-)

10:51 "terrorist use"?

10:51 replaca: stuarthalloway: that's the way that autodoc finds "additional" docs (except that it's broken right now cause of the oter changes I mentioned)

10:51 fogus_: "crass use"

10:51 s450r1: "shotgun use"?

10:51 chouser: "promiscuous use"

10:51 replaca: we can add docs there for any namespaces and they will get attached to the namespace in the autodoc

10:51 stuarthalloway: heh, amusing to see people's guesses at a "universal negatively connoting word"

10:52 ordnungswidrig: quick: where is the presentation where rich is deriving that oo is doing state wrong?

10:52 fogus_: stuarthalloway: Whenever you are lazy about :use the terrorists win

10:52 stuarthalloway: replaca: great, thought maybe that was it and hadn't checked, we should use it more

10:52 lpetit: chouser, stuarthalloway: thanks for the explanations. Makes sense to me, in a dynamic language, to prefer warnings over errors when possible

10:53 wlangstroth: "naked" already has *kind-of* that connotation in trading

10:53 stuarthalloway: cgrand: you happy? semi-happy?

10:53 s450r1: I like last-var-wins better than getting an error too.

10:53 cgrand: what about deprecating (warning in 1.2) naked use?

10:54 s450r1: cgrand: I was just about to suggest that :-)

10:54 stuarthalloway: would love to cemerick's view as well, hoping that with last-var-wins we can defer :as-of for now

10:55 cgrand: that feels unclojurish to me

10:56 naked use is not a great idea, but "never" is a bit strong

10:56 * cemerick catches up

10:56 replaca: stuarthalloway: yeah, we should :-). But I should get it working agian first! :)

10:57 stuarthalloway: lpetit, if you get a chance can you see if the latest labrepl is ok in ccw?

10:57 lpetit: I can see the value of naked use for RAD development, especially if for one-shot scripts. And with warnings helping you move from the "shit state" to the "production" state, that's a win-win, no ?

10:57 stuarthalloway: I think the pom.xml was pointing to the wrong contrib

10:57 lpetit: stuarthalloway: ok, tomorrow evening I hope

10:58 stuarthalloway: does anybody here have the ability to nuke artifacts on the CI box?

10:58 cemerick: last-var-wins seems remarkably dangerous to me

10:58 stuarthalloway: I have admin access but not ssh access, so maybe I can do it myself...

10:58 fogus_: lpetit: I always start with naked use

10:59 stuarthalloway: cemerick: what's your worst-case scenario?

10:59 cemerick: stuarthalloway: I'm trying to talk myself off the cliff.

10:59 lpetit: fogus_: so do I, incremental and interative development. I like it.

11:02 cemerick: OK, easy thing's first: naked :use is good and necessary. If you've got a couple of ns' that are constantly utilized (c.c.core, c.set, c.c.def, a few of our foundational internal libs), requiring them, even with an alias, is tedious.

11:02 ordnungswidrig: w

11:03 cemerick: What happens when you refer to a core fn on line 100 of a lib, and redefine that same core fn on line 200?

11:03 (thinking here of direct linking)

11:03 or, I should say....define a fn with the same name as the core fn on line 200.

11:04 stuarthalloway: ^^

11:05 stuarthalloway: you get a warning

11:06 and since the warning is in your own code, you fix it, by adding an exclude at the top of the namespace

11:06 the earlier name is now not available, and your code won't compile

11:06 cemerick: stuarthalloway: Right, I'm asking, which fn does the usage at line 100 get?

11:06 stuarthalloway: is this an interview question?

11:06 :-0

11:07 I am guessing you would get the core one

11:07 if direct linking is in play

11:07 cemerick: That might be my worst case scenario -- if a core (or otherwise :use'd fn) gets linked in prior to a redefinition (that is used later on in the ns), and you've got two behaviours going on in the same ns for the same name.

11:08 arohner: but can't you get that behavior now?

11:08 stuarthalloway: would you (or anyone on your team) ship with the warning in your own code?

11:08 arohner: yes, although not as easily

11:09 you would have to go (in-ns 'clojure.core)

11:09 cemerick: stuarthalloway: knowingly, no. *shrug*

11:09 We've been able to treat ns declarations *as* declarations for the most part, which is nice. Tossing that warning and going to last-var-wins sort of pulls the veil a bit.

11:10 This is all to prevent breakage like the case of flatten in enlive?

11:10 stuarthalloway: cemerick: I already floated (and rhickey didn't love) making it configurable ... even more complexity

11:10 cemerick: yes, although that breakage is pretty thorough

11:11 and with modular dependencies takes a while to rundown

11:11 cemerick: yeah, I wasn't meaning to imply that it's not a problem, or a widespread one

11:11 or *not* a widespread one

11:11 stuarthalloway: take my own case: labrepl broke

11:11 but when I went to fix I first had to fix circumspec

11:12 ...and then compojure (which I didn't own, and had to fork...)

11:12 the warning also lets us leave the old vars in place

11:12 cemerick: I remember various proposals floating around a long time ago to load the entire file and do some poking and prodding in order to avoid the need for declare. Maybe that could be resurfaced, and local declarations always given priority over referred namespaces?

11:13 Likely a much bigger change than last-var-wins, but seems far cleaner.

11:14 stuarthalloway: here's a crazy idea: last-var-wins during the beta period, and turn it back off for rc

11:14 cemerick: yes, that is crazy :-)

11:15 arohner: stuarthalloway: so official builds would have last-var-wins-off, and development builds would have it on?

11:15 stuarthalloway: but why crazy? lots of us are on snapshot bits of six different dependencies

11:15 making changes during beta requires enormous coordination, which last-var-wins solves

11:16 arohner: stuarthalloway: that would prevent e.g. using libraries based on clojure 1.1 with 1.2

11:16 stuarthalloway: and turning it off creates a sync point for various projects

11:16 cemerick: stuarthalloway: because lots more people are going to have exactly the same problem that aren't aggressively tracking 1.2-SNAPSHOT.

11:17 stuarthalloway: arohner: not necessarily, but would require yet another feature, either ad hoc version probing or something like :as-of

11:17 lpetit: cemerick: If last-var-wins changes vars, I don't think it's necessary to have "hard linked" vars (non dynamic) from e.g. clojure.core to get 2 different var values from two different points in code. code at line 100 will have its symbol resolved at compile time to some var, and code at line 200 will have its symbol resolved at compile time to a new var (the old var is not referenced anymore...

11:17 ...by the namespace, but is still available because referenced by some compiled code at line 100). At least that's how I understand it, without the ability to test it yet (though this is an easy test to drive)

11:18 cemerick: lpetit: good point

11:18 stuarthalloway: am I nuts with my suggestion?

11:18 half-baked as it is

11:19 stuarthalloway: lpetit: true or no, that doesn't bother me so much. it really comes down to how people will behave with warnings

11:19 cemerick: not nuts, I just don't know how hard it is to do

11:19 cemerick: yeah

11:19 lpetit: stuarthalloway: it was for the sake of the truth. Currently (without any experiment feedback), it also doesn't bother me.

11:20 stuarthalloway: I am going to sign off and do some day job for a while it's almost noon here and hard to pretend the sun isn't up :-)

11:20 I will make sure Rich looks at this but try to give him my slanted view

11:20 :-)

11:27 hugod: the reify doc string examples are missing the "this" argument

11:36 stuarthalloway: hugod: can you throw that in a ticket?

11:36 hugod: stuarthalloway: sure

11:36 stuarthalloway: thx

11:48 rhickey: new last-one-in-wins - tracks warnings and switches to throw after you've been warned 42 times

11:48 Chousuke: heh

11:48 "Code too broken, fix it"

11:57 ordnungswidrig: rhickey: 42? not 32? :-)

12:00 rhickey: ordnungswidrig: changed it. Now it pools results from all libs and apps overwriting something. If yours is in the last 10% to remove the warning, it switches to an error. Kind of like a silent auction with an unknown closing time.

12:00 ordnungswidrig: hehe

12:03 rhickey: you won't be able to sleep at night wondering - 'how long can I get away with this?'

12:06 ordnungswidrig: I can't sleep at night because I wonder how long I must keep programming java for a living...

12:08 sattvik: rhickey: I am looking into the Java 5 problem with the annotation tests. Unfortunately, because gen-class has to be AOT compiled, it's not as simple to fix. So am trying to decide the best way to handle this situation. Option 1 is to simply disable the test on Java 5, perhaps with a warning. Option 2 is to write a few custom annotations, possibly in Java, so the same test can work regardless of platform version. Option 3 is to write a limited version o

12:08 chouser: sattvik: cut off at "limited verion o"

12:09 sattvik: Option 3 is to write a limited version of the tests for Java 5 (like deftype), but this will also require some modifications to the build script. There may be other options.

12:09 scottj: How come (.getInterfaces clojure.lang.Symbol) doesn't include clojure.lang.IMeta, yet (instance? clojure.lang.IMeta 'foo) returns true?

12:10 remleduff: ,(class 'foo)

12:10 clojurebot: clojure.lang.Symbol

12:11 remleduff: ,(ancestors clojure.lang.Symbol)

12:11 clojurebot: #{clojure.lang.IObj clojure.lang.Obj clojure.lang.AFn :clojure.contrib.json.write/symbol clojure.lang.Named java.lang.Object clojure.lang.IMeta java.util.concurrent.Callable java.io.Serializable clojure.lang.IFn java.lang.Runnable :clojure.contrib.generic/any :clojure.contrib.pprint.examples.json/symbol java.lang.Comparable}

12:12 rhickey: scottj: it's not a direct super

12:13 remleduff: What does it mean that ":clojure.contrib.generic/any" is an ancestor of Symbol?

12:14 I guess that means (derive clojure.lang.Symbol ::any) got called somewhere

12:14 scottj: remleduff, rhickey: thanks

12:15 remleduff: ,(descendants :clojure.contrib.generic/any)

12:15 clojurebot: #{:clojure.contrib.generic.arithmetic/zero :clojure.contrib.complex-numbers/pure-imaginary :clojure.contrib.generic.arithmetic/one java.lang.Object :clojure.contrib.complex-numbers/complex}

12:24 remleduff_: rhickey: I mailed in my CA this morning, sorry about the process mixup on ticket 317

12:25 sattvik: rhickey: I think the only way to avoid making any changes to the build.xml is be restricted to the Java 5 nnotations, which do not include the full feature set, meaning the tests would be incomplete. I don't think that is a good idea.

12:26 Given that Java 5 is no longer supported by Sun/Oracle, I am somewhat partial to disabling the test on Java 5 and printing a warning.

12:42 slyphon: so, i'm trying to run 1.2 and slime, and i keep getting "unmatched delimeter: )"

12:42 my code works fine under 1.1

12:43 technomancy: slyphon: that's probably an issue with clojure-test-mode, not swank

12:43 slyphon: ah

12:43 technomancy: try fetching the latest from git

12:44 slyphon: ok

12:44 thanks :)

12:52 cemerick: surely we can run the build against 5 and 6 JDKs?

12:52 rhickey, sattvik ^^

12:54 sattvik: cemerick: The code works with 5, it is just the test that depends on annotations that were introduced in Java 6. Java 5 SE bundles only a few annotations.

12:55 For example, I don't think that Java 5 SE contains any nested annotations, though they are supported by the language.

12:56 cemerick: sattvik: Sure; I'm just saying, it's pretty straightforward to run multiple builds in hudson for a single project.

12:56 Then wrap the JDK 6-only tests in a jdk6-only macro that sniffs for the necessary dependency.

12:57 YAFEUC

12:57 (Yet Another Feature-based Execution Use Case)

13:09 Raynes: How does one find out of a method is static?

13:10 slyphon: Raynes: reflection, i think

13:10 technomancy: is clojure-test-mode part of clojure-mode?

13:10 oh, nvm

13:10 Raynes: I'm not quite sure how to use .getModifiers from Clojure. :|

13:11 rhickey: sattvik: stuarthalloway just dealt with this - ping him

13:11 nurv: Hi.

13:12 Raynes: Hi.

13:22 chouser: I'm trying to set up a namespace on-the-fly in which to load some trusted clojure code.

13:22 I'm using create-ns and then in a binding (refer 'clojure.core). This is working fine.

13:23 sattvik: rhickey: OK, I just missed him this morning. I added a comment on the bug. I guess the key obstacle to the deftype approach is that the build script will need to be modified. Perhaps that is not a big deal, but I wanted to check. I will go ahead and implement something this afternoon.

13:23 chouser: Now I need to import some class names, but since import is a macro that takes the value of *ns* at compile time, I feel stuck.

13:23 'binding' won't cut it anymore.

13:23 stuartsierra: chouser: That's why I was annoyed when 'import' became a macro

13:24 chouser: The only way around is a hack: use 'eval' or call methods in 'clojure.lang.Namespace'

13:24 or maybe it was clojure.lang.RT

13:24 chouser: the import macro seems to generate code taht calls clojure.core/import*

13:25 But I'd really rather not do that.

13:25 I guess I can have the code I'm loading do its own import. :-/

13:25 stuartsierra: clojure.core/import* is a special, not a real function anyway

13:26 chouser: oh. :-(

13:26 and since *ns* isn't getting passed in, it probably takes its value at compile time as well.

13:26 stuartsierra: It *should* be a real function

13:27 slyphon: technomancy: um, forgive my ignorance, please, but when doing the M-x package-install-from-buffer on clojure-test-mode and clojure-mode, it'll install itself under the elpa/ directory?

13:32 * chouser uses 'ns' and 'in-ns' to temporarily switch to another namespace in the middle of a .clj

13:32 chouser: that seems to work. I'll just try to pretend I didn't do that.

13:33 stuartsierra: I'll pretend I didn't hear that.

13:39 LauJensen: Raynes: feature request, $ping ip.ip.ip.ip

13:39 Raynes: LauJensen: Duly noted.

13:40 LauJensen: I could have used it today when Maven Central was down - wanted to know if it was just me :)

13:43 lrenn: Excuse me if I'm way off base, but might it be useful to have another way to specify the classloader that RT uses to initialize other than using the thread's context class loader?

13:53 zakwilson_: Why are there about 20 different jars for Compojure on clojars.org, some with non-descriptive descriptions?

13:58 Raynes: How does one catch nested exceptions?

13:59 LauJensen: zakwilson_: there seems to be a habit of pushing waaay to much stuff to clojars

14:00 We found one fork of ClojureQL there which was throughly broken - Why would anybody loot a jar, break it and then upload it ?

14:00 * zakwilson_ suggests confiscating all crack pipes belonging to Clojure developers.

14:01 Raynes: Don't forget the Meth syringes.

14:01 zakwilson_: Is meth normally injected?

14:02 Raynes: I'm pretty sure it's normally <insert anything that gets it into your body here>.

14:06 remleduff: How do you diagnose "why" lein deps is failing if you know the jar is there?

14:07 I'm willing to believe I have a proxy problem somewhere, I just can't figure out what link in the chain isn't working at the moment

14:08 ataggart: raynes: what do you mean by "nested exceptions"

14:12 Raynes: ataggart: java.lang.OmgException: java.lang.WtfException: java.lang.BbqException: blah

14:13 ataggart: that is the cause chain

14:13 you don't need to "handle" the causes

14:13 unless you pull the cause out and throw it

14:14 remleduff: Are you saying you want to catch BbqException, but it's been wrapped by Wtf and OmgExpection?

14:14 ataggart: I'm not saying anything about "Want"

14:15 but yes, Omg was caused by Wtf was caused by Bbq

14:15 the exception you're holding is a Omg

14:15 Raynes: Sorry, doing 100 things at one time here.

14:15 ataggart: the causes are mostly informational

14:15 Raynes: But yeah, the BbqException is what I wanted.

14:16 ataggart: then don't create new exceptions

14:16 or are you saying you're throwing an exception and something else is catching it and wrapping it?

14:16 chouser: there are several places in clojure where exceptions are wrapped in a way that does not add value.

14:17 Raynes: Something else is wrapping the exception. I just need to catch it.

14:17 clojurebot: http://paste.lisp.org/display/74305

14:17 chouser: I think you have to catch the outer one, check to see if the root is the one you want and if not rethrow that outer one again.

14:17 ataggart: you can peel back the layers of the onion via (.getCause ex)

14:18 chouser: clojure.stacktrace/root-cause

14:18 Raynes: Okay. :)

14:19 remleduff: Does lein downloading jars use some port other than 80?

14:19 ataggart: bear in mind that that'll rip through any of *your* wrapped exceptions

14:26 cemerick: looks like pprint's a little borked lately? (pprint #{}) => NPE

14:29 bmason: what does "#< ... some content ... >" mean from a println?

14:30 chouser: bmason: that's how an object prints by default when it doesn't have a matching reader.

14:30 cemerick: replaca: do you want an issue for that, or is it a simple tweak? ^^

14:30 slyphon: yeah, it's so if you try to read that with lisp, it'll barf

14:30 bmason: ah... I see

14:30 cemerick: ah, speaking of which....

14:30 bmason: I'm trying to capture a sample request object from the Compojure framework

14:31 figured I'd just println it, clean it up and assign it using def

14:32 cemerick: bmason: use pr or prn

14:32 even then though, there'll be plenty of unreadable objects

14:32 * slyphon still thinks "porn star" whenever he reads 'prn-str'

14:32 bmason: Clojure is dead sexy

14:33 cemerick: rhickey: can defrecords get a map-esque .toString that yields the same as what's shown w/ (str [some-record])

14:35 slyphon: bmason: :)

14:56 _nj: hi

15:07 replaca: cemerick: can you give me an issue? with simple-dispatch or code-dispatch?

15:08 cemerick: replaca: Sure -- I'm going to triple-check my environment first. What is simple-dispatch vs. code-dispatch?

15:09 replaca: if you do nothing, you get simple dispatch

15:09 cemerick: ah, simple then

15:09 just (pprint #{}) does it at the moment

15:09 replaca: and the output should be similar to what print would give you

15:09 yeah, that's simple

15:10 oh that's a set... sorry I was reading the curly braces as parens

15:11 cool, give me an issue and i'll knock it down this week. Does it seem to be just sets or is it worse than that?

15:11 cemerick: replaca: that's all AFAICT

15:12 is pprint in need of a test suite?

15:15 LauJensen: ~seen etate

15:15 clojurebot: etate was last seen quiting IRC, 8403 minutes ago

15:19 slyphon: technomancy: hey, the completion in the latest clojure-mode seems a lot better

15:21 replaca: cemerick: well, there are tests (more for the underlying cl-format than pprint itself), but there certainly could be more

15:22 Raynes: dnolen is at war with his connection.

15:22 slyphon: Raynes: i think he's losing

15:23 Raynes: I agree with your observation, sir.

15:23 slyphon: that's what IPv6'll do to ya

15:23 :)

15:25 dnolen: erg

15:31 slyphon: it'd be nice if the [{:keys [a b c]}] form could be used to capture [& args], or rather you could do (foo :a 1 :b 2) and have the [{:keys [a b]}] "handle that"

15:31 * slyphon knows he's describing an impossibility

15:31 chouser: you can!

15:31 slyphon: uh

15:31 you can do [& {:keys [a b]}] ?

15:32 chouser: should, yeah.

15:32 though I'm failing here so far...

15:32 slyphon: but then that's your variadic arity func

15:32 hah

15:32 i guess that's the rub, the limits on varargs

15:33 chouser: oh, this is an old clojure

15:33 ((fn [& {:keys [a b c]}] [a b c]) :b 2 :a 1)

15:34 jfields: if I have [1 2 1 3] is there any way to easily get [2 1 3]. (remove #(= 1 %) [1 2 1 3]) removes all instances of 1, which is not my desired behavior.

15:34 slyphon: jfields: (rest [1 2 1 3]) ?

15:34 hiredman: so you want the rest, not the first?

15:34 jfields: no

15:34 sorry, bad example

15:34 the element could be at any index

15:35 slyphon: jfields: so you want "remove first instance"

15:35 jfields: I want to remove only the first match, yes

15:35 hiredman: vectors don't do abitrary resizing

15:35 jfields: I don't need to resize, a new vector is fine, as long as it only has the first match removed.

15:35 hiredman: and seqs aren't index

15:35 indexed

15:36 chouser: ,(let [[a b] (split-with #(not= 1 %) [5 6 1 2 1 3])] (concat a (next b)))

15:36 clojurebot: (5 6 2 1 3)

15:36 hiredman: you could generate an index over a seq, find the index of the item you want to remove, then generate a new seq with take/drop leaving that index out

15:37 or what chouser said

15:40 jfields: chouser: wow. thanks.

15:51 ataggart: how neat that the map destructuring stuff only requires an even-count sequence

15:51 ,(let [{foo :a bar :b} '(:a 2 :b 3)] [foo bar])

15:51 clojurebot: [nil nil]

15:51 ataggart: hmm that worked on my box

15:51 ,*clojure-version*

15:51 clojurebot: {:interim true, :major 1, :minor 1, :incremental 0, :qualifier "master"}

15:52 ataggart: guess it's a new thing with 1.2

15:53 cemerick: it is

15:57 ordnungswidrig: is there a clojure lib to handle URIs the right way (rfc2396) especially parsing them?

15:58 chouser: there's java.net.URI

15:58 slyphon: yeah

15:58 but that's not "the right way"

15:58 chouser: oh?

15:58 slyphon: it's handling of query arguments is totally psychotic if you're trying to build URIs

15:58 its, even

15:58 it only escapes '%' chars

15:59 chouser: :-(

15:59 slyphon: it's completely baffling

15:59 ordnungswidrig: hmm, does it parse?

15:59 slyphon: it parses a single-argument string correctly

15:59 ordnungswidrig: btw. why doesn't HttpServletRequest return a java.net.URI for getRequestURI then?!

15:59 ;-)

15:59 slyphon: the escaping rules are totally insane

16:00 ordnungswidrig: slyphon: is the insanity from the rfc or invented by java.net.URI?

16:00 slyphon: i'm pretty sure it's invented by java.net.URI, it's the only implementation i've ever seen that does things that way

16:00 in a way that's *totally* not useful

16:01 i mean, look, it could be me being totally retarded

16:01 rsh: i connected to a swank server running remotely via slime-connect (emacs). Now, any clojure file I open locally is not associated with slime (i.e. c-c c-k compile file does not work). Any pointers on what is wrong?

16:03 ordnungswidrig: slyphon: the rfc is insane itself because it does not state any character set for % encoding.

16:03 slyphon: yeah, there's a lot wrong with the RFC

16:03 ordnungswidrig: slyphon: which means the charset depends on the application so java.net.URI should be able to specifiy the encoding.

16:04 slyphon: i'll say this

16:05 i spent about 6 hours trying to get it to do what i wanted, then gave up and just did (str uri-up-to-query '?' my-generated-query-str)

16:05 and handed that to (URI. )

16:06 ordnungswidrig: slyphon: I only need some parsing at the moment

16:07 slyphon: ordnungswidrig: yeah, just tryin' to give a friendly "heads up" before you skipping through the thorn bushes :)

16:08 ordnungswidrig: slyphon: that's how I took it :-)

16:08 slyphon: :)

16:26 _nj: Can I start a swank server from a lein uberjar?

16:27 puredanger: so, I'm trying to understand defrecord and there ain't much I can find about it. defrecord creates a class and the current idea is to create one like (Foo. etc) ala Java classes?

16:28 chouser: yes

16:29 puredanger: and do I need to import a Foo record type before I use it?

16:29 chouser: no, defrecord auto-imports for you

16:29 puredanger: I guess if I want to use it sans ns I do

16:29 I mean from another ns

16:29 ataggart: right

16:29 chouser: oh, right. yes, then you import

16:30 puredanger: and b/c it's a Java class the convention (requirement?) is to name it with a capital letter (Foo, not foo) ?

16:32 chouser: If anything, it's a convention, but I'm not sure it's even that quite yet.

16:33 it does seem common.

16:33 dnolen: puredanger: some people seem to be following that other's not. yes it's a Java class but it's also immutable cannot be subclassed and supports map operations. Not very Java class-y.

16:37 puredanger: and you can also optionally specify protocols (which map to methods on the Java obj)

16:40 bmason: I'm trying to compile a file in emacs and getting a name conflict error... I already tried running (ns-unmap) to remove the symbol

16:40 slyphon: bmason: easiest thing to do is restart the repl

16:40 bmason: seriously?

16:41 slyphon: that's the easiest

16:41 i've found

16:41 bmason: yeah, I was hoping to avoid that

16:41 slyphon: you can also do ns-unmap, it's just not always enough

16:41 i mean

16:42 bmason: maybe I'm not understanding what ns-unmap is supposed to do?

16:42 slyphon: sometimes it's kind of cumbersome to do that

16:42 i usually go (ns 'blah.foo) (ns-unmap *ns* 'symbol-name)

16:43 bmason: do you need to be in the ns where the symbol was defined, or the NS that's referencing the one where it was defined?

16:44 slyphon: if blah.foo had a definition of quux

16:44 and you moved quux into blah.bar

16:44 you need to (ns blah.foo) (ns-unmap *ns* 'quux)

16:48 ivenkys: b

16:49 que ?

16:49 MrEvil: so I'm trying to understand how to specify the :indent option for lazy-xml/emit and I'm having trouble figureing it out. Where can I find the refrence for ':as' in regards to optional keyword parameters? What's the proper way to specify the argument in this case is it (lazy-xml/emit my-xml {:indent " "})?

16:49 bmason: slyphon: yeah, none of that is working... I don't understand why so I will just restart the REPL

16:49 kotarak: slyphon: (ns-unmap 'blah.foo 'quux). No need for ns. If you really want to, use (in-ns 'blah.foo). ns should be used only once.

16:50 slyphon: ah

16:50 kotarak: ok, good to know

16:50 chouser: MrEvil: try (lazy-xml/emit my-xml :indent 2)

16:50 slyphon: kotarak: i figured one of the grown-ups would come along and tell me how to do it better

16:51 * kotarak is grown up? His wife has probably a different opinion. ;)

16:51 MrEvil: chouser: that was it. thanks!

16:51 chouser: MrEvil: np

16:53 MrEvil: so i'm curious about xml/emit and lazy-xml/emit being hard coded to always output to *out* instead of writing to a supplied bufferedwriter or file handle or something along those lines. It seams to me that it goes against the functional grain if you are required to use with-out-str in order to same your XML data to a file

16:53 also makes it hard to debug using print statements

16:54 am i wrong in thinking that this is wierd?

16:54 dakrone: technomancy: question for you

16:55 chouser: MrEvil: yeah, it's probably not best. clojure has several things like this. Besides emit: print printf println prn pr...

16:55 you can using (binding [*out* foo] ...) to send to a different outputstream without having it go into a String first

16:56 but I do think there should be some way to pass in the output stream directly.

16:56 slyphon: chouser: hrm, i don't think the [& {:keys [foo bar]}] works in 1.1

16:56 dakrone: technomancy: is it a bug if I declare clojure 1.2-snapshot as a dependency in my lein project.clj, but when doing a 'lein repl' it uses clojure 1.1?

16:56 technomancy: dakrone: it's a bug in leiningen 1.1; it's fixed in 1.2 (which is a couple weeks away from release)

16:56 chouser: slyphon: no, I think destructuring seqs into maps is just in 1.2

16:56 * slyphon nods

16:56 * slyphon is gonna have to do some work on migrating to 1.2

16:57 dakrone: technomancy: hmm...I'm working on a project with 1.2-specific features, should I just pull the latest lein from git and try using that?

16:57 technomancy: dakrone: sure; the other option is to use swank/nailgun instead of the repl task

16:57 dakrone: technomancy: not an emacs user

16:57 technomancy: dakrone: nailgun is an option too. the docs indicate it's tied to vim, but I don't think that's true

16:58 dakrone: technomancy: cool, I'll use nailgun instead then until the 1.2 release, thanks

16:58 technomancy: dakrone: lein 1.1 uses clojure 1.1, which had a bug that made the repl task impossible to implement correctly

16:58 dakrone: technomancy: interesting, what was the bug?

16:59 technomancy: ticket #299

16:59 ,ticket #299

16:59 clojurebot: java.lang.Exception: Unable to resolve symbol: ticket in this context

16:59 technomancy: ~ticket #299

16:59 why can I never keep those straight?

16:59 ~botsmack

16:59 clojurebot: Owww!

16:59 dakrone: heh, okay I can search using the number

16:59 technomancy: right. =)

17:00 cemerick: ~#299

17:00 clojurebot: excusez-moi

17:00 cemerick: oh well

17:00 clojurebot: {:url http://is.gd/bVRhz, :summary "clojure.main -e disables stdin", :status :fixed, :priority :normal, :created-on "2010-04-16T23:43:43-05:00"}

17:01 cemerick: wonky

17:01 dakrone: and while we're on the subject of different versions, is there any var that's bound to a string of Clojure's version at runtime?

17:01 something like *clojure-version*?

17:01 Chousuke: ,(clojure-version)

17:01 clojurebot: "1.1.0-master-SNAPSHOT"

17:01 dakrone: that would be it, thanks Chousuke

17:02 Chousuke: I wasn't even aware of that until recently

17:02 dakrone: now all it needs is something similar to Ruby's vars for all the different fields

17:02 something like (clojure-major-version) -> 1

17:03 etc

17:03 Chousuke: well hmm

17:03 ,((partial *clojure-version* :major))

17:03 clojurebot: 1

17:04 dakrone: oh hey, already exists, silly me

17:04 thanks again Chousuke

17:17 Raynes: LauJensen: Do you want the length of time it takes for the ping to complete, if it completes, or just whether or not the ping completes?

17:18 LauJensen: Raynes: something similar to ping -c 1 host, where if it pings once return the time, if host doesnt resolve or doesnt reply, print that

17:22 Raynes: LauJensen: It's not going to be very detailed, but I can tell you the time it takes and whether or not it completes. I'm using InetAddress.isReachable

17:22 LauJensen: cool

17:28 MrEvil: (with-open [*out* (io/output-stream output-file-name )] (lazy-xml/emit my-xml)) should work should it not?

17:32 kotarak: MrEvil: I think you need to wrap the stream in a writer.

17:52 bmason: is (:refer foo.bar :as baz) correct syntax inside a 'ns' definition?

17:52 kotarak: bmason: (:refer [foo.bar :as baz])

17:53 Raynes: (:refer [foo.bar :as baz])

17:53 Eh.

17:53 I should look at the monitor instead of watch television while I type.

17:53 bmason: clojure.lang.PersistentVector cannot be cast to clojure.lang.Symbol

17:54 Chousuke: you probably want require?

17:54 bmason: whereas it compiles without error without the vector, but doesn't properly initialize the alias

17:54 kotarak: Argh. Yes. require

17:54 Raynes: Yeah, I think you want require.

17:54 bmason: I'm on the 1.2 snapshot...

17:54 * kotarak should think when reading...

17:54 Chousuke: I haven't seen :refer used in ns ever.

17:54 bmason: k

17:54 Chousuke: except for :refer-clojure

17:54 or whatever it is

17:55 * kotarak and stop watching TV while chatting.

17:55 bmason: when I used :require I got an error saying it couldn't be found in clojure.core

17:55 oh nvm... works now

17:55 maybe I had something else wrong

17:56 ok, thanks guys

18:00 Dawgmatix: if i was to build something like heroku for compojure / other clojure web frameworks would anyone here want to buy clojure specific cloud services ?

18:00 I am trying to start a startup and the idea i was last working on (www.bitcrumb.com) seems to have bombed, so am looking for fresh ideas where i can make a honest living

18:08 Associat0r: join #proglangtheory

18:12 DuneMan: Hey all, I'm writing some code that reads a bunch of data indefinitely, I wrap the reads of this data in an "repeatedly" to turn it into a seq

18:12 however, I just ran into a case where this is causing a massive memory leak

18:12 because, apparently, using take-nth is causing the head of the list to be held

18:13 so I get a huge cons list that eats up all my memory

18:14 (doseq [e es] (println e)) <-- no memory leak, (doseq [e (take-nth 1000 es)] (println e)) <--- memory grows unbounded and the jvm dies.

18:14 I do *not* see how take-nth is holding the head.

18:15 I have created this issue before when I introduced a function, that I passed the seq to, which was (fn [& args] ...) [e.g. something that was created with partial], and doing this caused realization of the list

18:15 Thoughs? Should I not use seq to represent my infinite data?

18:16 hiredman: what version of clojure are you using?

18:16 master (what will be 1.2) is more aggressive about clearing locals

18:17 DuneMan: 1.2

18:17 oh wait

18:17 1.1

18:18 hiredman: try a snapshot of 1.2

18:18 DuneMan: Are there any major problems with 1.2 snapshot that I should know about?

18:19 hiredman: nope

18:19 well, there are changes

18:19 some fns where moved from contrib into core

18:22 DuneMan: (1.1.0-master-SNAPSHOT... right?)

18:23 or is it 1.2.0-master-SNAPSHOT

18:24 found it.

18:42 grrr - BLEH:. (hash-map :a 1 :a 2) -->> duplicate key error

18:42 (merge (map hash-map s)) ??

18:43 er, (apply merge

18:45 MadWombat: Hello

18:47 DeusExPikachu: anyone have any experience with using / writing custom class loaders for support for versioning, loading/unloading new classes from jars during runtime? I'm trying to design a clojure distribution and looking for tips

18:58 I'd prefer to use an existing classloader that meshes well with clojure's methods of operation which may not exist which is why I am considering writing my own

19:20 * XAMPP is away: I'm busy

19:27 XAMPP: sorry :/

19:31 DuneMan: hiredman: Thanks! 1.2 isn't exhibiting the same issue.

20:10 defn: cool stuff on disclojure/planet.clojure.in today

20:10 the lava lamp build env is just insanely awesome

20:12 DuneMan: We had that going at an old company of mine

20:13 Which was, conveniently, powered by our product

20:13 and an arduino microcontroller that could speak internets

20:13 and that got expanded into live traffic lights

20:19 defn: DuneMan: cool

20:19 DuneMan: im trying to find the right light or gadget to do something neat

20:20 DuneMan: Traffic lights are actually reasonably priced on ebay :-D

20:20 defn: id like to wire up a bunch of stuff and have it play a nice gong sound when the light changes as well :)

20:20 DuneMan: and impressive

20:21 defn: dune http://www.globalindustrial.com/p/material-handling/dock-truck/dock-traffic-systems/dock-traffic-light-system?utm_source=shopping&utm_medium=shp&utm_campaign=Dock-Traffic-Systems-shop&infoParam.campaignId=WP

20:21 sexpbot: "Dock & Truck Equipment | Dock-Traffic Systems | Dock Traffic Light System | B184101 - GlobalIndustrial.com"

20:21 defn: that's all i could find

20:22 900$ is a little out of my price range :) however, it weight 156lbs and would no doubt be impressive

20:22 in fact, probably more annoying than anything without a filter over it

20:23 however, getting a tan from the gigantic red light turning on in your face would probably get you satisfying your tests pretty damn quickly :)

20:23 @DuneMan

21:02 * nurv good night.

21:15 slyphon: hrmf, is something different about binding in 1.2 ?

21:17 i was binding a fn over c.c.sql.internal/transaction* to neuter it, but now it seems that isn't effective in 1.2

21:21 gah

21:21 sonofa

21:25 does the EPL allow me to copy c.c.sql into my own codebase and make modifications to it?

21:28 tomoj: only if your code is also EPL, I think

21:28 but I am not a lawyer

21:28 slyphon: shit

21:30 tomoj: if you don't release the code it's less of a problem I think

21:30 slyphon: ah

21:32 hrm

21:32 you can't bind over a macro?

21:33 this is really weird

21:33 tomoj: you mean like (binding [doseq ...] ...) ?

21:33 slyphon: i was able to monkey-patch clojure.contrib.sql.internal/transaction* under 1.1 so that it didn't actually do anything (i'm wrapping things in a JTA transaction, and you can't call .commit on a single connection)

21:33 yeah

21:34 tomoj: by the time it would make a difference, the macro call will be gone

21:34 slyphon: and that doesn't seem to work under 1.2, which kind of sucks as it's a pretty core behavior i was counting on

21:35 well, transaction* is the function

21:35 tomoj: so you're doing (binding [transaction* ...] ...) ?

21:36 slyphon: yeah essentially (binding [c.c.sql.internal/transaction* (fn [f] (f))] ...)

21:38 tomoj: well, hmm

21:38 slyphon: yeah, any idea why that wouldn't work under 1.2?

21:39 tomoj: the exact same thing worked in 1.1?

21:39 slyphon: yep

21:39 same code, didn't change a thing

21:39 only

21:39 well, i'm using the 1.2 version of c.c now

21:39 tomoj: well, my intuitions about why it wouldn't work are that what you are trying is just impossible

21:39 so I must be confused

21:39 slyphon: heh, one sec

21:40 talios: was there a chance in how c.c implemented the method between 1.1 and 1.2? anything on that side that's preventing the change?

21:40 * slyphon checks

21:40 talios: s/chance/change/

21:40 sexpbot: was there a change in how c.c implemented the method between 1.1 and 1.2? anything on that side that's preventing the change?

21:40 tomoj: whoa

21:40 * talios blinks - sexpbot ?

21:40 slyphon: that's a really useless feature

21:41 tomoj: oh, I guess I see what you're trying

21:41 and that it should be possible

21:42 the transaction macro won't expand any differently but will just now call the fn you slipped in, right?

21:42 talios: the (binding) only works on the current thread tho right - is something under your new code thats changing threads?

21:42 slyphon: yes

21:42 no

21:43 nothing is changing threads in my code

21:43 talios: *nod* any AOT compilation?

21:43 slyphon: uhm

21:43 nothing relevant

21:43 the only AOT i do is to generate Exception classes

21:46 there hasn't been a change to that lib between cc 1.1->1.2

21:47 * slyphon looks around for hiredman or chouser

21:50 * slyphon goes back to workin on 1.1

22:03 alexyk: I am using a project with JNI. It needs some libs in /opt/lib. Where do I stick -Djava.library.path in repl invocation?

22:05 lancepantz: alexyk: no different than without

22:05 i just put it as the first option after java usually

22:07 alexyk: are you the same alexy that was talking to my coworker about jiraph?

22:07 vIkSiT: hi all

22:07 alexyk: lancepantz: ah, are you the geni guy too?

22:07 lancepantz: yep :)

22:07 vIkSiT: is anyone here using c.c.string/str-utils/str-utils2?

22:08 alexyk: lancepantz: yeah, I'm engaging in unnatural acts with the said jiraph.

22:08 vIkSiT: I'm trying to figure out why there a) three different libraries and b) why requiring all three still doesn't give me access to chop/re-sub and other functions?

22:08 alexyk: trying to install it properly

22:08 you guys need some leiningen goodness! :)

22:09 lancepantz: i know

22:09 i tried at one point, but all the jni stuff just became a huge pain

22:09 clojurebot: the point of moby dick is "be yourself"

22:09 alexyk: lancepantz: but, it's brilliant. You must give Justin a big raise.

22:09 protobuf works from clojure

22:09 and tokyocabinet does too

22:10 lancepantz: i designed it too ;P

22:10 alexyk: lancepantz: he committed it :)

22:10 then add yourself to the committers on github, these repos will be famous! :)

22:10 I've tried some other crappy TDB bindings and they didn't work at all

22:11 lancepantz: yeah, we've got alot uncommited as well

22:11 alexyk: BTW, I suggest you factor out jiraph.tc as a separate TDB binding

22:11 so folks can use it instead of BDB

22:11 lancepantz: so are you moving from ruby to clojure?

22:11 lancepantz: we have it to where the graph is fully versioned as well, in that you can roll back and forward through modifications

22:12 we also have a rest front end

22:12 alexyk: lancepantz: I was asking Justin about that. He writes that a node exists in all layers. What if nodes are added every day?

22:12 I'd like every day to be a layer

22:12 lancepantz: but yeah, moving from ruby to clojure

22:12 alexyk: and nodes to exist from some day onward; in its own and future layers

22:12 lancepantz: yeah, we were discussing your message earlier

22:12 alexyk: that would allow me to process things like Twitter in parallel very nicely

22:13 so I guess if you version it, you version all layers too?

22:13 lancepantz: the problem with that is that layers are stored in separate tokyo cabinet files on disk

22:13 and its not nearly as fast if your walk has to cross files

22:14 alexyk: lancepantz: ah, hmm.

22:14 lancepantz: its a good idea to never have a walk cross layers

22:15 but yeah, any data is versioned

22:15 we also have a replication system, it uses the revision log

22:17 alexyk: lancepantz: sounds yummy!

22:18 lancepantz: and good advice on factoring out jiraph.tc, thats on our to do list

22:18 we're working on psql backend

22:22 alexyk: lancepantz: psql used to be slower than embedded

22:22 btw why did you drop BDB JE?

22:23 lancepantz: it kept getting corrupted and we couldn't figure out why

22:23 wlangstroth: postgres is awesome (I know that's not helpful or technical, but I'm a postgres fanboy - can't help it)

22:23 slyphon: wlangstroth: huzzah!

22:23 indeed :)

22:24 * slyphon is anxiously awaiting them to release "replication"

22:24 wlangstroth: haha - you just "huzzah"'d me

22:24 slyphon: yeah ... Slony ... *cough*

22:24 slyphon: :D

22:24 man

22:24 i took one look at slony and said "You know, i'll just take a dump every 15 minutes and pray"

22:24 lancepantz: the main idea behind adding psql is to have a single interface to the graph and other data, which we use psql for

22:25 wlangstroth: I'm playing with bup (http://github.com/apenwarr/bup) for replication

22:26 slyphon: no kidding. The difference in quality between postgres and its replication "solution" is vast and disheartening.

22:26 bup isn't production-ready, but it's an interesting angle on the problem

22:27 slyphon: wlangstroth: well, the next release should have something that's better than what mysql has built-in

22:27 yeah, sure, using git as a backup backend is indeed something i've thought about

22:27 wlangstroth: what, version 9.0?

22:27 slyphon: i'm glad to see someone was sufficiently motivated to actually do it :)

22:27 alexyk: lancepantz: did you see cupboard?

22:27 slyphon: uhm

22:27 wlangstroth: 8.5 ?

22:27 oh, maybe it's 9.0 now

22:28 i think they changed the numbering

22:29 lancepantz: alexyk: justin looked at it, i can't remember what the issue with it was

22:29 wlangstroth: yeah. I just switched up to 8.4 about two months ago - lots of excellent changes

22:29 alexyk: lancepantz: works like a charm for me

22:30 lancepantz: alexyk: are you using it for your graph work?

22:30 alexyk: yep. very cute and perfect for any clojure data

22:30 except reading is slower even with N threads; but faster than Mongo

22:32 wlangstroth: slyphon: do you do a lot of database work?

22:32 slyphon: yeah, i mean, on and off

22:33 depends on the project

22:33 wlangstroth: right, otherwise you'd be a dba

22:33 slyphon: hahahaha

22:33 lancepantz: alexyk: if you ever put together any benchmarks of what you've evaluated, i'd love to see them

22:33 slyphon: god forbid!

22:33 wlangstroth: I wasn't going to say it, but ... yeah

22:33 slyphon: hahaha

22:33 lancepantz: alexyk: i'm anxious to do jiraph vs neo4j

22:34 alexyk: lancepantz: would be interesting, but in fact my graphs fit my small RAM of 64 GB so I only need to slurp them whole

22:34 hence TDB seems good choice

22:34 lancepantz: according to some published neo4j benchmarks, we should be 10x faster, but i'm not sure how dated and accurate they were

22:34 alexyk: I don't want to walk no disks

22:34 neo4j had a lot of progress lately

22:35 wlangstroth: slyphon: I met a guy at a conference whose bread-and-butter is FoxPro. Remember FoxPro?

22:35 * slyphon throws up a little in his mouth

22:35 slyphon: jesus

22:35 "Career FAIL"

22:35 alexyk: lancepantz: did you guys buy the Mormon database :) ?

22:36 * alexyk passes some Oral-B to slyphon

22:36 wlangstroth: slyphon: you'd think, but the guy was doing really well! He was hiring!

22:36 lancepantz: alexyk: we took a different approach, neo4j stores incident edges seperate from the nodes, while we store the edges on the nodes themselves, so theoretically we'll have far less seeks on an equivalent walk

22:36 slyphon: wow

22:36 just...wow

22:36 alexyk: :)

22:37 alexyk: lancepantz: yeah, those nasty "relationships" bothered me for a simple graph

22:37 wlangstroth: alexyk: are you playing with neo4j at all?

22:38 alexyk: wlangstroth: tried to, didn't go far; BDB JE solved my simple needs and now jiraph looks promising

22:38 but "one of these days"

22:38 slyphon: oy

22:38 BDB?

22:38 * slyphon shudders

22:38 alexyk: cupboard rules

22:39 slyphon: i had some *bad* experiences w/ BDB + python back in the day

22:39 wlangstroth: alexyk: ah, gotcha - I'm testing out some of these systems, but I don't have the billion-row data-sets to really do any of them justice, so I'm asking around.

22:40 alexyk: bbl

22:41 * wlangstroth is looking up bdb

22:42 defn: FoxPro?! hahahahaha.

22:42 lancepantz: bdb and neo4j aren't really for the same problem

22:42 i think his point was that his graph was simple enought that neo4j was overkill

22:43 slyphon: wlangstroth: "berkley db"

22:43 aka "sleepycat"

22:44 lancepantz: aka, older, slower, more corruptable version of tokyo cabinet :P

22:44 wlangstroth: Oh, okay

22:44 only ... in Java. Um ... dear God, why?

22:46 defn: no kidding - the reason he was doing a bunch of conferences is that Microsoft is dropping support in 2015

22:46 defn: no wonder MS is tanking these last 10 years

22:46 they still support foxpor

22:46 pro

22:47 MS management is so out of touch

22:48 wlangstroth: dude's making more than I do, so I'm not going to judge. But yeah.

22:48 alexyk: hey stop pooping ob BDB JE. Java Edition completely rewritten in, well, Java. Threads, transactions, very well-understood and supported. I never had any problems with JE. Operate your machinery well! :)

22:48 Tokyo Cabinet is a C monster you try to stick your little JNI in. JE is pure Java

22:49 wlangstroth: alexyk: hey, that's cool, I wouldn't personally be motivated to re-write berkley db in java myself, but to each his own.

22:49 alexyk: tc is a pain in the neck installing, that's what anyone who tries to build jiraph will quickly realize and remember forever! especially how it priduces wrong mach-o on snow leopard out of the box

22:50 defn: wlangstroth: i know lots of people who make a lot of money doing boring antiquated garbage that no one else in their right mind would continue to support

22:50 i just feel sorry for them

22:50 alexyk: I suggest folks try cupboard off github

22:50 some guy is optimizing IDB/360 assembly language... inside a simulator on Windows.

22:50 now that's job security

22:50 IBM/360 I meant

22:51 wlangstroth: I guess some people just want the cheque and don't get bored. I envy them, in a way.

22:52 360 assembly ... that's nerd wizardry

22:52 DeusExPikachu: i'm grabbing clojure's classloader through (.get clojure.lang.Compiler/LOADER), but calling (.addURL ... file) doesn't seem to do anything, ie I can't (require) new packages

22:52 defn: wlangstroth: i dont. those people are slaves. drones. boring rat race paper chasing buffoons.

22:53 now let me tell you how i /really/ feel!

22:53 alexyk: the guy optimizing assembly of a nonexistent machine is a genius

22:53 wlangstroth: alexyk: agreed

22:54 defn: if you like programming, those people seem like strange imposters, it's true

22:54 talios: wasn't addUrl() support removed?

22:54 * alexyk grabbed the domain "clojure.pro" today for $30. Dunno why, or what for.

22:54 DeusExPikachu: how do I add new jars and source directories so the classloader sees it? (also with the above methods, checking the URLs with .getURLs seems to not do anything

22:54 using 1.1.0

22:55 defn: wlangstroth: it's more than that to me. i think they actually undermine the work of serious programmers and engineers.

22:56 wlangstroth: i dont even want to be associated with people who dont treat this stuff as art

22:56 DeusExPikachu: s/do anything/return anything different before and after .addURL

22:56 defn: it's like a doctor who, in the process of practicing medicine, manages to slowly kill his patients

22:57 lancepantz: hahahah

22:57 wlangstroth: DeusExPikachu: not ignoring you, just can't help - using leiningen

22:57 defn: DeusExPikachu: same here

22:57 DeusExPikachu: wlangstroth, np, just getting it out there

22:58 wlangstroth: defn: it's more like a psychiatrist who gradually drives his patients insane, because that's what actually happens

22:58 alexyk: DeusExPikachu: why are you grabbing the loader? Do you like to grab loaders?

22:59 wlangstroth: I've worked with crappy programmers (or overly-clever programmers) and insanity is what ensues

22:59 defn: wlangstroth: haha

22:59 DeusExPikachu: alexyk, trying to design a "clojure distribution", so I need a way to do custom modifications of classpath during runtime

23:00 alexyk: DeusExPikachu: cool! I was that mentioned a few times, adding to classpath from the repl here, but don't remember now

23:00 defn: im a crappy programmer in that im not the fastest most productive guy on the team, but what i have that a lot of the people i encounter don't is: I take this stuff real seriously. I can usually tell a legit programmer from a fake by asking them what they hack on outside of work, where they host their public repos, etc.

23:01 wlangstroth: I think in 1.1.0, there's a classpath function - let me check

23:01 DeusExPikachu: alexyk, I already got basic repository functionality and dependency resolution working, just want to be able, at first, to start projects without using much scripting

23:01 defn: "I've got a wife and kids-- I don't have time to program outside of work." <--asshole

23:01 slyphon: i don't think you can modify the classpath at runtime

23:01 alexyk: the fact about crappy programmers is, a good one is 1000x better than a bad one. That's why programming is so skewed. A good startup with 3 people can beat an offshore farm of a 100.

23:02 slyphon: alexyk: that's been my argument against PHP for a looooong time

23:02 defn: i wrote some PHP last night. oh god was it painful.

23:02 alexyk: defn: sounds like a reasonable guy to me :)

23:02 DeusExPikachu: slyphon, you're right you can't, but clojure uses an extension of URLClassLoader, which can arbitrary URLs to load from

23:02 defn: alexyk: i just dont understand how when you get home from work, you dont hack around on a little project or something

23:02 slyphon: ah

23:02 wlangstroth: http://richhickey.github.com/clojure/branch-1.1.x/clojure.core-api.html#clojure.core/add-classpath

23:03 alexyk: defn: how about you put kids to bed and spend time with your wife? :)

23:03 slyphon: DeusExPikachu: ok, you're obviously more aware of what's goin on than me :)

23:03 defn: i have a girlfriend i live with and we seem to balance my nerdery and our life together pretty well -- i mean i can see kids complicating that pretty significantly, but i still think id be sitting on the couch with my kid while they watch Dora the Explorer, and I'd be reading a programming book

23:03 alexyk: and you become 10x more productive at work. E.g. devnull slashdot and all other websites. Don't use browsers for anything other than API docs. :)

23:04 wlangstroth: defn: you're not a crappy programmer. Crappy programmers are ... something else

23:04 slyphon: defn: kids don't end your life

23:04 defn: i made that mistake

23:04 thinking that

23:04 alexyk: defn: before they get to Dora, you need to kind of make sure they grow there :)

23:04 defn: ahhhh yes!

23:04 they need attention, do they?

23:04 slyphon: alexyk: argh! dora!

23:04 eh

23:05 ;)

23:05 wlangstroth: haha! Dora! That evil ... wait, is Lau on?

23:05 alexyk: slyphon: I have no TV and my kid was lost at Disney World. Like, who *are* all these people?

23:05 slyphon: alexyk: i don't know how they get the audio on that cartoon to be SO DAMN PIERCING!

23:05 every time i hear her voice i wanna run into the next room

23:06 defn: i hate to use this, because it is a bit of a cliche, but a programmer without passion is like... clojure without map

23:06 alexyk: wlangstroth: is there a Danish version of Dora Lau should be especially familiar with? :)

23:06 * defn snickers

23:07 alexyk: defn: yeah! a programmer must be obssessed. I woke up at 2 am last night to torture jiraph into submission. (Thanks lancepantz...:)

23:07 wlangstroth: alexyk: naw, he's just sensitive to the language, and Dora brings out the sailor just a bit. It's an awful show.

23:07 slyphon: wlangstroth: yeah, what's up with that?

23:07 wlangstroth: i was gobsmacked that he actually reprimanded me for saying "f**k" in the channel the other day

23:07 alexyk: or is Lau in love with Dora?

23:07 slyphon: on *IRC* ffs!

23:07 replaca: cemerick: are you in here?

23:08 defn: alexyk: exactly. it's that insane (literally) and often disgusting drive that you get when you're knee deep in some hackery. there will be no stopping at 5pm. no stopping at 10pm. no stopping until it works.

23:08 DeusExPikachu: wlangstroth, I went to the source, and it just calls clojure.lang.RT.addURL, which when I check that, gets the classloader as I tried before, call Thread.currentThread().getContextClassLoader(). Actually I noticed there are like 5 classloaders in the runtime, and the most childish is from clojure.lang.Compiler/LOADER

23:08 slyphon: defn: it's that drive that makes you go past the point where it hurts

23:08 alexyk: defn: kids tend to moderate that, but that stays. You just become 100x more effective. And you don't pick wrong fights. :)

23:08 wlangstroth: slyphon: meh. He's one of the cool kids, so I'm not saying anything.

23:09 slyphon: wlangstroth: i was just surprised, that's all

23:09 wlangstroth: nothing against him

23:09 wlangstroth: slyphon: course not - he's hilarious

23:09 slyphon: :)

23:09 * alexyk makes a note to tease Lau about Dora. Maybe it's his aunt't name or something.

23:10 DeusExPikachu: the main problem I have right now is why does (.addURL classloader-from-above URL) doesn't change the result of (.getURLs classloader-from-above)?

23:10 defn: alexyk && slyphon: http://www.youtube.com/watch?v=iMjG2s6UOaw This is how I feel about "going past the point where it hurts."

23:10 sexpbot: "YouTube - Arnold Pumping Iron funny clip"

23:11 defn: damned sexpbot ruining the surprise

23:11 slyphon: hahah

23:11 DeusExPikachu: defn, hey you know that's my governor

23:11 slyphon: the Governor of California, ladies and gentlemen

23:11 * defn chuckles

23:11 defn: at least he's not soliciting gay sex in airport bathroom stalls

23:11 slyphon: *that guy* has the power to grant clemency

23:12 wlangstroth: DeusExPikachu: hehe. does it work?

23:12 defn: not that there's anything wrong with being gay or having sex. it's the airport bathroom that really muddies the situation.

23:12 slyphon: hahaha

23:13 wlangstroth: Ahnuld does not grant clemency. If you can survive the electric chair, you're free to go.

23:13 DeusExPikachu: wlangstroth, which add-classpath? no :(

23:13 defn: also, wlangstroth && slyphon -- #clojure-casual exists so we dont have to endure the wrath of Lau

23:13 slyphon: ah

23:13 wlangstroth: DeusExPikachu: bah! I was hoping for some magic-by-obscurity

23:14 alexyk: is there a #clojure-confidential?

23:14 slyphon: alexyk: we could tell you, but then we'd have to k...tell you

23:15 alexyk: slyphon: hmm, apparently there is!

23:15 wlangstroth: wow, a lot has changed since 1.1.0. I haven't even looked at 1.1 before

23:15 slyphon: alexyk: hah

23:15 !

23:18 wlangstroth: DeusExPikachu: if you search the irc logs on http://clojure-log.n01se.net/ for add-classpath, there's a ton of discussion about it

23:18 sexpbot: "#clojure log - May 05 2010"

23:18 DeusExPikachu: that's today

23:18 but yeah i'm searching

23:19 slyphon: y'know what would be useful, something that would check a namespace for unused imports/requires

23:20 defn: slyphon: that'd be darned handy

23:20 slyphon: i mean, totally overy *my* head :)

23:21 defn: slyphon: maybe something to mention to tcrayford for clojure-refactoring

23:21 slyphon: defn: i'll keep it in mind

23:21 defn: maybe it would refactor your ns macro to do :only for the used functions

23:21 slyphon: oooh

23:22 defn: i dont think that's actually all that difficult slyphon

23:22 ,(ns-interns 'clojure.contrib.pprint)

23:22 clojurebot: {english-ordinal-units #'clojure.contrib.pprint/english-ordinal-units, pprint-map #'clojure.contrib.pprint/pprint-map, compiled-format6472 #'clojure.contrib.pprint/compiled-format6472, parse-lb-options #'clojure.contrib.pprint/parse-lb-options, formatter-out #'clojure.contrib.pprint/formatter-out, process-directive-table-element #'clojure.contrib.pprint/process-directive-table-element, formatter #'clojure.contrib.pprint/fo

23:23 defn: for example

23:23 slyphon: hrm

23:23 yeah, but then you gotta analyze the code to pull out all the fn calls

23:24 and compare them to the stuff in :use

23:24 defn: yeah but that wouldn't be too difficult, just go line by line for the file

23:24 it's like a fancy rename for namespacen

23:26 DeusExPikachu: hmm I was reading (.getURLs wrong) need to use map or something to iterate through it to get at its values, it is actually getting stored, the problem now then is how do I load the URL?

23:27 defn: ,(map #(str (first %)) (ns-interns 'clojure.contrib.pprint))

23:27 clojurebot: ("english-ordinal-units" "pprint-map" "compiled-format6472" "parse-lb-options" "formatter-out" "process-directive-table-element" "formatter" "right-bracket" "arg-navigator" "check-arg-conditional" "set-indent" "conditional-newline" "process-bracket" "special-chars" "downcase-writer" "defdirectives" "translate-param" "pprint-simple-list" "pprint-array" "flag-defs" "execute-format" "iterate-list-of-sublists" "pprint-agent" "

23:30 replaca: defn: you can load the namespace, do an ns-map, look at each symbol to see where it came from, and generate the use from that

23:38 vIkSiT: hmm, how would you use a regex to find a word that is enclosed between two characters (say, *)?

23:39 slyphon: [*][-0-9a-zA-Z]+[*]

23:39 is one way

23:39 vIkSiT: I've got a regex that finds the word _with_ those characters .. (re-find #"\*[a-z]+\*" "this is a *test* statement"))

23:39 slyphon: vIkSiT: you need to capture

23:39 #"\*([a-z]+)\*"

23:39 then pull out $1

23:40 vIkSiT: slyphon, hmm, how do you define "pull out $1" btw?

23:40 slyphon: heh, sorry

23:40 MadWombat: well, if the character is *, #"\*\S+?\*" should do the trick

23:40 * slyphon 's ruby rewts are showing

23:41 vIkSiT: hehe

23:41 MadWombat, hmm that doesn't seem to work for me

23:41 MadWombat: or #"\*(\S+?)\*" if you want capture groups

23:41 lemme actually try

23:42 vIkSiT: interesting. so the latter gives me a list of two elements

23:42 (and I can get the second of that list)

23:42 MadWombat: user> (re-find #"\*\S+?\*" "This is a *test* of regex")

23:42 "*test*"

23:42 user> (re-find #"\*(\S+?)\*" "This is a *test* of regex")

23:42 ["*test*" "test"]

23:43 works for me

23:43 slyphon: ,(clojure.contrib.str-utils/re-sub #"\*(\w+)\*" "$1" "*this*")

23:43 clojurebot: "this"

23:43 MadWombat: slyphon: ah! the bots help :)

23:43 slyphon: :)

23:44 vIkSiT: slyphon, ah interesting

23:44 slyphon, how does that $1 work here?

23:44 slyphon: it just means "the first capture group"

23:44 MadWombat: vIkSiT: well, with re-find you don't have to pull in yet another piece of contrib :)

23:44 slyphon: MadWombat: totally

23:45 mine was just to demonstrate what i meant by $1

23:45 vIkSiT: ah

23:45 slyphon: which is kind of a perlism

23:45 vIkSiT: actually, i do need to a substitution later :)

23:45 MadWombat: yes

23:48 and to complete this (re-seq #"\*(\S+?)\*" "This is a *test* and *another* of regex")

23:48 ,(re-seq #"\*(\S+?)\*" "This is a *test* and *another* of regex")

23:48 clojurebot: (["*test*" "test"] ["*another*" "another"])

23:51 vIkSiT: ah yes re-seq is awesome

23:52 ,((second (second (["*test*" "test"] ["*another*" "another"]))))

23:52 clojurebot: java.lang.IllegalArgumentException: Key must be integer

23:52 vIkSiT: hmm

23:52 DeusExPikachu: hmm looking at the sources, specifically RT.java, I think I know why adding to addURL doesn't do anything, cause clojure never calls findClass or findResource, which is the only methods that implement the newclasspath functionality

Logging service provided by n01se.net