#clojure logs

2009-03-18

00:30timothypratleynamespace question... I've got a file that's getting too large so I split it (lets call them A.clj and B.clj), A.clj says (ns A (:use B)) B has a function that references a function in A. I tried to (declare A/function) but that complains that the namespace doesn't exit (correct)... is there a better way?
00:36cmvkkassuming you just split the file because it was too big,
00:36cmvkkyou can just have B.clj use (in-ns 'A) and load it from the bottom of A
00:36cmvkkwhich is how the clojure.core namespace does it i think
00:36timothypratleyhmmm I can (ns A) (declare function) then (ns B) (A/function)
00:37timothypratleycmvkk: just use the same namespace for both files??
00:38cmvkkit definitely works...
00:38Raynesmarkgunnels: It grows more every day. Install install install!
00:40timothypratleycmvkk: can you clarify the 'load it from the bottom' part? I've looked in proxy_core.clj and core.clj but I don't see how proxy_core.clj gets loaded (unless its ant magic)
00:41cmvkkit's above the futures section, so it's not at the exact bottom of core.clj
00:41cmvkkbut i think it's just a call to (load "core_proxy")
00:41timothypratleyoh i see it
00:42timothypratleythanks!
00:58pstickneare there some (decent) clojure (micro) benchmarks? I'm only finding cruft on google.
00:59durka42they're scattered around...
01:00durka42you can probably find some in the google group
01:04pstickneI'm mostly just curious what affect using boxed types has.
01:29psticknewow :p
01:29pstickneI didn't realize clojure had so much synchronization support.
01:29pstickneNeet.
01:29pstickneNeat, even.
01:45Raynes"@Rayne I've tried to fall in love with clojure, but it just hasn't clicked for me. I get kind of a "you look an awful lot like a woman who once stole my heart, but I know you're really java in drag" discord."
01:46RaynesI wonder how many people have turned down Clojure because of a dislike for Java.
01:46durka42what happens to clojurebot's twitter following, anyway
01:46RaynesShame.
01:46durka42yeah
01:47cmvkkIt seems like it might be a prevalent opinion...I understand where they're coming from but it's unfortunate
01:47durka42clojure makes java bearable :)
01:48RaynesClojure makes Java unnecessary.
01:49RaynesI wish there was a Haskell implementation on the JVM. That would be neat.
01:49slashus2Raynes: Write one :-)
01:49RaynesI know YHC can generate CLR bytecode.
01:49slashus2in clojure
01:50Raynesslashus2: I'm way to inexperienced for that :|
01:50durka42http://jaskell.codehaus.org/ is something
01:50durka42not entirely sure what, exactly
01:50RaynesThat's not exactly what I had in mind.
01:50Raynes"Scripting language" isn't what I have in mind I mean.
01:53hiredmanslashus2: I haven't looked at the JFrame thing, the box I run clojurebot on is headless
01:54hiredman,(javax.swing.JFrame.)
01:54clojurebotjava.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.
01:54slashus2hiredman: I fixed it by modifying the de-fang method
01:55slashus2adding doto
01:56slashus2de-fang doesn't check at the top level, it does a macroexpand-1
01:57slashus2I just made it check the beginning form.
01:57slashus2So adding doto will work.
02:02hiredman:(
02:03hiredmanthat is silly
02:03hiredmandoto is just a let
02:04hiredmanso you can by-pass by just using a let
02:05hiredman,(let [x (JFrame.) _ (.setSize x 800 600) _ (.setVisible x true)] x)
02:05clojurebotjava.lang.IllegalArgumentException: Unable to resolve classname: JFrame
02:06hiredmanfiguring out how to remove the permissions to use classes in java.awt would be a better idea
02:06hiredmanplus if you figure that out you can tell me
02:10harpastumclojurebot automatically runs clojure forms?
02:11harpastum,(+ 1 1)
02:11clojurebot2
02:11harpastumsweet
02:11hiredman,(def a 1)
02:11clojurebotDENIED
02:11harpastumouch
02:11harpastum,(def foo 13)
02:11clojurebotDENIED
02:12harpastumno defs allowed?
02:12hiredmannope
02:12harpastumso no defns either?
02:12hiredmanwhich is why de-fang uses macroexpand, things like defn expand to a def call, so I can just deny def
02:13harpastum(defn hello [] (println "hello"))
02:13harpastumforgot the comma. Oh well
02:13hiredman,(macroexpand-1 '(defn hello [] (println "hello"))
02:13clojurebotEOF while reading
02:13hiredman,(macroexpand-1 '(defn hello [] (println "hello")))
02:13clojurebotDENIED
02:13hiredmanah, yes, well
02:14cmvkkwe need multiple-line inputs.
02:14hiredmanNo
02:14cmvkkheh
02:14cmvkkbecause it's hard to do or because it's harmful?
02:14harpastum,(some #(= % "harpastum") '("hiredman" "cmvkk" "harpastum")))
02:14clojurebottrue
02:15harpastumpretty cool
02:15durka42cmvkk: it'd be really hard to follow :\
02:15RaynesOh boy.
02:16durka42why is macroexpand disallowed, though?
02:16harpastumhahahahah. i just sent a private message to clojurebot
02:16harpastumclojurebot: BUENOS DING DONG DIDDLY DIOS, fRaUline harpastum
02:16clojurebotHuh?
02:16RaynesThe Making Lancet Targets Run Only Once part part of the Concurrency chapter is screwed up rather bad.
02:16hiredman,(pl (?map (replicate 3 (?apply vector $ (?map range $ 10 inc � inc � inc) call � ?* $ 10 � call � (?+ -2) map)) shuffle))
02:16durka42what would be cool is modification of the last expression a la that c++ bot
02:16clojurebot((20 40 80 10 30 60 70 90 50 100) (10 60 40 50 80 100 30 20 70 90) (80 50 70 10 40 100 30 60 20 90))
02:17RaynesHe says hes using an Agent in the example but he uses an Atom. And there are a few grammatical errors. Worst I've seen in the book.
02:17hiredmandurka42: macroexpand is not disallowed, it just pukes on anything with 'def in it
02:17durka42oh
02:17Raynes~And suddenly...
02:17clojurebotCLABANGO!
02:18harpastum,(+ 2 2)
02:18clojurebot4
02:18durka42(+ 2 3)
02:18clojurebot*suffusion of yellow*
02:18RaynesHe also says the function takes an agent and a function but only takes a function o.o
02:18harpastum(+ 2 2)
02:18clojurebot4
02:19harpastumEnglish
02:19durka42Raynes: do you have the latest beta?
02:19RaynesYup.
02:22RaynesI might be missing something but what he says after that paragraph has nothing to do with agents. I might just not be understanding what he means. :\
02:25durka42well, anyway, goodnight
02:30hiredman!!!!!
02:31hiredmanunicode 5.1 added the inverted interrobang
02:31hiredman?
02:32hiredmantruely we are living in the future
02:34harpastumAlmost as good as the
02:34harpastum'reversed rotated floral heart bullet'
02:34harpastum?
02:34harpastumi hear there was a lot of demand that it be included
02:35hiredmanclojurebot: what?
02:35clojurebotwhat is latest
02:36hiredmanclojurebot: what is <reply>?Que?
02:36hiredmanhmmm
02:36hiredmanclojurebot: what?
02:36clojurebot?Que?
02:37Raynes"The first rule of the Macro Club is: Don't Write Macros."
02:37RaynesWell, if I was to stop reading there, it would save me time not having to read that chapter. :p
02:43cmvkki've heard people say before, "don't write a macro unless you *absolutely have to*"
02:43cmvkkbut i've never understood the rationale behind that. i mean, really, you *never* have to write a macro, right?
02:44RaynesYou would need to if you needed to have something that didn't evaluate it's parameters before using them I suppose.
02:45RaynesBut I'm sure you could design /around/ needing that thing. I don't know, I guess you would never need too...
02:45cmvkkright well, i guess that's what they mean by that.
02:45cmvkkbut "need to" is such a strong wrod, when 99% of programming languages don't even have macro facilities at all.
02:45RaynesMost languages have ways around that.
02:46RaynesHaskell is totally lazy, so it doesn't evaluate it's arguments by default.
02:47RaynesI would guess that it's optional.
02:47RaynesThe macros I mean.
02:47cmvkkright, well, i guess what i'm saying is that people like to make a big deal of acting like macros are a 'last ditch option', but
02:47cmvkki don't feel bad about writing macros if it makes the code look nicer or whatever.
02:47RaynesI'm not experienced enough to really knwo. :|
02:48RaynesPeople say gotos are the devil - People still use them.
02:48Raynesknow*
02:48cmvkkI suspect i'm not either, and that is why my code always contains lots of crazy macros.
02:49cmvkkat least this time, i don't have macros that expand into other macros which have macros in their expansion code, etc...
02:51RaynesIs there a reason that Stu writes (defmacro [expr form] (list 'if expr nil form)) instead of (defmacro [expr form] (if expr nil form))? They work the same it seems, but I'm new to this macrofoo.
02:51hiredmanwoa
02:51hiredmanno
02:51cmvkkthey don't work the same, actually:
02:51hiredmanthose are both different
02:52cmvkkexpr would never get evaluated inside the expander code (or that's how it seems to work in clojure)
02:52RaynesWell you see, he didn't explain the difference so I didn't know...
02:52hiredmanit is import to remember that the result of the macro expression is evaluated as code
02:52hiredmanimportant
02:55hiredmanmost people would write something like (defmacro [expr form] `(if expr nil form)) instead of (defmacro [expr form] (list 'if expr nil form))
02:55hiredmanbut making the list like that is a good way to make what the macro does very explicit
02:57RaynesHe explains it a page later, I was just impatient.
02:58cmvkkfunnily enough, your example works though :/
02:58hiredmancmvkk: only for some values of works
02:59RaynesStill works ;)
02:59cmvkkin the sense that it evals expr enough that it will only return nil when expr is true
02:59cmvkkand will return form when expr is false
02:59RaynesA car with no tires still works.
03:00cmvkki.e. it works in the repl, but i still don't feel like i have a good grip on when clojure will or will not evaluate objects passed to macros.
03:00cmvkkin common lisp, i think it would always work.
03:28RaynesLOL!
03:30Raynes"If the preceding sections did not convince you of this, the Lancet example at the end of the chapter is more complex still, and a few of the macros in Clojure itself are extremely complex. (If none of the macros in Clojure seem complex to you, my company is hiring.)
03:30Raynes"
03:34RaynesI just realized he never explained the meaning of declare.
03:34Raynes:|
03:36cmvkk,(doc declare)
03:36clojurebot"([& names]); defs the supplied var names with no bindings, useful for making forward declarations."
03:36RaynesI read that. :p
03:37RaynesBut if Stu was top have explained it he would of told me where that would be useful.
03:37cmvkkthat's true.
03:43Raynes...
03:43RaynesNow he's explaining declare.
03:43RaynesHe never ceases to surprise me in this book.
05:17Lau_of_DKIm walking a line-seq in a (for [line *line-seq*]) and this borks somewhere along the way, how do get the line count where it fails ?
05:25hiredman~jdoc java.io.LineNumberReader
05:29Lau_of_DKhiredman, when Im going through my for-loop, the 'line' object, is just a string, and after the LineNumberReader goes through line-seq, its a lazy-seq
05:32cgrandLau_of_DK: but if you keep a ref to the LineNumberReader then you can call .getLineNumber on it
05:33Lau_of_DKoh thats right - I just bailed out and kept a ref of a counter, and look at its value when it failed
05:34hiredmanhttp://tapestryjava.blogspot.com/2009/03/clojure-at-oscon.html
05:35hiredmanoh, god, that is from, uh seven days ago
06:16cow-orkerin the make-adder example (defn make-adder [x] (let [y x] (fn [z] (+ y z)))), is it necessary to use the let form and bind y? won't (def make-adder [x] (fn [y] (+ x y))) work in the same way?
06:17cgrandcow-orker: the let is unneeded
06:20cow-orkerthanks! That is what testing showed me as well, was just wondering if there was some detail I'd missed... :-)
06:20cgrandwhere did you find this example?
06:21cow-orkerftp://lispnyc.org/meeting-assets/2007-11-13_clojure/clojuretalk.pdf - slide 20
06:24cgrandit was maybe intended to show that locals were closed over
06:26cow-orkeryes that might be it....
06:27cow-orkeralthough I've done some lisp work many years ago I'm new to clojure (and java as well). I must say... it is _very_ nice :)
06:27hiredman:)
08:11cemerickrhickey: thanks for applying the patch for #94 -- I hope the diff ended up being recent enough so as to not be troublesome.
08:12rhickeycemerick: I couldn't use it as-is, as it used set/union before set is avalable, i.e. Clojure didn't build
08:13cemerickdamn. That's what I get for writing patches in the REPL.
08:13rhickey:)
08:13cemerickrhickey: sorry about that. :-(
08:13rhickeynp
08:21cemerickit's interesting, I never think to use into. I guess I should fix that.
08:45rhickeymore qcon coverage: http://steve.vinoski.net/blog/2009/03/18/qcon-london-the-best-one-yet/
08:46rhickeythis yesterday: http://constc.blogspot.com/2009/03/relativity-of-simultaneity.html
09:16gnuvincerhickey: it seems like you made quite the splash :)
09:17rhickeythe Erlang folks were great, very receptive to Clojure
09:29rhickeygnuvince: with your perf problem the other day - you were on JDK6?
09:33gnuvincerhickey: yes.
09:33rhickeycould you try it on JDK5?
09:34rhickeyit uses refs?
09:34gnuvinceNo refs.
09:34gnuvince(No agents or atoms either)
09:35rhickeyok, nevermind
09:37gnuvinceFor the moment being, my my best guess is that *I* am the problem and I need to figure out what I did wrong.
09:43digash`looks like IBM is going to by Sun, long live JVM
09:43rhickeyis it a done deal? I saw the rumors
09:44digash`they made an offer of 6.5B
09:44digash`1B for MySQL, 6.5B for Sun, interesting times.
09:52cgrandrhickey: I'm sorry for the regressions I introduced with my half-baked patch to proxy
09:53rhickeycgrand: no problem, it just ended up being more subtle than it seemed
09:53rhickeyit is the trunk after all
09:56Chouser2 days from original patch through regression discovery to final fix. not shabby at all.
09:59Chouserour unit tests live and breathe.
10:00rhickeyand think
10:01cgrand,(into {} [{1 2 3 4} {5 6}])
10:01clojurebot{5 6, 3 4, 1 2}
10:03cgrandit suprised me: I had forgotten that you can conj a map onto another one
10:03Chouserme too
10:03ChouserI saw someone conj two maps yesterday (I think) and was startled.
10:04rhickeya map entry is just a single item map, in some sense
10:04Chouser,(conj {1 2} {3 4 5 6})
10:04clojurebot{5 6, 3 4, 1 2}
10:04rhickeyseems in keeping with conjoin
10:05ChouserI'm not complaining.
10:05cgrandneither
10:05rhickeyI didn't think you were :)
10:07rhickeyseems better than all of Sun falling by the wayside?
10:07Chousercan a java class have a method foo(A) and also foo(Object)? I'm guessing not. Is it best to answer such questions by experimenting in .java?
10:08cemerickyeah, if it's a question of saving the JVM ecosystem, then I'm all for it. I didn't think we were at that point yet, tho.
10:09cemerickChouser: I *think* both can exist, but only the Object overload will be dispatched to...??
10:09rhickeySun's already open sourced all the crown jewels, so just a service co like IBM
10:09cgrandChouser: both exists and depending on the casting, one or the other will be targeted
10:10Chouserfun. perhaps I'm biting off to much trying to do the auto-hinting right now. :-)
10:10Chousertoo much
10:14cgrandChouser: http://aruld.info/synthetic-methods-in-java/
10:15Chousercgrand: thanks
10:20ChouserSo let's say LockEx and LockExImpl are imported, and I have an unhinted expression (.lockEx t m)
10:20Chouser(just thinking aloud here...)
10:22lisppaste8digash` pasted "which one is it going to call?" at http://paste.lisp.org/display/77224
10:22ChouserI can find LockEx.lockEx(T), LockExImpl.lockEx(LockExImpl), and LockExImpl(Object)
10:22digash`Chouser: it is my favorite interview question :)
10:23Chouserdigash`: seems obvious, which probably means I fail the interview.
10:24cgrandChouser: find where? in class files? if yes, there's no LockEx.lockEx(T)
10:24digash`Chouser: it is the same as foo(A) and foo(Object) question you had.
10:25Chouserdigash`: oh, indeed. and I guessed correctly. :-)
10:25digash`Chouser: ok, you are hired.
10:26Chousercgrand: why is that? interfaces get class files, normally, don't they?
10:27cgrandcgrand: it's the T that made me react :-)
10:31Chousersorry, my java is so weak... so is "void lockEx(T t);" on that page incorrect somehow? should it be (Object t) or something?
10:35rhickeyChouser: generic types are erased when compiled
10:38ChouserDoes LockEx need to be declared as LockEx<T> ?
10:39Chouserif I do that it compiles, and I see a LockEx.lockEx(Object) method
10:42cgrandChouser: yes it needs to be declared as LockEx<T>
10:42rhickeywell, LockEx<Something>
10:43rhickeyI guess T is used in the body
10:44Chouserok
10:44rhickeyThat's a very gnarly example
10:45Chousergood. :-) so, at clojure compile time I'll be able to see LockEx.lockEx(Object), LockExImpl.lockEx(LockExImpl), and LockExImpl(Object)
10:45rhickeyFYI, the rules are totally different in C#
10:45Chouserin which case I could make (.lockEx t m) point to only the first of those and be all set.
10:45Chouserrhickey: ah, ok.
10:46Chouseryou mentioned a pluggable reflector, but I think the compojure.lang.Reflector interface may be a notch or two too low for this kind of thing.
10:46rhickeyso this is a job for the reflector
10:47rhickeyany type resolution logic in the compiler needs to move to the reflector
10:48Chouserok
10:48rhickeye.g. subsumes
10:56cconstantinegiven something like (23/2), how do I turn that into a whole number (doing some kind of rounding obviously)?
10:59dliebke,(Math/round (float 23/2))
10:59clojurebot12
10:59dliebkeseems ugly, but it works
11:00cconstantinethanks :)
11:01cconstantineand my program only has to do it once, so the multiple conversions isn't huge
11:07Guest29794cconstantine: you may also want to check out clojure.contrib.math.clj
11:07cconstantinewhere's the docs for controb?
11:07cconstantinecontrib
11:09Guest29794not sure there is one. i just grep the svn directory
11:09cconstantine:/ I was afraid of that. ok. Thanks
11:11cconstantineThe joys of working in a fresh new language :)
11:11danlarkinthe source is pretty good documentation :) for contrib at least
11:11ffailla_i have a hierarchical data structure made up of maps and seqs, and would like to perform a function on all the leaves. Does anyone know of a built in clojure function that will recurse through my structure and give me the leaves, or allow me to run a function on the leaves?
11:12cconstantinedanlarkin: that's good to hear
11:14Chouserffailla_: clojure.contrib.walk might have something useful
11:15brianh2ffailla: there's also the clojure.zip
11:18cgrandffailla_: there's also tree-seq
11:40ffailla_Chouser: walk will do what I need, thanks to everyone for your reponses
12:05tehello all
12:05cgrandhello
12:05tehow goes the struggle
12:05cgrand?
12:09tethe clojure struggler
12:09tetogether we can win!
12:28notfonkHey there
12:28notfonkhas anybody experience with vimclojure ?
12:28notfonki'm struggling to make it work :|
12:34ozzileeI'm having a problem compiling an application that uses clojure-json, and I'm not sure where to start:
12:34ozzileejava.lang.ClassNotFoundException: org.danlarkin.json.encoder$map_entry_QMARK___1 (json.clj:26)
12:35ozzileeI'm pretty much at a loss.
12:35danlarkinozzilee: I haven't tested clojure-json in a while, lemme see if it works for me
12:37danlarkintests pass and compile works for me
12:38danlarkinozzilee: does it work without AOT compiling?
12:40ozzileedanlarkin: Yeah, it works fine without AOT.
12:40ozzileeI'm trying to compile a compojure app to deploy to tomcat.
12:41danlarkincould you pastebin your build.xml? assuming you're using ant
12:44lisppaste8ozzilee pasted "clojure-json AOT" at http://paste.lisp.org/display/77230
12:46danlarkinwith this configuration either the clojure-json source or .jar would have to be in src/ or WEB-INF/lib/
12:46ozzileeIf I take out the (:require (org.danlarkin [json :as json])) from my project's namespace, I end up with a "No such namespace: json" error, which I would expect.
12:46ozzileedanlarkin: Yes, clojure-json.jar is in WEB-INF/lib/
12:47danlarkinHm
12:47ozzileeI guess I should go through and start commenting stuff out until it compiles...
12:49danlarkinare you sure that the clojure-json.jar is actually being included on the classpath for clojure.lang.Compile? I am not familiar enough with ant xml to be sure
12:51ozzileedanlarkin: Pretty sure.
12:51ozzileeThe rest of the jars seem to be.
12:52danlarkindid you jar clojure-json with -Dclojure.jar?
12:52danlarkinwhat happens if you try it the opposite way
12:53ozzileeNot sure. Give me a couple minutes, have to deal with some unrelated nonsense.
12:55danlarkinsure. If this is a problem with clojure-json I want to fix it
12:58notfonkanybody could give me some insight on a vimclojure problem ?
13:02hiredmannotfonk: I've only got a few minutes, it is generally better to just ask the question instead of asking meta questions (can I ask this question? does anyone know about this question? etc)
13:02hiredmanso ask away
13:04notfonkok
13:04notfonki've got an error many people had :
13:04notfonkwhen launching vim with vimclojure activated
13:04notfonkE605: Exception non intercept�e : Couldn't execute Nail! /home/
13:04notfonknotfonk/.vim/./ng de.kotka.vimclojure.nails.NamespaceOf
13:05notfonki checked everything in the related topics
13:05notfonkthe ng server is running, my classpath is good AFAIK
13:05notfonki checked the vimclojure and it looks allright, but i may be wrong on that
13:06notfonkbut i hadn't any compil errors
13:06notfonkbut when i do "ng
13:06notfonkde.kotka.vimclojure.nails.NamespaceOfFile "
13:06notfonki get this
13:06hiredmanis the ng binary in /home/notfonk/.vim/./ng, does the file you are editing have a correct namespace declaration and is that namespace in the classpath passed to the nailgun server?
13:06notfonkjava.lang.NoClassDefFoundError: clojure/lang/IFn at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.martiansoftware.nailgun.NGSession.run(Unknown Source)
13:06notfonkCaused by: java.lang.ClassNotFoundException: clojure.lang.IFn at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
13:06ozzileedanlarkin: I believe I just used 'ant' or 'ant jar' to build clojure-json into a jar.
13:07notfonk at java.lng.ClassLoader.loadClass(ClasCsLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 3 more the ng is in the right place
13:07hiredmannotfonk: what about "ng clojure.main"
13:07notfonkgonna try that
13:08danlarkinozzilee: ok, try compiling clojure-json with -Dclojure.jar=/path/to/clojure.jar
13:08notfonkhiredman : it doesn't find it either
13:08notfonk17:59 -!- jbomo [n=dkd@pool-71-108-227-15.lsanca.dsl-w.verizon.net] has quit [Read error: 104 (Connection reset by
13:09ozzileedanlarkin: ant -Dclojure.jar=/path/to/clojure.jar ?
13:09notfonkthe strange thing is that i run the server in the same terminal
13:09danlarkinozzilee: yup
13:09notfonkand there it founds everything it needs
13:09hiredmannotfonk: so something is wrong classpath wise, the nailgun server instance cannot find the clojure classes
13:10notfonkyeah it seems so, but my CLASSPATH env variable works for java
13:10notfonkthat's what i don't get
13:11hiredmanhow are you starting the nailgun server?
13:12notfonk/home/notfonk/.vim/ng clojure.main
13:12notfonkthat's it
13:12notfonkah sorry
13:12hiredmanthat is the nailgun client
13:12notfonki have a scriptfile
13:12notfonkjava -cp $CLOJURE_JAR:$CLOJURE_CONTRIB:$CLOJURE_VIM com.martiansoftware.nailgun.NGServer 127.0.0.1
13:13notfonkand i defined the three variables
13:13notfonkalthough if i launch it from the cli directly without -cp it works
13:13notfonksince my classpath is ok
13:13notfonki'm getting a bit confused, sorry about the hectic postings -_-
13:14hiredmansorry I've got to run, hopefully someone else will be a long shortly
13:14ozzileedanlarkin: Hmm well I've got things pretty well commented away to nothing at the moment, still won't compile, let me go down this path a bit further to see if I can get something to compile.
13:15notfonknp, ty hired
13:15notfonki don't see any way out anyway, think i'm gonna drop if 'till tomorrow
13:17notfonkhah !
13:17danlarkinozzilee: let me know if you come to any conclusions
13:17notfonki restarted my server directly from the cli and now "ng clojure.main" works
13:20notfonkok i solved it, looks like my script was the problem
13:20notfonkwhen i start the server directly from the cli everything works fine
13:35ozzileedanlarkin: I've concluded that I need a break and something to eat. I don't think the problem is with the json library, more likely I've got something set up wrong. Thanks for the help.
13:36danlarkinozzilee: I'll be here for a few more hours if you do end up fixing it
13:36danlarkinor if it turns out to be my fault after all
13:38ozzileedanlarkin: Sounds good, I'll let you know what I find.
14:18hiredman~logs
14:18clojurebotlogs is http://clojure-log.n01se.net/
14:23danlarkindid someone post a link to rich's qcon presentation yesterday or the day before? I seem to remember it but can't find it
14:25bitbcktit would be wonderful if clojurebot delicioused any links seen in the channel not posted by itself
14:25dliebkehttp://qconlondon.com/london-2009/file?path=/qcon-london-2009/slides/RichHickey_PersistentDataStructuresAndManagedReferences.pdf
14:25bitbcktlike that one
14:25durka42clojurebot: qcon slides is http://qconlondon.com/london-2009/file?path=/qcon-london-2009/slides/RichHickey_PersistentDataStructuresAndManagedReferences.pdf
14:25clojurebotRoger.
14:29danlarkindliebke: thanks
14:29dliebkenp, I wish I could have heard the talk :)
14:45Raynes"Emacs is a little too simple for my taste."
14:45RaynesIt's okay, he's new.
14:45Raynes:|
14:45p_lRaynes: then switch such a person to TECO
14:46durka42M-x butterfly
14:46p_lnah, ITS TECO.... every key is a command key! :P
14:55danlarkinHm. sun cloud http://www.tbray.org/ongoing/When/200x/2009/03/16/Sun-Cloud
15:00kotarak,(if (drop 3 '(1 2 3)) true false)
15:00clojurebottrue
15:00kotarak,(drop 3 '(1 2 3))
15:00clojurebot()
15:01danlarkin,(boolean '())
15:01clojurebotjava.lang.NoClassDefFoundError: clojure/lang/PersistentList$EmptyList$1
15:01danlarkinpah
15:02danlarkin,(type (drop 3 '(1 2 3)))
15:02clojurebotclojure.lang.LazySeq
15:12Lau_of_DKHi guys
15:18hiredmananyone know how I can change the user-agent of a urlconnection?
15:19hiredmanactually, HttpURLConnection
15:20danlarkinconnection/setRequestProperty
15:20danlarkinwell you get the idea
15:20danlarkinI guess it's not a static method
15:21danlarkin(.setRequestProperty connection "User-Agent" "foo")
15:32hiredman*sigh*
15:32hiredmanstill getting a 401 from delicious
15:33durka42sorry, you are not authorized to enjoy food
15:35hiredmanand, of course, if I paste the url into firefox it goes through just fine
15:36danlarkincurious
15:36durka42cookie?
15:42hiredmanugh
15:42hiredmanthe url also works if I use "fetch"
15:42hiredmanI guess I could just shell out
15:48ozzileedanlarkin: Solved my problem. You have to include the build directory in the classpath when compiling. My mistake.
15:48danlarkind'oh!
15:49danlarkinozzilee: well I'm glad to hear you got it figured out
15:52ozzileeYeah. This stuff can be a bear to debug sometimes. But I will remember next time, just like I remember that "java.lang.ArrayIndexOutOfBoundsException: 5" means misformed XML for lazy-xml/emit.
15:54danlarkinaye I know what you mean
15:55ozzileeAlso, "Don't know how to create ISeq from: <whatever>" means "Good luck finding this one, sucker." :-)
15:55Chouserdrat
15:56ozzileeBut now it works, and your json lib works fine, thanks for writing that, btw.
16:03Raynes"I'd venture that it's [Ruby on rails] at least as eye-opening as something based on LISP or Smalltalk or Haskell, but probably more practical because you may actually end up using it at a job or for contract work. Clojure, Seaside, and HAppS sound really cool, but until one of them really catches on, you're unlikely to ever use any of that stuff again in your career unless you're a computer...
16:03Raynes...science PhD working with other PhD's."
16:03RaynesSorry, didn't realize that was so long.
16:03rhickeyRaynes: said where?
16:04RaynesStackoverflow.com The home of the career codemonkeys. :\
16:05Rayneshttp://stackoverflow.com/questions/656987/tired-of-asp-net-which-of-the-following-should-i-learn-and-why to be specific.
16:05Raynes2 people including me recommended Clojure and didn't get a single vote up. ._.
16:06danlarkinSO is a good idea but it's filled with zealots
16:06RaynesAgreed.
16:07Lau_of_DKHmm Raynes - I found this photo of you, and now I see why people dont vote for you so much http://photo.net/photodb/photo?photo_id=2490048
16:08RaynesOh noes. I've been found out.
16:08kotarakThere was a question on how to remember what values true and false are. There were several answer explaining, that false is zero and true anything else. And the only sane answer, which didn't chime in in the number stuff, didn't get a single vote... Well. With the blind the one-eye is king.
16:09RaynesWell, the thing is normally when you recommend Clojure and other functional languages others support you and vote you up. I guess they assumed that he want something "Practical" and something he can use in his "Career" and we all know, Clojure is NOT practical!
16:09Lau_of_DKFunny discussion this is "We're the best, but nobody gets us"
16:09Lau_of_DKReminds me of the blessed Common Lisp days :)
16:10RaynesI have 14 votes up for answering a question an explaining what let does to someone.
16:11RaynesEr, not explain what let will /do/ to someone, explaining what let does in a program to someone :p
16:12Lau_of_DKoh ok..
16:12Lau_of_DK:)
16:13Lau_of_DK"Well, if you use let in an anonymous function, it will in fact attack your manager, and THATS why you should use Clojure"
16:17cemerickhas there really not been a "Going to ILC 2009?" thread on the google group? I'll start one, but I figured it'd already be one up.
16:17cemericks/it'd/there'd
16:19RaynesWho voted me up?
16:19RaynesThey deserve a hug.
16:21RaynesSomeone else voted me up O.O
16:21hiredmanclojurebot: delicious is http://delicious.com/clojurebot
16:21clojurebotOk.
16:23RaynesEr wait, only one person, the last vote up was on a different question.
16:23hiredman http://delicious.com/clojurebot is clojurebot's feed of urls from channels, it tags with channel and nick of where the url came from
16:24RaynesSomeone voted up a (stupid) question I asked 2 days ago. Neat.
16:26hoeckhiredman: cool!
16:28RaynesI managed to get one of the people who think that OOP is the God of the programming world interested in Clojure. Took me 2 hours of coercing to do it but I managed it.
16:34bitbckthiredman: my hero
16:35danlarkinI like the turnaround on clojurebot features
16:35bitbcktdanlarkin: me too!
16:36hiredmanI am all about low hanging fruit
16:37bitbckthiredman: subscribing to #clojure URLs is oh-so-tasty
16:42hiredmanonce rhickey posts a link, there will be an rhickey tag, so you can subscribe to links posted by rhickey in #clojure
16:44bitbcktand this makes me a happy boy
16:46danlarkinthat's pretty neat
16:46danlarkingood feature
16:47hiredmanyeah, I have seen a similar ircbot feature, that did not use delicious, I think tag by channel and by nick is a winner
17:09hiredmaneh?
17:09drewrI have a process that's normally around 60MB on my laptop (OS X); it's 1000MB on the server.
17:09waltersdrewr: in what respect?
17:09hiredmanoh, that rss
17:10drewrIt loads a 4MB file into memory and serves info from it via Jetty.
17:10waltersdrewr: ok...one thing to keep in mind is that Apple's JVM is different from Sun JDK/OpenJDK
17:10drewrTrue, but why would the kernel provision that much extra?
17:10waltersdrewr: there are other possible major variables; is your server 64 bit?
17:10drewrYes.
17:10waltersthat makes a big difference
17:10waltersit will kick the jvm into --server mode by default
17:11waltersand of course pointers are bigger
17:11walters(upcoming pointer compression will be cool)
17:12drewrI can understand all that, but 1GB? That's pretty outrageous.
17:12waltersright, agreed
17:12waltersit seems to me there's some sort of leak there
17:12drewrI need to watch it to see how much it's actually growing.
17:12walterse.g. are you using the same libraries and same versions thereof?
17:13drewrYeah, I just deploy a jar with everything the same as the dev env.
17:13RaynesI think walters is Walter Bright undercover because he doesn't want the D programmers to know that Clojure is his secret pleasure.
17:14waltersheh
17:14waltersno, i'm just a gnome developer interested in languages
17:14RaynesSure you are - Mister Bright.
17:15waltersdrewr: well, i'd try something like https://visualvm.dev.java.net/ there's a variety of tools out there
17:16drewrwalters: Thanks.
17:20tashafahello all
17:23waltersdrewr: oh, one other important thing to keep in mind is the default ergonomics
17:23waltersdrewr: http://java.sun.com/docs/hotspot/gc5.0/ergo5.html
17:24waltersdrewr: basically if your server has say 16G of ram, the JVM default heap size is going to be a lot larger than on your 1G laptop
17:24walterswell if you're running OS X on a laptop you probably have at least 4G to make the OS run ;)
17:25drewrIt does just fine with 3G :-)
17:28drewrAccording to the ergo site, the initial heap size should be 1/64th of the physical mem, which is around 175m for this box.
17:30waltersdrewr: *initial* - not maximum
17:31waltersdrewr: if you haven't set any other constraints the JVM will fill up to the maximum for most collectors AIUI
17:31drewrThat's what it seems like.
17:31drewrIs it common to limit heap size or is that not recommended?
17:32waltersit's all pretty busted - what we really want is for the VM to get memory pressure notifications from the kernel, and know when to GC more intelligently
17:32drewrI can do it with an external parent process but I'd rather not kill the child.
17:32drewrYes!
17:32waltersyeah, it's very common to set -Xmx in JVM launching scripts
17:50RaynesExactly 100 users in #Scala.
17:50RaynesFirst time I've seen it that high since everybody thought Tony Morris offed himself.
18:29Raynes"Here's one way to reimplement null -> def mynull = error("you know you're going to get an NPE eventually anyway, so I'm just saving you the trouble.")"
18:39brennancwhy can't I do (map #([%]) [1 2 3])?
18:40brennancI have to do (map (fn [x] [x]) [1 2 3])
18:42hiredmanclojurebot: #()?
18:42clojurebot#() is not a replacement for fn
18:42hiredmanbrennanc: it is because of what #() is
18:42hiredman(macroepand-1 '#(foo))
18:42hiredman,(macroepand-1 '#(foo))
18:42clojurebotjava.lang.Exception: Unable to resolve symbol: macroepand-1 in this context
18:42hiredman,(macroexpand-1 '#(foo))
18:42clojurebot(fn* [] (foo))
18:43hiredman,(macroexpand-1 '#([x]))
18:43clojurebot(fn* [] ([x]))
18:43kotarak#(vector x)
18:43hiredmanso [x] is being called as a function with no arguments
18:43kotarak,(map #(vector %) [1 2 3])
18:43clojurebot([1] [2] [3])
18:43hiredman,(map vector (range 3))
18:43clojurebot([0] [1] [2])
18:44brennancI think I get it
18:45hiredmanclojurebot: function literals is <reply>Function literals are cute, but overused
18:45clojurebotOk.
18:48kotarakclojurebot: reader syntax of collections is <reply>Reader syntax of collections has gotchas
18:48clojurebotAck. Ack.
18:48brennancare you guys programming clojurebot to respond to things right there?
18:49brennancclojurebot: function literals?
18:49clojurebotFunction literals are cute, but overused
18:49brennanchmm, cool
18:49Chousukehiredman could really *program* it to respond to things. it's running in a repl :P
18:50Chousukein fact I think he sometimes does that. new features just appear
18:51brennancI was just glancing at the "Eliza" AI program last night from PAIP
18:51jhawk28clojurebot: well?
18:51clojurebotGabh mo leithsc�al?
18:51brennancthat would be a trip
19:19drewrwalters: visualvm ftw. It showed me that the size of all the objs used by my program was only 16m :-)
19:22waltersdrewr: ah, so it probably is just that your program generated garbage until the jvm got close to the max 1G heap, then collected but is unable to shrink the heap
19:23drewrYeah, because the usage was up to 200m before I GCed it.
19:24drewrhttp://img11.imageshack.us/img11/6507/cljzipheap.png
19:25drewrThat cliff at the right is where I hit the GC button.
19:34Mecwhat would the regex be for checking of a string doesnt contain a specific character?
19:37durka42,(map #(re-find #"^[^a]*$" %) ["this string contains an a" "this string does not"])
19:37clojurebot(nil "this string does not")
19:38durka42or you could just search for the character and invert the result...
19:38Mecweird, i thought ^[^a] would only check if a was the first character
19:38durka42^ says at the beginning
19:38durka42[^a] says anything but \a
19:39durka42* says zero or more times
19:39durka42$ says end of string
19:39Mecahh right right now i see
20:13Mec,(Integer. (apply str (reverse (seq (str 543)))))
20:13clojurebot345
20:13Mecany thoughts on a better way?
20:16durka42hmm, putting digits back together is pretty easy
20:16durka42,(reduce #(+ (* 10 %1) %2) [1 2 3])
20:16clojurebot123
20:16durka42how to get them apart in the first place, though
20:17Mecthey're characters after calling (reverse) not integers
20:18Mec,(reverse (str 123))
20:18clojurebot(\3 \2 \1)
20:18jsankeytake them apart by dividing by 10?
20:20durka42yeah
20:20durka42,(loop [n 123 rev 0] (if (< n 1) rev (recur (int (/ n 10)) (+ (* 10 rev) (mod n 10)))))
20:20clojurebot321
20:21durka42i wonder if there's a more expressive way to express that
20:21Mec,(time (loop [n 123456789 rev 0] (if (< n 1) rev (recur (int (/ n 10)) (+ (* 10 rev) (mod n 10))))))
20:21clojurebot987654321
20:21clojurebot"Elapsed time: 2.531 msecs"
20:22durka42,(time (Integer. (apply str (reverse (seq (str 123456789))))))
20:22clojurebot987654321
20:22clojurebot"Elapsed time: 0.435 msecs"
20:22Mecinteresting
20:22Mec> ,(time (Integer. (apply str (reverse (str 123456789)))))
20:22Mec,(time (Integer. (apply str (reverse (str 123456789)))))
20:22clojurebot987654321
20:23clojurebot"Elapsed time: 0.353 msecs"
20:23Meci'd have thought the math would be faster
20:24jsankeyis there a way to get the whole and remainder parts of a rational, so you don't need to divide and mod separately?
20:24ChouserI don't think so. rem and quot are the way.
20:24durka42,(.numerator (/ 123 10))
20:24clojurebot123
20:25Chouser,(map #(% 7 4) [quot rem])
20:25clojurebot(1 3)
20:25Chouserdurka42: ooh.
20:25Chousero
20:25Chouseroh
20:25durka42no that wasn't it, my mistake
20:25durka42quot makes it a lot faster actually
20:26durka42,(time (loop [n 123456789 rev 0] (if (< n 1) rev (recur (quot n 10) (+ (* 10 rev) (mod n 10))))))
20:26clojurebot987654321
20:26clojurebot"Elapsed time: 0.816 msecs"
20:26durka42,(time (loop [n 123456789 rev 0] (if (< n 1) rev (recur (quot n 10) (+ (* 10 rev) (rem n 10))))))
20:26clojurebot987654321
20:26clojurebot"Elapsed time: 0.748 msecs"
20:26Mecya rem is slightly faster than mod too
20:26durka42the obvious way is still faster :)
20:27Meci wouldnt call: turning a number into a string into a sequence, reverse, back to string to int obvious :D
20:27durka42you would think the basic operations would be the same
20:27durka42int->string by dividing and modding by 10
20:27durka42string->int by multiplying and adding
20:27durka42but it's implemented in native code
20:28durka42FSVO native
20:29Mec,(Integer. "6952014971")
20:29clojurebotjava.lang.NumberFormatException: For input string: "6952014971"
20:29Mecwhat should i use instead of integer?
20:30foresttoo big
20:30forestLong will be fine
20:31Mecnaw still too small, what's the class for bignum or bigint, whatever it is
20:31forestBigInteger
20:31Mecthere we go, thanks
21:05Mecany thoughts why (count string) is faster than (.length string)
21:05ChouserI don't buy it. :-)
21:07Chouseroh. reflection
21:08Mechmm
21:08Mecmakes sense i spose
21:09Chouser(.length #^String x) is about 4 or 5 times faster (count x)
21:10Mecthat gives me a couple of errors
21:10Chouser(.length x) for unhinted x is about 100 times slower than (count x)
21:10Mec(.length #^String "123")
21:11Mechmm did i kill it
21:11Mec,(.length #^String "123")
21:11clojurebotMetadata can only be applied to IMetas
21:11Chouser,(let [x "123"] (.length #^String x))
21:11clojurebot3
21:13Mec,(let [x (apply str (take 1000 (repeat 1)))] (time (.length x)) (time (.length #^String x)) (time (count x)))
21:13clojurebot1000
21:13clojurebot"Elapsed time: 0.216 msecs" "Elapsed time: 0.092 msecs" "Elapsed time: 0.0060 msecs"
21:14Chouserit's hard to get consistent results from microbenchmarks, especially on the JVM
21:15Mectrue
21:16Chouserso it's good to put the the code you want to run in a function and call it lots of times each time you call it, make sure it's doing enough iterations to last at least a tenth of a second
21:16Chousermake sure your processor doesn't change speeds
21:17Chouserwhen you can run the same code a few times in row and get roughly the same number, then note that and try your next test case.
21:20dreishI like the word "performant", because it's like shorthand for "I don't know what I'm talking about, don't bother listening to me."
21:21Chouserheh
21:27Mecis there a version of max that would work for strings?
21:29durka42depends what you mean by the maximum string :p
21:29durka42there's the new max-key
21:29Mecusing compare
21:30Chousergnuvince: have I dropped the ball greatest/least ?
21:33Chouserthe github project is gone. :-(
21:35gnuvince_Chouser: yeah, I deleted it. I still got a copy on my hard drive, you want?
21:35Chousergnuvince_: where did we leave it? I thought i was suppose to look it over and put it in contrib.
21:36gnuvince_The issue sort of just died.
21:36gnuvince_I'll put the repo back up.
21:39RaynesI'm one chapter away from completing Programming Clojure
21:39jsankeyany zip/xml-zip gurus out there?
21:40jsankeyshould it be possible for (remove (next (down loc))) to throw an NPE if (node (next (down loc))) gives me back something sensible?
21:40gnuvince_Chouser: http://github.com/gnuvince/clojure-greatest-smallest/tree/master
21:40Chousergnuvince_: I think the functionality is very useful.
21:50jsankeymore specifically: i have xml like <root><foo/><bar/><baz/></root>, and a function to remove by tag name
21:50jsankeyif i i remove :foo it works, but :bar and :baz both give NPEs
21:51jsankeyany pointers greatly appreciated (totally new to clojure and .zip)
21:54Chouser,#'remove
21:54clojurebot#'clojure.core/remove
21:54Chouser,#'clojure.zip/remove
21:54clojurebot#'clojure.zip/remove
21:55Chouserjsankey: which remove are you using?
21:55jsankeyChouser: zip.remove
21:59jsankeythe tag stripping function is:(defn strip [root tag]
21:59jsankey (loop [loc root]
21:59jsankey (if (zip/end? loc)
21:59jsankey (zip/root loc)
21:59jsankey (let [node (zip/node loc)]
21:59jsankey (recur (zip/next (if (= (:tag node) tag)
21:59jsankey (zip/remove loc)
21:59jsankey loc)))))))
22:08slashus2ugh
22:11hiredmanadding a (-> loc zip/node println) can be helpful for debugging
22:12jsankeyhiredman: thanks, i'll try it
22:14hiredman,(require '[clojure.zip :as zip])
22:14clojurebotnil
22:14hiredmanugh
22:16hiredmanthe idea of futzing with xml/parse until it reads from a string is very discouraging
22:16jsankeyhmmm, it just shows the bar node i expect before the 'splosion
22:17hiredmanI think remove on bar will try to return foo which has been removed
22:18hiredmanI would print the output of the remove
22:18cconstantineWhat's the replacement for lazy-cons?
22:19hiredmanlazy-seq
22:19jsankeyhiredman: it happens when just removing :bar, without touching :foo
22:19cconstantineit's not in the docs... whats the api?
22:19hiredman,(doc lazy-seq)
22:19clojurebot"([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls. Any closed over locals will be cleared prior to the tail call of body."
22:19cconstantineah, 'doc' appears useful :)
22:19hiredmanthe web site api reflects the last release
22:20jsankeyyou can feed a string to xml/parse by wrapping it in java crud: (java.io.ByteArrayInputStream. (.getBytes "str"))
22:20Chouser,(-> "<root><foo/><bar/><baz/></root>" java.io.StringReader. org.xml.sax.InputSource. clojure.xml/parse clojure.zip/xml-zip clojure.zip/down clojure.zip/remove)
22:20clojurebotjava.lang.NoClassDefFoundError: clojure/zip$xml_zip__5926$fn__5928
22:21Chouseroh
22:21hiredman,(import 'java.io.ByteArrayInputStream)
22:21clojurebotnil
22:21hiredman,(import 'org.xml.sax.InputSource)
22:21clojurebotnil
22:21cconstantinehiredman: Firefox's find can't find lazy-seq in the api doc
22:21Chouseranyway, that works. but if you put clojure.zip/next before the remove, NPE
22:21hiredmancconstantine: as I said, the website api reflects the latest release
22:22hiredmanwhich was back in december
22:22cconstantinehiredman: ahhh, and if I pulled from svn I may have something newer than 'latest'
22:22cconstantinehiredman: ok, thanks :)
22:22hiredmanyou have svn, not a release
22:27jsankeyprobably an faq: but how do i get to the line of clojure code where the npe occurs?
22:27pstickneis there a yacc and/or well-documented p-c library and/or other tool for creating a simpler parser?
22:27Chouser(.printStackTrace *e)
22:28pstickneI found fnparse and the parser from kotka (based on haskell's p-c?)
22:28pstickneBut they are both only barely documented.
22:28ChouserI've heard good things about fnparse
22:29pstickneI guess I'll sit down with it a bit longer then :)
22:29jsankeyah - sorry - i see if i learn how to use SLIME i can dig a little
22:37psticknehow can I add a path to closure files so they will be found? e.g. my source is foo.clj and I want to access fnparse/src/fqnstartshere
22:37jsankeyi see (slowly) that the codepath is triggered by the loc having left siblings
22:38psticknedo I need to rely on the classpath? :(
22:43Chouser'branch?' returns true, but 'down' NPEs
22:43jsankeyyeah, something like that
22:44hiredmanpstickne: the path to fnparse needs to be on the classpath, then you can use require or use
22:44psticknehiredman: darn, I wish I could ditch that wretched thing :)
22:44jsankeyso if i replace branch? with false for this simplistic case it works
22:45jsankeyi think perhaps the test needs to be more than just branch? i.e. branch? and has at least one child?
22:45hiredman~jar directory
22:45clojurebotwith java6(jdk1.6) CLASSPATH can contain a "*" so /jar/dir/* will suck in all the jars in the /jar/dir directory, this also works with swank-clojure-extra-classpaths in emacs, alternatively you can use this shell snippet: find .jars/ -type f -name \*.jar -print0|xargs -0|sed "s/ /:/g"
22:45jsankeyadmittedly i am in way over my head atm :)
22:46hiredman~namespace
22:46hiredmanclojurebot: eh?
22:46clojurebotIt's greek to me.
22:46hiredmanclojurebot: namespace
22:46hiredmanclojurebot: namespaces
22:46clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
22:47Chouserjsankey: the implementation of 'branch?' depends on the kind of tree
22:47psticknearg.
22:48pstickneis there a closure-contrib single-file download somewhere? :(
22:48Chouserfor xml, it's (complement string?)
22:49jsankeyChouser: according to the docs, branch? can return true even if there are no children atm
22:49psticknewell, this sucks :(
22:49jsankeyChouser: which seems like bad news for the -> down rightmost that it can trigger?
22:50Chouserhm...
22:51jsankeyif i make it: (and (branch? loc) (not (empty? (children loc)))) it works
22:51jsankeyfor some value of works, anyway
22:51hiredman,(pl inc $ inc $ inc $ 0)
22:51clojurebot3
22:51psticknesvn: OPTIONS of 'http://clojure-contrib.googlecode.com/svn/trunk': Could not resolve hostname `clojure-contrib.googlecode.com': Host not found (http://clojure-contrib.googlecode.com) :(
22:52hiredmanontrib
22:52hiredmangrrr
22:52Drakeson`what is the inverse of prxml?
22:52hiredman~contrib
22:52clojurebotcontrib is http://code.google.com/p/clojure-contrib/
22:52psticknecode.google.com/* stuff usually contains the most useless outdated links in my experience :(
22:52hiredmanhmmm
22:53Drakeson`(clojure.contrib.prxml)
22:53Chouserjsankey: i think that might be the right fix
22:53hiredmanpstickne: my svn checkout of contrib works fine
22:54jsankeyChouser: if it is, i would consider it a fluke, as it is 3am here and i'm starting to get parens etched into my retinas ;)
22:54psticknesvn: Server sent unexpected return value (400 Bad Request) in response to OPTIONS request for 'http://code.google.com/p/clojure-contrib' :(
22:54Chouserjsankey: would you mind writing up a runnable example that demonstrates the problem, posting it to the google group?
22:54psticknehiredman: can I get the command you used? :p
22:55jsankeynp, i'll do so (later) in the morning
22:55hiredmanpstickne: well I already have it checkout so I just "svn up"
22:55hiredmanugh, something is very wrong with quotes here
22:55psticknehiredman: can I grab the url via svn info? :)
22:56jsankeyChouser, hiredman: thanks for your help, i'm out for the night
22:57hiredmanpstickne: it is the same url that is on the source page of the googlecode site
22:57psticknehiredman: then why is it giving me such odd errors :(
22:58pstickneoh, I give up. it works now. stupid DNS fail.
22:58hiredman~works on my machine
22:58clojurebothttp://haacked.com/images/haacked_com/WindowsLiveWriter/IConfigMapPathIsInaccessibleDueToItsProt_1446B/works-on-my-machine-starburst.png
23:03Raynes~The phone rang and nobody was there, as I put down the phone... Suddenly...
23:03clojurebotNo entiendo
23:03Rayneso_o
23:06hiredmanfrom amidst the confusion, sudden...
23:07pstickneand of course fnparse has an error with the current version of clojure/contrib :(
23:09RaynesOh no.
23:09RaynesThe world shall surely end!
23:10pstickneRaynes: :(
23:10RaynesI'm just kidding, I feel your pain.
23:11psticknethere is definitely something good about object-qualified names :(
23:12pstickneand same for static types..
23:12pstickne(next tokens) is what dies :(
23:13Chouseryou've got clojure from svn?
23:18pstickneChouser: the 20081217 jar from the main site
23:19pstickneTrying the svn now with fingers crossed...
23:19pstickneErr... uck. I don't want to build it :p
23:20pstickneoh, maven, yay!
23:21psticknehmm, it's also tagged 20081217 :(
23:21Raynespstickne: Building it is as simple as typing ant build :p no special stuff. Or maven.
23:22Drakesonhow do you write build.xml files? do you do it by hand? is there a clojure tool to create build.xml files?
23:22pstickneRaynes: just built it, that was even simpler then I thought \o/
23:22pstickneAnd it works \o/
23:23pstickne(So what /is/ next? The API only shows something wrt. hierarchies)
23:23RaynesBuild.xml is an ant build script. You write them by hand. I don't suppose there is a tool to create them, IDE's generate them for building though, but not quite what you are thinking about.
23:23durka42pstickne: do the same for contrib :)
23:24Raynesdurka42: Didn't he /have/ to? You can't download C-C.
23:24RaynesThere are no releases the last time I checked >_>
23:24durka42meh? oh, i thought he was talking about building the main clojure
23:24durka42that'll teach me to jump into the middle of conversations
23:24RaynesHe did build the main Clojure.
23:25RaynesBut in order to get Clojure-Contrib you have to svn it I thought.
23:25durka42as far as i know
23:25pstickneyeah, I had to get c-c from svn -- but no build for it
23:25pstickne(or at least none I ran :p)
23:25RaynesThere is a build file for it.
23:25Chouserthere is one, but you hardly ever need it.
23:26RaynesIt just .jars it.
23:26Chouserpstickne: the web site largely documents the release. now you're on svn trunk, you're way ahead of all that. :-)
23:26RaynesIsn't much use for it, it doesn't compile it or anything it just jars it. I jarred it because netbeans borks on folders.
23:26pstickneChouser: O.o
23:26durka42you can get it to compile them
23:26Chouserpstickne: so get used to using the doc and find-doc functions
23:26Raynes(doc cons)
23:26clojurebotReturns a new seq where x is the first element and seq is the rest.; arglists ([x seq])
23:27pstickneChouser: just from the repl?
23:27Chouserpstickne: you can read http://clojure.org/lazy for a sense of some of the big changes since the last release
23:27Chouserpstickne: yes
23:27Raynes,(find-doc "cons")
23:27clojurebotjava.lang.NoClassDefFoundError: clojure/core$ns_interns__4302$fn__4304
23:27RaynesWell, you get the point.
23:27psticknethanks :)
23:28RaynesYou're welcome.
23:28durka42at this point Chouser should plug his c.c.repl-utils
23:28RaynesAfter I read this, I will have knowledge of every major feature in Clojure.
23:28ChouserI'll go to bed instead.
23:28Raynes\o/
23:43stuhoodwhats the function that generates an output sequence that alternates between input sequences?
23:44cmvkkinterleave?
23:44stuhoodahh
23:45stuhoodcmvkk: thanks a lot!
23:45stuhoodsynonyms, oi