#clojure log - Oct 31 2008

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

0:00 wwmorgan: bradbev_: nope, just zipped. You can do a jar tf to find the path of the clojure file you want to load

0:01 bradbev_: I guess I'm still confused then. why do I need the contrib jar file in my path? Can't I manually go & load-file the contribs I need? (which is what I thought I'd done)

0:03 wwmorgan: you could, but it's much nicer to do (ns your-project (:use (clojure xml))). Also it makes your code more portable

0:04 bradbev_: wwmorgan: ok, I get it then. Before when I was just messing about I must have missed compiling a file. Can you change the classpath at runtime?

0:05 wwmorgan: bradbev_: there's add-classpath, but it might not work in this situation

0:06 bradbev_: ok. Package management is a bit immature right now then? Not that CL is very much better

0:08 wwmorgan: I think the ns macro handles most use cases. Is there something you're trying to do that you don't think it covers?

0:10 bradbev_: no, I'm just learning at the moment, but it seems odd to me so far :) Would one normally put all their jar files in the same place & then just add that directory to the classpath?

0:13 Chouser: bradbev_: java requires each jar to be listed in the classpath

0:13 wwmorgan: I use enclojure, which runs in netbeans. When you start up the Repl in the IDE it looks up all your dependencies and supplies them as a command-line argument to the Repl, like java -cp /foo/bar/baz.jar:/foo/bar/qut.jar:/foo/bar/clojure.jar clojure.lang.Repl. So everything's available from the start

0:13 Chouser: there's another command-line flag, though, hang on...

0:14 bradbev_: I hadn't heard of enclojure before...

0:15 wwmorgan: if you like megalithic IDEs then check it out. It's pretty OK

0:15 Chouser: -Djava.ext.dirs

0:15 that lets you specify a directory full of .jars

0:17 bradbev_: Chouser: that's awesome

0:17 wwmorgan: I'm more of an emacs guy now

0:18 Chouser: I haven't used it yet. I didn't learn about it until I had figured out pretty well how to cope with -cp

0:20 wwmorgan: anyway, you don't need to make jars to develop your own multi-file application. :use and :require will traverse a normal directory structure too

0:21 then to distribute you jar the whole thing up and everything still works

0:21 bradbev_: nice, I didn't know that

0:23 so the namespace clojure.contrib.zip_filter.xml maps to the directory structure clojure/contrib/zip_filter/xml - is that enforced or just convention? And when I require clojure....filter.xml how does it know which clj file to load?

0:26 wwmorgan: it maps to clojure/contib/zip_filter/xml/xml.clj

0:27 bradbev_: so only one file per directory then

0:28 wwmorgan: in general yes.

0:28 bradbev_: thanks for the info, some of this is starting to come back from my java at school 10 years ago

0:28 wwmorgan: more correctly: one file that you can :use or :require per directory

0:30 Chouser: the specific place where it looks for a .clj file when given a namespace may be changing soon.

0:30 wwmorgan: if I have /foo/bar/baz.clj and /foo/bar/baz_helper.clj, I can do (ns foo.bar.baz (:load "baz_helper.clj")) in baz.clj

0:31 but that might be "wrong"

0:31 bradbev_: :)

0:31 Chouser: wwmorgan: actually, I think that's currently "right".

0:31 wwmorgan: oh sweet, cause I've been doing it _everywhere_

0:32 Chouser: Part of the argument for the directory structure was to allow multiple files in the same directory to contribute to a single namespace.

0:32 wwmorgan: yes

0:32 Chouser: but like I said, that might be changing with the AOTC stuff.

0:32 If you have good use cases for it, speak up.

0:32 (not now, but when rhickey's listening. ;-)

0:33 bradbev_: AOTC?

0:33 Chouser: ahead of time compilation

0:33 bradbev_: nice

0:33 Chouser: generating .class files from .clj files

0:41 albino: what's the time frame on AOT? I would like it so I could use it for the Android the way the Scala people do

0:45 Chouser: last I heard it was "on hold" until after the election.

0:46 my personal guess is it's be available to play with a couple weeks after that, but who knows.

0:46 wwmorgan: I don't know anything about Android, but the way it works now wouldn't work?

0:47 java application that compiles to a .class file loads clojure code, get a var and invokes that fn?

0:50 Chouser: the problem is that .class files have to be converted ("compiled") to android's bytecode

0:50 abrooks: Dalvik bytecode, technically.

0:51 wwmorgan: oh I see, so all the bytecode generation is broken

0:52 Chouser: yeah, it'd generate JVM bytecode at runtime and then ... ?

0:53 abrooks: Where the JVM is stack based, the Dalvik VM is register based. I don't know how limiting this ultimately is (I haven't given it much thought) but I suspect that widens the gap between porting Java to the DVM and languages that specifically care about compiling their own code.

0:53 bradbev_: Am I right in saying that android prevents runtime code generation?

0:53 Chouser: bradbev_: that may also be true, but it's not necessary to cause clojure trouble.

0:54 abrooks: bradbev_: That would probably depend on the class loader if they have a similar model.

0:54 Chouser: abrooks: but they already compile JVM bytecode to Dalvik, so the register thing must be a solved problem?

0:55 abrooks: Chouser: They do? I know they compiled Java to Dalvik. I hadn't heard about JVM bytecode.

0:55 * abrooks googles

0:56 Chouser: that's why compiling .clj to .class is going to be at all helpful

0:56 for android

0:57 abrooks: Hm... Interesting (presuming it's accurate): http://rebelwithoutamouse.blogspot.com/2007/11/dalvik-googles-workaround-for-suns-jvm.html

0:57 "The Android SDK does not compile your Java source code into Dalvik's bytecode directly, but it first uses a regular java compiler to generate regular java bytecode and then converts that bytecode into Dalvik's bytecode"

0:58 Seems like I should have known that.

1:30 lisppaste8: sunwukong pasted "printing in a proxy" at http://paste.lisp.org/display/69490

1:30 sunwukong: seems like I cannot print from a proxy - any idea why?

1:35 Chouser: sunwukong: works for me.

1:35 each time I click the button I see a new "Hello" print in my repl window.

1:36 I'm using a plain repl in a term window.

1:37 sunwukong: thanks, I'll try it, maybe it's just some slime thing

1:38 yes, from plain repl it works for me, too

1:51 sohail: so there isn't any real way to pre-compile clojure code yet is there? my app takes 3 seconds to get to main...

1:55 Chouser: right

1:56 it's like emacs -- just keep reusing the same process :-)

1:57 sohail: Chouser :-(

1:58 so no save-clojure-and-die planned?

2:06 Chouser: no, but AOTC is planned -- true compilation of .clj to .class

2:46 Pupeno: Good morning.

3:09 sohail: Chouser, cool, I look forward to it!

3:40 lisppaste8: sohail pasted "right or wrong way to write a while loop?" at http://paste.lisp.org/display/69495

4:22 Lau_of_DK: Morning gents

4:22 arbscht: hi lau

4:49 Lau_of_DK: Java guys, why is this

4:50 static {

4:50 com.trolltech.qt.Utilities.loadQtLibrary("QtCore");

4:50 com.trolltech.qt.Utilities.loadQtLibrary("QtNetwork");

4:50 }

4:50 not the same as this

4:50 (. com.trolltech.qt.Utilities (loadQtLibrary "QtCore"))

4:50 (. com.trolltech.qt.Utilities (loadQtLibrary "QtNetwork"))

4:52 (it compiles fine, but produces no effect)

4:53 The question is probably this. How do I mimic the static { ... } ?

4:54 tWip: static block is run after the class is loaded

4:54 Lau_of_DK: oh

4:54 Thats important

4:54 tWip: I don't know why that should matter as long as you do the calls before using anything

4:55 Lau_of_DK: It matters because this is a patch for a bug in Webkit

4:55 Do you know how to do a static in Clojure?

4:55 tWip: I don't know how that would apply as clojure isn't class based in the same manner

4:56 couldn't you just do those calls before defining anything else?

4:56 Lau_of_DK: I can, but that didnt work, hence the question

4:56 tWip: oh ok

4:57 well I'm afraid I don't know more about this subject as that seems to be native interfacing issue

4:58 Lau_of_DK: Alright

5:58 AWizzArd: Moin

7:18 Lau_of_DK: cemerick, can you port a static {} clause to Clojure

7:18 ?

7:20 cemerick: Lau_of_DK: that's sort of a non sequitur; there's no static initialization in clojure, everything is dynamic

7:20 (modulo whatever is going to come out of AOT, perhaps)

7:20 Lau_of_DK: So what do I do when I have Java code that requires to be static ?

7:21 cemerick: no code requires a static invocation context -- static blocks are just a convenient method for executing code once when a class is first loaded

7:22 You can have clojure code executed just once when a clj file is first loaded by making it a top-level form...

7:24 Lau_of_DK: oh

7:24 I tried that, but it didnt work, so I figured static was the magic

7:24 <Lau_of_DK> Java guys, why is this

7:24 <Lau_of_DK> static {

7:24 <Lau_of_DK> com.trolltech.qt.Utilities.loadQtLibrary("QtCore");

7:24 <Lau_of_DK> com.trolltech.qt.Utilities.loadQtLibrary("QtNetwork");

7:24 <Lau_of_DK> }

7:24 <Lau_of_DK> not the same as this

7:25 <Lau_of_DK> (. com.trolltech.qt.Utilities (loadQtLibrary "QtCore"))

7:25 <Lau_of_DK> (. com.trolltech.qt.Utilities (loadQtLibrary "QtNetwork"))

7:25 <Lau_of_DK> (it compiles fine, but produces no effect)

7:26 cemerick: totally a style point, but doing (com.trolltech.qt.Utilities/loadQtLibrary "QtCore") is more idiomatic at this point

7:26 I assume those calls load some native libs or something?

7:26 tWip: well I guess you could have your own main, or class you touch in Java that has that static block

7:27 but I fail to see how the mere staticness of that code affects anything... as long as ordering is correct

7:28 cemerick: yeah, a static block is just like any other java code, except it does not execute within the context of an instance ("this", etc)

7:29 tWip: Lau_of_DK: have you tried having that in a classname as static? then doing (Class/forName "my.class.with.StaticCode")

7:30 in a class that is

7:30 that should execute your static block as the class is loaded

7:32 cemerick: That really should be no different than what Lau_of_DK pasted above. If it is, then it'd be interesting to find out why.

7:32 Lau_of_DK: Just trying to understand what you guys are saying. cemerick thanks for the style point, I had no idea that was a possibility

7:32 tWip: yeah I don't believe that it will make a difference... just to prove a point :)

7:33 it may be some weird jvm bug/issue

7:33 Lau_of_DK: user=> (com.trolltech.qt.Utilities/loadQtLibrary "QtCore")

7:33 nil

7:33 user=> (com.trolltech.qt.Utilities/loadQtLibrary "QtNetwork")

7:33 nil

7:33 user=> (main)

7:33 com.trolltech.qt.designer.QUiLoaderException: Failed to load class (NO_SOURCE_FILE:0)

7:34 http://lists.trolltech.com/pipermail/qt-jambi-interest/2008-March/000096.html

7:34 read that, and the previous post

7:36 cemerick: Lau_of_DK: I don't know anything about jambi. Depending on what loadQtLibrary actually does, this might be a relevant issue: http://groups.google.com/group/clojure/browse_thread/thread/98714931a8edef1c

7:36 tWip: but your error seems different than the one discussed on the list

7:38 cemerick: yeah, "Failed to load class" sounds like a classpath or path issue?

7:46 Lau_of_DK: Im not sure what it is, but it directly relates to including QWebKit in your dialog

7:46 And this is a known bug, which they solve by the static {}.

7:47 cemerick, the link you provided may be related, but I dont see it presenting a fix ?

7:48 AWizzArd: rhickey: is there a way to "overload" syntax that is used for lists, vectors and maps? So, (sorted-map ..) returns a tree map, but one can use all functions that work on hash maps as well, and it prints the same. Can I add another tree in such a way as well?

7:50 rhickey: AWizzArd: yes, that's how it works. If you implement IPersistentMap your map will work like all of the others, with all functions that take maps, destructuring, everything

7:50 cemerick: Lau_of_DK: no, I didn't say that there was a clean fix yet -- looks like rhickey and Stephen are on it, at least for the use case(s) that they have

7:50 Lau_of_DK: ok

7:51 cemerick: If I were you, I'd make sure your classpath and path are configured properly, as the QUiLoaderException you pasted is different than what was in that mailing list post.

7:51 AWizzArd: rhickey: that's good news :-)

7:52 Lau_of_DK: cemerick, I've placed all the QtJambi.jars in my standard /clojure/libs dir, so that shouldnt be a problem

7:52 And I connect the 2, because I can use every other widget in the book, except for WebKit

7:52 cemerick: Lau_of_DK: have you configured your path? I presume there's some native libs that need to be on your path for stuff like that to work.

7:54 Lau_of_DK: configured my path ?

7:54 As far as I know, loading the .jars is all thats needed - which in turn, is all Ive done

7:54 All my imports, incl. Webkit, work fine

7:55 cemerick: Lau_of_DK: #2 in the list @ http://lists.trolltech.com/pipermail/qt-jambi-interest/2008-March/000096.html says that you have to add some path(s) to your PATH env var

7:56 Lau_of_DK: Yes, but they are 2 seperate solutions, you pick 1

7:56 cemerick: OK, but perhaps #2 will provide you with an interim solution.

7:57 Lau_of_DK: I didnt, I tried adding /bin to path

7:57 Java loads only jars right, .so files and such are not loaded ?

7:57 cemerick: no, Java links into native libs all the time as a matter of course. Especially so when you're bringing in libraries that come with native libs.

8:02 Pupeno-G: Hello.

8:02 When you use a little Java program to bootstrap a clojure application, do you need this program to compile and load all the Clojure files?

8:02 tWip: how would you do that?

8:03 all the same dynamic features are available from repl and any embedded use afaik

8:04 Pupeno-G: tWip: calling Complier.load(on every file) I suppose.

8:04 tWip: just have the clj files in your classpath, clojure will find them when you use something

8:05 Pupeno-G: tWip: all the files are inside a jar.

8:07 tWip: if you run a jar, then that jar's files would be in the classpath

8:08 Pupeno-G: tWip: what? you lost me there.

8:08 tWip: in short, it should work

8:09 Pupeno-G: I have file1.clj, file2.clj, both in the same directory inside a jar and a Java program that in its main does, something like, Compiler.load(file1.clj), now file1.clj calls a function in file2.clj, so compiling fails due to a missing function.

8:09 tWip: oh I see, you should think about making clojure namespaces

8:10 and structuring code in them as appropriate

8:11 Lau_of_DK: cemerick, QtJambi comes with a alot of so.4 files in /lib/ - Youre saying everything has to be on the classpath ?

8:12 cemerick: Lau_of_DK: probably just their containing directory

8:12 rhickey: Pupeno-G: unless you have special needs, you can just us RT.var to create Var objects that correspond to Clojure vars you want to call, then just invoke them. That way, you can work it out in Clojure then do the same thing in Java

8:12 cemerick: to be clear, I've never used any flavor of Qt, that's just a suggestion

8:14 * Pupeno-G goes to read more about Clojure namespaces to see how they can help here.

8:17 Pupeno-G: tWip: Did you mean that each file should be a namespace?

8:20 rhickey: for the moment, I'd rather improve the java wrapper and or build system to be able build the simplest possible cases, as what I'm really developing is not the program, but the plumbing to write programs.

8:22 rhickey: Pupeno-G: I understand, just advocating you do Var load = RT.var("clojure","load"); load.invoke(...); rather than Compiler.load(...)

8:23 Pupeno-G: rhickey: Oh! I totally misunderstood you. Right, I remember that way from Enclojure trunk.

8:24 AWizzArd: would it make sense that (dissoc my-vector n) would return a vector instead of throwing an exception?

8:24 gnuvince: Hello everyone

8:24 rhickey: AWizzArd: I don't think so

8:26 AWizzArd: so if I want to have a vector where I want to "delete" elements from the middle I should have a hash map with numeric keys probably

8:28 gnuvince: abrooks: thanks for the comments!

8:30 kib2: gnuvince: hi, I've read your tutorial last night.

8:31 Lau_of_DK: cemerick, Ive extended the classpath, Ive set everything up the way they propose, Ive manually loaded the 2 libs, I still get the same error

8:33 Pupeno-G: clojure.lang.RT is not part of the 20080916 release, isn't it?

8:34 gnuvince: kib2: any comments?

8:35 kib2: gnuvince: yes, it is said to be for beginners, and I don't think so (because I'm one).

8:36 rhickey: AWizzArd: yes, a hash-map makes a good sparse vector

8:37 AWizzArd: sorted-map probably better if you care about sequential iteration

8:37 gnuvince: All right, I'll make a few final corrections and post it during my lunch break

8:37 duck1123: rhickey: would it be possible (or wise) to just conj the two slices together?

8:38 Pupeno-G: Lau_of_DK: what error are you getting?

8:40 kib2: gnuvince: ie you're talking about macros, I don't think anybody who has programmed in whatever langage but Lisp like will *really* know what's a macro.

8:41 AWizzArd: rhickey: btw, if I want to implement my own vector and implement IPersistentVector.. can I do this purely from within Clojure or would I have to do that part in Java?

8:41 gnuvince: kib2: I may get into them in a future post.

8:41 kib2: gnuvince: Also, I found it hard to start with Clojure, because you need to know a little Java before, right or not ?

8:42 duck1123: gnuvince: it might be helpful, when referring to certain pages, to provide a link

8:42 gnuvince: duck1123: I'll add more of them. Thank you.

8:46 Chouser: AWizzArd: you can implement IPersistentVector with proxy

8:47 AWizzArd: good

8:48 abrooks: gnuvince: Thanks for your post!

8:48 Lau_of_DK: Pupeno, , I'll do a lisppaste, hang on

8:50 gnuvince: abrooks: thanks for your comments :)

8:50 kib2: is someone interested by GnuVince tutorial in pdf ?

8:51 Pupeno-G: kib2: by what?

8:51 kib2: the tutorial written by gnuvince

8:51 lisppaste8: Lau_of_DK pasted "QtWebkit load error" at http://paste.lisp.org/display/69503

8:53 Pupeno-G: Lau_of_DK: Are you running 4.4 on Windows?

8:54 Lau_of_DK: On Linux

8:54 Pupeno-G: Lau_of_DK: and you've tried the equivalent Java code?

8:55 Lau_of_DK: No - Ive never written 1 char of Java in my life

8:55 (which is a strong argument that Clojure should have been built on .Net)

8:56 Pupeno-G: Have you tried the workarounds in the mail you pointed to?

8:56 kib2: here it is : http://kib2.alwaysdata.net/tempo/gnuvince.pdf

8:56 Lau_of_DK: Yes, those are the first 2 lines of the code

8:56 And yes the paths are set up, according to their docs and the accompanying .sh scripts

8:56 Pupeno-G: Oh! I missed those, sorry.

8:58 Lau_of_DK: np :)

8:58 jdz: what does gnuvince use for writing that pdf?

8:58 Pupeno-G: I'm so pre-webkit era here :P

8:59 jdz: the code sure looks like colorized by emacs

8:59 Lau_of_DK: Pupeno-G, Webkit packs quite a punch though, and I want it for a specific app I have in mind

9:00 kib2: jdz: I've used Pygments

9:03 Pupeno-G: Lau_of_DK: I'm sorry, I don't have any idea. Do you get any other messages, any backtrace?

9:03 rhickey: Interesting: http://groups.google.com/group/jvm-languages/msg/8baa984ab66f00bb

9:03 Lau_of_DK: Nada

9:05 rhickey, almost makes you sea-sick with all those curly braces :)

9:06 rhickey: I wonder if they've done anything about the 'no classloaders in applets' security restriction? Else this is limited to pure interpreters or privileged runtimes

9:07 cemerick: rhickey: yes, update 10 is very, very welcome on a variety of fronts

9:09 kib2: rhickey: very interesting

9:09 Pupeno-G: rhickey: I converted to using RT.loadResourceScript(...), but how should that help me regarding having two files, and one not seeing the namespace/contents of the other? or should I name the files/namespaces in a specific way?

9:10 cemerick: I don' t think update 10 changes the classloader policy -- although signing one's applet is a good thing to do, anyway

9:11 rhickey: cemerick: If most Flash had to be signed it never would have gotten off the ground - they need to fix this

9:11 if they are serious about other languages

9:12 I don;t understand why classes loaded from a custom classloader don't just get the same verification and sandbox restrictions

9:12 cemerick: rhickey: agreed. I was saying (poorly) that it's a problem for consumer-level stuff, but not a problem for commercial stuff.

9:14 rhickey: or some standard public load-from-bytes-in-memory supported on the standard loader - this protected nonsense is goofy

9:15 everyone has to derive a custom classloader to do exactly the same thing, and incurs no end of grief for doing so

9:18 cemerick: the choir agrees :-D With update 10, every applet is in its own jvm process, so I'm guessing a lot of changes can now be put on the table.

9:19 rhickey: It would be so awesome to load your Clojure program to provide logic and remote control the browser-based UI

9:20 * rhickey last did LiveConnect pre-2000

9:22 duck1123: so, can clojurescript be used to generate javascript yet?

9:22 I thought it would be interesting to try to link clojure and mozrepl

9:29 gnuvince: http://gnuvince.wordpress.com/2008/10/31/fetching-web-comics-with-clojure-part-1/

9:32 cemerick: rhickey: I'm actually hoping to deploy clojure to drive a GUI app as an applet in the not-too-distant future. Not having to maintain ajax or flash code in addition to our necessary "back end" that's in clojure/Java will be very pleasant.

9:32 rhickey: cemerick: cool! - the UI is Swing or HTML?

9:35 cemerick: aiming for Swing (although we may bring in a native browser component using jdic for a couple of webby tasks)

9:36 rhickey: is JWebPane still MIA?

9:37 Chouser: duck1123: clojurescript can generate javascript today, for probably 90% or more of the constructs needed. The runtime support is probably about 70% complete (these number are slightly educated guesses)

9:37 cemerick: I don't know what JWebPane is/was, but JDIC has a WebBrowser class that hooks into whatever native browser component you have installed (mozilla, webkit, etc)

9:37 Chouser: rhickey: Lau_of_DK's working hard on getting Qt and Webkit working for clojure

9:37 cemerick: I played with it for 20 minutes some months ago, and looks promising, although I suppose there may be hidden issues.

9:37 rhickey: JWebPane wwraps WebKit for consumption by Java - very deep integration

9:38 Chouser: that can apparently be deployed using java web start

9:38 rhickey: Saw JWebPane at JavaOne and was stunned by how smart they were about it

9:38 duck1123: Chouser: that's cool. I haven't gotten around to playing with it yet, but it looks promising.

9:38 cemerick: ah, in that case, I'm behind the curve

9:39 Chouser: duck1123: well, the clojure-side API's still in flux, so it's not really ready to go yet

9:39 but I'm hoping to have a repl up on the web in the next few days.

9:39 cemerick: The web is a decidedly second-class citizen for us

9:41 duck1123: Chouser: I would also like to eventually replace my .conkerorrc file with some lisp-like language

9:41 Pupeno-G: So, if I RT.loadResourceScript all files it works, is that the way to go? I'm fine with that, but if there's a better way I'll take it.

10:32 gnuvince: Anyone wants to post my tutorial to programming.reddit?

10:34 tayssir: gnuvince: Done -- on programming.reddit!

10:35 gnuvince: tayssir: link?

10:35 tayssir: Er, yeah... http://www.reddit.com/r/programming/comments/7ait5/fetching_web_comics_with_clojure/

10:35 gnuvince: Upvoted!

10:36 Pupeno-G: idem.

10:46 How does Clojure know how to find the file containing a specific namespace?

10:47 Chouser: it looks through the classpath for a matching directory. com.foo.pkg would have to be at com/foo/pkg/pkg.clj

11:10 TommyOnMac: hi

11:11 kib2: didn't regexps supposed to be written like this #"..." ?

11:11 gnuvince: kib2: yes

11:12 jdz: only you don't need to escape backslashes since one of the recent patches

11:12 kib2: so why should I write (.matches "abc" "(a((b)(c))") instead of (.matches "abc" #"(a((b)(c))") ?

11:13 abrooks: jdz: gnuvince notes that below in the post.

11:20 Chousuke: kib2: because you're calling String.matches() which takes a string parameter

11:21 kib2: Chousuke: and then String.matches compiles the given string to a regexp, that's it ?

11:23 Chousuke: kib2: I don't know what String.matches really does, but most likely yes

11:25 kib2: Chousuke: because when I look at Java docs, it is said to take a regexp as parameter, so I suppose Clojure makes it automaticaly.

11:25 Chousuke: kib2: it takes a String representing the regexp as a pattern

11:25 not an actuall java.util.regexp.Pattern

11:25 -l

11:26 kib2: Chousuke: yes, so Java does the work

11:26 Chousuke: yeah

11:28 if you want to use an actual pattern object you'd have to do something like (-> #"foo" (.matcher "foo") (.matches))

11:30 Lau_of_DK: Chouser: Update - I have a Webkit widget running in a UI driven from Clojure now :)

11:30 AWizzArd: sounds nice

11:30 Chouser: Lau_of_DK: excellent!

11:30 AWizzArd: Now we just need some tutorials, how to do the basic stuff, step-by-step, so that we can impress people with youtube videos.

11:31 Lau_of_DK: lol

11:31 AWizzArd: Especially for all these 16 year olds out there it will be nice to programm "their own webbrowser" and show off before their friends... they are the guys who will write the software of tomorrow.

11:31 Lau_of_DK: haha

11:32 I'll put something up sooner or later, but not on Youtube

11:32 kib2: Chousuke: thanks for the tip

11:34 what is "->" synatxic sugar for ?

11:34 "syntaxic"

11:34 gnuvince: kib2: syntactic

11:34 kib2: oops :)

11:35 Chousuke: kib2: it takes the first form, puts it as the second element in the next form, then puts that as the second element in the next form, ad infinitym

11:35 gnuvince: kib2: (-> 3 (+ 1) (+ 2)) ==> 6

11:35 Chousuke: infinitum :P

11:36 gnuvince: it moves the result through the forms.

11:36 It's similar to Haskell's do-form

11:37 Chousuke: it's not very clear at first glance, but it's quite nice once you get it :)

11:37 kib2: nice :) I like most of Haskel features :)l

11:38 Chousuke: I agree, I have to learn playing dominoes

11:39 Chousuke: my example above would expand to (-> (.matcher #"foo" "foo") (.matches)) which further expands to (.matches (.matcher #"foo" "foo"))

11:40 Chouser: for extra fun, parens are optional on all but the first form: (-> #"foo" (.matcher "foo") .matches)

11:44 kib2: Chousuke: thanks, that's what I was trying to do, but I was lost.

11:46 Chousuke: hm. Just noticed that (-> 3 (+ 1) (+ 2)) looks like infix notation with weirdly placed parens :/

11:51 duck1123: with ->, the result becomes the 2nd param, right?

11:51 danlarkin: isn't -> deprecated?

11:52 Lau_of_DK: rhickey, I cant say that this isnt just my inexpertise talking, but I really would appreciate some examples to go along with the online documentation. Im trying to understand (gen-class) and (gen-class-and-load) and its not exactly straight-forward to me how to apply them

11:53 AWizzArd: Lau_of_DK: it's time for a how-to wiki or something like that

11:53 Lau_of_DK: Can somebody enlightmen me, if I want to create a class which has a constructor a private/public var and a helper function, how do I do that ?

11:53 AWizzArd: In principle for every function/aspect there could be a bunch of examples

11:54 When should I use vectors? How can I use assoc? How can I make a .jar file out of my clojure program that only needs to be double clicked on my friends computer? And so on

11:57 Chousuke: danlarkin: why would -> be deprecated?

11:57 it pretty much replaces (. and (..

11:57 Chouser: gen-class is among the trickiest pieces of clojure to use.

11:57 danlarkin: Chousuke: whoops! it's .-> that's deprecated

11:58 Chouser: but it's also illustrative of one reason that not too many docs have been written yet. gen-class is probably going away.

12:04 Lau_of_DK: Also one of the best reasons to get busy on some docs :)

12:06 Chouser: get busy writing docs for functions that are going away?

12:06 lisppaste8: Lau_of_DK pasted "gen-class-tutorial-needed" at http://paste.lisp.org/display/69516

12:06 Chouser: go right ahead.

12:08 Here's my gen-class tutorial. Please forgive me if it's a little dense: http://paste.lisp.org/display/68406

12:10 Lau_of_DK: Chouser, I gotta break, visitors coming - Could you do me a huge favor and annote my little example? :)

12:11 Chouser: Lau_of_DK: probably not. sorry.

12:18 Chousuke: gen-class is weird :/

12:21 Chouser: it is.

12:21 it's an unusual layout of clojure code for constructing an unusual kind of Java class.

12:26 Chousuke: I'm trying to make a trivial class and it fails with "no value supplied for 'init" :/

12:28 ah, never mind.

12:35 lisppaste8: sohail pasted "System tray app with SWT - comments?" at http://paste.lisp.org/display/69519

12:42 Chousuke: sohail: nothing much, but you define unless and use it nowhere :)

12:42 sohail: Chouser hehe

12:42 I think I intended to replace one of the (if (not ... with that

12:44 Chousuke: also couldn't you use SWT/PUSH instead of (.PUSH SWT)

12:45 sohail: Chouser, could I?!

12:45 that would make me very happy!!!

12:46 Chousuke: I'm not Chouser, and I'm not sure. there were some limitations to the / form, but try it.

12:46 sohail: err sorry :-)

12:46 Chousuke, :-)

12:47 Chousuke, replacing (.Push SWT) with SWT/Push works

12:47 err PUSH

12:48 Chousuke: as far as I know / can be used to access static fields in a class

12:48 sohail: that's helpful

12:48 Chousuke: so you can do stuff like Math/PI etc.

12:50 it'll also work for the accesses in the .addListener calls :)

12:52 sohail: Chouser, yeah I replaced those as well

12:53 Chousuke: You have to be more careful with your tabcompletion :D

12:53 sohail: damnit

12:53 you need ot change your nick!

12:53 duck1123: Chousuke: maybe one of you just needs to change their name

12:54 sohail: make yourself zChousuke :-)

12:55 H4ns: sohail: please post your reworked example!

12:57 lisppaste8: sohail annotated #69519 with "for h4ns" at http://paste.lisp.org/display/69519#1

12:57 H4ns: sohail: looks great, thanks!

12:58 Chousuke: you missed one.

12:58 (addListener (.Selection SWT) ...

12:58 sohail: so I did

12:58 thanks :-)

12:59 AWizzArd: sohail: see if you can add this to a wiki

13:00 sohail: AWizzArd, is there a wiki?

13:00 AWizzArd: http://en.wikibooks.org/wiki/Clojure_Programming is coming closest to it

13:02 we need much much more howtos and examples

13:02 sohail: maybe not a good idea, just realized there is a "leak" b/c I didn't dispose the image

13:02 AWizzArd: things that have to do with guis and graphics will attract also young people

13:03 Chousuke: I just noticed. Your definition of proxy-listener seems to have an error

13:03 cemerick: AWizzArd: as one of the young people (ostensibly!), I'd say we're already here ;-)

13:04 AWizzArd: Very good

13:04 sohail: Chousuke, what is the error

13:05 lisppaste8: Chousuke annotated #69519 with "hmm" at http://paste.lisp.org/display/69519#2

13:06 sohail: Chousuke, ah, good catch. Howcome it doesn't affect things?

13:08 Chousuke: never tried running the code, I don't have SWT stuff in my classpath. I think it should break though if it's accidentally expanded into the qualified name :/

13:08 sohail: it doesn't break...

13:12 Lau_of_DK: Gents, Ive only got a few minutes, and takes on this? http://paste.lisp.org/display/69516

13:14 cemerick: Lau_of_DK: there's a ton of gen-class tutorials on the google group

13:14 s/tutorials/examples

13:15 Lau_of_DK: thanks cemerick

13:22 Chousuke: sohail: seems like it works either way after all.

13:23 sohail: Chousuke, by design or accident?

13:23 why do you think it should barf?

13:24 Chousuke: maybe that was just my mistake.

13:25 rhickey_: Chousuke: Revision #907 Committed by rhickey at 6/17/08 8:29:06 AM made proxy tolerant of ns-qualified method names

13:26 before that it would have been bothered by the ns

13:27 Chousuke: ah

13:27 Lau_of_DK: What are the odds that gen-class functions will disappear, and what are the arguments behind it ?

13:27 rhickey_: Lau_of_DK: genclass can be viewed as a special case of AOT compilation

13:28 and thus subsumed by it

13:29 Lau_of_DK: "subsumed by it" ?

13:38 * sohail rubs hands with glee citing Clojure AOT

13:38 gnuvince: :)

13:39 Chouser: I'm not sure I'll ever use AOTC. sohail, what about it are you looking forward to?

13:39 reduced startup time?

13:41 sohail: Chouser, that and you don't have to include all your sources

13:42 Chouser: so startup time and obfuscation.

13:42 sohail: pretty much, what else would I want it for

13:42 Chouser: no special classloader I think may make applets less cumbersome

13:43 .class files can be compiled to work on android

13:43 Drakeson: how can I find the current "classpath" ?

13:43 sohail: I thought applet is now spelled as "flash"

13:43 ;-)

13:44 Drakeson: *classpath* is not default

13:44 Chouser: you may be able to deploy a clojure app without the Compiler or ASM, for reduction in deployed .jar size.

13:45 sohail: Chouser, good list!

13:46 Chouser: sohail: did you see the clojure-inspired lisp for flash?

13:47 Drakeson: this may help you: http://groups.google.com/group/clojure/browse_thread/thread/d83ed2808eef00da/3cd31b25f123e9a7

13:48 sohail: Chouser, I did not

13:48 but flash is horrible

13:48 Chouser: is it?

13:49 abrooks: Horible things can be done with flash. I don't think it's inherently that bad.

13:49 sohail: what abrooks said

13:50 Chouser: I have no doubt that plenty of horrible stuff will be written in Clojure.

13:50 rhickey: I certainly hope not!

13:51 Chouser: It'll be inevitable once it becomes the 3rd most popular language (behind cobol and vb)

13:51 rhickey: yikes

13:52 Chouser: :-)

13:52 abrooks: rhickey: You're making great strides evolving the programming language. It will take many generations to evolve the programmers. :-/

13:52 sohail: ya, see my swt example above

13:52 very horrible

13:52 Drakeson: The "lispish" aura around it may repels many idiots ;)

13:53 sohail: I don't think so

13:53 Chouser: I'm not finding that flash link.

13:53 sohail: most people understand Lisp is this awesome language but can't make any practical use of it... clojure makes that possible

13:54 Drakeson: what is the ruby on rails for clojure?

13:54 rhickey: Outside of more purely functional languages, Clojure is one of the few with some sense of "the right thing" baked in. So at least you'll have to go out of your way to be horrible, at least as far as mutation and concurrency, but I have no illusions...

13:55 abrooks: ;-) I know you don't.

13:56 Drakeson: Compojure and Webjure are web platforms in development but I don't think either is particularly Railsy.

13:57 Drakeson: Besides neither is alliterative. We need Clojure on Crack or some such.

13:57 sohail: is there a way we can have another killer app for clojure than web programming

13:57 Kerris3: haha abrooks

13:57 Drakeson: (ruby-on-rails: a *seeming* integrated web application server with nice *icons* and *graphics*)

13:59 Chouser: sohail: how about a programmer's text editor?

13:59 Drakeson: sohail: maybe some document processing. There is no good-enough tool-chain around SVG yet.

13:59 sohail: Chouser, clojmacs?

13:59 Chouser: we could call it Emacs on Euphemisms or something

13:59 sohail: heh

13:59 devinus: will clojure ever have tail call optimization?

14:00 Chouser: devinus: when the JVM does

14:00 sohail: devinus, if the jvm gets it

14:00 Kerris3: is that the domain of the javac jvm

14:00 edit: beaten

14:00 devinus: isn't that support to be in java 7?

14:00 Kerris3: devinus: I've no idea, but you can check on http://download.java.net/jdk7/binaries/

14:01 rhickey: http://openjdk.java.net/projects/mlvm/subprojects.html

14:01 Chouser: ah! A Clojure-derived Lisp for the AVM2: http://github.com/aemoncannon/las3r/wikis

14:02 that's the clojure-like flash thingy

14:05 sohail: ah crap

14:05 I just did (loop [] (recur))

14:05 in the flash thingy

14:05 Chouser: heh. will you have to close your browser?

14:07 sohail: yep

14:08 Chouser: sorry, man. At least when I do that in clojurescript, the browser steps in after a moment and offers to kill the loop.

14:08 sohail: the flash thingy is pretty cool

14:35 aperotte: Does anyone remember the name of the company that Rich mentioned when he was talking about a java cluster that ran the ant colony simulation?

14:41 dudleyf: aperotte: Was that Azul Systems?

14:41 Chouser: aperotte: azulsystems?

14:41 aperotte: thanks guys, I was listening to his screencasts trying to find it again, but wasn't having much luck

14:42 Chouser: http://blogs.azulsystems.com/cliff/2008/09/jvm-language-su.html

14:46 Drakeson: isn't a classpath path to a jar file? if so, what is the meaning of the following (from http://en.wikibooks.org/wiki/Clojure_Programming#Libraries) : Now we have to create a file in the classpath with the filename "example/ourlib/ourlib.clj"

14:48 sohail: Drakeson, clojure hijacks the classpath for it's own purposes too

14:48 Drakeson: ok, is classpath a variable?

14:49 can I see its value? can I add an extra path to it?

14:49 I also tried this --> http://groups.google.com/group/clojure/browse_thread/thread/d83ed2808eef00da/3cd31b25f123e9a7

14:49 which gives me a list of jar files.

14:53 or at least, is it too obvious what it means?

14:53 AWizzArd: Funny. When you type on the repl: (in-ns 'java), how do you then go back into (in-ns 'user)?

14:53 kotarak: Drakeson: (add-classpath "file:///to/some/path") adds to the classpath

14:54 devinus: is there a clojure textmate bundle?

14:55 Drakeson: kotarak: thanks.

14:57 Chouser: AWizzArd: oops

14:58 AWizzArd: don't do that

15:00 lisppaste8: fyuryu pasted "fighting with macros" at http://paste.lisp.org/display/69528

15:01 fyuryu: I've been fighting with this macro for the last 1.5 hours

15:01 sohail: fyuryu, what are you trying to do?

15:01 fyuryu: and don't know how to achieve the desired effect

15:02 sohail: chunk doesn't need to be a macro

15:02 oh I see

15:03 do you need the @?

15:03 * sohail reads ~ as , currently...

15:03 fyuryu: sohail: this is a simplified version, I want to be able to pass both, the test predicate and action from m-main

15:04 sohail: I don't know what you are trying to do actually

15:04 fyuryu: sohail: well, I think I need the @

15:04 lisppaste8: kotarak annotated #69528 with "fyuryu's macro with gensym" at http://paste.lisp.org/display/69528#1

15:05 fyuryu: sohail: I want the commented line to appear in place of ~@(chunk ...)

15:06 kotarak: Thanks, I think I tried that already, but let me try again

15:07 kotarak: yep, doesn't work

15:11 devinus: what does this do ->

15:12 fyuryu: devinus: (-> {} (assoc :a 1) (assoc :b 2)) --> {:a 1 :b 2}

15:12 Drakeson: is there a way better than web scraping to get the content of clojure.org ?

15:13 lisppaste8: chousuke annotated #69528 with "shouldn't this work?" at http://paste.lisp.org/display/69528#2

15:13 devinus: fyuryu: is it like an inline test case?

15:13 fyuryu: devinus: takes the first arg and puts it as the first arg of the following expression

15:13 then the result as first arg of the next one

15:14 devinus: no, more like chaining calls

15:16 Chousuke: fyuryu: did my version produce what you wanted?

15:18 fyuryu: Chousuke: yes, thanks a lot. Started writing the same thing, following sohail's comment about making chunk a function

15:19 when you have a hammer...

15:22 Chousuke: I've noticed that writing helper functions that return forms helps bring macro complexity down a lot.

15:22 Kerris4: fyuryu: everything looks like a thumb? :V

15:23 fyuryu: :-)

15:24 Chousuke: you have a function that takes a parameter and "instantiates" a template with the parameter. then in your macro you can call map with that function over the macro arguments to generate code for each of them.

15:25 aperotte: Drakeson: there is a pdf in the files on the google group that contains the contents of the site

15:26 Drakeson: http://groups.google.com/group/clojure/files

15:27 Drakeson: manual.pdf

15:30 Drakeson: aperotte: cool, thanks. Shouldn't that be in this channel's topic?

15:32 aperotte: I dunno, I'm pretty new here and only found it myself yesterday

15:33 has anyone used the patch that allows gen-class to access ancestral protected members?

16:24 Drakeson: what it takes to get tilda expansion?

16:24 kotarak: Drakeson: what tilde expansion?

16:25 Drakeson: ~/thing rather than file:///path/to/user's/home/directory/thing

16:26 kotarak: If it is not supported by the underlying Java classes, you probably have to write your own wrapper around the corresponding functions, which does that for you.

16:28 Drakeson: well, CL has user-homedir-pathname, and elisp has expand-file-name. what do you use here? I guess you don't write your own wrappers, right?

16:29 kotarak: Never needed ~/whatever up to now. I don't know whether there such functions.

16:32 At least java.io.File seems not to support ~.

16:34 danlarkin: Does this work for you? (. System (getProperty "user.home"))

16:34 Drakeson: yes, but that is not very convenient.

16:34 danlarkin: well that's what you've got

16:34 Chouser: (System/getProperty "user.home")

16:35 save those parens for CL programmers -- they need all they can get.

16:35 Drakeson: Chouser: :)

16:35 danlarkin: ah yes I keep forgetting /

16:35 Drakeson: I was hoping for something cleaner. Like a clean path syntax.

16:36 Chouser: Drakeson: it's not a terribly cross-platform standard. only unixen use ~ for the user home dir, I think.

16:36 kotarak: Drakeson: (defn expand-tilde [s] (if (= (first s) \~) (apply str (System/getProperty "user.home") (rest s)) s)) (untested)

16:37 Drakeson: it is not as clean as #P~/thing ;)

16:38 * sohail is also slowly getting to the point where he will scream for user-defined reader macros

16:39 Drakeson: Chouser: true, but it would make things easier if there was a way (pick your own favorite character) to mean user home directory. It could translate to C:\\Documents\ and\ Settings\\Username for Windows.

16:40 Chouser: sohail: find a way for different libs to provide reader macros without conflict, and rhickey may take your patch.

16:41 abrooks: sohail: I don't think you'll get them. rhickey (who has largely convinced me too) is pretty much against dirtying the language with user-defined reader macros which would break tools, etc. If you really need something, just create your own reader and hand off to the compiler.

16:41 Chouser: I've thought perhaps by making them look like fns or macros that follow namespace rules...

16:42 sohail: I don't see why you couldn't make them use... what Chouser said

16:42 Chouser: (myns/myreadmac now I can do what I want " this macro ends in a ]

16:42 sohail: hm

16:42 no

16:42 :-)

16:42 Kerris4: abrooks: sounds like Clojure halready has legacy apps to support ;-P

16:42 sohail: but maybe if #P could be read as # namespace/P and you dispatch on namespace/P

16:43 but I don't know how that would work

16:43 Chouser: Kerris4: no, the point is that two people could write two different libs, but if each can mess with the one reader table, you're never going to be able to use those two libs in the same project

16:43 abrooks: Kerris4: I don't think it's just a legacy thing. Writing code that a tool must first execute to be able to read creates a mess, particularly if the code is broken. Plus, I don't think the power is ultimately necessary.

16:44 Lisp + macros is a sufficiently powerful and yet hygienic system.

16:45 sohail: sheep!

16:45 :-)

16:46 Chouser: sohail: our proposals aren't very different, I was just thinking ( instead of #

16:46 abrooks: User defined reader macros add a bit but dirty the system massively.

16:46 Chouser: abrooks: that's roughly the same argument other languages make against macros

16:46 sohail: Chouser, problem is that ( is already used for something else

16:47 abrooks: Chouser: Other languages don't have CL like macros.

16:47 Chouser: sohail: sure, for invoking stuff, currently either at compile time or runtime. Why not at read time?

16:47 abrooks: right, because the "add a bit of power, but dirty the system massively"

16:47 sohail: doesn't the syntax become ambiguous then?

16:47 (p or (p-function ?

16:47 Kerris4: Chouser: thanks for the explanation :)

16:48 sohail: no

16:48 Chouser: sohail: well, I don't have a patch working or anything, but I think it could be done.

16:48 sohail: still, I think using ( is insane :-)

16:48 abrooks: Chouser: Yes. Clojure DOES have powerful macros that don't dirty the system thanks to the homoiconicity that other languages don't have.

16:49 sohail: ok I think if reader macros dirty the system, then we should remove the object literal syntax because it uses a reader macro

16:49 if it's good enough for rich to use, good enough for me, I say :-)

16:49 kotarak: Chouser has a point with (. It would be some strange kind of consistent. But it should be also closed with ). Otherwise we create special cases again. I'm happy, that the () syntax is so regular. It makes writing tools easy.

16:49 abrooks: Hm... Clojure should really just adopt M4 now that I think about it...

16:50 </joke>

16:50 sohail: ( to indicate a reader macro will cause no end of confusion

16:50 Chouser: kotarak: yeah, the closing ] was intentionally ugly. most macros would want to end in ), but it'd be up to them to quit reading and give up control

16:50 sohail: (f "i") -> function or macro?

16:51 function, macro or reader macro, that is

16:51 kotarak: As does ( to indicate a macro instead of a function creates confusion.

16:51 Chouser: kotarak's got my point. :-)

16:51 sohail: not the same though

16:51 Chouser: no, just a gradient.

16:52 sohail: they both follow the rules except a macro is a function that doesn't evaluate its arguments

16:52 a reader macro is a what?

16:52 (ok not exactly, but...)

16:52 Chouser: a reader macro is a function that takes a PushbackReader instead of an s-expression

16:53 sohail: you are asking for it

16:53 Chouser: both macros and reader macros return s-expressions

16:53 sohail: the evils that are possible with ( for reader macros...

16:53 atleast with # you aren't required to delimit, whereas with ( you are, unless you are really mean

16:55 kotarak: sohail: If I give you a rope and tree, will you hang yourself?

16:55 Kerris4: :(

16:55 sohail: if I have to use ( for reader macros

16:55 :-)

16:55 kotarak: If I give you ( for read macros, will you do evil things?

16:55 sohail: emacs will be very unhappy with me

16:56 kotarak: Not when there is a ) necessary.

16:56 Emacs won't note a difference.

16:56 sohail: if it's necessary, then sure I am happy

16:56 I just cringed at Chouser's example above

16:56 kotarak: beh :(

16:56 Such things are evil.

16:57 Solution: don't do it. Don't use other code which does it.

16:57 Simple.

16:57 sohail: uh, no

16:57 solution: don't allow it

16:57 much easier

16:57 you're just helping rhickey make his case against!

16:57 Chouser: sohail: how would you indicate the end of a # macro?

16:57 kotarak: I feel Ada coming up....

16:58 sohail: Chouser, I wouldn't, and Emacs wouldn't care

16:58 but if there is a ( and no ), I fear

16:58 by the way, do we really want clojure to be a language that gives you enough rope to hang yourself?

16:59 it is not the place to be

16:59 kotarak: rich talked about #+ and #-, in this I see much more potential for rope....

17:00 sohail: you see more potential in a regular syntax to give you rope than allowing irregular syntax?

17:00 interesting

17:01 though whatever argument you make for #+ applies to (+ :-)

17:02 Kerris4: is there a -Wall or XLint equivalent for Clojure?

17:05 kotarak: sohail: How is this handled? (cond (foo) bar #+frob (frobnicate) flogiston)

17:05 sohail: I don't understand why you are harping on about #+

17:06 kotarak: I want to understand it, because the people are so interested in it. In the above example: is this a valid example use?

17:08 sohail: kotarak, that is an odd cond

17:08 kotarak: sohail: May question is: would the reader complain?

17:09 sohail: what does the cond have to do with it

17:09 that cond doesn't even look correct

17:11 kotarak: Without #+frob it's a normal cond. However with #+frob it's easy to break the code. This is the same thing as with ( doing strange things without closing ). Or do I misunderstand something?

17:11 ReplRat: Why doesn't (doc def) work? I get java.lang.Exception: Unable to resolve var: def in this context

17:11 clojure.lang.Compiler$CompilerException: NO_SOURCE_FILE:22: Unable to resolve var: def in this context

17:11 kotarak: ReplRat: def is a special form

17:11 sohail: why would you write a cond like that

17:11 kotarak: why would I write a ( reader macro which doesn't close the )?

17:12 ReplRat: (def apply)

17:12 sohail: kotarak, why should you have the choice

17:12 kotarak: ReplRat: http://clojure.org/special_forms for more on special forms.

17:12 sohail: why should I be able to break the cond with #+?

17:13 ReplRat: kotarak: thanks

17:13 sohail: why will it break

17:14 kotarak: Because without frob feature the (frobnicate) will be removed. Leavind an odd number of clauses and flogiston in the position of a test.

17:15 sohail: so you're asking me why can you break cond by putting in an odd number?

17:15 I don't get it

17:15 I don't need #+ to do that

17:16 kotarak: It's not important. Certainly a misunderstanding of this whole stuff on my side.

17:16 Chouser: kotarak: you were doing so well!

17:17 sohail: the person writing the cond probably meant for the #+ to apply to the entire condition. It was a simple mistake that may go unnoticed for a long time.

17:17 sohail: ok..

17:18 yesterday I accidentally wrote (defmacro while [cond & body] `(when ~@cond ...))

17:18 kotarak: A *poof* the regular syntax of #+ introduced the rope...

17:18 sohail: which did odd things

17:18 so let's get rid of ~@ too

17:18 kotarak: Ah! Macros are bad!

17:18 sohail: see

17:19 kotarak: Other languages saw this already and remove them completely. ;)

17:19 Chouser: so maybe we already have enough rope to hang ourselves. in which case, what's wrong with ( for reader macros?

17:19 kotarak: sohail: I think there will alway be rope. Bondage and Discipline is not really the way to go...

17:19 sohail: I can't believe you are seriously considering ( without )

17:19 kotarak, exactly

17:19 Chouser: ah, nevermind. kotarak, you were right to give up.

17:19 sohail: so why are you advocating NO READER MACROS

17:19 Chouser: this is not a condusive forum for this kind of disucssion.

17:20 I have a feeling that if were all in the same room and had a whiteboard, we would have reached a concensus (or at least an understanding) quite a while ago.

17:20 kotarak: probably

17:20 * danlarkin has been lurking... and agrees

17:28 ReplRat: is there a way to access the nth most recent expression result in the Repl? like i can do in bash?

17:28 kotarak: there is *1 *2 and *3

17:28 ReplRat: thanks

17:29 where is that documented

17:29 kotarak: *e for the last thrown expection

17:30 ReplRat: hmm, i'm getting Unable to resolve symbol

17:31 kotarak: which version clojure do you use? Maybe it's only in SVN up to now...

17:31 ReplRat: an svn from less than 3 days ago

17:32 i'm using git svn but i haven't figured out how to see what the most recent commit is yet

17:32 (trying to learn git as well as clojure) :)

17:33 kotarak: Just e sec

17:33 Works for me...

17:34 ReplRat: i'm just typing *1 at the repl, should it eval as an expression or do i need to wrap it in something else?

17:34 sohail: I think you need to update swank if you are using it

17:34 ReplRat: ahh well i'm just using a naked repl at the moment, not slime/swank.

17:34 Chousuke: ReplRat: git log HEAD^..

17:36 more generally: git log HEAD~n.. shows you the log entries for the last n commits, and ^ is a synonym for ~1

17:36 ReplRat: Chousuke: thanks. the last commit seems to be July 22? i must be doing something stupid with git which is why *1 doesn't work.

17:36 Chousuke: you can also use tags or hashes, or specify and endpoint for the range.

17:37 july 22? that doesn't sound right.

17:37 ReplRat: i did git clone last weekend, and git fetch on wednesday to update my repo.

17:37 git svn clone i mean

17:38 Chousuke: r1086 | rhickey | 2008-10-29 14:42:40 +0200 (Wed, 29 Oct 2008) | 1 line

17:38 most recent, it seems

17:38 ReplRat: that looks more like it.

17:38 Chousuke: maybe you need to use git svn log or something

17:39 I have the clojure repo as plain svn so I can't test mysefl

17:39 ReplRat: Chousuke: that's it. git svn log shows r1085.

17:39 Chousuke: should really clone it as a git repo.

17:39 git is so much better than subversion

17:40 ReplRat: yep, and lots of clojure stuff, (clojure-mode etc) is on git

17:40 there seems to be a clojure clone on github, but i wonder how it is kept up to date?

17:40 http://github.com/kevinoneill/clojure/tree/master

17:41 Chousuke: well it seems to be current right now at least :)

17:42 ReplRat: maybe github has some svn sync magic that i don't know about

17:42 Chousuke: or maybe the person who created that just has a cronjob that updates it periodically :)

17:43 ReplRat: i thought i would be better off just using git svn myself that cloning his clone.

17:43 Chousuke: oh, apparently github can do svn imports by itself. nice.

17:44 though looking closer, it doesn't keep them synchronised automatically :P

18:39 ReplRat: should i use ant or maven to build clojure?

18:40 kotarak: I use ant. Never had problems.

20:23 mmcgrana: I see that the meta information on a var holding a function includes its file and line: e.g. (meta (resolve 'doc)) => {... :file "boot.clj", :line 2506 ...} but the file name is not qualified with a directory. Is there a reason for this, and can the fully qualified name be derived using e.g. the classpath?

20:32 Probably should have asked if anyone was here first, I'll post to the group...

23:15 gnuvince_: Hmmm

23:15 Did you guys watch the presentation by Slava about Factor? His EBFN library is *really* nice

23:29 sohail: man, I still remember when factor ran on the JVM

Logging service provided by n01se.net