#clojure logs

2008-10-31

00:00wwmorganbradbev_: nope, just zipped. You can do a jar tf to find the path of the clojure file you want to load
00:01bradbev_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)
00:03wwmorganyou could, but it's much nicer to do (ns your-project (:use (clojure xml))). Also it makes your code more portable
00:04bradbev_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?
00:05wwmorganbradbev_: there's add-classpath, but it might not work in this situation
00:06bradbev_ok. Package management is a bit immature right now then? Not that CL is very much better
00:08wwmorganI think the ns macro handles most use cases. Is there something you're trying to do that you don't think it covers?
00:10bradbev_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?
00:13Chouserbradbev_: java requires each jar to be listed in the classpath
00:13wwmorganI 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
00:13Chouserthere's another command-line flag, though, hang on...
00:14bradbev_I hadn't heard of enclojure before...
00:15wwmorganif you like megalithic IDEs then check it out. It's pretty OK
00:15Chouser-Djava.ext.dirs
00:15Chouserthat lets you specify a directory full of .jars
00:17bradbev_Chouser: that's awesome
00:17bradbev_wwmorgan: I'm more of an emacs guy now
00:18ChouserI haven't used it yet. I didn't learn about it until I had figured out pretty well how to cope with -cp
00:20wwmorgananyway, you don't need to make jars to develop your own multi-file application. :use and :require will traverse a normal directory structure too
00:21wwmorganthen to distribute you jar the whole thing up and everything still works
00:21bradbev_nice, I didn't know that
00:23bradbev_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?
00:26wwmorganit maps to clojure/contib/zip_filter/xml/xml.clj
00:27bradbev_so only one file per directory then
00:28wwmorganin general yes.
00:28bradbev_thanks for the info, some of this is starting to come back from my java at school 10 years ago
00:28wwmorganmore correctly: one file that you can :use or :require per directory
00:30Chouserthe specific place where it looks for a .clj file when given a namespace may be changing soon.
00:30wwmorganif 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
00:31wwmorganbut that might be "wrong"
00:31bradbev_:)
00:31Chouserwwmorgan: actually, I think that's currently "right".
00:31wwmorganoh sweet, cause I've been doing it _everywhere_
00:32ChouserPart of the argument for the directory structure was to allow multiple files in the same directory to contribute to a single namespace.
00:32wwmorganyes
00:32Chouserbut like I said, that might be changing with the AOTC stuff.
00:32ChouserIf you have good use cases for it, speak up.
00:32Chouser(not now, but when rhickey's listening. ;-)
00:33bradbev_AOTC?
00:33Chouserahead of time compilation
00:33bradbev_nice
00:33Chousergenerating .class files from .clj files
00:41albinowhat's the time frame on AOT? I would like it so I could use it for the Android the way the Scala people do
00:45Chouserlast I heard it was "on hold" until after the election.
00:46Chousermy personal guess is it's be available to play with a couple weeks after that, but who knows.
00:46wwmorganI don't know anything about Android, but the way it works now wouldn't work?
00:47wwmorganjava application that compiles to a .class file loads clojure code, get a var and invokes that fn?
00:50Chouserthe problem is that .class files have to be converted ("compiled") to android's bytecode
00:50abrooksDalvik bytecode, technically.
00:51wwmorganoh I see, so all the bytecode generation is broken
00:52Chouseryeah, it'd generate JVM bytecode at runtime and then ... ?
00:53abrooksWhere 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.
00:53bradbev_Am I right in saying that android prevents runtime code generation?
00:53Chouserbradbev_: that may also be true, but it's not necessary to cause clojure trouble.
00:54abrooksbradbev_: That would probably depend on the class loader if they have a similar model.
00:54Chouserabrooks: but they already compile JVM bytecode to Dalvik, so the register thing must be a solved problem?
00:55abrooksChouser: They do? I know they compiled Java to Dalvik. I hadn't heard about JVM bytecode.
00:56Chouserthat's why compiling .clj to .class is going to be at all helpful
00:56Chouserfor android
00:57abrooksHm... Interesting (presuming it's accurate): http://rebelwithoutamouse.blogspot.com/2007/11/dalvik-googles-workaround-for-suns-jvm.html
00:57abrooks"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"
00:58abrooksSeems like I should have known that.
01:30lisppaste8sunwukong pasted "printing in a proxy" at http://paste.lisp.org/display/69490
01:30sunwukongseems like I cannot print from a proxy - any idea why?
01:35Chousersunwukong: works for me.
01:35Chousereach time I click the button I see a new "Hello" print in my repl window.
01:36ChouserI'm using a plain repl in a term window.
01:37sunwukongthanks, I'll try it, maybe it's just some slime thing
01:38sunwukongyes, from plain repl it works for me, too
01:51sohailso there isn't any real way to pre-compile clojure code yet is there? my app takes 3 seconds to get to main...
01:55Chouserright
01:56Chouserit's like emacs -- just keep reusing the same process :-)
01:57sohailChouser :-(
01:58sohailso no save-clojure-and-die planned?
02:06Chouserno, but AOTC is planned -- true compilation of .clj to .class
02:46PupenoGood morning.
03:09sohailChouser, cool, I look forward to it!
03:40lisppaste8sohail pasted "right or wrong way to write a while loop?" at http://paste.lisp.org/display/69495
04:22Lau_of_DKMorning gents
04:22arbschthi lau
04:49Lau_of_DKJava guys, why is this
04:50Lau_of_DK static {
04:50Lau_of_DK com.trolltech.qt.Utilities.loadQtLibrary("QtCore");
04:50Lau_of_DK com.trolltech.qt.Utilities.loadQtLibrary("QtNetwork");
04:50Lau_of_DK }
04:50Lau_of_DKnot the same as this
04:50Lau_of_DK(. com.trolltech.qt.Utilities (loadQtLibrary "QtCore"))
04:50Lau_of_DK(. com.trolltech.qt.Utilities (loadQtLibrary "QtNetwork"))
04:52Lau_of_DK(it compiles fine, but produces no effect)
04:53Lau_of_DKThe question is probably this. How do I mimic the static { ... } ?
04:54tWipstatic block is run after the class is loaded
04:54Lau_of_DKoh
04:54Lau_of_DKThats important
04:54tWipI don't know why that should matter as long as you do the calls before using anything
04:55Lau_of_DKIt matters because this is a patch for a bug in Webkit
04:55Lau_of_DKDo you know how to do a static in Clojure?
04:55tWipI don't know how that would apply as clojure isn't class based in the same manner
04:56tWipcouldn't you just do those calls before defining anything else?
04:56Lau_of_DKI can, but that didnt work, hence the question
04:56tWipoh ok
04:57tWipwell I'm afraid I don't know more about this subject as that seems to be native interfacing issue
04:58Lau_of_DKAlright
05:58AWizzArdMoin
07:18Lau_of_DKcemerick, can you port a static {} clause to Clojure
07:18Lau_of_DK?
07:20cemerickLau_of_DK: that's sort of a non sequitur; there's no static initialization in clojure, everything is dynamic
07:20cemerick(modulo whatever is going to come out of AOT, perhaps)
07:20Lau_of_DKSo what do I do when I have Java code that requires to be static ?
07:21cemerickno code requires a static invocation context -- static blocks are just a convenient method for executing code once when a class is first loaded
07:22cemerickYou can have clojure code executed just once when a clj file is first loaded by making it a top-level form...
07:24Lau_of_DKoh
07:24Lau_of_DKI tried that, but it didnt work, so I figured static was the magic
07:24Lau_of_DK<Lau_of_DK> Java guys, why is this
07:24Lau_of_DK<Lau_of_DK> static {
07:24Lau_of_DK<Lau_of_DK> com.trolltech.qt.Utilities.loadQtLibrary("QtCore");
07:24Lau_of_DK<Lau_of_DK> com.trolltech.qt.Utilities.loadQtLibrary("QtNetwork");
07:24Lau_of_DK<Lau_of_DK> }
07:24Lau_of_DK<Lau_of_DK> not the same as this
07:25Lau_of_DK<Lau_of_DK> (. com.trolltech.qt.Utilities (loadQtLibrary "QtCore"))
07:25Lau_of_DK<Lau_of_DK> (. com.trolltech.qt.Utilities (loadQtLibrary "QtNetwork"))
07:25Lau_of_DK<Lau_of_DK> (it compiles fine, but produces no effect)
07:26cemericktotally a style point, but doing (com.trolltech.qt.Utilities/loadQtLibrary "QtCore") is more idiomatic at this point
07:26cemerickI assume those calls load some native libs or something?
07:26tWipwell I guess you could have your own main, or class you touch in Java that has that static block
07:27tWipbut I fail to see how the mere staticness of that code affects anything... as long as ordering is correct
07:28cemerickyeah, a static block is just like any other java code, except it does not execute within the context of an instance ("this", etc)
07:29tWipLau_of_DK: have you tried having that in a classname as static? then doing (Class/forName "my.class.with.StaticCode")
07:30tWipin a class that is
07:30tWipthat should execute your static block as the class is loaded
07:32cemerickThat really should be no different than what Lau_of_DK pasted above. If it is, then it'd be interesting to find out why.
07:32Lau_of_DKJust trying to understand what you guys are saying. cemerick thanks for the style point, I had no idea that was a possibility
07:32tWipyeah I don't believe that it will make a difference... just to prove a point :)
07:33tWipit may be some weird jvm bug/issue
07:33Lau_of_DKuser=> (com.trolltech.qt.Utilities/loadQtLibrary "QtCore")
07:33Lau_of_DKnil
07:33Lau_of_DKuser=> (com.trolltech.qt.Utilities/loadQtLibrary "QtNetwork")
07:33Lau_of_DKnil
07:33Lau_of_DKuser=> (main)
07:33Lau_of_DKcom.trolltech.qt.designer.QUiLoaderException: Failed to load class (NO_SOURCE_FILE:0)
07:34Lau_of_DKhttp://lists.trolltech.com/pipermail/qt-jambi-interest/2008-March/000096.html
07:34Lau_of_DKread that, and the previous post
07:36cemerickLau_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
07:36tWipbut your error seems different than the one discussed on the list
07:38cemerickyeah, "Failed to load class" sounds like a classpath or path issue?
07:46Lau_of_DKIm not sure what it is, but it directly relates to including QWebKit in your dialog
07:46Lau_of_DKAnd this is a known bug, which they solve by the static {}.
07:47Lau_of_DKcemerick, the link you provided may be related, but I dont see it presenting a fix ?
07:48AWizzArdrhickey: 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?
07:50rhickeyAWizzArd: 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
07:50cemerickLau_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
07:50Lau_of_DKok
07:51cemerickIf 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.
07:51AWizzArdrhickey: that's good news :-)
07:52Lau_of_DKcemerick, I've placed all the QtJambi.jars in my standard /clojure/libs dir, so that shouldnt be a problem
07:52Lau_of_DKAnd I connect the 2, because I can use every other widget in the book, except for WebKit
07:52cemerickLau_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.
07:54Lau_of_DKconfigured my path ?
07:54Lau_of_DKAs far as I know, loading the .jars is all thats needed - which in turn, is all Ive done
07:54Lau_of_DKAll my imports, incl. Webkit, work fine
07:55cemerickLau_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
07:56Lau_of_DKYes, but they are 2 seperate solutions, you pick 1
07:56cemerickOK, but perhaps #2 will provide you with an interim solution.
07:57Lau_of_DKI didnt, I tried adding /bin to path
07:57Lau_of_DKJava loads only jars right, .so files and such are not loaded ?
07:57cemerickno, 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.
08:02Pupeno-GHello.
08:02Pupeno-GWhen you use a little Java program to bootstrap a clojure application, do you need this program to compile and load all the Clojure files?
08:02tWiphow would you do that?
08:03tWipall the same dynamic features are available from repl and any embedded use afaik
08:04Pupeno-GtWip: calling Complier.load(on every file) I suppose.
08:04tWipjust have the clj files in your classpath, clojure will find them when you use something
08:05Pupeno-GtWip: all the files are inside a jar.
08:07tWipif you run a jar, then that jar's files would be in the classpath
08:08Pupeno-GtWip: what? you lost me there.
08:08tWipin short, it should work
08:09Pupeno-GI 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.
08:09tWipoh I see, you should think about making clojure namespaces
08:10tWipand structuring code in them as appropriate
08:11Lau_of_DKcemerick, QtJambi comes with a alot of so.4 files in /lib/ - Youre saying everything has to be on the classpath ?
08:12cemerickLau_of_DK: probably just their containing directory
08:12rhickeyPupeno-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
08:12cemerickto be clear, I've never used any flavor of Qt, that's just a suggestion
08:17Pupeno-GtWip: Did you mean that each file should be a namespace?
08:20Pupeno-Grhickey: 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.
08:22rhickeyPupeno-G: I understand, just advocating you do Var load = RT.var("clojure","load"); load.invoke(...); rather than Compiler.load(...)
08:23Pupeno-Grhickey: Oh! I totally misunderstood you. Right, I remember that way from Enclojure trunk.
08:24AWizzArdwould it make sense that (dissoc my-vector n) would return a vector instead of throwing an exception?
08:24gnuvinceHello everyone
08:24rhickeyAWizzArd: I don't think so
08:26AWizzArdso 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
08:28gnuvinceabrooks: thanks for the comments!
08:30kib2gnuvince: hi, I've read your tutorial last night.
08:31Lau_of_DKcemerick, Ive extended the classpath, Ive set everything up the way they propose, Ive manually loaded the 2 libs, I still get the same error
08:33Pupeno-Gclojure.lang.RT is not part of the 20080916 release, isn't it?
08:34gnuvincekib2: any comments?
08:35kib2gnuvince: yes, it is said to be for beginners, and I don't think so (because I'm one).
08:36rhickeyAWizzArd: yes, a hash-map makes a good sparse vector
08:37rhickeyAWizzArd: sorted-map probably better if you care about sequential iteration
08:37gnuvinceAll right, I'll make a few final corrections and post it during my lunch break
08:37duck1123rhickey: would it be possible (or wise) to just conj the two slices together?
08:38Pupeno-GLau_of_DK: what error are you getting?
08:40kib2gnuvince: 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.
08:41AWizzArdrhickey: 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?
08:41gnuvincekib2: I may get into them in a future post.
08:41kib2gnuvince: Also, I found it hard to start with Clojure, because you need to know a little Java before, right or not ?
08:42duck1123gnuvince: it might be helpful, when referring to certain pages, to provide a link
08:42gnuvinceduck1123: I'll add more of them. Thank you.
08:46ChouserAWizzArd: you can implement IPersistentVector with proxy
08:47AWizzArdgood
08:48abrooksgnuvince: Thanks for your post!
08:48Lau_of_DKPupeno, , I'll do a lisppaste, hang on
08:50gnuvinceabrooks: thanks for your comments :)
08:50kib2is someone interested by GnuVince tutorial in pdf ?
08:51Pupeno-Gkib2: by what?
08:51kib2the tutorial written by gnuvince
08:51lisppaste8Lau_of_DK pasted "QtWebkit load error" at http://paste.lisp.org/display/69503
08:53Pupeno-GLau_of_DK: Are you running 4.4 on Windows?
08:54Lau_of_DKOn Linux
08:54Pupeno-GLau_of_DK: and you've tried the equivalent Java code?
08:55Lau_of_DKNo - Ive never written 1 char of Java in my life
08:55Lau_of_DK(which is a strong argument that Clojure should have been built on .Net)
08:56Pupeno-GHave you tried the workarounds in the mail you pointed to?
08:56kib2here it is : http://kib2.alwaysdata.net/tempo/gnuvince.pdf
08:56Lau_of_DKYes, those are the first 2 lines of the code
08:56Lau_of_DKAnd yes the paths are set up, according to their docs and the accompanying .sh scripts
08:56Pupeno-GOh! I missed those, sorry.
08:58Lau_of_DKnp :)
08:58jdzwhat does gnuvince use for writing that pdf?
08:58Pupeno-GI'm so pre-webkit era here :P
08:59jdzthe code sure looks like colorized by emacs
08:59Lau_of_DKPupeno-G, Webkit packs quite a punch though, and I want it for a specific app I have in mind
09:00kib2jdz: I've used Pygments
09:03Pupeno-GLau_of_DK: I'm sorry, I don't have any idea. Do you get any other messages, any backtrace?
09:03rhickeyInteresting: http://groups.google.com/group/jvm-languages/msg/8baa984ab66f00bb
09:03Lau_of_DKNada
09:05Lau_of_DKrhickey, almost makes you sea-sick with all those curly braces :)
09:06rhickeyI wonder if they've done anything about the 'no classloaders in applets' security restriction? Else this is limited to pure interpreters or privileged runtimes
09:07cemerickrhickey: yes, update 10 is very, very welcome on a variety of fronts
09:09kib2rhickey: very interesting
09:09Pupeno-Grhickey: 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?
09:10cemerickI don' t think update 10 changes the classloader policy -- although signing one's applet is a good thing to do, anyway
09:11rhickeycemerick: If most Flash had to be signed it never would have gotten off the ground - they need to fix this
09:11rhickeyif they are serious about other languages
09:12rhickeyI don;t understand why classes loaded from a custom classloader don't just get the same verification and sandbox restrictions
09:12cemerickrhickey: agreed. I was saying (poorly) that it's a problem for consumer-level stuff, but not a problem for commercial stuff.
09:14rhickeyor some standard public load-from-bytes-in-memory supported on the standard loader - this protected nonsense is goofy
09:15rhickeyeveryone has to derive a custom classloader to do exactly the same thing, and incurs no end of grief for doing so
09:18cemerickthe 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.
09:19rhickeyIt would be so awesome to load your Clojure program to provide logic and remote control the browser-based UI
09:22duck1123so, can clojurescript be used to generate javascript yet?
09:22duck1123I thought it would be interesting to try to link clojure and mozrepl
09:29gnuvincehttp://gnuvince.wordpress.com/2008/10/31/fetching-web-comics-with-clojure-part-1/
09:32cemerickrhickey: 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.
09:32rhickeycemerick: cool! - the UI is Swing or HTML?
09:35cemerickaiming for Swing (although we may bring in a native browser component using jdic for a couple of webby tasks)
09:36rhickeyis JWebPane still MIA?
09:37Chouserduck1123: 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)
09:37cemerickI 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)
09:37Chouserrhickey: Lau_of_DK's working hard on getting Qt and Webkit working for clojure
09:37cemerickI played with it for 20 minutes some months ago, and looks promising, although I suppose there may be hidden issues.
09:37rhickeyJWebPane wwraps WebKit for consumption by Java - very deep integration
09:38Chouserthat can apparently be deployed using java web start
09:38rhickeySaw JWebPane at JavaOne and was stunned by how smart they were about it
09:38duck1123Chouser: that's cool. I haven't gotten around to playing with it yet, but it looks promising.
09:38cemerickah, in that case, I'm behind the curve
09:39Chouserduck1123: well, the clojure-side API's still in flux, so it's not really ready to go yet
09:39Chouserbut I'm hoping to have a repl up on the web in the next few days.
09:39cemerickThe web is a decidedly second-class citizen for us
09:41duck1123Chouser: I would also like to eventually replace my .conkerorrc file with some lisp-like language
09:41Pupeno-GSo, 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:32gnuvinceAnyone wants to post my tutorial to programming.reddit?
10:34tayssirgnuvince: Done -- on programming.reddit!
10:35gnuvincetayssir: link?
10:35tayssirEr, yeah... http://www.reddit.com/r/programming/comments/7ait5/fetching_web_comics_with_clojure/
10:35gnuvinceUpvoted!
10:36Pupeno-Gidem.
10:46Pupeno-GHow does Clojure know how to find the file containing a specific namespace?
10:47Chouserit looks through the classpath for a matching directory. com.foo.pkg would have to be at com/foo/pkg/pkg.clj
11:10TommyOnMachi
11:11kib2didn't regexps supposed to be written like this #"..." ?
11:11gnuvincekib2: yes
11:12jdzonly you don't need to escape backslashes since one of the recent patches
11:12kib2so why should I write (.matches "abc" "(a((b)(c))") instead of (.matches "abc" #"(a((b)(c))") ?
11:13abrooksjdz: gnuvince notes that below in the post.
11:20Chousukekib2: because you're calling String.matches() which takes a string parameter
11:21kib2Chousuke: and then String.matches compiles the given string to a regexp, that's it ?
11:23Chousukekib2: I don't know what String.matches really does, but most likely yes
11:25kib2Chousuke: because when I look at Java docs, it is said to take a regexp as parameter, so I suppose Clojure makes it automaticaly.
11:25Chousukekib2: it takes a String representing the regexp as a pattern
11:25Chousukenot an actuall java.util.regexp.Pattern
11:25Chousuke-l
11:26kib2Chousuke: yes, so Java does the work
11:26Chousukeyeah
11:28Chousukeif you want to use an actual pattern object you'd have to do something like (-> #"foo" (.matcher "foo") (.matches))
11:30Lau_of_DKChouser: Update - I have a Webkit widget running in a UI driven from Clojure now :)
11:30AWizzArdsounds nice
11:30ChouserLau_of_DK: excellent!
11:30AWizzArdNow we just need some tutorials, how to do the basic stuff, step-by-step, so that we can impress people with youtube videos.
11:31Lau_of_DKlol
11:31AWizzArdEspecially 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:31Lau_of_DKhaha
11:32Lau_of_DKI'll put something up sooner or later, but not on Youtube
11:32kib2Chousuke: thanks for the tip
11:34kib2what is "->" synatxic sugar for ?
11:34kib2"syntaxic"
11:34gnuvincekib2: syntactic
11:34kib2oops :)
11:35Chousukekib2: 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:35gnuvincekib2: (-> 3 (+ 1) (+ 2)) ==> 6
11:35Chousukeinfinitum :P
11:36gnuvinceit moves the result through the forms.
11:36gnuvinceIt's similar to Haskell's do-form
11:37Chousukeit's not very clear at first glance, but it's quite nice once you get it :)
11:37kib2nice :) I like most of Haskel features :)l
11:38kib2Chousuke: I agree, I have to learn playing dominoes
11:39Chousukemy example above would expand to (-> (.matcher #"foo" "foo") (.matches)) which further expands to (.matches (.matcher #"foo" "foo"))
11:40Chouserfor extra fun, parens are optional on all but the first form: (-> #"foo" (.matcher "foo") .matches)
11:44kib2Chousuke: thanks, that's what I was trying to do, but I was lost.
11:46Chousukehm. Just noticed that (-> 3 (+ 1) (+ 2)) looks like infix notation with weirdly placed parens :/
11:51duck1123with ->, the result becomes the 2nd param, right?
11:51danlarkinisn't -> deprecated?
11:52Lau_of_DKrhickey, 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:53AWizzArdLau_of_DK: it's time for a how-to wiki or something like that
11:53Lau_of_DKCan 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:53AWizzArdIn principle for every function/aspect there could be a bunch of examples
11:54AWizzArdWhen 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:57Chousukedanlarkin: why would -> be deprecated?
11:57Chousukeit pretty much replaces (. and (..
11:57Chousergen-class is among the trickiest pieces of clojure to use.
11:57danlarkinChousuke: whoops! it's .-> that's deprecated
11:58Chouserbut it's also illustrative of one reason that not too many docs have been written yet. gen-class is probably going away.
12:04Lau_of_DKAlso one of the best reasons to get busy on some docs :)
12:06Chouserget busy writing docs for functions that are going away?
12:06lisppaste8Lau_of_DK pasted "gen-class-tutorial-needed" at http://paste.lisp.org/display/69516
12:06Chousergo right ahead.
12:08ChouserHere's my gen-class tutorial. Please forgive me if it's a little dense: http://paste.lisp.org/display/68406
12:10Lau_of_DKChouser, I gotta break, visitors coming - Could you do me a huge favor and annote my little example? :)
12:11ChouserLau_of_DK: probably not. sorry.
12:18Chousukegen-class is weird :/
12:21Chouserit is.
12:21Chouserit's an unusual layout of clojure code for constructing an unusual kind of Java class.
12:26ChousukeI'm trying to make a trivial class and it fails with "no value supplied for 'init" :/
12:28Chousukeah, never mind.
12:35lisppaste8sohail pasted "System tray app with SWT - comments?" at http://paste.lisp.org/display/69519
12:42Chousukesohail: nothing much, but you define unless and use it nowhere :)
12:42sohailChouser hehe
12:42sohailI think I intended to replace one of the (if (not ... with that
12:44Chousukealso couldn't you use SWT/PUSH instead of (.PUSH SWT)
12:45sohailChouser, could I?!
12:45sohailthat would make me very happy!!!
12:46ChousukeI'm not Chouser, and I'm not sure. there were some limitations to the / form, but try it.
12:46sohailerr sorry :-)
12:46sohailChousuke, :-)
12:47sohailChousuke, replacing (.Push SWT) with SWT/Push works
12:47sohailerr PUSH
12:48Chousukeas far as I know / can be used to access static fields in a class
12:48sohailthat's helpful
12:48Chousukeso you can do stuff like Math/PI etc.
12:50Chousukeit'll also work for the accesses in the .addListener calls :)
12:52sohailChouser, yeah I replaced those as well
12:53ChousukeYou have to be more careful with your tabcompletion :D
12:53sohaildamnit
12:53sohailyou need ot change your nick!
12:53duck1123Chousuke: maybe one of you just needs to change their name
12:54sohailmake yourself zChousuke :-)
12:55H4nssohail: please post your reworked example!
12:57lisppaste8sohail annotated #69519 with "for h4ns" at http://paste.lisp.org/display/69519#1
12:57H4nssohail: looks great, thanks!
12:58Chousukeyou missed one.
12:58Chousuke(addListener (.Selection SWT) ...
12:58sohailso I did
12:58sohailthanks :-)
12:59AWizzArdsohail: see if you can add this to a wiki
13:00sohailAWizzArd, is there a wiki?
13:00AWizzArdhttp://en.wikibooks.org/wiki/Clojure_Programming is coming closest to it
13:02AWizzArdwe need much much more howtos and examples
13:02sohailmaybe not a good idea, just realized there is a "leak" b/c I didn't dispose the image
13:02AWizzArdthings that have to do with guis and graphics will attract also young people
13:03ChousukeI just noticed. Your definition of proxy-listener seems to have an error
13:03cemerickAWizzArd: as one of the young people (ostensibly!), I'd say we're already here ;-)
13:04AWizzArdVery good
13:04sohailChousuke, what is the error
13:05lisppaste8Chousuke annotated #69519 with "hmm" at http://paste.lisp.org/display/69519#2
13:06sohailChousuke, ah, good catch. Howcome it doesn't affect things?
13:08Chousukenever 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:08sohailit doesn't break...
13:12Lau_of_DKGents, Ive only got a few minutes, and takes on this? http://paste.lisp.org/display/69516
13:14cemerickLau_of_DK: there's a ton of gen-class tutorials on the google group
13:14cemericks/tutorials/examples
13:15Lau_of_DKthanks cemerick
13:22Chousukesohail: seems like it works either way after all.
13:23sohailChousuke, by design or accident?
13:23sohailwhy do you think it should barf?
13:24Chousukemaybe that was just my mistake.
13:25rhickey_Chousuke: Revision #907 Committed by rhickey at 6/17/08 8:29:06 AM made proxy tolerant of ns-qualified method names
13:26rhickey_before that it would have been bothered by the ns
13:27Chousukeah
13:27Lau_of_DKWhat are the odds that gen-class functions will disappear, and what are the arguments behind it ?
13:27rhickey_Lau_of_DK: genclass can be viewed as a special case of AOT compilation
13:28rhickey_and thus subsumed by it
13:29Lau_of_DK"subsumed by it" ?
13:38gnuvince:)
13:39ChouserI'm not sure I'll ever use AOTC. sohail, what about it are you looking forward to?
13:39Chouserreduced startup time?
13:41sohailChouser, that and you don't have to include all your sources
13:42Chouserso startup time and obfuscation.
13:42sohailpretty much, what else would I want it for
13:42Chouserno special classloader I think may make applets less cumbersome
13:43Chouser.class files can be compiled to work on android
13:43Drakesonhow can I find the current "classpath" ?
13:43sohailI thought applet is now spelled as "flash"
13:43sohail;-)
13:44Drakeson*classpath* is not default
13:44Chouseryou may be able to deploy a clojure app without the Compiler or ASM, for reduction in deployed .jar size.
13:45sohailChouser, good list!
13:46Chousersohail: did you see the clojure-inspired lisp for flash?
13:47ChouserDrakeson: this may help you: http://groups.google.com/group/clojure/browse_thread/thread/d83ed2808eef00da/3cd31b25f123e9a7
13:48sohailChouser, I did not
13:48sohailbut flash is horrible
13:48Chouseris it?
13:49abrooksHorible things can be done with flash. I don't think it's inherently that bad.
13:49sohailwhat abrooks said
13:50ChouserI have no doubt that plenty of horrible stuff will be written in Clojure.
13:50rhickeyI certainly hope not!
13:51ChouserIt'll be inevitable once it becomes the 3rd most popular language (behind cobol and vb)
13:51rhickeyyikes
13:52Chouser:-)
13:52abrooksrhickey: You're making great strides evolving the programming language. It will take many generations to evolve the programmers. :-/
13:52sohailya, see my swt example above
13:52sohailvery horrible
13:52DrakesonThe "lispish" aura around it may repels many idiots ;)
13:53sohailI don't think so
13:53ChouserI'm not finding that flash link.
13:53sohailmost people understand Lisp is this awesome language but can't make any practical use of it... clojure makes that possible
13:54Drakesonwhat is the ruby on rails for clojure?
13:54rhickeyOutside 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:55abrooks;-) I know you don't.
13:56abrooksDrakeson: Compojure and Webjure are web platforms in development but I don't think either is particularly Railsy.
13:57abrooksDrakeson: Besides neither is alliterative. We need Clojure on Crack or some such.
13:57sohailis there a way we can have another killer app for clojure than web programming
13:57Kerris3haha abrooks
13:57Drakeson(ruby-on-rails: a *seeming* integrated web application server with nice *icons* and *graphics*)
13:59Chousersohail: how about a programmer's text editor?
13:59Drakesonsohail: maybe some document processing. There is no good-enough tool-chain around SVG yet.
13:59sohailChouser, clojmacs?
13:59Chouserwe could call it Emacs on Euphemisms or something
13:59sohailheh
13:59devinuswill clojure ever have tail call optimization?
14:00Chouserdevinus: when the JVM does
14:00sohaildevinus, if the jvm gets it
14:00Kerris3is that the domain of the javac jvm
14:00Kerris3edit: beaten
14:00devinusisn't that support to be in java 7?
14:00Kerris3devinus: I've no idea, but you can check on http://download.java.net/jdk7/binaries/
14:01rhickeyhttp://openjdk.java.net/projects/mlvm/subprojects.html
14:01Chouserah! A Clojure-derived Lisp for the AVM2: http://github.com/aemoncannon/las3r/wikis
14:02Chouserthat's the clojure-like flash thingy
14:05sohailah crap
14:05sohailI just did (loop [] (recur))
14:05sohailin the flash thingy
14:05Chouserheh. will you have to close your browser?
14:07sohailyep
14:08Chousersorry, man. At least when I do that in clojurescript, the browser steps in after a moment and offers to kill the loop.
14:08sohailthe flash thingy is pretty cool
14:35aperotteDoes 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:41dudleyfaperotte: Was that Azul Systems?
14:41Chouseraperotte: azulsystems?
14:41aperottethanks guys, I was listening to his screencasts trying to find it again, but wasn't having much luck
14:42Chouserhttp://blogs.azulsystems.com/cliff/2008/09/jvm-language-su.html
14:46Drakesonisn'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:48sohailDrakeson, clojure hijacks the classpath for it's own purposes too
14:48Drakesonok, is classpath a variable?
14:49Drakesoncan I see its value? can I add an extra path to it?
14:49DrakesonI also tried this --> http://groups.google.com/group/clojure/browse_thread/thread/d83ed2808eef00da/3cd31b25f123e9a7
14:49Drakesonwhich gives me a list of jar files.
14:53Drakesonor at least, is it too obvious what it means?
14:53AWizzArdFunny. When you type on the repl: (in-ns 'java), how do you then go back into (in-ns 'user)?
14:53kotarakDrakeson: (add-classpath "file:///to/some/path") adds to the classpath
14:54devinusis there a clojure textmate bundle?
14:55Drakesonkotarak: thanks.
14:57ChouserAWizzArd: oops
14:58ChouserAWizzArd: don't do that
15:00lisppaste8fyuryu pasted "fighting with macros" at http://paste.lisp.org/display/69528
15:01fyuryuI've been fighting with this macro for the last 1.5 hours
15:01sohailfyuryu, what are you trying to do?
15:01fyuryuand don't know how to achieve the desired effect
15:02sohailchunk doesn't need to be a macro
15:02sohailoh I see
15:03sohaildo you need the @?
15:03fyuryusohail: this is a simplified version, I want to be able to pass both, the test predicate and action from m-main
15:04sohailI don't know what you are trying to do actually
15:04fyuryusohail: well, I think I need the @
15:04lisppaste8kotarak annotated #69528 with "fyuryu's macro with gensym" at http://paste.lisp.org/display/69528#1
15:05fyuryusohail: I want the commented line to appear in place of ~@(chunk ...)
15:06fyuryukotarak: Thanks, I think I tried that already, but let me try again
15:07fyuryukotarak: yep, doesn't work
15:11devinuswhat does this do ->
15:12fyuryudevinus: (-> {} (assoc :a 1) (assoc :b 2)) --> {:a 1 :b 2}
15:12Drakesonis there a way better than web scraping to get the content of clojure.org ?
15:13lisppaste8chousuke annotated #69528 with "shouldn't this work?" at http://paste.lisp.org/display/69528#2
15:13devinusfyuryu: is it like an inline test case?
15:13fyuryudevinus: takes the first arg and puts it as the first arg of the following expression
15:13fyuryuthen the result as first arg of the next one
15:14fyuryudevinus: no, more like chaining calls
15:16Chousukefyuryu: did my version produce what you wanted?
15:18fyuryuChousuke: yes, thanks a lot. Started writing the same thing, following sohail's comment about making chunk a function
15:19fyuryuwhen you have a hammer...
15:22ChousukeI've noticed that writing helper functions that return forms helps bring macro complexity down a lot.
15:22Kerris4fyuryu: everything looks like a thumb? :V
15:23fyuryu:-)
15:24Chousukeyou 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:25aperotteDrakeson: there is a pdf in the files on the google group that contains the contents of the site
15:26aperotteDrakeson: http://groups.google.com/group/clojure/files
15:27aperotteDrakeson: manual.pdf
15:30Drakesonaperotte: cool, thanks. Shouldn't that be in this channel's topic?
15:32aperotteI dunno, I'm pretty new here and only found it myself yesterday
15:33aperottehas anyone used the patch that allows gen-class to access ancestral protected members?
16:24Drakesonwhat it takes to get tilda expansion?
16:24kotarakDrakeson: what tilde expansion?
16:25Drakeson~/thing rather than file:///path/to/user's/home/directory/thing
16:26kotarakIf 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:28Drakesonwell, 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:29kotarakNever needed ~/whatever up to now. I don't know whether there such functions.
16:32kotarakAt least java.io.File seems not to support ~.
16:34danlarkinDoes this work for you? (. System (getProperty "user.home"))
16:34Drakesonyes, but that is not very convenient.
16:34danlarkinwell that's what you've got
16:34Chouser(System/getProperty "user.home")
16:35Chousersave those parens for CL programmers -- they need all they can get.
16:35DrakesonChouser: :)
16:35danlarkinah yes I keep forgetting /
16:35DrakesonI was hoping for something cleaner. Like a clean path syntax.
16:36ChouserDrakeson: it's not a terribly cross-platform standard. only unixen use ~ for the user home dir, I think.
16:36kotarakDrakeson: (defn expand-tilde [s] (if (= (first s) \~) (apply str (System/getProperty "user.home") (rest s)) s)) (untested)
16:37Drakesonit is not as clean as #P~/thing ;)
16:39DrakesonChouser: 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:40Chousersohail: find a way for different libs to provide reader macros without conflict, and rhickey may take your patch.
16:41abrookssohail: 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:41ChouserI've thought perhaps by making them look like fns or macros that follow namespace rules...
16:42sohailI don't see why you couldn't make them use... what Chouser said
16:42Chouser(myns/myreadmac now I can do what I want " this macro ends in a ]
16:42sohailhm
16:42sohailno
16:42sohail:-)
16:42Kerris4abrooks: sounds like Clojure halready has legacy apps to support ;-P
16:42sohailbut maybe if #P could be read as # namespace/P and you dispatch on namespace/P
16:43sohailbut I don't know how that would work
16:43ChouserKerris4: 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:43abrooksKerris4: 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:44abrooksLisp + macros is a sufficiently powerful and yet hygienic system.
16:45sohailsheep!
16:45sohail:-)
16:46Chousersohail: our proposals aren't very different, I was just thinking ( instead of #
16:46abrooksUser defined reader macros add a bit but dirty the system massively.
16:46Chouserabrooks: that's roughly the same argument other languages make against macros
16:46sohailChouser, problem is that ( is already used for something else
16:47abrooksChouser: Other languages don't have CL like macros.
16:47Chousersohail: sure, for invoking stuff, currently either at compile time or runtime. Why not at read time?
16:47Chouserabrooks: right, because the "add a bit of power, but dirty the system massively"
16:47sohaildoesn't the syntax become ambiguous then?
16:47sohail(p or (p-function ?
16:47Kerris4Chouser: thanks for the explanation :)
16:48sohailno
16:48Chousersohail: well, I don't have a patch working or anything, but I think it could be done.
16:48sohailstill, I think using ( is insane :-)
16:48abrooksChouser: Yes. Clojure DOES have powerful macros that don't dirty the system thanks to the homoiconicity that other languages don't have.
16:49sohailok I think if reader macros dirty the system, then we should remove the object literal syntax because it uses a reader macro
16:49sohailif it's good enough for rich to use, good enough for me, I say :-)
16:49kotarakChouser 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:49abrooksHm... Clojure should really just adopt M4 now that I think about it...
16:50abrooks</joke>
16:50sohail( to indicate a reader macro will cause no end of confusion
16:50Chouserkotarak: 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:50sohail(f "i") -> function or macro?
16:51sohailfunction, macro or reader macro, that is
16:51kotarakAs does ( to indicate a macro instead of a function creates confusion.
16:51Chouserkotarak's got my point. :-)
16:51sohailnot the same though
16:51Chouserno, just a gradient.
16:52sohailthey both follow the rules except a macro is a function that doesn't evaluate its arguments
16:52sohaila reader macro is a what?
16:52sohail(ok not exactly, but...)
16:52Chousera reader macro is a function that takes a PushbackReader instead of an s-expression
16:53sohailyou are asking for it
16:53Chouserboth macros and reader macros return s-expressions
16:53sohailthe evils that are possible with ( for reader macros...
16:53sohailatleast with # you aren't required to delimit, whereas with ( you are, unless you are really mean
16:55kotaraksohail: If I give you a rope and tree, will you hang yourself?
16:55Kerris4:(
16:55sohailif I have to use ( for reader macros
16:55sohail:-)
16:55kotarakIf I give you ( for read macros, will you do evil things?
16:55sohailemacs will be very unhappy with me
16:56kotarakNot when there is a ) necessary.
16:56kotarakEmacs won't note a difference.
16:56sohailif it's necessary, then sure I am happy
16:56sohailI just cringed at Chouser's example above
16:56kotarakbeh :(
16:56kotarakSuch things are evil.
16:57kotarakSolution: don't do it. Don't use other code which does it.
16:57kotarakSimple.
16:57sohailuh, no
16:57sohailsolution: don't allow it
16:57sohailmuch easier
16:57sohailyou're just helping rhickey make his case against!
16:57Chousersohail: how would you indicate the end of a # macro?
16:57kotarakI feel Ada coming up....
16:58sohailChouser, I wouldn't, and Emacs wouldn't care
16:58sohailbut if there is a ( and no ), I fear
16:58sohailby the way, do we really want clojure to be a language that gives you enough rope to hang yourself?
16:59sohailit is not the place to be
16:59kotarakrich talked about #+ and #-, in this I see much more potential for rope....
17:00sohailyou see more potential in a regular syntax to give you rope than allowing irregular syntax?
17:00sohailinteresting
17:01sohailthough whatever argument you make for #+ applies to (+ :-)
17:02Kerris4is there a -Wall or XLint equivalent for Clojure?
17:05kotaraksohail: How is this handled? (cond (foo) bar #+frob (frobnicate) flogiston)
17:05sohailI don't understand why you are harping on about #+
17:06kotarakI want to understand it, because the people are so interested in it. In the above example: is this a valid example use?
17:08sohailkotarak, that is an odd cond
17:08kotaraksohail: May question is: would the reader complain?
17:09sohailwhat does the cond have to do with it
17:09sohailthat cond doesn't even look correct
17:11kotarakWithout #+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:11ReplRatWhy doesn't (doc def) work? I get java.lang.Exception: Unable to resolve var: def in this context
17:11ReplRatclojure.lang.Compiler$CompilerException: NO_SOURCE_FILE:22: Unable to resolve var: def in this context
17:11kotarakReplRat: def is a special form
17:11sohailwhy would you write a cond like that
17:11kotarakwhy would I write a ( reader macro which doesn't close the )?
17:12ReplRat(def apply)
17:12sohailkotarak, why should you have the choice
17:12kotarakReplRat: http://clojure.org/special_forms for more on special forms.
17:12kotaraksohail: why should I be able to break the cond with #+?
17:13ReplRatkotarak: thanks
17:13sohailwhy will it break
17:14kotarakBecause without frob feature the (frobnicate) will be removed. Leavind an odd number of clauses and flogiston in the position of a test.
17:15sohailso you're asking me why can you break cond by putting in an odd number?
17:15sohailI don't get it
17:15sohailI don't need #+ to do that
17:16kotarakIt's not important. Certainly a misunderstanding of this whole stuff on my side.
17:16Chouserkotarak: you were doing so well!
17:17Chousersohail: 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:17sohailok..
17:18sohailyesterday I accidentally wrote (defmacro while [cond & body] `(when ~@cond ...))
17:18kotarakA *poof* the regular syntax of #+ introduced the rope...
17:18sohailwhich did odd things
17:18sohailso let's get rid of ~@ too
17:18kotarakAh! Macros are bad!
17:18sohailsee
17:19kotarakOther languages saw this already and remove them completely. ;)
17:19Chouserso maybe we already have enough rope to hang ourselves. in which case, what's wrong with ( for reader macros?
17:19kotaraksohail: I think there will alway be rope. Bondage and Discipline is not really the way to go...
17:19sohailI can't believe you are seriously considering ( without )
17:19sohailkotarak, exactly
17:19Chouserah, nevermind. kotarak, you were right to give up.
17:19sohailso why are you advocating NO READER MACROS
17:19Chouserthis is not a condusive forum for this kind of disucssion.
17:20ChouserI 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:20kotarakprobably
17:28ReplRatis there a way to access the nth most recent expression result in the Repl? like i can do in bash?
17:28kotarakthere is *1 *2 and *3
17:28ReplRatthanks
17:29ReplRatwhere is that documented
17:29kotarak*e for the last thrown expection
17:30ReplRathmm, i'm getting Unable to resolve symbol
17:31kotarakwhich version clojure do you use? Maybe it's only in SVN up to now...
17:31ReplRatan svn from less than 3 days ago
17:32ReplRati'm using git svn but i haven't figured out how to see what the most recent commit is yet
17:32ReplRat(trying to learn git as well as clojure) :)
17:33kotarakJust e sec
17:33kotarakWorks for me...
17:34ReplRati'm just typing *1 at the repl, should it eval as an expression or do i need to wrap it in something else?
17:34sohailI think you need to update swank if you are using it
17:34ReplRatahh well i'm just using a naked repl at the moment, not slime/swank.
17:34ChousukeReplRat: git log HEAD^..
17:36Chousukemore generally: git log HEAD~n.. shows you the log entries for the last n commits, and ^ is a synonym for ~1
17:36ReplRatChousuke: 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:36Chousukeyou can also use tags or hashes, or specify and endpoint for the range.
17:37Chousukejuly 22? that doesn't sound right.
17:37ReplRati did git clone last weekend, and git fetch on wednesday to update my repo.
17:37ReplRatgit svn clone i mean
17:38Chousuker1086 | rhickey | 2008-10-29 14:42:40 +0200 (Wed, 29 Oct 2008) | 1 line
17:38Chousukemost recent, it seems
17:38ReplRatthat looks more like it.
17:38Chousukemaybe you need to use git svn log or something
17:39ChousukeI have the clojure repo as plain svn so I can't test mysefl
17:39ReplRatChousuke: that's it. git svn log shows r1085.
17:39Chousukeshould really clone it as a git repo.
17:39Chousukegit is so much better than subversion
17:40ReplRatyep, and lots of clojure stuff, (clojure-mode etc) is on git
17:40ReplRatthere seems to be a clojure clone on github, but i wonder how it is kept up to date?
17:40ReplRathttp://github.com/kevinoneill/clojure/tree/master
17:41Chousukewell it seems to be current right now at least :)
17:42ReplRatmaybe github has some svn sync magic that i don't know about
17:42Chousukeor maybe the person who created that just has a cronjob that updates it periodically :)
17:43ReplRati thought i would be better off just using git svn myself that cloning his clone.
17:43Chousukeoh, apparently github can do svn imports by itself. nice.
17:44Chousukethough looking closer, it doesn't keep them synchronised automatically :P
18:39ReplRatshould i use ant or maven to build clojure?
18:40kotarakI use ant. Never had problems.
20:23mmcgranaI 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:32mmcgranaProbably should have asked if anyone was here first, I'll post to the group...
23:15gnuvince_Hmmm
23:15gnuvince_Did you guys watch the presentation by Slava about Factor? His EBFN library is *really* nice
23:29sohailman, I still remember when factor ran on the JVM