#clojure logs

2008-12-03

05:02blackdogthis looks interesting http://github.com/aemoncannon/las3r/wikis
06:50AWizzArduh, jdk 6 update 11 is out
06:51AWizzArdthat was fast.. 10 came out only 6 week ago
07:02hoeckblackdog: yeah, I've seen this too, very nice.
07:25AWizzArdHi rhickey. Could the docstring of (defn repl ...) in main.clj need a correction, where it still says "default: println" vs "default: prn"?
07:27rhickeyAWizzArd: done
07:29AWizzArdrhickey: btw, is it planned that Clojure will support annotations one day? Or do you think this will never make sense?
07:30rhickeyAWizzArd: I imagine it will someday
07:30AWizzArdI would like to use a very powerful webdevelopment framework for Java (Rife) which uses annotations in a few cases. So perhaps I could have a use for that feature in the future.
07:31rhickeyAWizzArd: what does Rife need?
07:31rhickey(pointer to javadoc is fine)
07:31AWizzArdhttp://rifers.org/wiki/display/RIFE/Annotations+support+for+element+declaration
07:32AWizzArdI would like to clojurize Rife over the coming weeks, and I think when that is done we can outperform Ruby+Rails with the combo Clojure+Rife.
07:38rhickeyAWizzArd: it doesn't look like those attributes are required, and you might get more power from a code-based approach since you have macros: http://rifers.org/wiki/display/RIFE/Site+structure+and+element+declaration+without+XML
07:38AWizzArdyes, I would like to macro most/all pain out of Rife which it got because of the use of Java.
07:39rhickeyAWizzArd: I would stay away from named classes and attributes then
07:40AWizzArdI will later look deeper into Rife, to see if annotations and other stuff really is needed. Currently I still have the problem that I can't get it running. I was already discussing the issue with Chouser to some extent.
07:40rhickeyRife does bytecode transformation, right?
07:41AWizzArdMy idea is to get the minimal Rife app running, a HelloWorld. Currently the hello world example contains just a .java file. Rife expects either .class or .java files. What Chouser and I tested was to compile the existing .java with javac and just have the .class there. This works.
07:41AWizzArdWhen I put in instead my 3 (with clojure) compiled .class files it can't instatiate HelloWorld
07:42AWizzArdI am not sure if it transforms Bytecode
07:43rhickeyI went to a Rife talk at Java One, I think it does
07:43AWizzArdMy clojure code compiles. At the top you see the original .java code, at the bottom my .clj code: http://paste.lisp.org/display/71154
07:44AWizzArdthe stuff after (defn -processElement ...) is just for me, to remember what I need
07:45AWizzArdLet's say Rife does indeed do bytecode transformation. What would this then mean for the combo Clojure+Rife? Could it still work?
07:46rhickeyThat depends on whether Rife could handle the bytecode Clojure emits, I'm sure it's expecting bytecode produced by Java
07:48AWizzArdIn fact Geert Bevin said something like that.. I told him about my plan, to replace the HelloWorld.java with .class files from Clojure, and just tell jetty where it finds the clojure.jar. But he then said that he doesn't expect it to be so easy.
07:48AWizzArdFor Groovy they had to do some extra work. Now Rife can also take plain .groovy files and will compile them on the fly.
07:49AWizzArdThis would be the goal for Clojure as well, but I hoped the other step would be easier and work straight away, without writing any .java code.
07:55leafwhi all. So find-doc is supposed to be able to accept #"regex", yet it doesn't: java.lang.ClassCastException: java.util.regex.Pattern cannot be cast to java.lang.String
07:56leafwrev 1138 supports it, according to the commit message
07:57rhickeyleafw: works for me
07:57rhickeyant clean?
07:58leafwchecking
08:00leafwsame thing
08:00leafwlet me check more
08:00leafwmy classpath is too long, maybe contains other clojure.jar
08:02leafwnice, now it worked
08:02leafwthanks rhickey
08:03leafwby the way, would be nice if (doc ...) accepted regex too, but for function names only.
08:04rhickeyleafw: unlikely
08:05leafwwill make my own in user.clj
08:05rhickeythere you go
09:00leafwin gen-class :methods, the example at http://clojure.org/compilation lists a new method as [[foo [] String]]; if I understand correctly, this means a vector of one method, the latter a vector with the name, an empty vector and a String type. What are the empty and the String doing there?
09:00leafwthe empty I guess is the paramters. But the String?
09:00rhickeyleafw: return value
09:00rhickeyreturn type
09:01leafwaha, thank you.
09:01rhickey(doc gen-class)
09:01clojurebotWhen compiling, generates compiled bytecode for a class with the given package-qualified :name (which, as all names in these parameters, can be a string or symbol), and writes the .class file to the *compile-path* directory. When not compiling, does nothing. The gen-class construct contains no implementation, as the implementation will be dynamically sought by the generated class in functions in an implementi
09:01rhickeyaargh
09:02leafwcut short.
09:02rhickey :methods [ [name [param-types] return-type], ...]
09:02leafwand when void, just nil return type? Or must return something always?
09:03rhickeyvoid
09:03rhickeyit's a Java signature
09:04leafwthanks.
09:05abrooksVoid (upper case)
09:06rhickeyabrooks: no, void/int/float etc should now work, no need for Void/TYPE
09:06lvijayclojurebot: svn
09:06clojurebotsvn co https://clojure.svn.sourceforge.net/svnroot/clojure clojure
09:07blackdogping Chouser
09:10blackdogrhickey, you will be interested in this too, clojure in AS3 http://github.com/aemoncannon/las3r/wikis
09:11rhickeyblackdog: yes, I spoke with him when he embarked on that
09:11blackdogoh really :) ok, thought i was ahead of the curve
09:16duck1123it looks pretty neat
09:16duck1123the repl still hasn't loaded for me though
09:17abrooksrhickey: Ah! Okay, thanks.
09:17blackdogcould be useful to do a haxe port of that, and see if it can't target both flash and js at the same time
09:21rhickeyduck1123: it doesn't really say anything when it's done loading, just type in the lower frame
09:22duck1123ahh, ok. I know nothing about flash, so it has little use for me.
09:30alvin-x$ java -cp clojure.jar clojure.lang.Repl Exception in thread "main" java.lang.ClassFormatError: JVMCFRE068 class name is invalid; class=clojure/core-proxy__init, offset=0 at java.lang.ClassLoader.defineClass(ClassLoader.java:264) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(URLClassLoader.java:506
09:30alvin-xahem
09:31alvin-xhttp://paste.lisp.org/display/71490
09:31alvin-xsvn 1141, compiling and running under Java 5 in AIX... compiling goes ok, but running -- not so good
09:36danlarkinGooooooodmorning clojurecrats
09:37abrooksClojurites?
09:37danlarkinclojureitis?
09:37rhickeyalvin-x: I was wondering when some VM would complain about that - fixed in svn 1142
09:37alvin-x:)
09:37abrooksdanlarkin: Ew.. :)
09:38alvin-xrhickey: ok, i'll get it
09:41danlarkinclojurebot: clojureitis is a condition in which it becomes impossible to program in other languages anymore
09:41clojurebotIn Ordnung
09:43alvin-xrhickey: it worked
09:47lisppaste8leafw pasted "Trying out gen-class" at http://paste.lisp.org/display/71492
09:48leafwwould appreciate help figuring out why I get an error such as: Caused by: java.io.FileNotFoundException: Could not locate fj/process/FloatProcessorPlus__init.class or fj/process/FloatProcessorPlus.clj on classpath
09:48Chouseradd "./classes/" to your classpath
09:49leafwChouser: ./classes/ being a folder where classes will be generated to? Should I create that folder if it doesn't exist?
09:51leafwdidn't work either way
09:51leafwdespite the obvious namespace typo in the paste, fiji for fj in the -main
09:52duck1123rhickey: Do you need the CA's mailed to you, or is it ok to scan it and email you the PDF?
09:53leafwI hope I don't need to save the .clj file under the hierachy of folders specified in its namespace?
09:53Chouserleafw: yes, I think you do.
09:53leafwargh
09:54leafwnow that is ugly.
09:54Chouserleafw: embrace the javaness :-/
09:54leafwprecisely, clojure was freeing me of it.
09:54duck1123is it still possible to store it somewhere else if you use load? or is that gone?
09:55duck1123not that doing that was a very good idea
09:55Chouseryou can put the .clj wherever you want, unless you want to use compile, require, use, etc. on it. For those, it has to be in a well-known place so they can find it.
09:57leafwstill fails, ... this is frustrating
10:00Chousermake sure you lib loads okay with (require 'my.lib) first
10:01leafwit's all in the same file, like the example in the webpage
10:01leafwdon't think one needs to require the self file
10:01cemerickconforming to some kind of package/namespace directory convention is necessary for any kind of useful module system. We happen to be reusing java's approach, but I'm not sure that anything bad comes out of that.
10:01leafwChouser: but I see that logically there may be an imports problem
10:47leafwI am either profoundly stupid, or the gen-class needs a very, very detailed hold-my-hand tutorial. No matter what, I always get java.io.FileNotFoundException: Could not locate .... something is just plain unintuitive to me with the gen-class implied requirements.
10:48Chouserleafw: I've not used gen-class as a stand-alone call like that (since AOT anyway), I've always just used :gen-class in the ns macro call.
10:48leafwChouser: on the ns macro call I can't get it to work either.
10:49rhickeyleafw: have you tried the examples here? : http://clojure.org/compilation
10:50leafwmy setup: ./fj/tests/process/imageprocessor-filter.clj , and that file declares (ns fj.tests.process.FloatProcessorPlus ..., and I am trying to compile it from a Repl started at the parent folder of ./fj/ folder.
10:51rhickeyleafw: you shouldn't have dashes in your file names, the lib system will map 'blah-filter to blah_filter.clj
10:51Chouserwhat you pasted looks like you're trying to create a class named fiji.process.FloatProcessorPlus -- are you saying you've changed that now?
10:51leafwok, first hint ... changing to underscores
10:51rhickeybut you should get the examples to work first
10:52leafwChouser: yes. I have several versions now.
10:52Chouserheh, ok.
10:53leafwtrying examples. So I understand the gen-class example should be put in a file named [a-zA-Z_]+.clj, and put in a subfolder according to its namespace
10:54leafwso a file named instance.clj under ./clojure/examples/ folder.
10:55rhickeyleafw: that . above could be any directory in the classpath
10:55leafwrhickey: sorry, I don't copy
10:56leafwthat dot ? In the file name ?
10:56rhickeyno, the first dot, sorry
10:56leafwrhickey: of course.
10:57leafwI meant ./clojure/examples/ as the folder relative to where I instantiate the Repl
10:57leafwbut never mind
10:58leafwthe example compiles.
10:58rhickeywell, the classpath part is important, even if it's . it must be in classpath
10:59leafwand it runs as well.
11:01leafwbut mine doesn't. Such is life
11:08RSchulzAWizzArd mentioned a new JDK release. It reminds me that I got two JVM crashes yesterday while running Clojure
11:11abrooksRSchulz: I've had several JVM crashes with Sun Java 1.6.0_05-b13
11:11ChouserRSchulz: I've gotten a couple JVM crashes, but usually when mucking with native libs, and never repeatably
11:11abrooksI thought that wasn't supposed to happen...
11:12stuarthallowayChouser: your own native libs?
11:13abrooksstuarthalloway: QT jambi, I think.
11:14stuarthallowayabrooks: no way JVM can protect from badly behaved third party native lib
11:14stuarthallowaywrite once, debug everywhere...
11:15ChouserNot my own native libs. Qt Jambi was the most recent.
11:15ChouserI didn't check the stack trace to see if it was actually from the native lib of not.
11:16abrooksstuarthalloway: Naturally. I belive I've had JVM crashes without using third-party native libs. (Naturally there's
11:16abrooks...JNI libs as part of the JRE.
11:16abrooks)
11:16abrooksFrickin' fat fingers.
11:16RSchulzabrooks: It's certainly _not_ supposed to happen. Any more than your OS kernel should crash. It is by definition a bug.
11:16RSchulz...Unless there's a hardware problem, of course, but I'm pretty sure that's not what I'm seeing.
11:17RSchulzThough of course no one minds "Frickin'"...
11:17stuarthallowayRSchulz: but if you are using even one third party native lib, it may be to blame, even if the stack trace or core dump appears to blame Java
11:17RSchulzI guess drewr and I are both fogey / curmudgeons, then?
11:18RSchulzYeah, but I'm not using any JNI that isn't part of the Sun JVM / JDK.
11:18RSchulzAnd I'm not talking about Java exceptions, I'm talking about the JVM process crashing outright.
11:18RSchulzAs in: SIGBUS (0x7) at pc=0x40277c83, pid=17260, tid=1075825584
11:20leafwrhickey: got it to work -- not quite, now errors: for example, the :imports in the ns macro are not seen from the body of the file itself, which surprises me.
11:21abrooksstuarthalloway: BTW, when are you expecting round two of reviews?
11:21stuarthallowayabrooks: expecting to ship to reviewers, or have them back
11:22RSchulzstuarthalloway: Are we supposed to send book review feedback to you?
11:22stuarthallowayI am finishing the macro chapter today. It usually takes the publisher 48 hours to review and post a Beta
11:22RSchulzI have very little, but some.
11:22RSchulzstuarthalloway: If you've already dealt with the :: and #=(...) notations, then I have nothing to add. Have you?
11:22stuarthallowayYou can send feedback directly to me, or to my editor Susannah Pfalzer
11:23RSchulzOK
11:23Chouserstuarthalloway: I can't seem to pull new betas from the web site, am I supposed to be able to?
11:23stuarthallowayRSchulz: I have dealt with them, but not sufficiently :-)
11:23stuarthallowayChouser: that process seems to be manual for the publisher
11:23leafwnm
11:23RSchulzOK. But since you're aware of it, then there's nothing else for me to say. But I do eagerly await new chapters.
11:24RSchulzstuarthalloway: Also, will you be bring the AOT compilation stuff in line with the recent changes? I noticed it's considerably out-of-date, now.
11:24stuarthallowayApparently most reviewers are not energetic enough to read every beta, so they don't automatically do it
11:24stuarthallowayRSchulz: This beta will *not* update the AOT stuff. I like to let things be live for a few weeks so in case direction changes I don't have to rewrite twice.
11:25RSchulzstuarthalloway: Are change-bars a possibility in successive releases? That would make it easy to give better feedback even on chapters we've already read.
11:25abrooksstuarthalloway: Both. Originally you had said that you split reviewers into two groups, the latter to review in December (I'm in that group).
11:26stuarthallowayabrooks: The published currently plans to go second round when the book is prose complete
11:26abrooksstuarthalloway: RSchulz: change bars +1
11:26stuarthallowayI am going to request instead that they go this week (Beta 4) since so many people seem eager to review
11:27abrooksstuarthalloway: Okay, great! :)
11:27RSchulzI notice a tomhickey in the Nick list. Is he a relative of Rich's?
11:27drewrRSchulz: Brother.
11:27leafwsuccess ... the :gen-class in the ns confused me: it expected a closed () block. And didn't complain when it had other keywords in it such as :import, etc. that affect the ns, not the :gen-class
11:27RSchulzHe did the Web site? I really like that site design.
11:28drewrYep.
11:28stuarthallowayTalented family.
11:28RSchulzBut I'd still like a printing CSS that shrinks the font size and omits the index side-bar.
11:28abrooksstuarthalloway: The beta PDF purchase allows regular beta PDF updates (and a final PDF), I assume.
11:28stuarthallowayabrooks: You bet
11:28drewrThe logo is my favorite.
11:29abrooksdrewr: Ditto. The logo is every bit as brilliant as the language... if a little less useful.
11:30RSchulzstuarthalloway: I'm all for pushing up the release schedule. I, too, am anxious to see more. I really need to acquire an FP mindset. I don't know if a book can do that, but...
11:30ChouserRSchulz: projecteuler can do it
11:31abrooksRSchulz: I suggest spending some time with Clojure and http://ProjectEuler.net . The problems lend to functional.... darn you Chouser ... ;-)
11:31Chouser:-)
11:31RSchulzChouser, abrooks: Thanks for the refernce. I'll give that a look-see.
11:32Chouserit can also suck away all your free time
11:32RSchulzFree what?
11:33Chouserok, then it'll suck away non-free time that you ought to be using for something important
11:33danlarkininstantrimshot.com
11:33RSchulzOr for the mouse-addicted: http://instantrimshot.com/
11:36RSchulzWas Euler the guy who found the short-cut answer to the sum of all the integers from 1 to 100 as a schoolchild?
11:36RSchulzOr should I say, "shortcut way to answer"
11:36holmakI want to say it was Gauss
11:37holmakhttp://en.wikipedia.org/wiki/Gauss
11:37stuarthallowayabrooks, RSchulz: the change bars may be tough given the markup language used to build the book, but I will ask
11:37holmakFirst section, second paragraph
11:38RSchulzstuarthalloway: What are you using? DocBook? TeX?
11:38holmakGood story, that
11:38RSchulzOK. Gauss it is. The nature of the those Project Euler problems made me think of that story.
11:39holmakHave you been doing Project Euler problems for Clojure practice
11:39holmak?
11:40Chouserholmak: yes, several people have.
11:41Chouserholmak: some of the solutions are available on a wiki, though I personally never look there until I've solved it myself -- more fun this way. :-)
11:41Chouserclojurebot: projecteuler?
11:41clojurebotGabh mo leithsc�al?
11:41Chouserclojurebot: project euler?
11:41clojurebotproject euler is http://clojure-euler.wikispaces.com/
11:41holmakI should do that, seems like a solid plan -- working on them, not copying from the wiki.
11:41ChouserI do like to refer to the wiki afterwards to see what tricks I may have missed.
11:47RSchulzstuarthalloway: Noun- and verb-based programming?
11:47RSchulz(I just got a PragProg blurb in the mail.)
11:48stuarthallowayReference to http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html
11:48RSchulzAh. That one's new to me. As is so much since I stepped through the looking glass into the world of Clojure and FP...
11:48stuarthallowayI expect most Lisp programmers would get approximately 0 out of the podcast
11:49stuarthallowaywhile hopefully the choice of casual language like "nouns" and "verbs" will appeal to some Blub programmers
11:51RSchulzIt kind of reminds me of the arguments in favor of REST. At least superficially.
11:51RSchulzOr is it the opposite?
11:51RSchulzI had no idea PragProg had a podcast series.
11:52RSchulzMore stuff to keep my ears occupied while I try to concentrate on other things...
12:54abrooksclojurebot: project euler is http://ProjectEuler.net
12:54clojurebotIn Ordnung
12:54abrooksclojurebot: clojure euler is http://clojure-euler.wikispaces.com/
12:54clojurebotIk begrijp
12:55hiredmanuh
12:55abrookshiredman: Is that not okay?
12:55hiredmanthat is fine
12:59mattreplhrmm, is there a way to refer in static methods of a Java class? e.g., (refer 'java.lang.Math :only '(sin cos))
12:59stuarthallowaymattrepl: there is a contrib from Stuart Sierra that does that
12:59kotarakmattrepl: there is importstatic
13:00stuarthallowayclojure.contrib.import-static
13:00mattreplthanks
13:09RSchulzCan clojurebot do any pattern-oriented look-up? Regexes, e.g.?
13:09hiredmanRSchulz: not currently
13:10RSchulzWould it make sense to add something of that sort?
13:10hiredmanyes
13:10hiredmanvery much so
13:10hiredmanI would like look ups to be a lot fuzzier
13:10RSchulzYou know... As a guy who has seen all of Futurama 17 times over but is new IRC, I keep seeing a funky robot in my mind whenever I see "clojurebot."
13:11hiredmanclojurebot: bender is my idol
13:11clojurebotIn Ordnung
13:11hiredmanclojurebot: bender?
13:11clojurebotbender is my idol
13:12RSchulzRemind me to stay at least ten feet away from clojurebot at all times...
13:13RSchulzI need my wallet.
15:40sethtrainim just getting into clojure but plan on recording my process along the way, first video... http://vimeo.com/2419596
16:04charliekilosethtrain: very nice ... which I had that before I figued it out myself ... looking forward to next one ... q: what is your background? Java? Lisp? Ruby? Smalltalk? All of the above?
16:06charliekilosethtrain: any reason you don't use Aquamacs Emacs?
16:07charliekilosethtrain: would be nice to enable and show the 'function keys pressed'
16:08sethtraincharliekilo: trying to stay emacs pure i guess, background is Python
16:08sethtrainsome Ruby though
16:08sethtrainplayed in Java, C, etc. but nothing production.
16:09RSchulzI've got a Lisp buddy who hatest the Mac and didn't like Aquamacs, either. For one thing, he's addicted to "focus follows mouse."
16:10hiredmanoh, so he likes the correct behavior?
16:10Chousermy mouse follows focus. I don't think I could stand any "normal" window manager anymore.
16:10RSchulzYes (binding [*correct* 'the-old-old-OLD-school-way] (run-Bruce))
16:11hiredmanmouse follows focus? is that some kind of tiling window manager thing?
16:11gnuvinceChouser: tile wm user?
16:11charliekiloso what does he do: Emacs in full-screen iterm?
16:11hiredmanI imagine he just doesn't mac os
16:11RSchulzHe just grumbles a lot.
16:11Chouserhiredman: nice! yes, I use ion3 despite the oddities of its creator.
16:12gnuvinceChouser: figured so.
16:12RSchulzIt doesn't matter. He won't have to use it fro long. His company went under and they're shutting down operations...
16:12gnuvinceChouser: did you try some of the alternatives? dwm, xmonad, awesome, etc.?
16:13abrooksawesome sucks.
16:13abrooksxmonad is well done but automatic and not what I want (and I really don't feel like hacking enough Haskell to make it so).
16:16Chousergnuvince: no, not really. Friends have hacked together ion configs that work well enough for me. One less thing I've had to learn deeply... :-)
16:27Chouser(??? [1 2 3]) ==> ([1] [1 2] [1 2 3])
16:28gnuvinceChouser: that function doesn't exist in Clojure, but it's be called inits
16:29gnuvinceFrom Haskell:
16:29gnuvincePrelude Data.List> inits [1,2,3]
16:29gnuvince[[],[1],[1,2],[1,2,3]]
16:30Chousergah, I know it's come up before...
16:32hiredmansome sort of reduce
16:32Chouseroh, in fact I've asked this before.
16:32gnuvinceAt worst:
16:32gnuvinceuser=> (map #(take % [1 2 3]) (range (+ 1 (count [1 2 3]))))
16:32gnuvince(nil (1) (1 2) (1 2 3))
16:32Lau_of_DKGood evening everyone
16:33kotarakHi Lau
16:33Chouserhttp://clojure-log.n01se.net/date/2008-07-10.html#14:18
16:41drewolsonChouser: cool implementation. what is the complexity of reverse?
16:42ChouserO(n)
16:55abrooksreverse is also non-lazy.
16:55abrooksdrewolson: --^
16:55abrooksThat is to say, eager.
16:55ericthorsenAre we still able to have hyphens in namespaces? It appears my dir/file_name with namespace dir.file-name gets an error from load now when I attempt AOT compile
16:56ericthorsenif I change the namespace to use the underscore I'm good
16:56Chouserericthorsen: I was just testing that today, and wasn't having any problems
16:56drewolsonabrooks: yeah, i remember reading that
16:57ericthorsenChouser: hmm....let me look at this again.
16:58hiredmanclojurebot: mock objects is <reply>Your mock object is a joke; that object is mocking you. For needing it. -- rhicky
16:58clojurebotAck. Ack.
17:01Chouserericthorsen: My test namespace was using :gen-class -- is yours?
17:02ericthorsenChouser: no.
17:02ericthorsenChouser: i guess I better read the docs again :)
17:02Chouserlet me try without..
17:03ericthorsenChouser: I thought I only needed that when I wanted a java class consumable by java
17:03ericthorsenChouser: I'm just AOT compiling an existing clojure source
17:04Chouserno, you're right.
17:04ChouserI just compiled and used a namespace named bar.a-b without a problem
17:05ericthorsenChouser: ok..thanks...i'll break it down and see what i can find
17:05Chouserthis is svn 1142
17:08Chouserclojurebot: svn
17:08clojurebotsvn co https://clojure.svn.sourceforge.net/svnroot/clojure clojure
17:08Chouserhm.
17:09hiredmanclojurebot: latest?
17:09clojurebotlatest is 1142
17:09technomancyhiredman: is that using the SVN polling that I wrote?
17:10hiredman*cough*
17:10hiredmanahem
17:10ericthorsenChouser: same here - 1142
17:10Chousukehm
17:10hiredmanI feel kind of bad, last night I wrote my own svn polling using svn's xml log output
17:10Chousukethe github mirror is 9 revisions behind :/
17:11hiredmantechnomancy: http://gist.github.com/31479
17:11technomancyhiredman: ah, no worries.
17:11technomancyhiredman: would appreciate feedback on why you wrote your own though
17:11technomancyjust didn't like the idea of shelling out?
17:11hiredmanoh
17:11hiredmanI did shell out
17:11hiredmana few things
17:12hiredmanI would rather use the xml log from svn
17:12technomancythat was basically my first clojure, so you won't hurt my feelings. =)
17:12hiredmanstandard string munging instead of, less standard string munging
17:12technomancyyeah, I didn't know XML output was an option from the SVN client; I was looking for something like that directly from the sourceforge site.
17:13hiredmanand clojurebot's (define ...) just wasn't going to work for this
17:13technomancywhy's that?
17:13hiredmanit tries to acknowledge that you defined something
17:13hiredmanclojurebot: a is b
17:13clojurebotc'est bon!
17:13technomancyhiredman: oh, heh; of course.
17:14hiredmanand the last line, threads don't just loop
17:14hiredmanthey run and stop, unless you loop
17:14technomancythat's what I get for not trying it out live I guess. =)
17:15hiredmanyeah, I have that advantage
17:16hiredmanclojurebot: latest is 0
17:16clojurebotYou don't have to tell me twice.
17:16technomancyhiredman: ah, you put the limit in the svn invocation rather than using take. guess that makes sense too.
17:16hiredmanso in > five minutes we should get the last five revs
17:17hiredmantechnomancy: it helps
17:17hiredmanand with the the xml it is easy to get a structured seq of revisions, which I can just filter for stuff newer then what is latest
17:18technomancyhiredman: I haven't gotten to the XML-as-sequences chapter yet. =)
17:18hiredmanugh
17:18hiredmanI still seem to have some kind of threading issues with it though
17:19hiredmanlike some how latest just go bumped back up to 1142, and no messages sent
17:19technomancy=(
17:19hiredmanyeah
17:20hiredmanit does that sometimes, moving all of svn-message into the dosync helped but has not completely fixed that
17:21technomancyhiredman: doesn't svn-summaries get called outside the dosync though?
17:21technomancysince svn-message's args get eval'd before it's called?
17:21technomancyoh... unless it's lazy
17:21hiredmanyeah, but that should be fine
17:21hiredmanwait
17:21hiredmanugh
17:22hiredmanside effects in my transactions
17:22hiredmanmea culpa
17:22ericthorsenChouser: The use case is that I have a namespace foo and then a namespace foo.bar.a-b
17:22ericthorsenChouser: That is when I run into a problem
17:22clojurebotsvn rev 1138; short print-dup for LazilyPersistenVectors made re-pattern identity for patterns, now find-doc works with patterns too
17:22clojurebotsvn rev 1139; use prn as default print in main
17:22clojurebotsvn rev 1140; fixed doc for main/repl
17:22clojurebotsvn rev 1141; expose inherited protected fields that originate from farther up the hierarchy than the super class, patch from Matt Revelle
17:22clojurebotsvn rev 1142; renamed clojure-print.clj, clojure-proxy.clj to clojure_...
17:22hiredmanclojurebot: dork
17:22clojurebotGabh mo leithsc�al?
17:23ericthorsenChouser: so compiling foo.clj and foo/bar/a-b.clj
17:23lsmith[1]afternoon everyone
17:24rhickeylsmith[1]: hi
17:24lsmith[1]I'm curious if anyone can give me some pointers on how to get clojure talking the code in an external .jar archive.
17:24ericthorsenChouser: sorry...foo/bar.clj and foo/bar/a-b.clj
17:25ericthorsenChouser: ava.lang.Exception: namespace 'foo.bar' not found after loading '/foo/bar'
17:27clojurebotsvn rev 1138; short print-dup for LazilyPersistenVectors made re-pattern identity for patterns, now find-doc works with patterns too
17:27clojurebotsvn rev 1139; use prn as default print in main
17:27clojurebotsvn rev 1140; fixed doc for main/repl
17:27clojurebotsvn rev 1141; expose inherited protected fields that originate from farther up the hierarchy than the super class, patch from Matt Revelle
17:27clojurebotsvn rev 1142; renamed clojure-print.clj, clojure-proxy.clj to clojure_...
17:28rhickeylsmith[1]: just put the jar in your classpath java -cp clojure.jar:other.jar ...
17:28lsmith[1]and it will find the contents automatically. Yep, that makes sense.
17:28lsmith[1]thanks
17:29Chouserericthorsen: does one :require the other?
17:29lsmith[1]no
17:29lsmith[1]how would that affect things?
17:31ericthorsenChouser: yes
17:31Chouserericthorsen: foo.bar requires a-b I assume?
17:32ericthorsenChouser: (ns foo.bar.a-b
17:32ericthorsen (:use foo.bar))
17:32Chouseroh, ok.
17:32ericthorsenChouser: (ns foo.bar.a-b (:use foo.bar))
17:34Chouserericthorsen: are you sure you have ./classes in your classpath? I can't get this to fail.
17:37lsmith[1]Is there a way to get the current classpath from within clojure?
17:38kotarak(System/getProperty "java.class.path")
17:39rhickey(filter #(re-find #"path" %) (keys (System/getProperties)))
17:43lsmith[1]appreciate it. I take it I can set it using (System/setProperty "java.class.path"
17:45technomancyhiredman: any other features you've got in mind for clojurebot that I could screw up^W^Whelp with?
17:46holmakI am trying to use require with the :as option -- http://paste2.org/p/110354 -- but I think I have the syntax wrong. I can't find any examples or require with :as anywhere.
17:53kotarakholmak: (require '[cobalt.vector :as cv]) (vector and vec are already used. Don't know whether this interferes.
17:53danlarkinkotarak: don't you ever sleep? :)
17:54kotarakdanlarking: Well. It's ten to midnight. So this point will certainly arrive soon. ;)
17:54Lau_of_DKChouser: Thanks for commenting your code
17:55holmakkotarak: Works fine, thanks. I couldn't find an example of require ... :as anywhere, oddly enough.
17:55holmakIt doesn't help that you can't google for ":require :as" meaningfully
17:56hiredmantechnomancy: url logging
17:56hiredmanfuzzy lookup
17:56hiredmanwell, it already logs urls
17:56hiredmanjust not sure what to do with it
17:56hiredmanmaybe an rss feed?
18:05AWizzArdWhat is the syntax in ns for requiring clojure.contrib.sql :as sql and clojure.contrib.duck-streams :as ds ?
18:06kotarak(ns foo.bar (:require (clojure.contrib [sql :as sql] [duck-streams :as ds])))
18:06AWizzArdthx
18:06kotaraknp
18:15technomancyhiredman: one of the #emacs bots creates tinyurls for any URLs above a certain length
18:15technomancybut I'm not sure that's terrbily useful
18:16hiredmanthere is an irc channel that I got kicked out of that had a bot that made an rss feed of all the urls in the channel
18:16hiredmanthat was very nice
18:16duck1123the bot i #swig does something like that
18:17duck1123yo can also comment and title the links
18:17technomancythat shouldn't be too hard provided that it's running on a box that can serve files up
18:17hiredmanit is running on my web server conviently enough
18:18technomancyhow nice. I'll try my hand at that.
18:18technomancyseems like it'd be easy to test, too
18:18technomancywithout a connection to an actual IRC server
18:36charliekilonoob question: What is the preferred persistence library in Clojure connecting to (a) RDMBS/MySQL, (b) 'Functional DBMS'?
18:36duck1123clojure.contrib.sql
18:37duck1123for a at least
18:37duck1123for b, zip-filter?
18:42charliekiloduck1123: thanks ... I assume zip-filter is in cotrib as well ... so there is nothing like 'AllegroCache'?!?
18:43technomancycharliekilo: some folks have experimented with terracotta, which IIRC is similar
18:43duck1123is it in java?
18:43technomancyyeah
18:43duck1123if it's in java, it's in clojure
18:44duck1123just not as elegant
18:44duck1123I've been working with the jena library, man is that a pain.
18:46RSchulzTerracatto came up on the Clojure group / list a while bat (10/18). The subject was "Clojure + Terracotta"
18:46RSchulz('cept they spelled it correctly...)
18:51charliekilothanks ... terracotta looks interesting ...
19:03lsmith[1]any canadians in the audience
19:03lsmith[1]?
19:06technomancyI don't think IRC channels have audiences. =)
19:07lsmith[1]lol
19:20rsynnottthey do if you attach them to a text-to-speech thingy
19:21cemerickrhickey: are nested anonymous literal fns a future possibility?
19:21rhickeycemerick: you mean nested #()s?
19:22cemerickrhickey: yeah. I guess the % forms would get messy pretty quick.
19:22rhickeythat's why I disallowed it
19:22cemerickjust curious :-)
19:23cemerickit's a nutty edge case, certainly
19:23rhickeyanytime I've done that in Mathematica I've confused myself
19:47lisppaste8grkz pasted "what would be the canonical clojure equivalent?" at http://paste.lisp.org/display/71552
19:47technomancywhy does clojure-contrib contain two copies of each lib?
19:47technomancyeg duck_streams.clj and duck_streams/duck_streams.clj ?
19:48grkztechnomancy: I think because of the namespace changes a few weeks ago; everything was "lifted up" one step
19:48Chousergrkz: right
19:48technomancyso it's a transitionary thing?
19:49Chousertechnomancy: yes.
19:49technomancygotcha; thanks
19:49technomancyso the new rules don't require the last directory then?
19:49Chouserright
19:49technomancycool, seemed a bit verbose.
19:50Chousernamespace: foo.bar.bing-bang, file: foo/bar/bing_bang.clj
19:50RSchulzDo I understand that the fully qualified namespace name did not change? Just how that name maps to a file name (in the FS or a JAR file)?
19:50Chouserif you use :gen-class, the class would be named foo.bar.bing_bang
19:51ChouserRSchulz: If I understand what you're saying, yes.
19:52RSchulzI mean that, for contrib specifically, the individual modules did not change namespaces, but what file the compiler / namespace code looks for when you (use ...) or (require ...) that namespace did change.
19:52ChouserRSchulz: yes, that's correct.
19:52RSchulzOK.
19:53RSchulzI'm curious. What was it decided that a hyphen in a namespace name should map to an underscore in the file name? Surely there are no modern filesystems that prohibit hyphen in file or directory names.
19:53Chousergrkz: you're trying to wrap a bunch of Java features in a nice Clojure api?
19:53RSchulz(_Why_ was it decided...)
19:53ChouserRSchulz: I've been wondering that myself, but just thought of something earlier -- class and package names.
19:54RSchulzYeah, that's what I was wondering.
19:54rsynnottRSchulz: possibly something to do with dealing wih things from the java end?
19:54rsynnottjava will interpret the hyphen as numeric subtraction, I think
19:55grkzChouser: I'm trying to figure out how to append a string to a file (and create the file if it doesn't exist), nothing more than that :-) I have no Java background whatsoever (the code in the paste is Common Lisp btw)
19:55Chouserthe class has to be named with a _ and so any class file names or package directories would have to have _
19:55RSchulzSort of. If you tried to reference that from Java code, you couldn't. The FQ class name or the import would be syntactically invalid.
19:55RSchulzIt's just like Alan Perlis said: "Syntactic sugar leads to cancer of the semicolon."
19:55Chousergrkz: oh! sorry, I assumed you just made it up. :-)
19:57technomancythe irony of adding thread-safety to the JRuby project at work while I learn Clojure on the side is just too much.
19:58Chouser"adding thread-safety"? ha.
19:58technomancyyou laugh at my pain? =(
19:58RSchulzJust write it all in Clojure and put a thin JRuby wrapper over it and don't tell anyone until it's a fait accompli!
19:58powr-toctechnomancy: lol... how are you finding JRuby anyway?
19:59Chousergrkz: I would normally recommend duck-streams, but I don't know if it has any way to append to an existing file.
19:59technomancypowr-toc: it's not bad. the main problem is the load time is lousy when you're using AR, so TDD cycles are slow
19:59RSchulzWhat's the gist of Duck Streams?
19:59powr-toctechnomancy: yeah, I implemented a prototype for a system last year in JRuby... I found the same thing
19:59Chouseruses a bit of introspection to abstract away a lot of Java io api druft.
20:00Chousercruft
20:00technomancypowr-toc: it's gotten *much* better since I started working on it in May
20:00technomancyback then rubygems was nigh-unusable
20:00technomancybut activesupport is still activesupport... =\
20:00powr-toctechnomancy: yeah, I did have problems with gems for a while... but since 1.0.1 (or whatever it was) it did seem to improve...
20:00technomancyeasiest fix is probably to just move to datamapper
20:01grkzChouser: ok, thanks. I'll have a look through duck-streams
20:01RSchulzHow much documentation (besides the code and its (doc ...) strings) is there for Clojure Contrib?
20:02powr-toctechnomancy: I reimplemented the AR code with ActiveObjects instead... it's very easy to adopt a rails AR schema, with pluralisation etc...
20:02RSchulzWhat do you think about a Hibernate API specifically for Clojure? Useful? Necessary? Superfluous?
20:03technomancypowr-toc: huh. I don't know any Java, but datamapper looks promising
20:05powr-toctechnomancy: Yeah, I know a decent ruby guy who says good things about it, he described it as a "bit more sugary"
20:05technomancya bit less magic is what I'm looking for. all that const_missing and method_missing is hell on your backtraces
20:05powr-toctechnomancy: true
20:05lisppaste8Chouser annotated #71552 with "append to file (for grkz)" at http://paste.lisp.org/display/71552#1
20:08powr-toctechnomancy: my biggest problem with JRuby was bridging it from the Java side into java... There were lots of corner cases, particularly around Exception propogation between languages that had very skeletal support (I actually got a patch commited concerning this)
20:09technomancyyeah, exception interop has improved
20:09powr-tocthat's one of things I like about clojure though, is that the semantics around language integration are far cleaner, because clojure is trying to be a java language
20:09technomancyI don't know anything about calling JRuby from Java though
20:10technomancypowr-toc: yeah, backwards-compatibility is holding JRuby back in a way... though in another way it's kind of the point.
20:10technomancybut you get the feeling there are a lot of things they wish they could do differently.
20:10grkzChouser: many thanks, exactly what I was after :-)
20:12powr-toctechnomancy: well it was a little volatile for a while... I first tried to implement it through the scripting API, but found some things weren't supported... so then I switched to using jruby's api, which is a hideous thing java side
20:12powr-tocI think the scripting api support has improved now though
20:12powr-toctechnomancy: agreed.
20:13technomancythe scripting api is the stuff that was designed to support rhino?
20:13powr-toctechnomancy: well, I think it supports rhino out of the box... but it's designed so other languages can implement it too
20:14Chousergrkz: yeah, so easy, isn't it? :-/ The 'true' is to append. You know your way around java docs?
20:16duck1123how come none of the fibonacci functions on the wiki use recur?
20:16duck1123it seems like they all should
20:16powr-tocduck1123: I think it's because they uses lazy seq's instead
20:17duck1123ok, I get it now
20:24rsynnottduck1123: I'm surprised they don't, as it's a useful teaching aid, but IIRC an iterative approach is somewhat more efficiet in that case
22:41hiredmanclojurebot: latest?
22:41clojurebotlatest is 1142
22:41hiredmanclojurebot: latest is 1141
22:41clojurebotc'est bon!
22:48clojurebotsvn rev 1142; renamed clojure-print.clj, clojure-proxy.clj to clojure_...
23:17notallamaalright, so i want to use a key listener to assoc/dissoc the key code to a map. how can i be sure that keyReleased won't commit before keyPressed? will agents or commute garuntee that? should i have them increment/decrement a counter instead? (i don't care if it's wrong for a fraction of a second, but i don't want it to get stuck thinking a key is down when it's not)
23:18notallamaor will the listener handle that?
23:22lsmith[1]Does anyone know if there is something akin to the "case" statement in CL? Any idea where it is documented?
23:24jeremy___would fcase work in clojure-contrib?
23:25Chousernotallama: I'm pretty sure the listener executes in the swing thread, and will get the events in order.
23:25Chousernotallama: if you then send from each event to the same agent, the agent will get the actions in order
23:25jeremy___lsmith[1]: http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib/trunk/src/clojure/contrib/fcase/fcase.clj?revision=150&amp;view=markup
23:26Chousernotallama: if you were to send from the listener to two different agents (don't know why you'd do that) there's be no guarantee which would happen first.
23:26lsmith[1]I'll check it out. Thanks.