#clojure log - Dec 03 2008

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

5:02 blackdog: this looks interesting http://github.com/aemoncannon/las3r/wikis

6:50 AWizzArd: uh, jdk 6 update 11 is out

6:51 that was fast.. 10 came out only 6 week ago

7:02 hoeck: blackdog: yeah, I've seen this too, very nice.

7:25 AWizzArd: Hi rhickey. Could the docstring of (defn repl ...) in main.clj need a correction, where it still says "default: println" vs "default: prn"?

7:27 rhickey: AWizzArd: done

7:29 AWizzArd: rhickey: btw, is it planned that Clojure will support annotations one day? Or do you think this will never make sense?

7:30 rhickey: AWizzArd: I imagine it will someday

7:30 AWizzArd: I 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.

7:31 rhickey: AWizzArd: what does Rife need?

7:31 (pointer to javadoc is fine)

7:31 AWizzArd: http://rifers.org/wiki/display/RIFE/Annotations+support+for+element+declaration

7:32 I 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.

7:38 rhickey: AWizzArd: 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

7:38 AWizzArd: yes, I would like to macro most/all pain out of Rife which it got because of the use of Java.

7:39 rhickey: AWizzArd: I would stay away from named classes and attributes then

7:40 AWizzArd: I 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.

7:40 rhickey: Rife does bytecode transformation, right?

7:41 AWizzArd: My 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.

7:41 When I put in instead my 3 (with clojure) compiled .class files it can't instatiate HelloWorld

7:42 I am not sure if it transforms Bytecode

7:43 rhickey: I went to a Rife talk at Java One, I think it does

7:43 AWizzArd: My clojure code compiles. At the top you see the original .java code, at the bottom my .clj code: http://paste.lisp.org/display/71154

7:44 the stuff after (defn -processElement ...) is just for me, to remember what I need

7:45 Let's say Rife does indeed do bytecode transformation. What would this then mean for the combo Clojure+Rife? Could it still work?

7:46 rhickey: That depends on whether Rife could handle the bytecode Clojure emits, I'm sure it's expecting bytecode produced by Java

7:48 AWizzArd: In 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.

7:48 For Groovy they had to do some extra work. Now Rife can also take plain .groovy files and will compile them on the fly.

7:49 This 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.

7:55 leafw: hi 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

7:56 rev 1138 supports it, according to the commit message

7:57 rhickey: leafw: works for me

7:57 ant clean?

7:58 leafw: checking

8:00 same thing

8:00 let me check more

8:00 my classpath is too long, maybe contains other clojure.jar

8:02 nice, now it worked

8:02 thanks rhickey

8:03 by the way, would be nice if (doc ...) accepted regex too, but for function names only.

8:04 rhickey: leafw: unlikely

8:05 leafw: will make my own in user.clj

8:05 rhickey: there you go

9:00 leafw: in 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?

9:00 the empty I guess is the paramters. But the String?

9:00 rhickey: leafw: return value

9:00 return type

9:01 leafw: aha, thank you.

9:01 rhickey: (doc gen-class)

9:01 clojurebot: When 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

9:01 rhickey: aargh

9:02 leafw: cut short.

9:02 rhickey: :methods [ [name [param-types] return-type], ...]

9:02 leafw: and when void, just nil return type? Or must return something always?

9:03 rhickey: void

9:03 it's a Java signature

9:04 leafw: thanks.

9:05 abrooks: Void (upper case)

9:06 rhickey: abrooks: no, void/int/float etc should now work, no need for Void/TYPE

9:06 lvijay: clojurebot: svn

9:06 clojurebot: svn co https://clojure.svn.sourceforge.net/svnroot/clojure clojure

9:07 blackdog: ping Chouser

9:10 rhickey, you will be interested in this too, clojure in AS3 http://github.com/aemoncannon/las3r/wikis

9:11 rhickey: blackdog: yes, I spoke with him when he embarked on that

9:11 blackdog: oh really :) ok, thought i was ahead of the curve

9:16 duck1123: it looks pretty neat

9:16 the repl still hasn't loaded for me though

9:17 abrooks: rhickey: Ah! Okay, thanks.

9:17 blackdog: could be useful to do a haxe port of that, and see if it can't target both flash and js at the same time

9:21 rhickey: duck1123: it doesn't really say anything when it's done loading, just type in the lower frame

9:22 duck1123: ahh, ok. I know nothing about flash, so it has little use for me.

9:30 alvin-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

9:30 ahem

9:31 http://paste.lisp.org/display/71490

9:31 svn 1141, compiling and running under Java 5 in AIX... compiling goes ok, but running -- not so good

9:36 danlarkin: Gooooooodmorning clojurecrats

9:37 abrooks: Clojurites?

9:37 danlarkin: clojureitis?

9:37 rhickey: alvin-x: I was wondering when some VM would complain about that - fixed in svn 1142

9:37 alvin-x: :)

9:37 abrooks: danlarkin: Ew.. :)

9:38 alvin-x: rhickey: ok, i'll get it

9:41 danlarkin: clojurebot: clojureitis is a condition in which it becomes impossible to program in other languages anymore

9:41 clojurebot: In Ordnung

9:43 alvin-x: rhickey: it worked

9:47 lisppaste8: leafw pasted "Trying out gen-class" at http://paste.lisp.org/display/71492

9:48 leafw: would 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

9:48 Chouser: add "./classes/" to your classpath

9:49 leafw: Chouser: ./classes/ being a folder where classes will be generated to? Should I create that folder if it doesn't exist?

9:51 didn't work either way

9:51 despite the obvious namespace typo in the paste, fiji for fj in the -main

9:52 duck1123: rhickey: Do you need the CA's mailed to you, or is it ok to scan it and email you the PDF?

9:53 leafw: I hope I don't need to save the .clj file under the hierachy of folders specified in its namespace?

9:53 Chouser: leafw: yes, I think you do.

9:53 leafw: argh

9:54 now that is ugly.

9:54 Chouser: leafw: embrace the javaness :-/

9:54 leafw: precisely, clojure was freeing me of it.

9:54 duck1123: is it still possible to store it somewhere else if you use load? or is that gone?

9:55 not that doing that was a very good idea

9:55 Chouser: you 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.

9:57 leafw: still fails, ... this is frustrating

10:00 Chouser: make sure you lib loads okay with (require 'my.lib) first

10:01 leafw: it's all in the same file, like the example in the webpage

10:01 don't think one needs to require the self file

10:01 cemerick: conforming 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:01 leafw: Chouser: but I see that logically there may be an imports problem

10:47 I 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:48 Chouser: leafw: 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:48 leafw: Chouser: on the ns macro call I can't get it to work either.

10:49 rhickey: leafw: have you tried the examples here? : http://clojure.org/compilation

10:50 leafw: my 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:51 rhickey: leafw: you shouldn't have dashes in your file names, the lib system will map 'blah-filter to blah_filter.clj

10:51 Chouser: what you pasted looks like you're trying to create a class named fiji.process.FloatProcessorPlus -- are you saying you've changed that now?

10:51 leafw: ok, first hint ... changing to underscores

10:51 rhickey: but you should get the examples to work first

10:52 leafw: Chouser: yes. I have several versions now.

10:52 Chouser: heh, ok.

10:53 leafw: trying 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:54 so a file named instance.clj under ./clojure/examples/ folder.

10:55 rhickey: leafw: that . above could be any directory in the classpath

10:55 leafw: rhickey: sorry, I don't copy

10:56 that dot ? In the file name ?

10:56 rhickey: no, the first dot, sorry

10:56 leafw: rhickey: of course.

10:57 I meant ./clojure/examples/ as the folder relative to where I instantiate the Repl

10:57 but never mind

10:58 the example compiles.

10:58 rhickey: well, the classpath part is important, even if it's . it must be in classpath

10:59 leafw: and it runs as well.

11:01 but mine doesn't. Such is life

11:08 RSchulz: AWizzArd mentioned a new JDK release. It reminds me that I got two JVM crashes yesterday while running Clojure

11:11 abrooks: RSchulz: I've had several JVM crashes with Sun Java 1.6.0_05-b13

11:11 Chouser: RSchulz: I've gotten a couple JVM crashes, but usually when mucking with native libs, and never repeatably

11:11 abrooks: I thought that wasn't supposed to happen...

11:12 stuarthalloway: Chouser: your own native libs?

11:13 abrooks: stuarthalloway: QT jambi, I think.

11:14 * abrooks likes speaking for Chouser ....

11:14 stuarthalloway: abrooks: no way JVM can protect from badly behaved third party native lib

11:14 write once, debug everywhere...

11:15 Chouser: Not my own native libs. Qt Jambi was the most recent.

11:15 I didn't check the stack trace to see if it was actually from the native lib of not.

11:16 abrooks: stuarthalloway: Naturally. I belive I've had JVM crashes without using third-party native libs. (Naturally there's

11:16 ...JNI libs as part of the JRE.

11:16 )

11:16 Frickin' fat fingers.

11:16 RSchulz: abrooks: It's certainly _not_ supposed to happen. Any more than your OS kernel should crash. It is by definition a bug.

11:16 ...Unless there's a hardware problem, of course, but I'm pretty sure that's not what I'm seeing.

11:17 * abrooks realizes that some may be sensative to the phrase "fat fingers" an appologizes preemptively.

11:17 RSchulz: Though of course no one minds "Frickin'"...

11:17 * drewr is sensitive to spelling

11:17 stuarthalloway: RSchulz: 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:17 RSchulz: I guess drewr and I are both fogey / curmudgeons, then?

11:18 Yeah, but I'm not using any JNI that isn't part of the Sun JVM / JDK.

11:18 And I'm not talking about Java exceptions, I'm talking about the JVM process crashing outright.

11:18 As in: SIGBUS (0x7) at pc=0x40277c83, pid=17260, tid=1075825584

11:20 leafw: rhickey: 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:21 abrooks: stuarthalloway: BTW, when are you expecting round two of reviews?

11:21 stuarthalloway: abrooks: expecting to ship to reviewers, or have them back

11:22 RSchulz: stuarthalloway: Are we supposed to send book review feedback to you?

11:22 stuarthalloway: I am finishing the macro chapter today. It usually takes the publisher 48 hours to review and post a Beta

11:22 RSchulz: I have very little, but some.

11:22 stuarthalloway: If you've already dealt with the :: and #=(...) notations, then I have nothing to add. Have you?

11:22 stuarthalloway: You can send feedback directly to me, or to my editor Susannah Pfalzer

11:23 RSchulz: OK

11:23 Chouser: stuarthalloway: I can't seem to pull new betas from the web site, am I supposed to be able to?

11:23 stuarthalloway: RSchulz: I have dealt with them, but not sufficiently :-)

11:23 Chouser: that process seems to be manual for the publisher

11:23 leafw: nm

11:23 RSchulz: OK. But since you're aware of it, then there's nothing else for me to say. But I do eagerly await new chapters.

11:24 stuarthalloway: 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:24 stuarthalloway: Apparently most reviewers are not energetic enough to read every beta, so they don't automatically do it

11:24 RSchulz: 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:25 RSchulz: stuarthalloway: 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:25 abrooks: stuarthalloway: Both. Originally you had said that you split reviewers into two groups, the latter to review in December (I'm in that group).

11:26 * drewr must have responded too late to review

11:26 stuarthalloway: abrooks: The published currently plans to go second round when the book is prose complete

11:26 abrooks: stuarthalloway: RSchulz: change bars +1

11:26 stuarthalloway: I am going to request instead that they go this week (Beta 4) since so many people seem eager to review

11:27 abrooks: stuarthalloway: Okay, great! :)

11:27 RSchulz: I notice a tomhickey in the Nick list. Is he a relative of Rich's?

11:27 drewr: RSchulz: Brother.

11:27 leafw: success ... 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:27 RSchulz: He did the Web site? I really like that site design.

11:28 drewr: Yep.

11:28 stuarthalloway: Talented family.

11:28 RSchulz: But I'd still like a printing CSS that shrinks the font size and omits the index side-bar.

11:28 abrooks: stuarthalloway: The beta PDF purchase allows regular beta PDF updates (and a final PDF), I assume.

11:28 stuarthalloway: abrooks: You bet

11:28 drewr: The logo is my favorite.

11:29 abrooks: drewr: Ditto. The logo is every bit as brilliant as the language... if a little less useful.

11:30 RSchulz: stuarthalloway: 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:30 Chouser: RSchulz: projecteuler can do it

11:31 abrooks: RSchulz: I suggest spending some time with Clojure and http://ProjectEuler.net . The problems lend to functional.... darn you Chouser ... ;-)

11:31 Chouser: :-)

11:31 RSchulz: Chouser, abrooks: Thanks for the refernce. I'll give that a look-see.

11:32 Chouser: it can also suck away all your free time

11:32 RSchulz: Free what?

11:33 Chouser: ok, then it'll suck away non-free time that you ought to be using for something important

11:33 danlarkin: instantrimshot.com

11:33 RSchulz: Or for the mouse-addicted: http://instantrimshot.com/

11:36 Was Euler the guy who found the short-cut answer to the sum of all the integers from 1 to 100 as a schoolchild?

11:36 Or should I say, "shortcut way to answer"

11:36 holmak: I want to say it was Gauss

11:37 http://en.wikipedia.org/wiki/Gauss

11:37 stuarthalloway: abrooks, RSchulz: the change bars may be tough given the markup language used to build the book, but I will ask

11:37 holmak: First section, second paragraph

11:38 RSchulz: stuarthalloway: What are you using? DocBook? TeX?

11:38 holmak: Good story, that

11:38 RSchulz: OK. Gauss it is. The nature of the those Project Euler problems made me think of that story.

11:39 holmak: Have you been doing Project Euler problems for Clojure practice

11:39 ?

11:40 Chouser: holmak: yes, several people have.

11:41 holmak: 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:41 clojurebot: projecteuler?

11:41 clojurebot: Gabh mo leithsc�al?

11:41 Chouser: clojurebot: project euler?

11:41 clojurebot: project euler is http://clojure-euler.wikispaces.com/

11:41 holmak: I should do that, seems like a solid plan -- working on them, not copying from the wiki.

11:41 Chouser: I do like to refer to the wiki afterwards to see what tricks I may have missed.

11:47 RSchulz: stuarthalloway: Noun- and verb-based programming?

11:47 (I just got a PragProg blurb in the mail.)

11:48 stuarthalloway: Reference to http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html

11:48 RSchulz: Ah. 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:48 stuarthalloway: I expect most Lisp programmers would get approximately 0 out of the podcast

11:49 while hopefully the choice of casual language like "nouns" and "verbs" will appeal to some Blub programmers

11:51 RSchulz: It kind of reminds me of the arguments in favor of REST. At least superficially.

11:51 Or is it the opposite?

11:51 I had no idea PragProg had a podcast series.

11:52 More stuff to keep my ears occupied while I try to concentrate on other things...

12:54 abrooks: clojurebot: project euler is http://ProjectEuler.net

12:54 clojurebot: In Ordnung

12:54 abrooks: clojurebot: clojure euler is http://clojure-euler.wikispaces.com/

12:54 clojurebot: Ik begrijp

12:55 hiredman: uh

12:55 abrooks: hiredman: Is that not okay?

12:55 hiredman: that is fine

12:59 mattrepl: hrmm, is there a way to refer in static methods of a Java class? e.g., (refer 'java.lang.Math :only '(sin cos))

12:59 stuarthalloway: mattrepl: there is a contrib from Stuart Sierra that does that

12:59 kotarak: mattrepl: there is importstatic

13:00 stuarthalloway: clojure.contrib.import-static

13:00 mattrepl: thanks

13:09 RSchulz: Can clojurebot do any pattern-oriented look-up? Regexes, e.g.?

13:09 hiredman: RSchulz: not currently

13:10 RSchulz: Would it make sense to add something of that sort?

13:10 hiredman: yes

13:10 very much so

13:10 I would like look ups to be a lot fuzzier

13:10 RSchulz: You 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:11 hiredman: clojurebot: bender is my idol

13:11 clojurebot: In Ordnung

13:11 hiredman: clojurebot: bender?

13:11 clojurebot: bender is my idol

13:12 RSchulz: Remind me to stay at least ten feet away from clojurebot at all times...

13:13 I need my wallet.

15:40 sethtrain: im just getting into clojure but plan on recording my process along the way, first video... http://vimeo.com/2419596

16:04 charliekilo: sethtrain: 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:06 sethtrain: any reason you don't use Aquamacs Emacs?

16:07 sethtrain: would be nice to enable and show the 'function keys pressed'

16:08 sethtrain: charliekilo: trying to stay emacs pure i guess, background is Python

16:08 some Ruby though

16:08 played in Java, C, etc. but nothing production.

16:09 RSchulz: I'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:10 hiredman: oh, so he likes the correct behavior?

16:10 Chouser: my mouse follows focus. I don't think I could stand any "normal" window manager anymore.

16:10 RSchulz: Yes (binding [*correct* 'the-old-old-OLD-school-way] (run-Bruce))

16:11 hiredman: mouse follows focus? is that some kind of tiling window manager thing?

16:11 gnuvince: Chouser: tile wm user?

16:11 * drewr misses focus-follows-mouse

16:11 charliekilo: so what does he do: Emacs in full-screen iterm?

16:11 hiredman: I imagine he just doesn't mac os

16:11 RSchulz: He just grumbles a lot.

16:11 Chouser: hiredman: nice! yes, I use ion3 despite the oddities of its creator.

16:12 gnuvince: Chouser: figured so.

16:12 RSchulz: It doesn't matter. He won't have to use it fro long. His company went under and they're shutting down operations...

16:12 gnuvince: Chouser: did you try some of the alternatives? dwm, xmonad, awesome, etc.?

16:12 * abrooks has converted his prIon project over to Clojure though it's not doing anything meaningful yet.

16:13 abrooks: awesome sucks.

16:13 xmonad 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:16 Chouser: gnuvince: 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:27 (??? [1 2 3]) ==> ([1] [1 2] [1 2 3])

16:28 gnuvince: Chouser: that function doesn't exist in Clojure, but it's be called inits

16:29 From Haskell:

16:29 Prelude Data.List> inits [1,2,3]

16:29 [[],[1],[1,2],[1,2,3]]

16:30 Chouser: gah, I know it's come up before...

16:32 hiredman: some sort of reduce

16:32 Chouser: oh, in fact I've asked this before.

16:32 gnuvince: At worst:

16:32 user=> (map #(take % [1 2 3]) (range (+ 1 (count [1 2 3]))))

16:32 (nil (1) (1 2) (1 2 3))

16:32 Lau_of_DK: Good evening everyone

16:33 kotarak: Hi Lau

16:33 Chouser: http://clojure-log.n01se.net/date/2008-07-10.html#14:18

16:41 drewolson: Chouser: cool implementation. what is the complexity of reverse?

16:42 Chouser: O(n)

16:55 abrooks: reverse is also non-lazy.

16:55 drewolson: --^

16:55 That is to say, eager.

16:55 ericthorsen: Are 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:56 if I change the namespace to use the underscore I'm good

16:56 Chouser: ericthorsen: I was just testing that today, and wasn't having any problems

16:56 drewolson: abrooks: yeah, i remember reading that

16:57 ericthorsen: Chouser: hmm....let me look at this again.

16:58 hiredman: clojurebot: mock objects is <reply>Your mock object is a joke; that object is mocking you. For needing it. -- rhicky

16:58 clojurebot: Ack. Ack.

17:01 Chouser: ericthorsen: My test namespace was using :gen-class -- is yours?

17:02 ericthorsen: Chouser: no.

17:02 Chouser: i guess I better read the docs again :)

17:02 Chouser: let me try without..

17:03 ericthorsen: Chouser: I thought I only needed that when I wanted a java class consumable by java

17:03 Chouser: I'm just AOT compiling an existing clojure source

17:04 Chouser: no, you're right.

17:04 I just compiled and used a namespace named bar.a-b without a problem

17:05 ericthorsen: Chouser: ok..thanks...i'll break it down and see what i can find

17:05 Chouser: this is svn 1142

17:08 clojurebot: svn

17:08 clojurebot: svn co https://clojure.svn.sourceforge.net/svnroot/clojure clojure

17:08 Chouser: hm.

17:09 hiredman: clojurebot: latest?

17:09 clojurebot: latest is 1142

17:09 technomancy: hiredman: is that using the SVN polling that I wrote?

17:10 hiredman: *cough*

17:10 ahem

17:10 ericthorsen: Chouser: same here - 1142

17:10 Chousuke: hm

17:10 hiredman: I feel kind of bad, last night I wrote my own svn polling using svn's xml log output

17:10 Chousuke: the github mirror is 9 revisions behind :/

17:11 hiredman: technomancy: http://gist.github.com/31479

17:11 technomancy: hiredman: ah, no worries.

17:11 hiredman: would appreciate feedback on why you wrote your own though

17:11 just didn't like the idea of shelling out?

17:11 hiredman: oh

17:11 I did shell out

17:11 a few things

17:12 I would rather use the xml log from svn

17:12 technomancy: that was basically my first clojure, so you won't hurt my feelings. =)

17:12 hiredman: standard string munging instead of, less standard string munging

17:12 technomancy: yeah, 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:13 hiredman: and clojurebot's (define ...) just wasn't going to work for this

17:13 technomancy: why's that?

17:13 hiredman: it tries to acknowledge that you defined something

17:13 clojurebot: a is b

17:13 clojurebot: c'est bon!

17:13 technomancy: hiredman: oh, heh; of course.

17:14 hiredman: and the last line, threads don't just loop

17:14 they run and stop, unless you loop

17:14 technomancy: that's what I get for not trying it out live I guess. =)

17:15 hiredman: yeah, I have that advantage

17:16 clojurebot: latest is 0

17:16 clojurebot: You don't have to tell me twice.

17:16 technomancy: hiredman: ah, you put the limit in the svn invocation rather than using take. guess that makes sense too.

17:16 hiredman: so in > five minutes we should get the last five revs

17:17 technomancy: it helps

17:17 and 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:18 technomancy: hiredman: I haven't gotten to the XML-as-sequences chapter yet. =)

17:18 hiredman: ugh

17:18 I still seem to have some kind of threading issues with it though

17:19 like some how latest just go bumped back up to 1142, and no messages sent

17:19 technomancy: =(

17:19 hiredman: yeah

17:20 it does that sometimes, moving all of svn-message into the dosync helped but has not completely fixed that

17:21 technomancy: hiredman: doesn't svn-summaries get called outside the dosync though?

17:21 since svn-message's args get eval'd before it's called?

17:21 oh... unless it's lazy

17:21 hiredman: yeah, but that should be fine

17:21 wait

17:21 ugh

17:22 side effects in my transactions

17:22 mea culpa

17:22 ericthorsen: Chouser: The use case is that I have a namespace foo and then a namespace foo.bar.a-b

17:22 Chouser: That is when I run into a problem

17:22 clojurebot: svn rev 1138; short print-dup for LazilyPersistenVectors made re-pattern identity for patterns, now find-doc works with patterns too

17:22 svn rev 1139; use prn as default print in main

17:22 svn rev 1140; fixed doc for main/repl

17:22 svn rev 1141; expose inherited protected fields that originate from farther up the hierarchy than the super class, patch from Matt Revelle

17:22 svn rev 1142; renamed clojure-print.clj, clojure-proxy.clj to clojure_...

17:22 hiredman: clojurebot: dork

17:22 clojurebot: Gabh mo leithsc�al?

17:23 ericthorsen: Chouser: so compiling foo.clj and foo/bar/a-b.clj

17:23 lsmith[1]: afternoon everyone

17:24 rhickey: lsmith[1]: hi

17:24 lsmith[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:24 ericthorsen: Chouser: sorry...foo/bar.clj and foo/bar/a-b.clj

17:25 Chouser: ava.lang.Exception: namespace 'foo.bar' not found after loading '/foo/bar'

17:27 clojurebot: svn rev 1138; short print-dup for LazilyPersistenVectors made re-pattern identity for patterns, now find-doc works with patterns too

17:27 svn rev 1139; use prn as default print in main

17:27 svn rev 1140; fixed doc for main/repl

17:27 svn rev 1141; expose inherited protected fields that originate from farther up the hierarchy than the super class, patch from Matt Revelle

17:27 svn rev 1142; renamed clojure-print.clj, clojure-proxy.clj to clojure_...

17:28 rhickey: lsmith[1]: just put the jar in your classpath java -cp clojure.jar:other.jar ...

17:28 lsmith[1]: and it will find the contents automatically. Yep, that makes sense.

17:28 thanks

17:29 Chouser: ericthorsen: does one :require the other?

17:29 lsmith[1]: no

17:29 how would that affect things?

17:31 ericthorsen: Chouser: yes

17:31 Chouser: ericthorsen: foo.bar requires a-b I assume?

17:32 ericthorsen: Chouser: (ns foo.bar.a-b

17:32 (:use foo.bar))

17:32 Chouser: oh, ok.

17:32 ericthorsen: Chouser: (ns foo.bar.a-b (:use foo.bar))

17:34 Chouser: ericthorsen: are you sure you have ./classes in your classpath? I can't get this to fail.

17:37 lsmith[1]: Is there a way to get the current classpath from within clojure?

17:38 kotarak: (System/getProperty "java.class.path")

17:39 rhickey: (filter #(re-find #"path" %) (keys (System/getProperties)))

17:43 lsmith[1]: appreciate it. I take it I can set it using (System/setProperty "java.class.path"

17:45 technomancy: hiredman: any other features you've got in mind for clojurebot that I could screw up^W^Whelp with?

17:46 holmak: I 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:53 kotarak: holmak: (require '[cobalt.vector :as cv]) (vector and vec are already used. Don't know whether this interferes.

17:53 danlarkin: kotarak: don't you ever sleep? :)

17:54 kotarak: danlarking: Well. It's ten to midnight. So this point will certainly arrive soon. ;)

17:54 Lau_of_DK: Chouser: Thanks for commenting your code

17:55 holmak: kotarak: Works fine, thanks. I couldn't find an example of require ... :as anywhere, oddly enough.

17:55 It doesn't help that you can't google for ":require :as" meaningfully

17:56 hiredman: technomancy: url logging

17:56 fuzzy lookup

17:56 well, it already logs urls

17:56 just not sure what to do with it

17:56 maybe an rss feed?

18:05 AWizzArd: What is the syntax in ns for requiring clojure.contrib.sql :as sql and clojure.contrib.duck-streams :as ds ?

18:06 kotarak: (ns foo.bar (:require (clojure.contrib [sql :as sql] [duck-streams :as ds])))

18:06 AWizzArd: thx

18:06 kotarak: np

18:15 technomancy: hiredman: one of the #emacs bots creates tinyurls for any URLs above a certain length

18:15 but I'm not sure that's terrbily useful

18:16 hiredman: there 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:16 that was very nice

18:16 duck1123: the bot i #swig does something like that

18:17 yo can also comment and title the links

18:17 technomancy: that shouldn't be too hard provided that it's running on a box that can serve files up

18:17 hiredman: it is running on my web server conviently enough

18:18 technomancy: how nice. I'll try my hand at that.

18:18 seems like it'd be easy to test, too

18:18 without a connection to an actual IRC server

18:36 charliekilo: noob question: What is the preferred persistence library in Clojure connecting to (a) RDMBS/MySQL, (b) 'Functional DBMS'?

18:36 duck1123: clojure.contrib.sql

18:37 for a at least

18:37 for b, zip-filter?

18:42 charliekilo: duck1123: thanks ... I assume zip-filter is in cotrib as well ... so there is nothing like 'AllegroCache'?!?

18:43 technomancy: charliekilo: some folks have experimented with terracotta, which IIRC is similar

18:43 duck1123: is it in java?

18:43 technomancy: yeah

18:43 duck1123: if it's in java, it's in clojure

18:44 just not as elegant

18:44 I've been working with the jena library, man is that a pain.

18:46 RSchulz: Terracatto came up on the Clojure group / list a while bat (10/18). The subject was "Clojure + Terracotta"

18:46 ('cept they spelled it correctly...)

18:51 charliekilo: thanks ... terracotta looks interesting ...

19:03 lsmith[1]: any canadians in the audience

19:03 ?

19:06 technomancy: I don't think IRC channels have audiences. =)

19:07 lsmith[1]: lol

19:20 rsynnott: they do if you attach them to a text-to-speech thingy

19:21 cemerick: rhickey: are nested anonymous literal fns a future possibility?

19:21 rhickey: cemerick: you mean nested #()s?

19:22 cemerick: rhickey: yeah. I guess the % forms would get messy pretty quick.

19:22 rhickey: that's why I disallowed it

19:22 cemerick: just curious :-)

19:23 it's a nutty edge case, certainly

19:23 rhickey: anytime I've done that in Mathematica I've confused myself

19:47 lisppaste8: grkz pasted "what would be the canonical clojure equivalent?" at http://paste.lisp.org/display/71552

19:47 technomancy: why does clojure-contrib contain two copies of each lib?

19:47 eg duck_streams.clj and duck_streams/duck_streams.clj ?

19:48 grkz: technomancy: I think because of the namespace changes a few weeks ago; everything was "lifted up" one step

19:48 Chouser: grkz: right

19:48 technomancy: so it's a transitionary thing?

19:49 Chouser: technomancy: yes.

19:49 technomancy: gotcha; thanks

19:49 so the new rules don't require the last directory then?

19:49 Chouser: right

19:49 technomancy: cool, seemed a bit verbose.

19:50 Chouser: namespace: foo.bar.bing-bang, file: foo/bar/bing_bang.clj

19:50 RSchulz: Do 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:50 Chouser: if you use :gen-class, the class would be named foo.bar.bing_bang

19:51 RSchulz: If I understand what you're saying, yes.

19:52 RSchulz: I 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:52 Chouser: RSchulz: yes, that's correct.

19:52 RSchulz: OK.

19:53 I'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:53 Chouser: grkz: you're trying to wrap a bunch of Java features in a nice Clojure api?

19:53 RSchulz: (_Why_ was it decided...)

19:53 Chouser: RSchulz: I've been wondering that myself, but just thought of something earlier -- class and package names.

19:54 RSchulz: Yeah, that's what I was wondering.

19:54 rsynnott: RSchulz: possibly something to do with dealing wih things from the java end?

19:54 java will interpret the hyphen as numeric subtraction, I think

19:55 grkz: Chouser: 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:55 Chouser: the class has to be named with a _ and so any class file names or package directories would have to have _

19:55 RSchulz: Sort 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:55 It's just like Alan Perlis said: "Syntactic sugar leads to cancer of the semicolon."

19:55 Chouser: grkz: oh! sorry, I assumed you just made it up. :-)

19:57 technomancy: the irony of adding thread-safety to the JRuby project at work while I learn Clojure on the side is just too much.

19:58 Chouser: "adding thread-safety"? ha.

19:58 technomancy: you laugh at my pain? =(

19:58 RSchulz: Just 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:58 powr-toc: technomancy: lol... how are you finding JRuby anyway?

19:59 Chouser: grkz: I would normally recommend duck-streams, but I don't know if it has any way to append to an existing file.

19:59 technomancy: powr-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:59 RSchulz: What's the gist of Duck Streams?

19:59 powr-toc: technomancy: yeah, I implemented a prototype for a system last year in JRuby... I found the same thing

19:59 Chouser: uses a bit of introspection to abstract away a lot of Java io api druft.

20:00 cruft

20:00 technomancy: powr-toc: it's gotten *much* better since I started working on it in May

20:00 back then rubygems was nigh-unusable

20:00 but activesupport is still activesupport... =\

20:00 powr-toc: technomancy: 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:00 technomancy: easiest fix is probably to just move to datamapper

20:01 grkz: Chouser: ok, thanks. I'll have a look through duck-streams

20:01 RSchulz: How much documentation (besides the code and its (doc ...) strings) is there for Clojure Contrib?

20:02 * technomancy hasn't found much, but the comments in the code can be helpful

20:02 powr-toc: technomancy: I reimplemented the AR code with ActiveObjects instead... it's very easy to adopt a rails AR schema, with pluralisation etc...

20:02 RSchulz: What do you think about a Hibernate API specifically for Clojure? Useful? Necessary? Superfluous?

20:03 technomancy: powr-toc: huh. I don't know any Java, but datamapper looks promising

20:05 powr-toc: technomancy: Yeah, I know a decent ruby guy who says good things about it, he described it as a "bit more sugary"

20:05 technomancy: a bit less magic is what I'm looking for. all that const_missing and method_missing is hell on your backtraces

20:05 powr-toc: technomancy: true

20:05 lisppaste8: Chouser annotated #71552 with "append to file (for grkz)" at http://paste.lisp.org/display/71552#1

20:08 powr-toc: technomancy: 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:09 technomancy: yeah, exception interop has improved

20:09 powr-toc: that'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:09 technomancy: I don't know anything about calling JRuby from Java though

20:10 powr-toc: yeah, backwards-compatibility is holding JRuby back in a way... though in another way it's kind of the point.

20:10 but you get the feeling there are a lot of things they wish they could do differently.

20:10 grkz: Chouser: many thanks, exactly what I was after :-)

20:12 powr-toc: technomancy: 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:12 I think the scripting api support has improved now though

20:12 technomancy: agreed.

20:13 technomancy: the scripting api is the stuff that was designed to support rhino?

20:13 powr-toc: technomancy: well, I think it supports rhino out of the box... but it's designed so other languages can implement it too

20:14 Chouser: grkz: yeah, so easy, isn't it? :-/ The 'true' is to append. You know your way around java docs?

20:16 duck1123: how come none of the fibonacci functions on the wiki use recur?

20:16 it seems like they all should

20:16 powr-toc: duck1123: I think it's because they uses lazy seq's instead

20:17 duck1123: ok, I get it now

20:24 rsynnott: duck1123: 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:41 hiredman: clojurebot: latest?

22:41 clojurebot: latest is 1142

22:41 hiredman: clojurebot: latest is 1141

22:41 clojurebot: c'est bon!

22:48 svn rev 1142; renamed clojure-print.clj, clojure-proxy.clj to clojure_...

23:17 notallama: alright, 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:18 or will the listener handle that?

23:22 lsmith[1]: Does anyone know if there is something akin to the "case" statement in CL? Any idea where it is documented?

23:24 jeremy___: would fcase work in clojure-contrib?

23:25 Chouser: notallama: I'm pretty sure the listener executes in the swing thread, and will get the events in order.

23:25 notallama: if you then send from each event to the same agent, the agent will get the actions in order

23:25 jeremy___: lsmith[1]: http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib/trunk/src/clojure/contrib/fcase/fcase.clj?revision=150&view=markup

23:26 Chouser: notallama: 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:26 lsmith[1]: I'll check it out. Thanks.

Logging service provided by n01se.net