#clojure logs

2010-05-05

00:01alexyktechnomancy: what does :namespaces expect? ['a 'b] ?
00:07technomancyalexyk: like that but with no quotes
00:07technomancyI think
00:07technomancyI don't really do AOT much
00:08slyphonhmm
00:08alexykah
00:08slyphonit'd be nice to be able to have some control over the threadpool agents used
00:09slyphonuse differnt pools for different tasks
00:14alexyktechnomancy: 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?
00:18jkkramerslyphon: re your cron question, i came across this today: http://github.com/stuarthalloway/orolo/blob/master/src/orolo/periodically.clj
00:18slyphonoh, nuts
00:18slyphon1.2 probably
00:19slyphonjkkramer: i'll make a note of this though
00:19jkkrameryeah, uses protocols
00:21slyphonhrm, could probably be done w/o protocols
00:21slyphonsince i don't need the JMX goop
00:22jkkramerslyphon: looks like there's an older version based on 1.1 -- http://github.com/stuarthalloway/orolo/blob/2848ddb63ee3bd635e56c0fbd1e46a558bee6c52/src/orolo/periodically.clj
00:22technomancyalexyk: I think you can set :source-path in project.clj
00:23alexykkk
00:23technomancyhugod: hey, I am getting exceptions without stacktraces on your hyperdoc branch; have you tried it since the changes in clojure 1.2?
00:24eslickAnyone having trouble with recent changes to 1.2?
00:24hugodtechnomancy: I haven't tried it recently
00:24technomancyeslick: it's certainly confused a number of people
00:25technomancyhugod: I did merge the compile-file branch though; seems to work great
00:26alexyktechnomancy: the clojure-protobuf project wants to run proto compiler to generate Java. How can I stick that into lein?...
00:26technomancyI'm not sure what that is
00:26hugodtechnomancy: I saw. Thanks!
00:27alexyktechnomancy: basically google protobuf compiler taking a spec and generating java. Then that java is used in clojure. ant does it with an exec step...
00:28technomancyalexyk: I see. you can write custom lein tasks that call out to the ant exec api no problem
00:28technomancyalexyk: see http://github.com/antoniogarrote/lein-javac for an example
00:30alexykcool
00:40replacatechnomancy: 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.
00:40technomancyreplaca: also an option
00:40replacathis is basically what I do to manage the various version of clojure itself
00:40technomancyreplaca: the cost/benefit tradeoff is really going to depend on how many people stick with 1.1 though
00:41replaca(which would mean in the end we'll be going three layers deep)
00:41replacawell, hopefully 1.2 isn't the end of the road
00:41technomancyreplaca: look into the eval-in-project function in leiningen/compile.clj for one way to do that
00:41technomancytrue
00:41replacatechnomancy: ahh, thanks for the pointer
00:59slyphonhrm
01:00slyphonit's undocument that *agent* is set to the current agent when the send-off fn is running
01:00slyphonundocumented*
01:00slyphonis that on purpose? i.e. should one not rely on that behavior?
01:06imran_srclojure 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?
01:06imran_sr(thought I might just jump in ask, rather than ask to ask ... )
01:06hiredmanyeah, you have to read the javadocs for Pattern
01:06hiredman(there is a flag, but I forget)
01:07imran_srI'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!)
01:07sexpbot"Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)"
01:08imran_srhiredman: I'll check out the javadocs for util.regex
01:09hiredmanI think it's on Pattern
01:10hiredmanhttp://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#MULTILINE
01:10sexpbot"Pattern (Java Platform SE 6)"
01:11imran_srhiredman: thanks mate. Was looking at that page while you said that :)
01:12imran_srso I embed (?m) into the pattern
01:17imran_srhiredman: hmm, still not working. Do I use it like this? #"(?m)my_re_pattern"
01:17tomojI want a pair of giant parentheses I can wield
01:17hiredman,(re-find #"(?m)foo\nbar" "foo\nbar")
01:17clojurebot"foo\nbar"
01:18imran_sr(re-seq #"(?m)........" <a multiline string>)
01:18hiredman,(re-find #"(?m)......." "foo\nbar")
01:18clojurebotnil
01:18hiredman,(re-find #"(?m)......" "foo\nbar")
01:18clojurebotnil
01:18imran_srhey, is that clojurebot evaluating expressions? :)
01:18hiredman,(re-find #"(?m).*\n.*" "foo\nbar")
01:18clojurebot"foo\nbar"
01:18hiredmanyes
01:19imran_sr:)
01:19hiredmanI'm pretty sure this whole multiline regex thing has been done before, but maybe chouser was here
01:20hiredman,(re-find #"(?m)....." "foo\nbar")
01:20clojurebotnil
01:20hiredman,(re-find #"(?m)....." "foo")
01:20clojurebotnil
01:20hiredman,(re-find #"(?m)..." "foo")
01:20clojurebot"foo"
01:20hiredman,(re-find #"(?m)....." "foo\nb")
01:20clojurebotnil
01:20imran_srhiredman: nope, not working
01:21imran_srhmmm
01:21hiredman"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"
01:21hiredmanwe all so need the DOTALL flag, whatever that is
01:22hiredman,(re-find #"(?ms)....." "foo\nb")
01:22clojurebot"foo\nb"
01:22imran_sr.(re-find #"(?md)foo" "fo\no")
01:23hiredman,(= "," ".")
01:23clojurebotfalse
01:25imran_sr.(re-find #"(?md)foo" "a \nfoo b")
01:26hiredman,(= \, \.)
01:26clojurebotfalse
01:28imran_srhiredman: 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).
01:29uberjardo 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.
01:29uberjar""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)."
01:30uberjareach week they put something else that was public behind a pay wall.. they started with solaris..
01:32uberjarI hope you all can get used to OpenJDK :)
01:37tomojhmm
01:37tomojwouldn't there be riots?
01:38tomojmass panic?
01:48uberjaryes
01:48uberjarwell in theory they would only put new version of the JRE behind the pay wall
01:48uberjarso it wouldn't be a massive panic all at once
01:49uberjarjust a slow growing disguist
01:49uberjardisgust
01:50uberjarit'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
01:50slyphonoh good god
01:51slyphonthey're messing with people who bought sun hardware
01:51slyphonnot java developers
01:51slyphon*huge* difference in the markets
01:53uberjaryou never know.. is all I'm sayin.. you never know :)
01:53slyphonFUD
01:55slyphonargh
02:06LauJensenGood Morning all
02:10zmilarainy morning
02:12LauJensenDoes Brian Carper hang out here?
02:52uberjarThese two strings walk into a bar and sit down. The bartender says, "So what'll it be?"
02:52uberjarThe first string says, "I think I'll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy owmc63^Dz x.xvcu"
02:52uberjar"Please excuse my friend," the second string says, "He isn't null-terminated."
02:55tomoj:D
03:10unfo-lol\0
03:12LauJensenIm getting a failure trying to fetch
03:12LauJensenDownloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from central
03:12LauJensen
03:12LauJensenAnybody else having that issue?
03:13LauJensen(ie., didnt have it yesterday, came after flushing .m2)
03:14LauJensenIf 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/"
03:14LauJensenI may have over complicated, but that should be traceless on your system
03:15LauJensen$ping repo1.maven.org
03:15sexpbotCommand not found. No entiendo lo que estás diciendo.
03:15LauJensenI think I definately overcomplicated, seems maven-central is down
03:17maravillasi was able to download it fine with an otherwise empty project
03:18LauJensenmaravillas: can you ping repo1.maven.org ?
03:18maravillaslooks up from here
03:18LauJensenah it just came back up I see
03:18maravillas:)
03:19LauJensenThanks for digging in though :)
03:19maravillasnp
03:29LauJensenhugod: ping
03:52zmilahow to add doc-string to a def?
03:53zmila,(def the-rules #^{:doc "the rules"} [ [] ,,, [] ])
03:53clojurebotDENIED
04:00unfo-i lol'd at that :D
04:14zmilai'm in the top 5th of clojurians at Project Euler :) heh
04:20jowagis there some idiom for (not (nil? x)) ? or this is the correct way to check for non-nil values
04:20_atojowag: just x
04:21tomojeh
04:21_atoif you need a boolean:
04:21jowagyep, I need a boolean
04:21_ato,(boolean 1)
04:21clojurebottrue
04:21_ato,(boolean nil)
04:21clojurebotfalse
04:21tomoj,(boolean false)
04:21clojurebotfalse
04:21tomojfalse is a non-nil value
04:22tomojunless you're looking for truthy values..
04:22tomojhaving booleans around kinda sucks I guess
04:22_atowell yeah if you really mean non-nil rather than truthy there's not nothing better than (not (nil? ...))
04:24jowagthank you
04:36tomojwhoa
04:37tomoj,'''foo
04:37clojurebot(quote (quote foo))
04:37tomoj,```foo
04:37clojurebot(clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list (quote sandbox/foo))))
04:37tomojI feel like I might have understood that at one point
04:37tomojbut not tonight
04:40tomojif you (count (flatten `'`'`'`'foo)) is 261
04:54tomoj,`````[]
04:54clojurebot(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
04:56tomojhmm
04:56tomoj,``````[]
04:56clojurebotjava.lang.StackOverflowError
04:56tomojweird, I get: java.lang.ClassFormatError: Invalid method Code length 162261 in class file user$eval__7
04:59LauJensenin 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}]))) ?
05:08jowagI'm trying to prevent concurrent access to InputStream object, is using "locking" macro a good approach, or should I use something else?
05:10LauJensenjowag: wrap it in an atom
05:14jowagLeuJensen: but swap! may retry, so I cannot read from InputStream inside swap!
05:20LauJensengood point
05:20LauJensenjowag: would dosync+ensure not work? Thats a lock in itself
05:23jowagLauJensen: 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
05:28LauJensenI 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
05:29Chousukejowag: use an agent if you can, but I suppose there's nothing wrong with the locking macro either if nothing else works.
05:31jowagok 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.
05:31Chousukeany object will do
05:32Chousukeyou could use the InputStream itself as the monitor I guess.
05:35jowaghmm, interesting
06:15cschreinerWhy wont this work? (lambda () (interactive) (mark-defun) (kill-region))
06:19defn:)
06:21defn,`[]
06:21clojurebot[]
06:21defn,``[]
06:21clojurebot(clojure.core/apply clojure.core/vector (clojure.core/seq (clojure.core/concat)))
06:21defn,```[]
06:21clojurebot(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))))))))))
06:45eliantorhi
06:51eliantorquestion: 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?
07:11powr-tocDoes anyone know how to get slime-connect to redirect system output from other threads to my slime repl?
07:12powr-tocit 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
07:18_atopowr-toc: maybe try running this in the repl you want the output to go to: (alter-var-root #'*out* (fn [_] *out*))
07:24powr-toc_ato: hmmm nice trick... but it doesn't seem to work for java libraries using System.out
07:25powr-tochmm maybe I can call System/setErr
07:27_atoyeah, not sure what you can set it to though
07:28powr-tocyeah, not sure how to convert a PrintWriter to a PrintStream
07:32ivenkysgents 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 ?
07:34powr-tocivenkys: does it not return a seq of maps?
07:35ivenkyspowr-toc: seq of maps .. hmm , i might have missed a paren,,, let me check
07:36powr-tocivenkys: I think each tag is effectively described as a map
07:38ivenkyspowr-toc: yup - you are right - map of sequences . sorry abt the newb question
07:38ivenkyspowr-toc: thanks
07:43powr-tocno probs
07:43powr-toctop tip: functions with the word seq in them usually return sequences ;-)
07:44powr-tocor operate on them
07:46cemerickIs it the case that protocol fns cannot be rebound?
07:48cemerickillustration: https://gist.github.com/31dcb5bd2cacb7ef29ad
08:29jfieldsis there a function to return the value from a map or a specified default if one is not found?
08:29chouser,(get {:a 1} :b :not-found)
08:29clojurebot:not-found
08:30chouser,({:a 1} :b :not-found)
08:30clojurebot:not-found
08:30chouser,(:b {:a 1} :not-found)
08:30clojurebot:not-found
08:30chouserjfields: a few. :-)
08:30jfieldsoh, that was obvious, sorry :)
08:41chousercemerick: protocol methods have call-site caching magic that is defeating the dynamic binding
08:41chouserthe var is indeed rebound, but the call site was already compiled to point to the protocol method
08:41cemerickchouser: I figured.
08:41cemerickOh, maybe your latest post is relevant?
08:42chouserhm... not sure
08:42cemerickhrm, probably not. call-site caching != direct var linking
08:50dfa2which version of git I should use on windows?
08:51dfa2(the most recent msysgit release is in 2009, it is good?)
08:52dfa2forgive me, solved :)
09:03jfieldsthere doesn't seem to be a way to set a default for (get-in {:a {:b 1}} [:a :b]) though
09:04carkhbut, why are you putting nils in your maps anyways ?
09:04jfieldsI'm not, but sometimes I need to ask for keys that don't exist. e.g. (get-in {:a {:b 1}} [:c :b])
09:05carkhso if it returns nil, then you know there was nothing there
09:05carkhsince you know that you don't put nil in there
09:05jfieldssure, so (or (get-in {:a {:b 1}} [:c :b]) :default) is the best plan then?
09:05carkhbut why do you need that :default return value ? nil is pretty usefull in itself
09:06carkhbut yes, when you do need a default value, or is the way to go
09:22basilarheyup, new here... quick question...
09:22basilaris 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}?
09:25stuarthallowaybasilar: otherwise {:keys [a b c]} wouldn't work
09:25stuarthallowayand, btw, :keys eliminates a ton of explicit k/v destructures
09:27basilarcheers, that makes perfect sense.
09:40AWizzArdstuarthalloway: does Lancet have dependencies, such as ant/maven?
09:44stuarthallowayAWizzArd: it is build on Ant
09:44ivenkysAWizzArd: it depends on Ant
09:44stuarthallowayand, I should mention, unsupported
09:48AWizzArdok
09:56cemerickis it the case that enlive transformations are lazy now?
10:11lpetithello, would a keen mind help an outdated clojure follower understand what is behind the laconic sentence "last var wins" ?
10:13chouserlpetit: previously, 'use'ing a var with the same name from two different namespaces was a compile-time exception.
10:13chouserNow it is a warning, and whichever one is pull in last wins.
10:19alexyklet the varest var win
10:20lpetitchouser: ok, the last var is "reinterned" in the ns, something like this ?
10:20sparievalexyk: or, should we say, (let [(varest? var) :win]) :)
10:21alexyksurvival of the latest
10:22lpetitchouser: 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:22stuarthallowayI am about to send a long email to the mailing list
10:22lpetitstuarthalloway: yes ?
10:22stuarthallowayI like "last var wins" but the shortest accurate statement is ...
10:23stuarthalloway"attempting to define or refer a var that is already referred from another namespace causes a *warning*, not an *error*"
10:23alexyklast var warns :)
10:23alexykto err is human; to warn is divine
10:24lpetitchouser, stuarthalloway: and what is the rationale for this move ?
10:24cgrandbut isn't "last var wins" the road to more :use without :only?
10:26lpetit"(use 'ns1) (shared-fn-name ...) (use 'ns2) (shared-fn-name ...) (use 'ns1 (shared-fn-name ...) " ;)
10:27stuarthallowaycgrand: no, you will want to eliminate the warnings
10:34stuarthallowayjust posted to the mailing list. I have 15-20 minutes to hang here and discuss if anyone has suggestions/questions/comments/rotten tomatoes
10:36chouserI like the all-caps single quote. :-)
10:37chouserstuarthalloway: nice writeup, thanks.
10:40stuarthallowaychouser: does it scare you that you can now (more easily) disregard vars in core?
10:40arohnerstuarthalloway: I like the solution
10:40chouserhm, I don't *feel* scared.
10:42cgrandstuarthalloway: 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:42chouserno, 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:42stuarthallowaycgrand: in that scenario they get a warning
10:43chousercgrand: 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:43stuarthallowaychouser: right
10:44stuarthalloway...and, if they know it is safe, they can continue to get shit done and fix the warning tomorrow
10:44stuarthallowayor work with the lib provider to do so
10:44chouserthe only reason it's even come up for clojure.core is because we implicit naked use that all the time
10:44chouser...despite my earnest attempts to talk people out of it.
10:45s450r1could the last-var-wins policy be configurable?
10:45stuarthalloways450r:1: I proposed that too
10:45arohners450r1: what advantage would that provide?
10:45stuarthallowayand, in fact, it is an interesting motivating case for a condition system
10:45chouser,(require '[clojure.core :as core])
10:45clojurebotnil
10:45chouser,(core/prn (core/get {::a 1} ::a))
10:45clojurebot1
10:45chouser:-)
10:46replacastuarthalloway: do you want me to take that pprint doc on clojure.org ticket since it's really an autodoc ticket?
10:46s450r1arohner: you could use last-var-wins during development and then turn it off when testing something you want to release to double-check
10:47stuarthallowayconfiguring it back to an error might ease the minds of uptight folks: warn during beta, err during release
10:47stuarthalloways450r1: but on balance, not worth the complexityu
10:47stuarthallowayadding a mutable setting to double-protect against people that won't heed warnings doesn't feel very Clojurish
10:47cgrandstuarthalloway & 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:47stuarthallowayreplaca: yes please
10:48replacastuarthalloway: k
10:48chouserthe 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:48stuarthallowayreplaca: 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:48chouserand the cliff-jumping sort could make all the warnings disappear.
10:49chouser...all without adding the complexity of a real config option.
10:49stuarthallowaycgrand: we should make sure that the style guide in assembla strictly forbids naked use
10:49stuarthallowayand we should make sure to call it "naked use", good use of negative connotations
10:50fogus_Hmmmm.. I guess it depends on your view of nakedness
10:50chouserfogus_: that's why we don't call it "nude use"
10:50stuarthallowaychouser: good luck getting rhickey to go to even that trouble on behalf of the foolish :-)
10:51stuarthalloway"terrorist use"?
10:51replacastuarthalloway: that's the way that autodoc finds "additional" docs (except that it's broken right now cause of the oter changes I mentioned)
10:51fogus_"crass use"
10:51s450r1"shotgun use"?
10:51chouser"promiscuous use"
10:51replacawe can add docs there for any namespaces and they will get attached to the namespace in the autodoc
10:51stuarthallowayheh, amusing to see people's guesses at a "universal negatively connoting word"
10:52ordnungswidrigquick: where is the presentation where rich is deriving that oo is doing state wrong?
10:52fogus_stuarthalloway: Whenever you are lazy about :use the terrorists win
10:52stuarthallowayreplaca: great, thought maybe that was it and hadn't checked, we should use it more
10:52lpetitchouser, stuarthalloway: thanks for the explanations. Makes sense to me, in a dynamic language, to prefer warnings over errors when possible
10:53wlangstroth"naked" already has *kind-of* that connotation in trading
10:53stuarthallowaycgrand: you happy? semi-happy?
10:53s450r1I like last-var-wins better than getting an error too.
10:53cgrandwhat about deprecating (warning in 1.2) naked use?
10:54s450r1cgrand: I was just about to suggest that :-)
10:54stuarthallowaywould love to cemerick's view as well, hoping that with last-var-wins we can defer :as-of for now
10:55stuarthallowaycgrand: that feels unclojurish to me
10:56stuarthallowaynaked use is not a great idea, but "never" is a bit strong
10:56replacastuarthalloway: yeah, we should :-). But I should get it working agian first! :)
10:57stuarthallowaylpetit, if you get a chance can you see if the latest labrepl is ok in ccw?
10:57lpetitI 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:57stuarthallowayI think the pom.xml was pointing to the wrong contrib
10:57lpetitstuarthalloway: ok, tomorrow evening I hope
10:58stuarthallowaydoes anybody here have the ability to nuke artifacts on the CI box?
10:58cemericklast-var-wins seems remarkably dangerous to me
10:58stuarthallowayI have admin access but not ssh access, so maybe I can do it myself...
10:58fogus_lpetit: I always start with naked use
10:59stuarthallowaycemerick: what's your worst-case scenario?
10:59cemerickstuarthalloway: I'm trying to talk myself off the cliff.
10:59lpetitfogus_: so do I, incremental and interative development. I like it.
11:02cemerickOK, 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:02ordnungswidrigw
11:03cemerickWhat happens when you refer to a core fn on line 100 of a lib, and redefine that same core fn on line 200?
11:03cemerick(thinking here of direct linking)
11:03cemerickor, I should say....define a fn with the same name as the core fn on line 200.
11:04cemerickstuarthalloway: ^^
11:05stuarthallowayyou get a warning
11:06stuarthallowayand since the warning is in your own code, you fix it, by adding an exclude at the top of the namespace
11:06stuarthallowaythe earlier name is now not available, and your code won't compile
11:06cemerickstuarthalloway: Right, I'm asking, which fn does the usage at line 100 get?
11:06stuarthallowayis this an interview question?
11:06stuarthalloway:-0
11:07stuarthallowayI am guessing you would get the core one
11:07stuarthallowayif direct linking is in play
11:07cemerickThat 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:08arohnerbut can't you get that behavior now?
11:08stuarthallowaywould you (or anyone on your team) ship with the warning in your own code?
11:08stuarthallowayarohner: yes, although not as easily
11:09stuarthallowayyou would have to go (in-ns 'clojure.core)
11:09cemerickstuarthalloway: knowingly, no. *shrug*
11:09cemerickWe'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:10cemerickThis is all to prevent breakage like the case of flatten in enlive?
11:10stuarthallowaycemerick: I already floated (and rhickey didn't love) making it configurable ... even more complexity
11:10stuarthallowaycemerick: yes, although that breakage is pretty thorough
11:11stuarthallowayand with modular dependencies takes a while to rundown
11:11cemerickyeah, I wasn't meaning to imply that it's not a problem, or a widespread one
11:11cemerickor *not* a widespread one
11:11stuarthallowaytake my own case: labrepl broke
11:11stuarthallowaybut when I went to fix I first had to fix circumspec
11:12stuarthalloway...and then compojure (which I didn't own, and had to fork...)
11:12stuarthallowaythe warning also lets us leave the old vars in place
11:12cemerickI 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:13cemerickLikely a much bigger change than last-var-wins, but seems far cleaner.
11:14stuarthallowayhere's a crazy idea: last-var-wins during the beta period, and turn it back off for rc
11:14cemerickyes, that is crazy :-)
11:15arohnerstuarthalloway: so official builds would have last-var-wins-off, and development builds would have it on?
11:15stuarthallowaybut why crazy? lots of us are on snapshot bits of six different dependencies
11:15stuarthallowaymaking changes during beta requires enormous coordination, which last-var-wins solves
11:16arohnerstuarthalloway: that would prevent e.g. using libraries based on clojure 1.1 with 1.2
11:16stuarthallowayand turning it off creates a sync point for various projects
11:16cemerickstuarthalloway: because lots more people are going to have exactly the same problem that aren't aggressively tracking 1.2-SNAPSHOT.
11:17stuarthallowayarohner: not necessarily, but would require yet another feature, either ad hoc version probing or something like :as-of
11:17lpetitcemerick: 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:17lpetit...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:18cemericklpetit: good point
11:18cemerickstuarthalloway: am I nuts with my suggestion?
11:18cemerickhalf-baked as it is
11:19stuarthallowaylpetit: true or no, that doesn't bother me so much. it really comes down to how people will behave with warnings
11:19stuarthallowaycemerick: not nuts, I just don't know how hard it is to do
11:19cemerickyeah
11:19lpetitstuarthalloway: it was for the sake of the truth. Currently (without any experiment feedback), it also doesn't bother me.
11:20stuarthallowayI 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:20stuarthallowayI will make sure Rich looks at this but try to give him my slanted view
11:20stuarthalloway:-)
11:27hugodthe reify doc string examples are missing the "this" argument
11:36stuarthallowayhugod: can you throw that in a ticket?
11:36hugodstuarthalloway: sure
11:36stuarthallowaythx
11:48rhickeynew last-one-in-wins - tracks warnings and switches to throw after you've been warned 42 times
11:48Chousukeheh
11:48Chousuke"Code too broken, fix it"
11:57ordnungswidrigrhickey: 42? not 32? :-)
12:00rhickeyordnungswidrig: 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:00ordnungswidrighehe
12:03rhickeyyou won't be able to sleep at night wondering - 'how long can I get away with this?'
12:06ordnungswidrigI can't sleep at night because I wonder how long I must keep programming java for a living...
12:08sattvikrhickey: 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:08chousersattvik: cut off at "limited verion o"
12:09sattvikOption 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:09scottjHow come (.getInterfaces clojure.lang.Symbol) doesn't include clojure.lang.IMeta, yet (instance? clojure.lang.IMeta 'foo) returns true?
12:10remleduff,(class 'foo)
12:10clojurebotclojure.lang.Symbol
12:11remleduff,(ancestors clojure.lang.Symbol)
12:11clojurebot#{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:12rhickeyscottj: it's not a direct super
12:13remleduffWhat does it mean that ":clojure.contrib.generic/any" is an ancestor of Symbol?
12:14remleduffI guess that means (derive clojure.lang.Symbol ::any) got called somewhere
12:14scottjremleduff, rhickey: thanks
12:15remleduff,(descendants :clojure.contrib.generic/any)
12:15clojurebot#{: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:24remleduff_rhickey: I mailed in my CA this morning, sorry about the process mixup on ticket 317
12:25sattvikrhickey: 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:26sattvikGiven 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:42slyphonso, i'm trying to run 1.2 and slime, and i keep getting "unmatched delimeter: )"
12:42slyphonmy code works fine under 1.1
12:43technomancyslyphon: that's probably an issue with clojure-test-mode, not swank
12:43slyphonah
12:43technomancytry fetching the latest from git
12:44slyphonok
12:44slyphonthanks :)
12:52cemericksurely we can run the build against 5 and 6 JDKs?
12:52cemerickrhickey, sattvik ^^
12:54sattvikcemerick: 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:55sattvikFor example, I don't think that Java 5 SE contains any nested annotations, though they are supported by the language.
12:56cemericksattvik: Sure; I'm just saying, it's pretty straightforward to run multiple builds in hudson for a single project.
12:56cemerickThen wrap the JDK 6-only tests in a jdk6-only macro that sniffs for the necessary dependency.
12:57cemerickYAFEUC
12:57cemerick(Yet Another Feature-based Execution Use Case)
13:09RaynesHow does one find out of a method is static?
13:10slyphonRaynes: reflection, i think
13:10slyphontechnomancy: is clojure-test-mode part of clojure-mode?
13:10slyphonoh, nvm
13:10RaynesI'm not quite sure how to use .getModifiers from Clojure. :|
13:11rhickeysattvik: stuarthalloway just dealt with this - ping him
13:11nurvHi.
13:12RaynesHi.
13:22chouserI'm trying to set up a namespace on-the-fly in which to load some trusted clojure code.
13:22chouserI'm using create-ns and then in a binding (refer 'clojure.core). This is working fine.
13:23sattvikrhickey: 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:23chouserNow 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:23chouser'binding' won't cut it anymore.
13:23stuartsierrachouser: That's why I was annoyed when 'import' became a macro
13:24stuartsierrachouser: The only way around is a hack: use 'eval' or call methods in 'clojure.lang.Namespace'
13:24stuartsierraor maybe it was clojure.lang.RT
13:24chouserthe import macro seems to generate code taht calls clojure.core/import*
13:25chouserBut I'd really rather not do that.
13:25chouserI guess I can have the code I'm loading do its own import. :-/
13:25stuartsierraclojure.core/import* is a special, not a real function anyway
13:26chouseroh. :-(
13:26chouserand since *ns* isn't getting passed in, it probably takes its value at compile time as well.
13:26stuartsierraIt *should* be a real function
13:27slyphontechnomancy: 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:32chouserthat seems to work. I'll just try to pretend I didn't do that.
13:33stuartsierraI'll pretend I didn't hear that.
13:39LauJensenRaynes: feature request, $ping ip.ip.ip.ip
13:39RaynesLauJensen: Duly noted.
13:40LauJensenI could have used it today when Maven Central was down - wanted to know if it was just me :)
13:43lrennExcuse 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:53zakwilson_Why are there about 20 different jars for Compojure on clojars.org, some with non-descriptive descriptions?
13:58RaynesHow does one catch nested exceptions?
13:59LauJensenzakwilson_: there seems to be a habit of pushing waaay to much stuff to clojars
14:00LauJensenWe found one fork of ClojureQL there which was throughly broken - Why would anybody loot a jar, break it and then upload it ?
14:01RaynesDon't forget the Meth syringes.
14:01zakwilson_Is meth normally injected?
14:02RaynesI'm pretty sure it's normally <insert anything that gets it into your body here>.
14:06remleduffHow do you diagnose "why" lein deps is failing if you know the jar is there?
14:07remleduffI'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:08ataggartraynes: what do you mean by "nested exceptions"
14:12Raynesataggart: java.lang.OmgException: java.lang.WtfException: java.lang.BbqException: blah
14:13ataggartthat is the cause chain
14:13ataggartyou don't need to "handle" the causes
14:13ataggartunless you pull the cause out and throw it
14:14remleduffAre you saying you want to catch BbqException, but it's been wrapped by Wtf and OmgExpection?
14:14ataggartI'm not saying anything about "Want"
14:15ataggartbut yes, Omg was caused by Wtf was caused by Bbq
14:15ataggartthe exception you're holding is a Omg
14:15RaynesSorry, doing 100 things at one time here.
14:15ataggartthe causes are mostly informational
14:15RaynesBut yeah, the BbqException is what I wanted.
14:16ataggartthen don't create new exceptions
14:16ataggartor are you saying you're throwing an exception and something else is catching it and wrapping it?
14:16chouserthere are several places in clojure where exceptions are wrapped in a way that does not add value.
14:17RaynesSomething else is wrapping the exception. I just need to catch it.
14:17clojurebothttp://paste.lisp.org/display/74305
14:17chouserI 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:17ataggartyou can peel back the layers of the onion via (.getCause ex)
14:18chouserclojure.stacktrace/root-cause
14:18RaynesOkay. :)
14:19remleduffDoes lein downloading jars use some port other than 80?
14:19ataggartbear in mind that that'll rip through any of *your* wrapped exceptions
14:26cemericklooks like pprint's a little borked lately? (pprint #{}) => NPE
14:29bmasonwhat does "#< ... some content ... >" mean from a println?
14:30chouserbmason: that's how an object prints by default when it doesn't have a matching reader.
14:30cemerickreplaca: do you want an issue for that, or is it a simple tweak? ^^
14:30slyphonyeah, it's so if you try to read that with lisp, it'll barf
14:30bmasonah... I see
14:30cemerickah, speaking of which....
14:30bmasonI'm trying to capture a sample request object from the Compojure framework
14:31bmasonfigured I'd just println it, clean it up and assign it using def
14:32cemerickbmason: use pr or prn
14:32cemerickeven then though, there'll be plenty of unreadable objects
14:32bmasonClojure is dead sexy
14:33cemerickrhickey: can defrecords get a map-esque .toString that yields the same as what's shown w/ (str [some-record])
14:35slyphonbmason: :)
14:56_njhi
15:07replacacemerick: can you give me an issue? with simple-dispatch or code-dispatch?
15:08cemerickreplaca: Sure -- I'm going to triple-check my environment first. What is simple-dispatch vs. code-dispatch?
15:09replacaif you do nothing, you get simple dispatch
15:09cemerickah, simple then
15:09cemerickjust (pprint #{}) does it at the moment
15:09replacaand the output should be similar to what print would give you
15:09replacayeah, that's simple
15:10replacaoh that's a set... sorry I was reading the curly braces as parens
15:11replacacool, 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:11cemerickreplaca: that's all AFAICT
15:12cemerickis pprint in need of a test suite?
15:15LauJensen~seen etate
15:15clojurebotetate was last seen quiting IRC, 8403 minutes ago
15:19slyphontechnomancy: hey, the completion in the latest clojure-mode seems a lot better
15:21replacacemerick: well, there are tests (more for the underlying cl-format than pprint itself), but there certainly could be more
15:22Raynesdnolen is at war with his connection.
15:22slyphonRaynes: i think he's losing
15:23RaynesI agree with your observation, sir.
15:23slyphonthat's what IPv6'll do to ya
15:23slyphon:)
15:25dnolenerg
15:31slyphonit'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:31chouseryou can!
15:31slyphonuh
15:31slyphonyou can do [& {:keys [a b]}] ?
15:32chousershould, yeah.
15:32chouserthough I'm failing here so far...
15:32slyphonbut then that's your variadic arity func
15:32slyphonhah
15:32slyphoni guess that's the rub, the limits on varargs
15:33chouseroh, this is an old clojure
15:33chouser((fn [& {:keys [a b c]}] [a b c]) :b 2 :a 1)
15:34jfieldsif 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:34slyphonjfields: (rest [1 2 1 3]) ?
15:34hiredmanso you want the rest, not the first?
15:34jfieldsno
15:34jfieldssorry, bad example
15:34jfieldsthe element could be at any index
15:35slyphonjfields: so you want "remove first instance"
15:35jfieldsI want to remove only the first match, yes
15:35hiredmanvectors don't do abitrary resizing
15:35jfieldsI don't need to resize, a new vector is fine, as long as it only has the first match removed.
15:35hiredmanand seqs aren't index
15:35hiredmanindexed
15:36chouser,(let [[a b] (split-with #(not= 1 %) [5 6 1 2 1 3])] (concat a (next b)))
15:36clojurebot(5 6 2 1 3)
15:36hiredmanyou 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:37hiredmanor what chouser said
15:40jfieldschouser: wow. thanks.
15:51ataggarthow neat that the map destructuring stuff only requires an even-count sequence
15:51ataggart,(let [{foo :a bar :b} '(:a 2 :b 3)] [foo bar])
15:51clojurebot[nil nil]
15:51ataggarthmm that worked on my box
15:51ataggart,*clojure-version*
15:51clojurebot{:interim true, :major 1, :minor 1, :incremental 0, :qualifier "master"}
15:52ataggartguess it's a new thing with 1.2
15:53cemerickit is
15:57ordnungswidrigis there a clojure lib to handle URIs the right way (rfc2396) especially parsing them?
15:58chouserthere's java.net.URI
15:58slyphonyeah
15:58slyphonbut that's not "the right way"
15:58chouseroh?
15:58slyphonit's handling of query arguments is totally psychotic if you're trying to build URIs
15:58slyphonits, even
15:58slyphonit only escapes '%' chars
15:59chouser:-(
15:59slyphonit's completely baffling
15:59ordnungswidrighmm, does it parse?
15:59slyphonit parses a single-argument string correctly
15:59ordnungswidrigbtw. why doesn't HttpServletRequest return a java.net.URI for getRequestURI then?!
15:59ordnungswidrig;-)
15:59slyphonthe escaping rules are totally insane
16:00ordnungswidrigslyphon: is the insanity from the rfc or invented by java.net.URI?
16:00slyphoni'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:00slyphonin a way that's *totally* not useful
16:01slyphoni mean, look, it could be me being totally retarded
16:01rshi 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:03ordnungswidrigslyphon: the rfc is insane itself because it does not state any character set for % encoding.
16:03slyphonyeah, there's a lot wrong with the RFC
16:03ordnungswidrigslyphon: which means the charset depends on the application so java.net.URI should be able to specifiy the encoding.
16:04slyphoni'll say this
16:05slyphoni 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:05slyphonand handed that to (URI. )
16:06ordnungswidrigslyphon: I only need some parsing at the moment
16:07slyphonordnungswidrig: yeah, just tryin' to give a friendly "heads up" before you skipping through the thorn bushes :)
16:08ordnungswidrigslyphon: that's how I took it :-)
16:08slyphon:)
16:26_njCan I start a swank server from a lein uberjar?
16:27puredangerso, 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:28chouseryes
16:29puredangerand do I need to import a Foo record type before I use it?
16:29chouserno, defrecord auto-imports for you
16:29puredangerI guess if I want to use it sans ns I do
16:29puredangerI mean from another ns
16:29ataggartright
16:29chouseroh, right. yes, then you import
16:30puredangerand b/c it's a Java class the convention (requirement?) is to name it with a capital letter (Foo, not foo) ?
16:32chouserIf anything, it's a convention, but I'm not sure it's even that quite yet.
16:33chouserit does seem common.
16:33dnolenpuredanger: 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:37puredangerand you can also optionally specify protocols (which map to methods on the Java obj)
16:40bmasonI'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:40slyphonbmason: easiest thing to do is restart the repl
16:40bmasonseriously?
16:41slyphonthat's the easiest
16:41slyphoni've found
16:41bmasonyeah, I was hoping to avoid that
16:41slyphonyou can also do ns-unmap, it's just not always enough
16:41slyphoni mean
16:42bmasonmaybe I'm not understanding what ns-unmap is supposed to do?
16:42slyphonsometimes it's kind of cumbersome to do that
16:42slyphoni usually go (ns 'blah.foo) (ns-unmap *ns* 'symbol-name)
16:43bmasondo 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:44slyphonif blah.foo had a definition of quux
16:44slyphonand you moved quux into blah.bar
16:44slyphonyou need to (ns blah.foo) (ns-unmap *ns* 'quux)
16:48ivenkys b
16:49ivenkysque ?
16:49MrEvilso 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:49bmasonslyphon: yeah, none of that is working... I don't understand why so I will just restart the REPL
16:49kotarakslyphon: (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:50slyphonah
16:50slyphonkotarak: ok, good to know
16:50chouserMrEvil: try (lazy-xml/emit my-xml :indent 2)
16:50slyphonkotarak: i figured one of the grown-ups would come along and tell me how to do it better
16:51MrEvilchouser: that was it. thanks!
16:51chouserMrEvil: np
16:53MrEvilso 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:53MrEvilalso makes it hard to debug using print statements
16:54MrEvilam i wrong in thinking that this is wierd?
16:54dakronetechnomancy: question for you
16:55chouserMrEvil: yeah, it's probably not best. clojure has several things like this. Besides emit: print printf println prn pr...
16:55chouseryou can using (binding [*out* foo] ...) to send to a different outputstream without having it go into a String first
16:56chouserbut I do think there should be some way to pass in the output stream directly.
16:56slyphonchouser: hrm, i don't think the [& {:keys [foo bar]}] works in 1.1
16:56dakronetechnomancy: 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:56technomancydakrone: it's a bug in leiningen 1.1; it's fixed in 1.2 (which is a couple weeks away from release)
16:56chouserslyphon: no, I think destructuring seqs into maps is just in 1.2
16:57dakronetechnomancy: 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:57technomancydakrone: sure; the other option is to use swank/nailgun instead of the repl task
16:57dakronetechnomancy: not an emacs user
16:57technomancydakrone: nailgun is an option too. the docs indicate it's tied to vim, but I don't think that's true
16:58dakronetechnomancy: cool, I'll use nailgun instead then until the 1.2 release, thanks
16:58technomancydakrone: lein 1.1 uses clojure 1.1, which had a bug that made the repl task impossible to implement correctly
16:58dakronetechnomancy: interesting, what was the bug?
16:59technomancyticket #299
16:59technomancy,ticket #299
16:59clojurebotjava.lang.Exception: Unable to resolve symbol: ticket in this context
16:59technomancy~ticket #299
16:59technomancywhy can I never keep those straight?
16:59technomancy~botsmack
16:59clojurebotOwww!
16:59dakroneheh, okay I can search using the number
16:59technomancyright. =)
17:00cemerick~#299
17:00clojurebotexcusez-moi
17:00cemerickoh well
17:00clojurebot{: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:01cemerickwonky
17:01dakroneand 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:01dakronesomething like *clojure-version*?
17:01Chousuke,(clojure-version)
17:01clojurebot"1.1.0-master-SNAPSHOT"
17:01dakronethat would be it, thanks Chousuke
17:02ChousukeI wasn't even aware of that until recently
17:02dakronenow all it needs is something similar to Ruby's vars for all the different fields
17:02dakronesomething like (clojure-major-version) -> 1
17:03dakroneetc
17:03Chousukewell hmm
17:03Chousuke,((partial *clojure-version* :major))
17:03clojurebot1
17:04dakroneoh hey, already exists, silly me
17:04dakronethanks again Chousuke
17:17RaynesLauJensen: 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:18LauJensenRaynes: 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:22RaynesLauJensen: 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:22LauJensencool
17:28MrEvil(with-open [*out* (io/output-stream output-file-name )] (lazy-xml/emit my-xml)) should work should it not?
17:32kotarakMrEvil: I think you need to wrap the stream in a writer.
17:52bmasonis (:refer foo.bar :as baz) correct syntax inside a 'ns' definition?
17:52kotarakbmason: (:refer [foo.bar :as baz])
17:53Raynes(:refer [foo.bar :as baz])
17:53RaynesEh.
17:53RaynesI should look at the monitor instead of watch television while I type.
17:53bmasonclojure.lang.PersistentVector cannot be cast to clojure.lang.Symbol
17:54Chousukeyou probably want require?
17:54bmasonwhereas it compiles without error without the vector, but doesn't properly initialize the alias
17:54kotarakArgh. Yes. require
17:54RaynesYeah, I think you want require.
17:54bmasonI'm on the 1.2 snapshot...
17:54ChousukeI haven't seen :refer used in ns ever.
17:54bmasonk
17:54Chousukeexcept for :refer-clojure
17:54Chousukeor whatever it is
17:55bmasonwhen I used :require I got an error saying it couldn't be found in clojure.core
17:55bmasonoh nvm... works now
17:55bmasonmaybe I had something else wrong
17:56bmasonok, thanks guys
18:00Dawgmatixif i was to build something like heroku for compojure / other clojure web frameworks would anyone here want to buy clojure specific cloud services ?
18:00DawgmatixI 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:08Associat0rjoin #proglangtheory
18:12DuneManHey 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:12DuneManhowever, I just ran into a case where this is causing a massive memory leak
18:12DuneManbecause, apparently, using take-nth is causing the head of the list to be held
18:13DuneManso I get a huge cons list that eats up all my memory
18:14DuneMan(doseq [e es] (println e)) <-- no memory leak, (doseq [e (take-nth 1000 es)] (println e)) <--- memory grows unbounded and the jvm dies.
18:14DuneManI do *not* see how take-nth is holding the head.
18:15DuneManI 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:15DuneManThoughs? Should I not use seq to represent my infinite data?
18:16hiredmanwhat version of clojure are you using?
18:16hiredmanmaster (what will be 1.2) is more aggressive about clearing locals
18:17DuneMan1.2
18:17DuneManoh wait
18:17DuneMan1.1
18:18hiredmantry a snapshot of 1.2
18:18DuneManAre there any major problems with 1.2 snapshot that I should know about?
18:19hiredmannope
18:19hiredmanwell, there are changes
18:19hiredmansome fns where moved from contrib into core
18:22DuneMan(1.1.0-master-SNAPSHOT... right?)
18:23DuneManor is it 1.2.0-master-SNAPSHOT
18:24DuneManfound it.
18:42DuneMangrrr - BLEH:. (hash-map :a 1 :a 2) -->> duplicate key error
18:42DuneMan(merge (map hash-map s)) ??
18:43DuneManer, (apply merge
18:45MadWombatHello
18:47DeusExPikachuanyone 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:58DeusExPikachuI'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:27XAMPPsorry :/
19:31DuneManhiredman: Thanks! 1.2 isn't exhibiting the same issue.
20:10defncool stuff on disclojure/planet.clojure.in today
20:10defnthe lava lamp build env is just insanely awesome
20:12DuneManWe had that going at an old company of mine
20:13DuneManWhich was, conveniently, powered by our product
20:13DuneManand an arduino microcontroller that could speak internets
20:13DuneManand that got expanded into live traffic lights
20:19defnDuneMan: cool
20:19defnDuneMan: im trying to find the right light or gadget to do something neat
20:20DuneManTraffic lights are actually reasonably priced on ebay :-D
20:20defnid like to wire up a bunch of stuff and have it play a nice gong sound when the light changes as well :)
20:20DuneManand impressive
20:21defndune http://www.globalindustrial.com/p/material-handling/dock-truck/dock-traffic-systems/dock-traffic-light-system?utm_source=shopping&amp;utm_medium=shp&amp;utm_campaign=Dock-Traffic-Systems-shop&amp;infoParam.campaignId=WP
20:21sexpbot"Dock & Truck Equipment | Dock-Traffic Systems | Dock Traffic Light System | B184101 - GlobalIndustrial.com"
20:21defnthat's all i could find
20:22defn900$ is a little out of my price range :) however, it weight 156lbs and would no doubt be impressive
20:22defnin fact, probably more annoying than anything without a filter over it
20:23defnhowever, getting a tan from the gigantic red light turning on in your face would probably get you satisfying your tests pretty damn quickly :)
20:23defn@DuneMan
21:15slyphonhrmf, is something different about binding in 1.2 ?
21:17slyphoni 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:21slyphongah
21:21slyphonsonofa
21:25slyphondoes the EPL allow me to copy c.c.sql into my own codebase and make modifications to it?
21:28tomojonly if your code is also EPL, I think
21:28tomojbut I am not a lawyer
21:28slyphonshit
21:30tomojif you don't release the code it's less of a problem I think
21:30slyphonah
21:32slyphonhrm
21:32slyphonyou can't bind over a macro?
21:33slyphonthis is really weird
21:33tomojyou mean like (binding [doseq ...] ...) ?
21:33slyphoni 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:33slyphonyeah
21:34tomojby the time it would make a difference, the macro call will be gone
21:34slyphonand 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:35slyphonwell, transaction* is the function
21:35tomojso you're doing (binding [transaction* ...] ...) ?
21:36slyphonyeah essentially (binding [c.c.sql.internal/transaction* (fn [f] (f))] ...)
21:38tomojwell, hmm
21:38slyphonyeah, any idea why that wouldn't work under 1.2?
21:39tomojthe exact same thing worked in 1.1?
21:39slyphonyep
21:39slyphonsame code, didn't change a thing
21:39slyphononly
21:39slyphonwell, i'm using the 1.2 version of c.c now
21:39tomojwell, my intuitions about why it wouldn't work are that what you are trying is just impossible
21:39tomojso I must be confused
21:39slyphonheh, one sec
21:40talioswas 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:40talioss/chance/change/
21:40sexpbotwas 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:40tomojwhoa
21:40slyphonthat's a really useless feature
21:41tomojoh, I guess I see what you're trying
21:41tomojand that it should be possible
21:42tomojthe transaction macro won't expand any differently but will just now call the fn you slipped in, right?
21:42taliosthe (binding) only works on the current thread tho right - is something under your new code thats changing threads?
21:42slyphonyes
21:42slyphonno
21:43slyphonnothing is changing threads in my code
21:43talios*nod* any AOT compilation?
21:43slyphonuhm
21:43slyphonnothing relevant
21:43slyphonthe only AOT i do is to generate Exception classes
21:46slyphonthere hasn't been a change to that lib between cc 1.1->1.2
22:03alexykI am using a project with JNI. It needs some libs in /opt/lib. Where do I stick -Djava.library.path in repl invocation?
22:05lancepantzalexyk: no different than without
22:05lancepantzi just put it as the first option after java usually
22:07lancepantzalexyk: are you the same alexy that was talking to my coworker about jiraph?
22:07vIkSiThi all
22:07alexyklancepantz: ah, are you the geni guy too?
22:07lancepantzyep :)
22:07vIkSiTis anyone here using c.c.string/str-utils/str-utils2?
22:08alexyklancepantz: yeah, I'm engaging in unnatural acts with the said jiraph.
22:08vIkSiTI'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:08alexyktrying to install it properly
22:08alexykyou guys need some leiningen goodness! :)
22:09lancepantzi know
22:09lancepantzi tried at one point, but all the jni stuff just became a huge pain
22:09clojurebotthe point of moby dick is "be yourself"
22:09alexyklancepantz: but, it's brilliant. You must give Justin a big raise.
22:09alexykprotobuf works from clojure
22:09alexykand tokyocabinet does too
22:10lancepantzi designed it too ;P
22:10alexyklancepantz: he committed it :)
22:10alexykthen add yourself to the committers on github, these repos will be famous! :)
22:10alexykI've tried some other crappy TDB bindings and they didn't work at all
22:11lancepantzyeah, we've got alot uncommited as well
22:11alexykBTW, I suggest you factor out jiraph.tc as a separate TDB binding
22:11alexykso folks can use it instead of BDB
22:11alexyklancepantz: so are you moving from ruby to clojure?
22:11lancepantzwe have it to where the graph is fully versioned as well, in that you can roll back and forward through modifications
22:12lancepantzwe also have a rest front end
22:12alexyklancepantz: I was asking Justin about that. He writes that a node exists in all layers. What if nodes are added every day?
22:12alexykI'd like every day to be a layer
22:12lancepantzbut yeah, moving from ruby to clojure
22:12alexykand nodes to exist from some day onward; in its own and future layers
22:12lancepantzyeah, we were discussing your message earlier
22:12alexykthat would allow me to process things like Twitter in parallel very nicely
22:13alexykso I guess if you version it, you version all layers too?
22:13lancepantzthe problem with that is that layers are stored in separate tokyo cabinet files on disk
22:13lancepantzand its not nearly as fast if your walk has to cross files
22:14alexyklancepantz: ah, hmm.
22:14lancepantzits a good idea to never have a walk cross layers
22:15lancepantzbut yeah, any data is versioned
22:15lancepantzwe also have a replication system, it uses the revision log
22:17alexyklancepantz: sounds yummy!
22:18lancepantzand good advice on factoring out jiraph.tc, thats on our to do list
22:18lancepantzwe're working on psql backend
22:22alexyklancepantz: psql used to be slower than embedded
22:22alexykbtw why did you drop BDB JE?
22:23lancepantzit kept getting corrupted and we couldn't figure out why
22:23wlangstrothpostgres is awesome (I know that's not helpful or technical, but I'm a postgres fanboy - can't help it)
22:23slyphonwlangstroth: huzzah!
22:23slyphonindeed :)
22:24wlangstrothhaha - you just "huzzah"'d me
22:24wlangstrothslyphon: yeah ... Slony ... *cough*
22:24slyphon:D
22:24slyphonman
22:24slyphoni took one look at slony and said "You know, i'll just take a dump every 15 minutes and pray"
22:24lancepantzthe main idea behind adding psql is to have a single interface to the graph and other data, which we use psql for
22:25wlangstrothI'm playing with bup (http://github.com/apenwarr/bup) for replication
22:26wlangstrothslyphon: no kidding. The difference in quality between postgres and its replication "solution" is vast and disheartening.
22:26wlangstrothbup isn't production-ready, but it's an interesting angle on the problem
22:27slyphonwlangstroth: well, the next release should have something that's better than what mysql has built-in
22:27slyphonyeah, sure, using git as a backup backend is indeed something i've thought about
22:27wlangstrothwhat, version 9.0?
22:27slyphoni'm glad to see someone was sufficiently motivated to actually do it :)
22:27alexyklancepantz: did you see cupboard?
22:27slyphonuhm
22:27slyphonwlangstroth: 8.5 ?
22:27slyphonoh, maybe it's 9.0 now
22:28slyphoni think they changed the numbering
22:29lancepantzalexyk: justin looked at it, i can't remember what the issue with it was
22:29wlangstrothyeah. I just switched up to 8.4 about two months ago - lots of excellent changes
22:29alexyklancepantz: works like a charm for me
22:30lancepantzalexyk: are you using it for your graph work?
22:30alexykyep. very cute and perfect for any clojure data
22:30alexykexcept reading is slower even with N threads; but faster than Mongo
22:32wlangstrothslyphon: do you do a lot of database work?
22:32slyphonyeah, i mean, on and off
22:33slyphondepends on the project
22:33wlangstrothright, otherwise you'd be a dba
22:33slyphonhahahaha
22:33lancepantzalexyk: if you ever put together any benchmarks of what you've evaluated, i'd love to see them
22:33slyphongod forbid!
22:33wlangstrothI wasn't going to say it, but ... yeah
22:33slyphonhahaha
22:33lancepantzalexyk: i'm anxious to do jiraph vs neo4j
22:34alexyklancepantz: would be interesting, but in fact my graphs fit my small RAM of 64 GB so I only need to slurp them whole
22:34alexykhence TDB seems good choice
22:34lancepantzaccording to some published neo4j benchmarks, we should be 10x faster, but i'm not sure how dated and accurate they were
22:34alexykI don't want to walk no disks
22:34alexykneo4j had a lot of progress lately
22:35wlangstrothslyphon: I met a guy at a conference whose bread-and-butter is FoxPro. Remember FoxPro?
22:35slyphonjesus
22:35slyphon"Career FAIL"
22:35alexyklancepantz: did you guys buy the Mormon database :) ?
22:36wlangstrothslyphon: you'd think, but the guy was doing really well! He was hiring!
22:36lancepantzalexyk: 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:36slyphonwow
22:36slyphonjust...wow
22:36slyphonalexyk: :)
22:37alexyklancepantz: yeah, those nasty "relationships" bothered me for a simple graph
22:37wlangstrothalexyk: are you playing with neo4j at all?
22:38alexykwlangstroth: tried to, didn't go far; BDB JE solved my simple needs and now jiraph looks promising
22:38alexykbut "one of these days"
22:38slyphonoy
22:38slyphonBDB?
22:38alexykcupboard rules
22:39slyphoni had some *bad* experiences w/ BDB + python back in the day
22:39wlangstrothalexyk: 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:40alexykbbl
22:42defnFoxPro?! hahahahaha.
22:42lancepantzbdb and neo4j aren't really for the same problem
22:42lancepantzi think his point was that his graph was simple enought that neo4j was overkill
22:43slyphonwlangstroth: "berkley db"
22:43slyphonaka "sleepycat"
22:44lancepantzaka, older, slower, more corruptable version of tokyo cabinet :P
22:44wlangstrothOh, okay
22:44wlangstrothonly ... in Java. Um ... dear God, why?
22:46wlangstrothdefn: no kidding - the reason he was doing a bunch of conferences is that Microsoft is dropping support in 2015
22:46defnno wonder MS is tanking these last 10 years
22:46defnthey still support foxpor
22:46defnpro
22:47defnMS management is so out of touch
22:48wlangstrothdude's making more than I do, so I'm not going to judge. But yeah.
22:48alexykhey 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:48alexykTokyo Cabinet is a C monster you try to stick your little JNI in. JE is pure Java
22:49wlangstrothalexyk: hey, that's cool, I wouldn't personally be motivated to re-write berkley db in java myself, but to each his own.
22:49alexyktc 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:50defnwlangstroth: 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:50defni just feel sorry for them
22:50alexykI suggest folks try cupboard off github
22:50alexyksome guy is optimizing IDB/360 assembly language... inside a simulator on Windows.
22:50alexyknow that's job security
22:50alexykIBM/360 I meant
22:51wlangstrothI guess some people just want the cheque and don't get bored. I envy them, in a way.
22:52wlangstroth360 assembly ... that's nerd wizardry
22:52DeusExPikachui'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:52defnwlangstroth: i dont. those people are slaves. drones. boring rat race paper chasing buffoons.
22:53defnnow let me tell you how i /really/ feel!
22:53alexykthe guy optimizing assembly of a nonexistent machine is a genius
22:53wlangstrothalexyk: agreed
22:54wlangstrothdefn: if you like programming, those people seem like strange imposters, it's true
22:54talioswasn't addUrl() support removed?
22:54DeusExPikachuhow 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:54DeusExPikachuusing 1.1.0
22:55defnwlangstroth: it's more than that to me. i think they actually undermine the work of serious programmers and engineers.
22:56defnwlangstroth: i dont even want to be associated with people who dont treat this stuff as art
22:56DeusExPikachus/do anything/return anything different before and after .addURL
22:56defnit's like a doctor who, in the process of practicing medicine, manages to slowly kill his patients
22:57lancepantzhahahah
22:57wlangstrothDeusExPikachu: not ignoring you, just can't help - using leiningen
22:57defnDeusExPikachu: same here
22:57DeusExPikachuwlangstroth, np, just getting it out there
22:58wlangstrothdefn: it's more like a psychiatrist who gradually drives his patients insane, because that's what actually happens
22:58alexykDeusExPikachu: why are you grabbing the loader? Do you like to grab loaders?
22:59wlangstrothI've worked with crappy programmers (or overly-clever programmers) and insanity is what ensues
22:59defnwlangstroth: haha
22:59DeusExPikachualexyk, trying to design a "clojure distribution", so I need a way to do custom modifications of classpath during runtime
23:00alexykDeusExPikachu: cool! I was that mentioned a few times, adding to classpath from the repl here, but don't remember now
23:00defnim 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:01wlangstrothI think in 1.1.0, there's a classpath function - let me check
23:01DeusExPikachualexyk, 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:01defn"I've got a wife and kids-- I don't have time to program outside of work." <--asshole
23:01slyphoni don't think you can modify the classpath at runtime
23:01alexykthe 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:02slyphonalexyk: that's been my argument against PHP for a looooong time
23:02defni wrote some PHP last night. oh god was it painful.
23:02alexykdefn: sounds like a reasonable guy to me :)
23:02DeusExPikachuslyphon, you're right you can't, but clojure uses an extension of URLClassLoader, which can arbitrary URLs to load from
23:02defnalexyk: i just dont understand how when you get home from work, you dont hack around on a little project or something
23:02slyphonah
23:02wlangstrothhttp://richhickey.github.com/clojure/branch-1.1.x/clojure.core-api.html#clojure.core/add-classpath
23:03alexykdefn: how about you put kids to bed and spend time with your wife? :)
23:03slyphonDeusExPikachu: ok, you're obviously more aware of what's goin on than me :)
23:03defni 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:03alexykand 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:04wlangstrothdefn: you're not a crappy programmer. Crappy programmers are ... something else
23:04slyphondefn: kids don't end your life
23:04slyphondefn: i made that mistake
23:04slyphonthinking that
23:04alexykdefn: before they get to Dora, you need to kind of make sure they grow there :)
23:04defnahhhh yes!
23:04defnthey need attention, do they?
23:04slyphonalexyk: argh! dora!
23:04slyphoneh
23:05slyphon;)
23:05wlangstrothhaha! Dora! That evil ... wait, is Lau on?
23:05alexykslyphon: I have no TV and my kid was lost at Disney World. Like, who *are* all these people?
23:05slyphonalexyk: i don't know how they get the audio on that cartoon to be SO DAMN PIERCING!
23:05slyphonevery time i hear her voice i wanna run into the next room
23:06defni hate to use this, because it is a bit of a cliche, but a programmer without passion is like... clojure without map
23:06alexykwlangstroth: is there a Danish version of Dora Lau should be especially familiar with? :)
23:07alexykdefn: yeah! a programmer must be obssessed. I woke up at 2 am last night to torture jiraph into submission. (Thanks lancepantz...:)
23:07wlangstrothalexyk: naw, he's just sensitive to the language, and Dora brings out the sailor just a bit. It's an awful show.
23:07slyphonwlangstroth: yeah, what's up with that?
23:07slyphonwlangstroth: i was gobsmacked that he actually reprimanded me for saying "f**k" in the channel the other day
23:07alexykor is Lau in love with Dora?
23:07slyphonon *IRC* ffs!
23:07replacacemerick: are you in here?
23:08defnalexyk: 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:08DeusExPikachuwlangstroth, 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:08slyphondefn: it's that drive that makes you go past the point where it hurts
23:08alexykdefn: kids tend to moderate that, but that stays. You just become 100x more effective. And you don't pick wrong fights. :)
23:08wlangstrothslyphon: meh. He's one of the cool kids, so I'm not saying anything.
23:09slyphonwlangstroth: i was just surprised, that's all
23:09slyphonwlangstroth: nothing against him
23:09wlangstrothslyphon: course not - he's hilarious
23:09slyphon:)
23:10DeusExPikachuthe 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:10defnalexyk && slyphon: http://www.youtube.com/watch?v=iMjG2s6UOaw This is how I feel about "going past the point where it hurts."
23:10sexpbot"YouTube - Arnold Pumping Iron funny clip"
23:11defndamned sexpbot ruining the surprise
23:11slyphonhahah
23:11DeusExPikachudefn, hey you know that's my governor
23:11slyphonthe Governor of California, ladies and gentlemen
23:11defnat least he's not soliciting gay sex in airport bathroom stalls
23:11slyphon*that guy* has the power to grant clemency
23:12wlangstrothDeusExPikachu: hehe. does it work?
23:12defnnot that there's anything wrong with being gay or having sex. it's the airport bathroom that really muddies the situation.
23:12slyphonhahaha
23:13wlangstrothAhnuld does not grant clemency. If you can survive the electric chair, you're free to go.
23:13DeusExPikachuwlangstroth, which add-classpath? no :(
23:13defnalso, wlangstroth && slyphon -- #clojure-casual exists so we dont have to endure the wrath of Lau
23:13slyphonah
23:13wlangstrothDeusExPikachu: bah! I was hoping for some magic-by-obscurity
23:14alexykis there a #clojure-confidential?
23:14slyphonalexyk: we could tell you, but then we'd have to k...tell you
23:15alexykslyphon: hmm, apparently there is!
23:15wlangstrothwow, a lot has changed since 1.1.0. I haven't even looked at 1.1 before
23:15slyphonalexyk: hah
23:15slyphon!
23:18wlangstrothDeusExPikachu: if you search the irc logs on http://clojure-log.n01se.net/ for add-classpath, there's a ton of discussion about it
23:18sexpbot"#clojure log - May 05 2010"
23:18DeusExPikachuthat's today
23:18DeusExPikachubut yeah i'm searching
23:19slyphony'know what would be useful, something that would check a namespace for unused imports/requires
23:20defnslyphon: that'd be darned handy
23:20slyphoni mean, totally overy *my* head :)
23:21defnslyphon: maybe something to mention to tcrayford for clojure-refactoring
23:21slyphondefn: i'll keep it in mind
23:21defnmaybe it would refactor your ns macro to do :only for the used functions
23:21slyphonoooh
23:22defni dont think that's actually all that difficult slyphon
23:22defn,(ns-interns 'clojure.contrib.pprint)
23:22clojurebot{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:23defnfor example
23:23slyphonhrm
23:23slyphonyeah, but then you gotta analyze the code to pull out all the fn calls
23:24slyphonand compare them to the stuff in :use
23:24defnyeah but that wouldn't be too difficult, just go line by line for the file
23:24defnit's like a fancy rename for namespacen
23:26DeusExPikachuhmm 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:27defn,(map #(str (first %)) (ns-interns 'clojure.contrib.pprint))
23:27clojurebot("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:30replacadefn: 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:38vIkSiThmm, how would you use a regex to find a word that is enclosed between two characters (say, *)?
23:39slyphon[*][-0-9a-zA-Z]+[*]
23:39slyphonis one way
23:39vIkSiTI've got a regex that finds the word _with_ those characters .. (re-find #"\*[a-z]+\*" "this is a *test* statement"))
23:39slyphonvIkSiT: you need to capture
23:39slyphon#"\*([a-z]+)\*"
23:39slyphonthen pull out $1
23:40vIkSiTslyphon, hmm, how do you define "pull out $1" btw?
23:40slyphonheh, sorry
23:40MadWombatwell, if the character is *, #"\*\S+?\*" should do the trick
23:41vIkSiThehe
23:41vIkSiTMadWombat, hmm that doesn't seem to work for me
23:41MadWombator #"\*(\S+?)\*" if you want capture groups
23:41MadWombatlemme actually try
23:42vIkSiTinteresting. so the latter gives me a list of two elements
23:42vIkSiT(and I can get the second of that list)
23:42MadWombatuser> (re-find #"\*\S+?\*" "This is a *test* of regex")
23:42MadWombat"*test*"
23:42MadWombatuser> (re-find #"\*(\S+?)\*" "This is a *test* of regex")
23:42MadWombat["*test*" "test"]
23:43MadWombatworks for me
23:43slyphon,(clojure.contrib.str-utils/re-sub #"\*(\w+)\*" "$1" "*this*")
23:43clojurebot"this"
23:43MadWombatslyphon: ah! the bots help :)
23:43slyphon:)
23:44vIkSiTslyphon, ah interesting
23:44vIkSiTslyphon, how does that $1 work here?
23:44slyphonit just means "the first capture group"
23:44MadWombatvIkSiT: well, with re-find you don't have to pull in yet another piece of contrib :)
23:44slyphonMadWombat: totally
23:45slyphonmine was just to demonstrate what i meant by $1
23:45vIkSiTah
23:45slyphonwhich is kind of a perlism
23:45vIkSiTactually, i do need to a substitution later :)
23:45MadWombatyes
23:48MadWombatand to complete this (re-seq #"\*(\S+?)\*" "This is a *test* and *another* of regex")
23:48MadWombat,(re-seq #"\*(\S+?)\*" "This is a *test* and *another* of regex")
23:48clojurebot(["*test*" "test"] ["*another*" "another"])
23:51vIkSiTah yes re-seq is awesome
23:52vIkSiT,((second (second (["*test*" "test"] ["*another*" "another"]))))
23:52clojurebotjava.lang.IllegalArgumentException: Key must be integer
23:52vIkSiThmm
23:52DeusExPikachuhmm 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