#clojure log - Oct 29 2008

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

0:14 bradbev: I managed to set the meta with the java function setMeta

0:14 poor form, but it's debugging.

0:32 Drakeson: will there ever be a way to use java's camelCase methods the-way-they-should-have-been-named in clojure? (e.g., I prefer to-upper-case over toUpperCase).

0:37 sohail: what is the clojure equivalent of import foo.bar.*;

0:37 Drakeson, I'd also like that

0:39 Drakeson: sohail: like what?

0:41 sohail: Drakeson, to-upper-case over toUpperCase

0:41 would be very cool to be able to set the reader(?) in such a mode

0:41 Drakeson: or the other way, import and rename symbols that way

0:42 there is a :rename already, I guess

0:42 sohail: yeah that can get annoying quick

0:42 there is no way to modify the reader right now right?

0:43 Drakeson: I guess not, IIRC I read/heard somewhere that reader is out of reach for now. unlike CL

0:45 how do you find out what directory you are in? also, how do you "cd" ?

0:48 sohail: you'd probably have to use the java api for that

0:48 is clojure.org/api manually maintained or is it automagically generated from all the other pages

0:49 Drakeson: what is the java api for that then?

0:49 * Drakeson feels crippled

0:49 sohail: I dunno, google it.. you can still type it seems

0:50 Drakeson: is there an apropos in slime/clojure/java to look for commands?

0:54 sohail: Drakeson, fyi, the completion works for me

0:54 I did (def foo-x [] ...) (foo-<M-TAB> and it worked

0:54 err esc-tab

0:56 Drakeson: sohail: it works for me now, (I used to be using debian unstable's slime (2008-02-..), then I tried the slime from git it, and it works well.

0:57 is there an easier "pwd" than (.getCanonicalPath (java.io.File. ".")) ?

0:57 sohail: uh

0:58 java.lang.System probably has what you want

1:02 Drakeson: sohail: thanks

1:58 sohail: when you do (ns foo...) (defn bar [] ...) in file foo.clj, when you (load "foo.clj") how does clojure know to put bar in foo/bar ?

1:58 ah.. Sets *ns* to the namespace named by name (unevaluated),

1:58 damnit, rtfm man

2:29 so anyone know? clojure equivalent to Java's import foo.bar.*;?

5:12 AWizzArd: Moin

8:23 Chouser: 05:12 < AWizzArd> Moin

8:23 oops, sorry.

8:24 cemerick: rhickey: in Reflector.invokeMatchingMethod(String, List, Object, Object[]), if 'target' is null (which is true if we're looking for a matching static method), then a NPE is thrown in the process of building the IllegalArgumentException message in the case where a matching method couldn't be found

8:24 I could just change that function to take the target's class (which will never be null), but I thought I'd ping you on it first.

8:26 rhickey: cemerick: ack, will fix

8:31 cemerick: so, while I was digging around in there, I finally see why it's not so straightforward to automatically upcast numerics (e.g. float => double, int => float, etc).

8:32 or, I *think* I see why ;-)

8:37 rhickey: what was your case for the invokeMatchingMethod problem?

8:39 cemerick: I had a reflective static call to a method with multiple overloads with the same arity, but was passing a literal int argument instead of specifying (float 5)

8:40 the signatures were (Object, Object, float) and (OtherObject, OtherObject, float)

8:43 rhickey: cemerick: fixed

8:43 cemerick: rhickey: nice, thanks

8:44 the error messages are much better these days

8:44 rhickey: little by little

8:45 the next level is pro-active compiler checks for arity etc

8:45 blackdog: hows' AOT coming rhickey ?

8:46 rhickey: AOT's on pause until after the election next week

8:46 then front and center

8:46 blackdog: nice

8:49 jao: sorry for the dumb question: what's AOT?

8:50 cemerick: Ahead Of time Compliation

8:50 generating classfiles from .clj files, rather than having to load/compile them at runtime

8:50 jao: aha, thanks!

8:50 cemerick: I may need to write a sonnet for recur.

9:02 jdz: can I ask why remove is not implemented as just (filter (complement pred) coll)?

9:04 cemerick: ah, I just noticed declare -- nice addition

9:05 jdz: I actually just noticed remove last week -- I've always used (filter (complement pred) coll) myself. Can't say what the motivation is behind the impl, though.

9:05 rhickey: jdz: no good reason

9:06 maybe I didn't think I had complement yet at that point in boot.clj, but I do...

9:06 cemerick: for some reason, using complement sits better in my head, especially when working with maps or sets as predicates

9:11 jdz: rhickey: on that note --- i'm sure you must have thought about mutually-recursive functions?

9:11 or is it something that AOT will be able to provide?

9:12 rhickey: jdz: you can write mutually recursive top-level functions right now, just no letrec/labels

9:12 Chouser: jdz: mutually-recursive functions work, but without tail call optimization in the JVM, they're a bit dangerous.

9:12 any chance of getting add-watch for refs?

9:13 cemerick: I never dug far enough into that side of it, but doesn't scala provide TCO over mutually-recursive fns?

9:13 rhickey: Chouser: I think dangerous is too strong - there are plenty of valid uses of recursion that don't need to handle large data

9:13 jdz: ok, that's good to know. i have been mislead by defining my functions with C-M-x...

9:14 Chouser: jdz: well, you do have to declare the var first: (def f1) (defn f2 [...] ...) (defn f1 [...] ...)

9:15 rhickey: fair enough. have a more appropriate word at hand? :-)

9:15 maybe "must be careful"

9:19 Chousuke: does the SVN link on clojure.org work for anyone else? I get an error :/

9:20 j-dot: mindful?

9:20 rhickey: cemerick: if they do it has to be in a compilation unit where they can inline one of the methods - the JVM doesn't support TCO across real method calls

9:21 Chousuke: hm

9:21 apparently all of sourceforge is having trouble.

9:21 cemerick: yeah, I know they go through all sorts of contortions internally to support local TCO, nevermind mutually recursive TCO.

9:21 rhickey: Chouser: I think it's best to say there's no TCO and leave it at that.

9:33 j-dot: rhickey: currently the docs at http://clojure.org/evaluation have this example, which doesn't work with SVN's HEAD:

9:33 (eval (list + 1 2 3))

9:33 -> 6

9:33 should that be: (eval (list '+ 1 2 3)) -> 6?

9:34 danm__: I think the first one is right

9:35 or (eval '(+ 1 2 3))

9:35 which should be equivalent

9:35 jdz: danm__: the first and your version are not equivalent

9:35 in the first case the + is evaluated and its value put into the lit

9:36 *list

9:36 danm__: ahh, I see

9:36 they would be equivalent in CL though?

9:36 <-- new

9:36 jdz: danm__: no, the difference is the same in CL

9:36 danm__: ok

9:37 jdz: danm__: it's about evaluation rules and self-evaluating objects (like numbers)

9:37 i might have the terminology a bit wrong, though

9:38 danm__: right, ' is shorthand for quote, not list

9:47 Zzompp: hello, I used the instructions in http://riddell.us/clojure/ , but ran into something like this: http://paste.lisp.org/display/63396/

9:51 any suggestions? :-)

9:52 Lau_of_DK: Youre trying to use 'progn' in a Clojure Repl ?

9:52 hoeck_: Zzompp: looks like slime is using the wrong init function

9:53 duck1123: I've seen that before

9:53 it's very picky about the order you load the libs

9:54 make sure you're require-ing swank-clojure-autoloads before slime

9:56 hoeck_: Zzompp: or for now try evaling in emacs-lisp mode (setq slime-lisp-implementations (list (list 'clojure (swank-clojure-cmd) :init 'swank-clojure-init)))

9:58 Zzompp: now it complains the following: java.lang.Exception: No such var: swank/start-server

10:02 hoeck_: Zzompp: i have my requires in this order: slime, swank-clojure, swank-clojure-autoload

10:05 Zzompp: thanks, got it working

10:05 using clojure from svn

10:07 by the way, any chance of using clojure as a scripting language? as in #!/usr/bin/env clojure etc.

10:07 (I just started to explore clojure)

10:07 Chouser: Zzompp: there are a few .sh scripts kicking around that make that possible.

10:08 and there's a impressive, if convoluted, trick on the wiki as well.

10:08 so yes, but there's not yet a standard way to do it.

10:10 Zzompp: ok

10:13 abrooks: Zzompp: One thing to note is that the JVM and Clojure compiling / classloading overhead is significant.

10:15 Chouser: 1.871s for clojure vs. 0m0.006s for perl on my machine.

10:15 Zzompp: right

10:16 I'm just starting to learn clojure, so far it seems interesting

10:16 abrooks: Zzompp: There is a project, I need to remember the name, which allows you to run the JVM as a persistent scripting host. This project forwards all data over TCP sockets so the throughput is not optimal. It also doesn't, to my knowledge handle the forwarding of signals or process attributes to the script instance.

10:17 Zzompp: basically a java daemon?

10:17 abrooks: I have a sketch of a design for a better scripting host for POSIX-y systems (with UDS support) but it's currently vaporware.

10:17 Zzompp: Yes.

10:46 Lau_of_DK: Could someone here enlighten me on the differences between inferior-lisp and superior-lisp ?

10:57 Chouser: Lau_of_DK: apparently not.

10:57 * Lau_of_DK pouts

10:57 abrooks: Isn't inferior-lisp for non-elisp?

10:58 * Chousuke would guess superior-lisp is the lisp emacs uses to run itself

10:58 Lau_of_DK: Swank is using inferior, Slime is on Superior

10:58 But I still dont know that that means

10:58 abrooks: Chousuke: Right... that's what I seem to recall.

10:58 Chousuke: it's just a guess though :P

10:59 Lau_of_DK: <tcr> Lau_of_DK: Inferior foo is Emacs speak and means that foo is run in a child process, communicating with Emacs.

10:59 from #lisp

11:58 cads: if a person were to learn only one lisp, is there any reason why that lisp should not be closure?

11:59 clojure, even!

11:59 Chousuke: maybe if you were paid to learn something other than clojure. :)

11:59 H4ns: cads: maybe you are looking for a lisp that is described in a book or two

11:59 cads: always a good reason

12:00 gnuvince_: cads: most people learn only one Lisp in college, and that almost always happens to be Scheme (and then they promplty forget it.)

12:01 Maybe the colleges could teach Scheme as intro to computer science and then switch to Clojure and be like "well it's compatible with Java, what are you whining about?"

12:01 :)

12:02 Chousuke: heh

12:02 that'd teach them to use the java libraries, but with clojure.

12:03 cads: H4ns: so perhaps it may not be the best idea to introduce it to a friend who is new to programming in general, but might be okay for someone who has read a few theoretical papers using simplified lisps as the working language?

12:03 duck1123: it would be interesting to see how well someone does learning Clojure as their first programming language

12:03 H4ns: cads: yes - i think, for someone who is completely new to programming, a good textbook is essential

12:04 cads: (unless there is a teacher who has enough time to actually teach the person)

12:04 gnuvince_: duck1123: I think it could work; I believe that one of the important things a first language should have is practicality.

12:05 The student should not feel that it is merely mental masturbation, he should be able to use it to create practical programs (however small)

12:12 Lau_of_DK: Boys, Ive put in some work to customize emacs. Like session management and the likes. This is pretty cool, will give you a clj file on top, and a repl below. Very easy

12:12 (defun open-and-run-lisp (file)

12:12 "This function open a file at TOP window, and execute `run-lisp' at LOWER window."

12:12 (interactive "FFile: ")

12:12 (delete-other-windows)

12:12 (find-file file)

12:12 (split-window-vertically 50)

12:12 (other-window 1)

12:12 (with-current-buffer (current-buffer)

12:12 (call-interactively 'run-lisp)))

12:13 cads: H4ns, for a teacher willing to 'translate' learning material into clojure and put together a curriculum for his pupil, is there any lisp book which stands out as being particularly suited?

12:14 H4ns: cads: maybe practical common lisp - stuart halloway has translated some of the example code already, and it is oriented towards practical things. not suitable for an absolute beginner.

12:15 wwmorgan: cads: SICP is really good. It's Scheme though

12:15 H4ns: cads: for an absolute beginner, maybe using something like http://www.cs.cmu.edu/~dst/LispBook/ might be better

12:17 cads: those both seem like great resources, thanks

12:18 and halloway's writing a full blown clojure book!

12:21 tayssir: With SICP, a class taught by the authors are on Google Video, and you can download/torrent the vids direct from mit.edu. You might find it handy, depending on how you learn. Also, the textbook is online...

12:26 (That said, I wasn't a big fan of SICP and Scheme, for some reason...)

12:31 gnuvince_: Should re-pattern be able to take two arguments like Pattern.compile(String, int)?

12:32 Chouser: I wonder if the Pattern literal should take flags, but I'm not sure what the syntax would be.

12:32 gnuvince_: you can use (Pattern/compile ...) for now.

12:32 gnuvince_: I wouldn't have it for pattern literals

12:38 AWizzArd: Is there something like undef or unintern in CLJ?

12:40 wwmorgan: AWizzArd: (doc ns-unmap)

12:43 AWizzArd: wwmorgan: thx

12:45 Is there a variable that automatically gets bound to the last result? Like *, ** and *** in CL. Or like +, ++, ++ or /, //, ///

12:50 wwmorgan: AWizzArd: *1, *2, and *3

12:51 H4ns: do *1, *2, *3 work in slime now?

12:51 Chouser: very simple visual explorer for clojure data structures: http://blog.n01se.net/?p=30

12:52 H4ns: Chouser: very cute!

12:53 Chousuke: cool

12:53 AWizzArd: H4ns: for me they do work in Slime

12:54 H4ns: AWizzArd: ok, time to update, thanks.

12:54 abrooks: Chouser: Nice!

12:56 H4ns: Chouser: the img tag in your blog seems to have wrong width/height specs, though

12:58 abrooks: Chouser: Yes, the image is being scrunched.

12:58 Chouser: yeah. The template fixes the width slightly smaller than the shot's actual size.

13:02 AWizzArd: How can I convert strings containing a number to a number? (parse-integer "14") ==> 14

13:03 wwmorgan: AWizzArd: arbitrary precision? integers?

13:04 abrooks: (. Integer (parseInt "14"))

13:05 (.parseInt Integer "14")

13:05 Either should work.

13:05 wwmorgan: also (Integer. "14")

13:05 Chousuke: (Integer/valueOf "14")

13:05 lots of options :p

13:05 abrooks: Heh.

13:06 H4ns: so there is no clojure way to do that, one uses java calls instead.

13:06 Chousuke: well, the java calls are the clojure way

13:07 H4ns: Chousuke: that was what i wanted to say :)

13:07 AWizzArd: I already supposed that and tried stuff like (.toInteger String "25")

13:08 (as there was nothing in the boot.clj that seemed to do the job)

13:09 wwmorgan: http://look.fo/java-integer-from-string

13:10 Chousuke: the java API doc is your friend as much as the clojure doc is.

13:11 AWizzArd: I moved to another city and had no internet in the past days

13:11 Chousuke: if there's something "basic" that clojure seems to lack it's likely because it's already provided by the Java class library.

13:12 leafw: how does one expose the inspector namespace? (all-ns) doesn't list it

13:12 ... but it lists set, zip and xml

13:14 wwmorgan: leafw: (use '(clojure inspector))

13:14 rhickey: leafw it's not loaded by default, since it's Swing

13:14 leafw: I see, would break in non-X11 forwarding environments, right

13:21 Chouser: I've been surprised to discover clojure.inspector in the past -- I wonder why I keep forgetting about it.

13:28 gnuvince_: Is there a way to give a docstring to a multimethod?

13:33 leafw: Chouser: would be great if the inspector was coupled with java beans, listing for each object its accessible get properties

13:34 at the moment, it would just list vector, vector, vector ... for a beans dict.

13:35 Chouser: when I first started thinking about this yesterday, I thought I would call mine gprint, and use a multimethod like prn does now.

13:35 that might allow you to drop in new behavior.

13:39 Chousuke: gnuvince_: (defmulti #^{:doc "This is the docstring"} foo :bar) but that's not perfect :/

13:42 gnuvince_: yucky :-/

13:42 Here's another question: if I have a .jar file, can I use the classes inside it?

13:42 Chouser: yes, you can.

13:43 * Chouser suspects that's not the end of the conversation.

13:43 Chousuke: hmmh

13:43 gnuvince_: :)

13:43 Chouser: ok, fine, I

13:43 I'll just tell you...

13:43 gnuvince_: Wait

13:44 * Chouser waits.

13:44 gnuvince_: I'll try to see if it's on the website.

13:44 Chouser: :-)

13:44 gnuvince_: Don't want to appear to be a documentation non-reader ;)

13:45 Chousuke: documenting multimethods could be useful but doc doesn't seem to handle them very well. it expects the :arglists metadata :/

13:46 AWizzArd: gnuvince: you could maybe try to manually attach metadata to a multimethod

13:46 gnuvince_: I was just wondering if there was a nice syntax like with functions

13:47 AWizzArd: not yet

13:49 Look into your Clojure directory and see if you find src/boot.clj. There you can look up defmulti. Currently it doesn't take doc strings.

13:49 gnuvince_: Yeah, I saw.

13:49 Chousuke: ok, I'll ask: can I just put the .jar in my CLASSPATH?

13:51 Chousuke: you probably meant Chouser.

13:51 Chouser: gnuvince_: yep

13:51 gnuvince_: yay

13:51 Chousuke: but now I'm a bit confused

13:51 gnuvince_: Chousuke: I did.

13:51 Too many people in here with similar nicknames

13:51 drewc and drewr, Chousuke and Chouser

13:52 AWizzArd: yeah, 4

13:52 duck1123: it won't pick up the presence of a new jar while it's running though, will it?

13:52 Chouser: duck1123: you can try using add-classpath to get that behavior

13:53 * duck1123 still wishes add-classpath returned something useful

13:54 lisppaste8: Chousuke pasted "why doesn't meta return anything?" at http://paste.lisp.org/display/69406

13:57 Chouser: Chousuke: (meta (var foo))

13:57 wwmorgan: Chousuke: alternatively ^#'foo

13:58 Chousuke: ah

13:58 Chouser: When you def something, there are actually 2 or 3 objects involved.

13:59 foo, (var foo), and in a way 'foo

13:59 Chousuke: hmm

14:00 Chouser: that is: the value you're assigning, the var you're assigning it to, and the symbol which is the name of the var

14:00 Chousuke: right.

14:03 so I can actually attach metadata to "nothing"

14:03 with (def #^{whatever} x), correct?

14:03 Chouser: no, but you can attach metadata to a var that is unbound or bound to nil

14:04 yeah, your example is fine.

14:04 (def #^{:is "var"} foo #^{:is "val"} ["value"])

14:09 AWizzArd: btw, why does it make sense to have unbound vars vs vars bound to nil?

14:09 I mean, nil stands for nothing...

14:09 Chouser: evaluating an unbound var is an exception instead of just returning nil

14:10 AWizzArd: yes

14:13 Chousuke: is there way to test if a var is bound? without try/catch

14:13 Chouser: (.isBound (var x))

14:22 Drakeson: how can I write this in clojure: import org.gnome.gtk.Gtk; ... Gtk.init(args); ?

14:23 (. org.gnome.gtk.Gtk init args) ?

14:23 Chouser: (import '(org.gnome.gtk Gtl)) (Gtk/init args)

14:24 Drakeson: thanks.

14:30 I am a bit confused about java library paths in Debian. Do I *need* to set LD_LIBRARY_PATH=/usr/lib/jni ? Debian installs libraries in there.

14:31 sohail: Drakeson, either that or -Djava.library.path=/usr/lib/jni

14:32 walters: i think the JDK should do that by default

14:32 but I can't speak for Debian

14:33 Drakeson: Debian usually tries to integrate stuff, so this feels so un-Debianish.

14:33 that's why I feel I am missing the correct way

14:33 walters: are you using openjdk/icedtea?

14:34 Drakeson: no, what is that? I am using sun-java6-*

14:34 walters: oh you're using java-gnome?

14:34 Drakeson: walters: libjava-gnome-java

14:34 walters: i think their stuff was buggy in this respect though I saw something in the most recent upstream release about fixing it

14:35 * walters notes JGIR doesn't have this bug ;)

14:36 Drakeson: walters: I am going to JGIR, but I felt I better run a hello-world clojure + gtk using whatever comes with debian before using JGIR

14:36 walters: probably the main pain for using JGIR is that someone will have to package JNA for Debian, last I checked it wasn' tin

14:36 *wasn't in

14:37 * Drakeson doesn't even know what is JNA.

14:37 * Drakeson is such a javaNewbie

14:37 walters: https://jna.dev.java.net/

14:38 "ctypes for the JVM" if you know Python

14:38 Drakeson: oh, I see.

14:39 what is the anonymous user/pass for svn checkout https://jna.dev.java.net/svn/jna/trunk jna ?

14:40 walters: Drakeson: looks like it's "guest" with no password

14:40 Drakeson: https://jna.dev.java.net/servlets/ProjectSource

14:41 dev.java.net isn't really a great hosting site

14:44 Drakeson: you have so many dependencies :p

14:45 walters: yeah, we're working towards a release hopefully in the next few weeks, i'll touch base with the debian desktop packaging team and help them get it shipped

14:45 Drakeson: walters: what do you use yourself? is it debian/... ?

14:46 walters: i use fedora; I work for Red Hat now, though long ago I was part of the Debian/GNOME team

14:47 blackdog: jgir good alternative to mono by the looks of it

14:47 mono/gtk

14:47 Drakeson: yeah, that's what I think

14:48 blackdog: in the same space anyway - given that walters works for redhat :P

14:49 walters: we're getting there but the mono/gtk integration has years of work behind it; just to bring this back ontopic a good chunk of the reason I did work on JGIR is because most of the language innovation seems to be happening on the JVM now, Clojure being a good example

14:49 blackdog: yep

14:49 Drakeson: when java comes out of "non-free" in debian, and jgir packages appear in debian, mono/gtk and maybe even pygtk will get a fierce competion.

14:51 walters: didn't openjdk get in main?

14:52 Chousuke: I thought it did

14:53 Drakeson: oh, sorry, I didn't know openjdk is *the* open sourced sun-java.

14:54 walters: well...fedora at least ships icedtea (http://icedtea.classpath.org/) which is derived from openjdk but removes the remaining binary plugs; i assume Debian would ship icedtea too

15:15 vy: Is Jeffrey Chu in here?

16:19 duck1123: What would I need to do if I'm getting an InvocationTargetException when trying to create a new instance of a class?

16:21 Chouser: you might look at the full stack trace to see if there's a more helpful message farther down.

16:26 duck1123: I ran this from the REPL, so the rest of the trace just involves clojure.lang.Compiler

16:27 0: clojure.lang.Compiler$DefExpr.eval(Compiler.java:300)

16:27 1: clojure.lang.Compiler.eval(Compiler.java:4113)

16:27 2: clojure.eval__791.invoke(boot.clj:1443)


16:32 Chouser: Not sure. I guess I'd check all the args to the constructor. Can you paste your code?

16:32 duck1123: the constructor doesn't take any args

16:34 (import '(org.openid4java.consumer ConsumerManager)) (def manager (new ConsumerManager))

17:06 Zzompp: how do I loop forever reading one line at a time from standard input?

17:06 (read *in*) seems to read one line at a time, how do I keep doing that forever?

17:07 Chouser: read is for converting text files to s-expression objects

17:08 so it reads as many lines as needed to get a complete s-expression.

17:08 Zzompp: what I want to do, is read one line from standard input, find if it matches a regexp and then print "found" or "not found"

17:09 Chouser: take a look at (doc line-seq)

17:09 Zzompp: thanks, I'll check that

17:10 but I'm still wondering about that looping bit, this would be a sort of redirector used by squid

17:11 so it has to read one line at a time, match regexp, print line, and keep doing that forever

17:13 Chouser: If you give line-seq an infinite stream of lines, it will return an infinite (lazy) sequence of those lines.

17:14 so then you can just iterate through that seq, such as with doseq

17:14 (doseq line (line-seq ...) (if (re-find #"foo" line) (println "found") (println "not found)))

17:15 Zzompp: thanks, I'll try that

17:19 gnuvince_: I want to write a small series of posts on Clojure on my blog. Do you guys think there's enough introductory material on the net right now, or should I go ahead and give a crash course in Clojure as I develop the program?

17:23 Lau_of_DK: gnuvince, I cant comment on the amount of materials, but I always find those types of blogs very interesting, so I will definately read it if you chose to write it

17:25 Guys, if I have a standard .java file, which declares some classes. How do I consume these with Clojure, so that I can use the classes and their functions?

17:26 gnuvince_: Lau_of_DK: ok. I'll probably run it by the guys here to proof read.

17:26 Lau_of_DK: Alright - Let me know if you need any help

17:26 kotarak: Lau_of_DK, javac foo/bar/Baz.java, make sure resulting foo/bar/Baz.class is in cp. Use... (-> (new foo.bar.Baz "Blah") .frobnicate)

17:27 Lau_of_DK: javac ?

17:28 kotarak: java compiler

17:28 Lau_of_DK: oh, so clojure consumes .class files in the loadpath ? cool

17:39 duck1123: Clojure can never get enough press

17:46 sohail: clojure needs a killer app

17:46 bittorrent?

17:46 :-)

17:47 please don't make it web apps

17:47 I'll quit right now

17:47 Lau_of_DK: Clojure needs Qt

17:47 Thats it, then everything would blow big

17:47 AWizzArd: what for?

17:48 are the Java guis not so good?

17:48 Lau_of_DK: If we had full Qt integration, we would have 100% Crossplatform, incl. Mobile devices, every multimedia framework in the book, webkit, ease of GUI design and so on.

17:48 Java is OK but Qt is a whole different story

17:48 kotarak: Lau_of_DK, you sure are a Qt fan.

17:48 Lau_of_DK: kotarak, no doubt about it

17:49 sohail: what's wrong with Swing vs Qt?

17:49 wwmorgan: clojure has qt integration with jambi right?

17:49 kotarak: Lau_of_DK, but it would only work, where the JVM exists. So portability is limited by JVM.

17:49 Lau_of_DK: Yes, sort of

17:49 wwmorgan, I dont quite have all the details worked out yet

17:51 sohail: Lau_of_DK, what do you like about qt that you don't like about swing?

17:52 Lau_of_DK: sohail, It opens up many possibilities, when you get so easy access to Multimedia, Webkit and alot more along those lines, its high quality stuff. Secondly you get their 'designer' to build complex GUIs with ease. Thirdly, Trolltech develop like madmen,its a wave I want to ride

17:53 sohail: those are all true statements

17:53 wwmorgan: what are the best applications built on top of Qt?

17:53 Lau_of_DK: Google earth? Vlc?

17:53 * sohail does not use any Qt apps at the moment

17:53 sohail: well, I guess Amarok counts

17:53 Lau_of_DK: There are too many to mention... and still, they all mentioned them on trolltechs website :)

17:54 sohail: Lau_of_DK, ever used thinlet?

17:54 Lau_of_DK: Never heard of it

17:55 sohail: ya me either

17:55 till today

17:55 Lau_of_DK: Worth looking into ?

17:55 sohail: dunno, that's why I asked

17:55 it's no Qt

17:55 but you don't always need all those goodies

17:56 duck1123: do I need to do anything special to create an instance of a class with a constructor that doesn't take any parameters?

17:56 Lau_of_DK: No not always, but it would still bring so much power to Clojure, enable rapid development of a wide range of applications, that are currently a hassle to begin work on

17:56 duck1123: I keep getting an exception when I try

17:56 wwmorgan: duck1123: are you still getting the InvocationTargetException?

17:57 duck1123: yeah, but I can access static methods just fine

17:57 wwmorgan: is the exception getting raised in the constructor?

17:58 sohail: Lau_of_DK, until very recently, I did not appreciate the Qt designer. It is really very good

17:58 duck1123: hmm... when I try to do the constructor alone, I'm getting a different error

17:59 let me see if I can take care of this error, then I'm sure the other will go away

17:59 Lau_of_DK: Its excellent, but reading a tutorial on it helps alot, alot of subtle qualities to it

18:05 Welcome back cgrand

18:15 AWizzArd: Lau_of_DK: does Java not offer easy access to Multimedia, Webkit and so on?

18:15 Lau_of_DK: Not to my knowledge

18:16 http://trolltech.com/products/appdev <-- At the bottom of this page, there are for videos, I recommend at least watching "New features"

18:16 AWizzArd: And btw, what tools honestly need a gui that can't also run in a web browser?

18:16 At least for myself I see basically not much need for non-in-browser GUIs.

18:17 Lau_of_DK: Not the best platform for decision making

18:17 AWizzArd: It makes mostly sense for applications that process at lot of data, like image manipulation (Photoshop) or video cut (After Effects, ...)

18:19 But stuff like email clients, file browsers for your online hard disks, programming editors, Word, music player, Sudoku and so on.. it all would work perfectly inside your webbrowser. No Swing needed, no Qt needed. Runs under all OSes, is automatically updated for the customers.

18:21 Google already offers email, navigation and other tools. They are currently working on Word and Excel: http://docs.google.com/

18:23 I think that over time more and more applications will go online, and not use Swing or Qt.

18:25 Lau_of_DK: AWizzArd, This is not a productive discussion. For some applications a desktop-app is preffered, for others you want something webbased. No reason to close any of those 2 options.

18:25 Yes I understood that you think so :)

18:28 AWizzArd: Right, not closing options completely down. I just vote for orienting on the future. I can really not think of many things that need a GUI and that are at the same time not very data intensive, like 3d games or video cut.

18:30 Maybe you could deliver the "killer app" for Clojure by making something like Qt, but for the webbrowser :-)

18:31 Lau_of_DK: I dislike Webapps, so I dont think I'll be the first to do it :)

18:32 AWizzArd: It's just the gui... the real software is on what we should concentrate

18:33 Lau_of_DK: That attitude has held Linux back for years while Mac accelerated

18:34 AWizzArd: Well, I very much like good looking stuff. The website of clojure looks fresh and clean, I like it.

18:34 for common lisp I see guis with style from the early 90ies

18:34 so yes, I agree

18:35 I just say that I personally like to do programming, solve problems and such, and not represent my data to people.

18:37 Lau_of_DK: I view the whole thing as one task with many sub-tasks, GUI, design, being just a few

18:38 AWizzArd: this is a realistic view for many of us, who can't work in a team and have their own gui expert who is much more experienced

18:39 I just like the idea of completely separating the gui from the real program. Having an expert who can edit his template files and control really everything of the gui (be it in a browser or desktop app) and the programmer has never to write any line of html.

18:41 Lau_of_DK: I gotta jet - Good evening/night to all

19:09 Chouser: AWizzArd: you use emacs, right? would you prefer a similar features set in a web app for your programming editor?

19:09 AWizzArd: Yes

19:09 in principle everything that I do in emacs could be done in the browser as well.

19:09 Chouser: would you want to run the server part locally, or have it hosted?

19:09 AWizzArd: in the future it will be hosted

19:10 gnuvince_: How does one get invited to Google Tech Talks?

19:10 Chouser: AWizzArd: You never need to work without interet access?

19:10 gnuvince_: brilliant!

19:10 gnuvince_: We need to get Rich there :)

19:11 AWizzArd: Chouser: right, for me personally it is not a requirement to program while I have no internet access.

19:11 gnuvince_: Steve Yegge would go nuts

19:11 A Lisp that talks to Java

19:11 Natively

19:11 He would immediately say that it's what he meant when he said NBL ;)

19:37 sohail: keep yegge away from clojure!

19:44 AWizzArd: ;-)

19:47 gnuvince_: sohail: ;)

19:48 AWizzArd: Is there already something like (partition 4 (range 10)) but which would not result in ((0 1 2 3) (4 5 6 7)) but instead ==> ((0 1 2 3) (4 5 6 7) (8 9))

19:48 gnuvince_: sohail: note that he'd write a blog post longer than "War and Peace" about the language and that would take him until 2032 to finish, so we'd be okay ;)

19:48 sohail: gnuvince_, ah, good. By then Arc will have taken over

19:49 gnuvince_: haha :)

20:38 duck1123: has anyone used any endorsed jars with Clojure?

20:39 I'm trying to use a library that has a dependence on Xalan

20:44 nvm. I got it working

21:15 AWizzArd: uh: (format "%s" ()) ==> "clojure.lang.PersistentList$EmptyList@1a183d2" instead of "()"

21:18 Chouser: heh

21:19 (format "%s" (pr-str ()))

21:42 AWizzArd: n8

22:01 gnuvince_: Damn...

22:01 1800 words :-/

22:01 That's quite a lot for a blog post, isn't it?

22:10 Chouser: Is there some kind of official style guide for blog posts that I've never heard of?

22:10 gnuvince_: Not that I know of, but beyond a certain length, a lot of people just say "tl;dr"

22:10 Chouser: would you mind reviewing the blog post?

22:11 Chouser: :-) sure.

22:12 gnuvince_: I'm going to bed, so you can send comments by email at vfoley@gmail.com

22:12 Chouser: ok

22:13 gnuvince_: I'm interested in pretty much anything

22:13 http://fornost.homeip.net:81/vince/clojure-comics1.html

22:13 If some parts have a weird "not-quite-English" tone, let me know.

22:13 Thanks a lot, good night!

22:14 Chouser: g'night

22:15 abrooks: gnuvince_: I'm taking a look at it too.

22:16 gnuvince_: It looks pretty good so far. Just one note: The regex format is changing eliminating the double escape ("\\d").

22:16 This is not in a release yet but you may want to note that.

23:20 _sohail_: is a new class created everytime proxy is called?

23:41 hrm... how can I convince clojure to let me create a String[][] from [["foo"]["bar"]]

23:41 to-array* just gives me an array of Object

23:47 Chouser: proxy will re-use a class it created earlier if the list of base classes is the same.

23:51 _sohail_: thanks Chouser

23:51 any idea about [["foo"]["bar"]] -> String[][] or do I have to do it manually?

23:52 Chouser: I'm not sure.

23:53 How about an array of vectors? (into-array [["foo"]["bar"]])

23:53 ;-)

23:54 (into-array (map into-array [["foo"]["bar"]]))

23:54 I think that might do it.

23:55 _sohail_: whoa

23:57 Chouser, I'll have to read that a bit...

23:58 Chouser: (map into-array [["foo"]["bar"]]) -> seq of String[]

23:59 pass that seq to into-array to get an array instead, thus an array of String[], a.k.a. String[][]

23:59 _sohail_: oh geez, I didn't realize into-array is what I wanted in the first place

23:59 Chouser: I think. My understanding of Java array types is patchy.

23:59 _sohail_: thanks :-)

Logging service provided by n01se.net