#clojure logs

2008-10-29

00:14bradbevI managed to set the meta with the java function setMeta
00:14bradbevpoor form, but it's debugging.
00:32Drakesonwill 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).
00:37sohailwhat is the clojure equivalent of import foo.bar.*;
00:37sohailDrakeson, I'd also like that
00:39Drakesonsohail: like what?
00:41sohailDrakeson, to-upper-case over toUpperCase
00:41sohailwould be very cool to be able to set the reader(?) in such a mode
00:41Drakesonor the other way, import and rename symbols that way
00:42Drakesonthere is a :rename already, I guess
00:42sohailyeah that can get annoying quick
00:42sohailthere is no way to modify the reader right now right?
00:43DrakesonI guess not, IIRC I read/heard somewhere that reader is out of reach for now. unlike CL
00:45Drakesonhow do you find out what directory you are in? also, how do you "cd" ?
00:48sohailyou'd probably have to use the java api for that
00:48sohailis clojure.org/api manually maintained or is it automagically generated from all the other pages
00:49Drakesonwhat is the java api for that then?
00:49sohailI dunno, google it.. you can still type it seems
00:50Drakesonis there an apropos in slime/clojure/java to look for commands?
00:54sohailDrakeson, fyi, the completion works for me
00:54sohailI did (def foo-x [] ...) (foo-<M-TAB> and it worked
00:54sohailerr esc-tab
00:56Drakesonsohail: 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.
00:57Drakesonis there an easier "pwd" than (.getCanonicalPath (java.io.File. ".")) ?
00:57sohailuh
00:58sohailjava.lang.System probably has what you want
01:02Drakesonsohail: thanks
01:58sohailwhen 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 ?
01:58sohailah.. Sets *ns* to the namespace named by name (unevaluated),
01:58sohaildamnit, rtfm man
02:29sohailso anyone know? clojure equivalent to Java's import foo.bar.*;?
05:12AWizzArdMoin
08:23Chouser05:12 < AWizzArd> Moin
08:23Chouseroops, sorry.
08:24cemerickrhickey: 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
08:24cemerickI 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.
08:26rhickeycemerick: ack, will fix
08:31cemerickso, 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).
08:32cemerickor, I *think* I see why ;-)
08:37rhickeywhat was your case for the invokeMatchingMethod problem?
08:39cemerickI 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)
08:40cemerickthe signatures were (Object, Object, float) and (OtherObject, OtherObject, float)
08:43rhickeycemerick: fixed
08:43cemerickrhickey: nice, thanks
08:44cemerickthe error messages are much better these days
08:44rhickeylittle by little
08:45rhickeythe next level is pro-active compiler checks for arity etc
08:45blackdoghows' AOT coming rhickey ?
08:46rhickeyAOT's on pause until after the election next week
08:46rhickeythen front and center
08:46blackdognice
08:49jaosorry for the dumb question: what's AOT?
08:50cemerickAhead Of time Compliation
08:50cemerickgenerating classfiles from .clj files, rather than having to load/compile them at runtime
08:50jaoaha, thanks!
08:50cemerickI may need to write a sonnet for recur.
09:02jdzcan I ask why remove is not implemented as just (filter (complement pred) coll)?
09:04cemerickah, I just noticed declare -- nice addition
09:05cemerickjdz: 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.
09:05rhickeyjdz: no good reason
09:06rhickeymaybe I didn't think I had complement yet at that point in boot.clj, but I do...
09:06cemerickfor some reason, using complement sits better in my head, especially when working with maps or sets as predicates
09:11jdzrhickey: on that note --- i'm sure you must have thought about mutually-recursive functions?
09:11jdzor is it something that AOT will be able to provide?
09:12rhickeyjdz: you can write mutually recursive top-level functions right now, just no letrec/labels
09:12Chouserjdz: mutually-recursive functions work, but without tail call optimization in the JVM, they're a bit dangerous.
09:12Chouserany chance of getting add-watch for refs?
09:13cemerickI never dug far enough into that side of it, but doesn't scala provide TCO over mutually-recursive fns?
09:13rhickeyChouser: I think dangerous is too strong - there are plenty of valid uses of recursion that don't need to handle large data
09:13jdzok, that's good to know. i have been mislead by defining my functions with C-M-x...
09:14Chouserjdz: well, you do have to declare the var first: (def f1) (defn f2 [...] ...) (defn f1 [...] ...)
09:15Chouserrhickey: fair enough. have a more appropriate word at hand? :-)
09:15Chousermaybe "must be careful"
09:19Chousukedoes the SVN link on clojure.org work for anyone else? I get an error :/
09:20j-dotmindful?
09:20rhickeycemerick: 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
09:21Chousukehm
09:21Chousukeapparently all of sourceforge is having trouble.
09:21cemerickyeah, I know they go through all sorts of contortions internally to support local TCO, nevermind mutually recursive TCO.
09:21rhickeyChouser: I think it's best to say there's no TCO and leave it at that.
09:33j-dotrhickey: currently the docs at http://clojure.org/evaluation have this example, which doesn't work with SVN's HEAD:
09:33j-dot(eval (list + 1 2 3))
09:33j-dot-> 6
09:33j-dotshould that be: (eval (list '+ 1 2 3)) -> 6?
09:34danm__I think the first one is right
09:35danm__or (eval '(+ 1 2 3))
09:35danm__which should be equivalent
09:35jdzdanm__: the first and your version are not equivalent
09:35jdzin the first case the + is evaluated and its value put into the lit
09:36jdz*list
09:36danm__ahh, I see
09:36danm__they would be equivalent in CL though?
09:36danm__<-- new
09:36jdzdanm__: no, the difference is the same in CL
09:36danm__ok
09:37jdzdanm__: it's about evaluation rules and self-evaluating objects (like numbers)
09:37jdzi might have the terminology a bit wrong, though
09:38danm__right, ' is shorthand for quote, not list
09:47Zzompphello, I used the instructions in http://riddell.us/clojure/ , but ran into something like this: http://paste.lisp.org/display/63396/
09:51Zzomppany suggestions? :-)
09:52Lau_of_DKYoure trying to use 'progn' in a Clojure Repl ?
09:52hoeck_Zzompp: looks like slime is using the wrong init function
09:53duck1123I've seen that before
09:53duck1123it's very picky about the order you load the libs
09:54duck1123make sure you're require-ing swank-clojure-autoloads before slime
09:56hoeck_Zzompp: or for now try evaling in emacs-lisp mode (setq slime-lisp-implementations (list (list 'clojure (swank-clojure-cmd) :init 'swank-clojure-init)))
09:58Zzomppnow it complains the following: java.lang.Exception: No such var: swank/start-server
10:02hoeck_Zzompp: i have my requires in this order: slime, swank-clojure, swank-clojure-autoload
10:05Zzomppthanks, got it working
10:05Zzomppusing clojure from svn
10:07Zzomppby the way, any chance of using clojure as a scripting language? as in #!/usr/bin/env clojure etc.
10:07Zzompp(I just started to explore clojure)
10:07ChouserZzompp: there are a few .sh scripts kicking around that make that possible.
10:08Chouserand there's a impressive, if convoluted, trick on the wiki as well.
10:08Chouserso yes, but there's not yet a standard way to do it.
10:10Zzomppok
10:13abrooksZzompp: One thing to note is that the JVM and Clojure compiling / classloading overhead is significant.
10:15Chouser1.871s for clojure vs. 0m0.006s for perl on my machine.
10:15Zzomppright
10:16ZzomppI'm just starting to learn clojure, so far it seems interesting
10:16abrooksZzompp: 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:17Zzomppbasically a java daemon?
10:17abrooksI have a sketch of a design for a better scripting host for POSIX-y systems (with UDS support) but it's currently vaporware.
10:17abrooksZzompp: Yes.
10:46Lau_of_DKCould someone here enlighten me on the differences between inferior-lisp and superior-lisp ?
10:57ChouserLau_of_DK: apparently not.
10:57abrooksIsn't inferior-lisp for non-elisp?
10:58Lau_of_DKSwank is using inferior, Slime is on Superior
10:58Lau_of_DKBut I still dont know that that means
10:58abrooksChousuke: Right... that's what I seem to recall.
10:58Chousukeit's just a guess though :P
10:59Lau_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:59Lau_of_DKfrom #lisp
11:58cadsif a person were to learn only one lisp, is there any reason why that lisp should not be closure?
11:59cadsclojure, even!
11:59Chousukemaybe if you were paid to learn something other than clojure. :)
11:59H4nscads: maybe you are looking for a lisp that is described in a book or two
11:59cadsalways a good reason
12:00gnuvince_cads: most people learn only one Lisp in college, and that almost always happens to be Scheme (and then they promplty forget it.)
12:01gnuvince_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:01gnuvince_:)
12:02Chousukeheh
12:02Chousukethat'd teach them to use the java libraries, but with clojure.
12:03cadsH4ns: 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:03duck1123it would be interesting to see how well someone does learning Clojure as their first programming language
12:03H4nscads: yes - i think, for someone who is completely new to programming, a good textbook is essential
12:04H4nscads: (unless there is a teacher who has enough time to actually teach the person)
12:04gnuvince_duck1123: I think it could work; I believe that one of the important things a first language should have is practicality.
12:05gnuvince_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:12Lau_of_DKBoys, 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:12Lau_of_DK(defun open-and-run-lisp (file)
12:12Lau_of_DK "This function open a file at TOP window, and execute `run-lisp' at LOWER window."
12:12Lau_of_DK (interactive "FFile: ")
12:12Lau_of_DK (delete-other-windows)
12:12Lau_of_DK (find-file file)
12:12Lau_of_DK (split-window-vertically 50)
12:12Lau_of_DK (other-window 1)
12:12Lau_of_DK (with-current-buffer (current-buffer)
12:12Lau_of_DK (call-interactively 'run-lisp)))
12:13cadsH4ns, 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:14H4nscads: 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:15wwmorgancads: SICP is really good. It's Scheme though
12:15H4nscads: for an absolute beginner, maybe using something like http://www.cs.cmu.edu/~dst/LispBook/ might be better
12:17cadsthose both seem like great resources, thanks
12:18cadsand halloway's writing a full blown clojure book!
12:21tayssirWith 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:26tayssir(That said, I wasn't a big fan of SICP and Scheme, for some reason...)
12:31gnuvince_Should re-pattern be able to take two arguments like Pattern.compile(String, int)?
12:32ChouserI wonder if the Pattern literal should take flags, but I'm not sure what the syntax would be.
12:32Chousergnuvince_: you can use (Pattern/compile ...) for now.
12:32gnuvince_I wouldn't have it for pattern literals
12:38AWizzArdIs there something like undef or unintern in CLJ?
12:40wwmorganAWizzArd: (doc ns-unmap)
12:43AWizzArdwwmorgan: thx
12:45AWizzArdIs there a variable that automatically gets bound to the last result? Like *, ** and *** in CL. Or like +, ++, ++ or /, //, ///
12:50wwmorganAWizzArd: *1, *2, and *3
12:51H4nsdo *1, *2, *3 work in slime now?
12:51Chouservery simple visual explorer for clojure data structures: http://blog.n01se.net/?p=30
12:52H4nsChouser: very cute!
12:53Chousukecool
12:53AWizzArdH4ns: for me they do work in Slime
12:54H4nsAWizzArd: ok, time to update, thanks.
12:54abrooksChouser: Nice!
12:56H4nsChouser: the img tag in your blog seems to have wrong width/height specs, though
12:58abrooksChouser: Yes, the image is being scrunched.
12:58Chouseryeah. The template fixes the width slightly smaller than the shot's actual size.
13:02AWizzArdHow can I convert strings containing a number to a number? (parse-integer "14") ==> 14
13:03wwmorganAWizzArd: arbitrary precision? integers?
13:04abrooks(. Integer (parseInt "14"))
13:05abrooks(.parseInt Integer "14")
13:05abrooksEither should work.
13:05wwmorganalso (Integer. "14")
13:05Chousuke(Integer/valueOf "14")
13:05Chousukelots of options :p
13:05abrooksHeh.
13:06H4nsso there is no clojure way to do that, one uses java calls instead.
13:06Chousukewell, the java calls are the clojure way
13:07H4nsChousuke: that was what i wanted to say :)
13:07AWizzArdI already supposed that and tried stuff like (.toInteger String "25")
13:08AWizzArd(as there was nothing in the boot.clj that seemed to do the job)
13:09wwmorganhttp://look.fo/java-integer-from-string
13:10Chousukethe java API doc is your friend as much as the clojure doc is.
13:11AWizzArdI moved to another city and had no internet in the past days
13:11Chousukeif there's something "basic" that clojure seems to lack it's likely because it's already provided by the Java class library.
13:12leafwhow does one expose the inspector namespace? (all-ns) doesn't list it
13:12leafw... but it lists set, zip and xml
13:14wwmorganleafw: (use '(clojure inspector))
13:14rhickeyleafw it's not loaded by default, since it's Swing
13:14leafwI see, would break in non-X11 forwarding environments, right
13:21ChouserI've been surprised to discover clojure.inspector in the past -- I wonder why I keep forgetting about it.
13:28gnuvince_Is there a way to give a docstring to a multimethod?
13:33leafwChouser: would be great if the inspector was coupled with java beans, listing for each object its accessible get properties
13:34leafwat the moment, it would just list vector, vector, vector ... for a beans dict.
13:35Chouserwhen I first started thinking about this yesterday, I thought I would call mine gprint, and use a multimethod like prn does now.
13:35Chouserthat might allow you to drop in new behavior.
13:39Chousukegnuvince_: (defmulti #^{:doc "This is the docstring"} foo :bar) but that's not perfect :/
13:42gnuvince_yucky :-/
13:42gnuvince_Here's another question: if I have a .jar file, can I use the classes inside it?
13:42Chouseryes, you can.
13:43Chousukehmmh
13:43gnuvince_:)
13:43Chouserok, fine, I
13:43ChouserI'll just tell you...
13:43gnuvince_Wait
13:44gnuvince_I'll try to see if it's on the website.
13:44Chouser:-)
13:44gnuvince_Don't want to appear to be a documentation non-reader ;)
13:45Chousukedocumenting multimethods could be useful but doc doesn't seem to handle them very well. it expects the :arglists metadata :/
13:46AWizzArdgnuvince: you could maybe try to manually attach metadata to a multimethod
13:46gnuvince_I was just wondering if there was a nice syntax like with functions
13:47AWizzArdnot yet
13:49AWizzArdLook 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:49gnuvince_Yeah, I saw.
13:49gnuvince_Chousuke: ok, I'll ask: can I just put the .jar in my CLASSPATH?
13:51Chousukeyou probably meant Chouser.
13:51Chousergnuvince_: yep
13:51gnuvince_yay
13:51Chousukebut now I'm a bit confused
13:51gnuvince_Chousuke: I did.
13:51gnuvince_Too many people in here with similar nicknames
13:51gnuvince_drewc and drewr, Chousuke and Chouser
13:52AWizzArdyeah, 4
13:52duck1123it won't pick up the presence of a new jar while it's running though, will it?
13:52Chouserduck1123: you can try using add-classpath to get that behavior
13:54lisppaste8Chousuke pasted "why doesn't meta return anything?" at http://paste.lisp.org/display/69406
13:57ChouserChousuke: (meta (var foo))
13:57wwmorganChousuke: alternatively ^#'foo
13:58Chousukeah
13:58ChouserWhen you def something, there are actually 2 or 3 objects involved.
13:59Chouserfoo, (var foo), and in a way 'foo
13:59Chousukehmm
14:00Chouserthat is: the value you're assigning, the var you're assigning it to, and the symbol which is the name of the var
14:00Chousukeright.
14:03Chousukeso I can actually attach metadata to "nothing"
14:03Chousukewith (def #^{whatever} x), correct?
14:03Chouserno, but you can attach metadata to a var that is unbound or bound to nil
14:04Chouseryeah, your example is fine.
14:04Chouser(def #^{:is "var"} foo #^{:is "val"} ["value"])
14:09AWizzArdbtw, why does it make sense to have unbound vars vs vars bound to nil?
14:09AWizzArdI mean, nil stands for nothing...
14:09Chouserevaluating an unbound var is an exception instead of just returning nil
14:10AWizzArdyes
14:13Chousukeis there way to test if a var is bound? without try/catch
14:13Chouser(.isBound (var x))
14:22Drakesonhow can I write this in clojure: import org.gnome.gtk.Gtk; ... Gtk.init(args); ?
14:23Drakeson(. org.gnome.gtk.Gtk init args) ?
14:23Chouser(import '(org.gnome.gtk Gtl)) (Gtk/init args)
14:24Drakesonthanks.
14:30DrakesonI 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:31sohailDrakeson, either that or -Djava.library.path=/usr/lib/jni
14:32waltersi think the JDK should do that by default
14:32waltersbut I can't speak for Debian
14:33DrakesonDebian usually tries to integrate stuff, so this feels so un-Debianish.
14:33Drakesonthat's why I feel I am missing the correct way
14:33waltersare you using openjdk/icedtea?
14:34Drakesonno, what is that? I am using sun-java6-*
14:34waltersoh you're using java-gnome?
14:34Drakesonwalters: libjava-gnome-java
14:34waltersi think their stuff was buggy in this respect though I saw something in the most recent upstream release about fixing it
14:36Drakesonwalters: 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:36waltersprobably the main pain for using JGIR is that someone will have to package JNA for Debian, last I checked it wasn' tin
14:36walters*wasn't in
14:37waltershttps://jna.dev.java.net/
14:38walters"ctypes for the JVM" if you know Python
14:38Drakesonoh, I see.
14:39Drakesonwhat is the anonymous user/pass for svn checkout https://jna.dev.java.net/svn/jna/trunk jna ?
14:40waltersDrakeson: looks like it's "guest" with no password
14:40waltersDrakeson: https://jna.dev.java.net/servlets/ProjectSource
14:41waltersdev.java.net isn't really a great hosting site
14:44Drakesonyou have so many dependencies :p
14:45waltersyeah, 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:45Drakesonwalters: what do you use yourself? is it debian/... ?
14:46waltersi use fedora; I work for Red Hat now, though long ago I was part of the Debian/GNOME team
14:47blackdogjgir good alternative to mono by the looks of it
14:47blackdogmono/gtk
14:47Drakesonyeah, that's what I think
14:48blackdogin the same space anyway - given that walters works for redhat :P
14:49walterswe'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:49blackdogyep
14:49Drakesonwhen 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:51waltersdidn't openjdk get in main?
14:52ChousukeI thought it did
14:53Drakesonoh, sorry, I didn't know openjdk is *the* open sourced sun-java.
14:54walterswell...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:15vyIs Jeffrey Chu in here?
16:19duck1123What would I need to do if I'm getting an InvocationTargetException when trying to create a new instance of a class?
16:21Chouseryou might look at the full stack trace to see if there's a more helpful message farther down.
16:26duck1123I ran this from the REPL, so the rest of the trace just involves clojure.lang.Compiler
16:27duck1123 0: clojure.lang.Compiler$DefExpr.eval(Compiler.java:300)
16:27duck1123 1: clojure.lang.Compiler.eval(Compiler.java:4113)
16:27duck1123 2: clojure.eval__791.invoke(boot.clj:1443)
16:27duck1123
16:32ChouserNot sure. I guess I'd check all the args to the constructor. Can you paste your code?
16:32duck1123the constructor doesn't take any args
16:34duck1123(import '(org.openid4java.consumer ConsumerManager)) (def manager (new ConsumerManager))
17:06Zzompphow do I loop forever reading one line at a time from standard input?
17:06Zzompp(read *in*) seems to read one line at a time, how do I keep doing that forever?
17:07Chouserread is for converting text files to s-expression objects
17:08Chouserso it reads as many lines as needed to get a complete s-expression.
17:08Zzomppwhat 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:09Chousertake a look at (doc line-seq)
17:09Zzomppthanks, I'll check that
17:10Zzomppbut I'm still wondering about that looping bit, this would be a sort of redirector used by squid
17:11Zzomppso it has to read one line at a time, match regexp, print line, and keep doing that forever
17:13ChouserIf you give line-seq an infinite stream of lines, it will return an infinite (lazy) sequence of those lines.
17:14Chouserso then you can just iterate through that seq, such as with doseq
17:14Chouser(doseq line (line-seq ...) (if (re-find #"foo" line) (println "found") (println "not found)))
17:15Zzomppthanks, I'll try that
17:19gnuvince_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:23Lau_of_DKgnuvince, 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:25Lau_of_DKGuys, 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:26gnuvince_Lau_of_DK: ok. I'll probably run it by the guys here to proof read.
17:26Lau_of_DKAlright - Let me know if you need any help
17:26kotarakLau_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:27Lau_of_DKjavac ?
17:28kotarakjava compiler
17:28Lau_of_DKoh, so clojure consumes .class files in the loadpath ? cool
17:39duck1123Clojure can never get enough press
17:46sohailclojure needs a killer app
17:46sohailbittorrent?
17:46sohail:-)
17:47sohailplease don't make it web apps
17:47sohailI'll quit right now
17:47Lau_of_DKClojure needs Qt
17:47Lau_of_DKThats it, then everything would blow big
17:47AWizzArdwhat for?
17:48AWizzArdare the Java guis not so good?
17:48Lau_of_DKIf 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:48Lau_of_DKJava is OK but Qt is a whole different story
17:48kotarakLau_of_DK, you sure are a Qt fan.
17:48Lau_of_DKkotarak, no doubt about it
17:49sohailwhat's wrong with Swing vs Qt?
17:49wwmorganclojure has qt integration with jambi right?
17:49kotarakLau_of_DK, but it would only work, where the JVM exists. So portability is limited by JVM.
17:49Lau_of_DKYes, sort of
17:49Lau_of_DKwwmorgan, I dont quite have all the details worked out yet
17:51sohailLau_of_DK, what do you like about qt that you don't like about swing?
17:52Lau_of_DKsohail, 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:53sohailthose are all true statements
17:53wwmorganwhat are the best applications built on top of Qt?
17:53Lau_of_DKGoogle earth? Vlc?
17:53sohailwell, I guess Amarok counts
17:53Lau_of_DKThere are too many to mention... and still, they all mentioned them on trolltechs website :)
17:54sohailLau_of_DK, ever used thinlet?
17:54Lau_of_DKNever heard of it
17:55sohailya me either
17:55sohailtill today
17:55Lau_of_DKWorth looking into ?
17:55sohaildunno, that's why I asked
17:55sohailit's no Qt
17:55sohailbut you don't always need all those goodies
17:56duck1123do I need to do anything special to create an instance of a class with a constructor that doesn't take any parameters?
17:56Lau_of_DKNo 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:56duck1123I keep getting an exception when I try
17:56wwmorganduck1123: are you still getting the InvocationTargetException?
17:57duck1123yeah, but I can access static methods just fine
17:57wwmorganis the exception getting raised in the constructor?
17:58sohailLau_of_DK, until very recently, I did not appreciate the Qt designer. It is really very good
17:58duck1123hmm... when I try to do the constructor alone, I'm getting a different error
17:59duck1123let me see if I can take care of this error, then I'm sure the other will go away
17:59Lau_of_DKIts excellent, but reading a tutorial on it helps alot, alot of subtle qualities to it
18:05Lau_of_DKWelcome back cgrand
18:15AWizzArdLau_of_DK: does Java not offer easy access to Multimedia, Webkit and so on?
18:15Lau_of_DKNot to my knowledge
18:16Lau_of_DKhttp://trolltech.com/products/appdev <-- At the bottom of this page, there are for videos, I recommend at least watching "New features"
18:16AWizzArdAnd btw, what tools honestly need a gui that can't also run in a web browser?
18:16AWizzArdAt least for myself I see basically not much need for non-in-browser GUIs.
18:17Lau_of_DKNot the best platform for decision making
18:17AWizzArdIt makes mostly sense for applications that process at lot of data, like image manipulation (Photoshop) or video cut (After Effects, ...)
18:19AWizzArdBut 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:21AWizzArdGoogle already offers email, navigation and other tools. They are currently working on Word and Excel: http://docs.google.com/
18:23AWizzArdI think that over time more and more applications will go online, and not use Swing or Qt.
18:25Lau_of_DKAWizzArd, 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:25Lau_of_DKYes I understood that you think so :)
18:28AWizzArdRight, 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:30AWizzArdMaybe you could deliver the "killer app" for Clojure by making something like Qt, but for the webbrowser :-)
18:31Lau_of_DKI dislike Webapps, so I dont think I'll be the first to do it :)
18:32AWizzArdIt's just the gui... the real software is on what we should concentrate
18:33Lau_of_DKThat attitude has held Linux back for years while Mac accelerated
18:34AWizzArdWell, I very much like good looking stuff. The website of clojure looks fresh and clean, I like it.
18:34AWizzArdfor common lisp I see guis with style from the early 90ies
18:34AWizzArdso yes, I agree
18:35AWizzArdI just say that I personally like to do programming, solve problems and such, and not represent my data to people.
18:37Lau_of_DKI view the whole thing as one task with many sub-tasks, GUI, design, being just a few
18:38AWizzArdthis 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:39AWizzArdI 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:41Lau_of_DKI gotta jet - Good evening/night to all
19:09ChouserAWizzArd: you use emacs, right? would you prefer a similar features set in a web app for your programming editor?
19:09AWizzArdYes
19:09AWizzArdin principle everything that I do in emacs could be done in the browser as well.
19:09Chouserwould you want to run the server part locally, or have it hosted?
19:09AWizzArdin the future it will be hosted
19:10gnuvince_How does one get invited to Google Tech Talks?
19:10ChouserAWizzArd: You never need to work without interet access?
19:10Chousergnuvince_: brilliant!
19:10gnuvince_We need to get Rich there :)
19:11AWizzArdChouser: right, for me personally it is not a requirement to program while I have no internet access.
19:11gnuvince_Steve Yegge would go nuts
19:11gnuvince_A Lisp that talks to Java
19:11gnuvince_Natively
19:11gnuvince_He would immediately say that it's what he meant when he said NBL ;)
19:37sohailkeep yegge away from clojure!
19:44AWizzArd;-)
19:47gnuvince_sohail: ;)
19:48AWizzArdIs 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:48gnuvince_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:48sohailgnuvince_, ah, good. By then Arc will have taken over
19:49gnuvince_haha :)
20:38duck1123has anyone used any endorsed jars with Clojure?
20:39duck1123I'm trying to use a library that has a dependence on Xalan
20:44duck1123nvm. I got it working
21:15AWizzArduh: (format "%s" ()) ==> "clojure.lang.PersistentList$EmptyList@1a183d2" instead of "()"
21:18Chouserheh
21:19Chouser(format "%s" (pr-str ()))
21:42AWizzArdn8
22:01gnuvince_Damn...
22:01gnuvince_1800 words :-/
22:01gnuvince_That's quite a lot for a blog post, isn't it?
22:10ChouserIs there some kind of official style guide for blog posts that I've never heard of?
22:10gnuvince_Not that I know of, but beyond a certain length, a lot of people just say "tl;dr"
22:10gnuvince_Chouser: would you mind reviewing the blog post?
22:11Chouser:-) sure.
22:12gnuvince_I'm going to bed, so you can send comments by email at vfoley@gmail.com
22:12Chouserok
22:13gnuvince_I'm interested in pretty much anything
22:13gnuvince_http://fornost.homeip.net:81/vince/clojure-comics1.html
22:13gnuvince_If some parts have a weird "not-quite-English" tone, let me know.
22:13gnuvince_Thanks a lot, good night!
22:14Chouserg'night
22:15abrooksgnuvince_: I'm taking a look at it too.
22:16abrooksgnuvince_: It looks pretty good so far. Just one note: The regex format is changing eliminating the double escape ("\\d").
22:16abrooksThis 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_sohail_hrm... how can I convince clojure to let me create a String[][] from [["foo"]["bar"]]
23:41_sohail_to-array* just gives me an array of Object
23:47Chouserproxy will re-use a class it created earlier if the list of base classes is the same.
23:51_sohail_thanks Chouser
23:51_sohail_any idea about [["foo"]["bar"]] -> String[][] or do I have to do it manually?
23:52ChouserI'm not sure.
23:53ChouserHow about an array of vectors? (into-array [["foo"]["bar"]])
23:53Chouser;-)
23:54Chouser(into-array (map into-array [["foo"]["bar"]]))
23:54ChouserI think that might do it.
23:55_sohail_whoa
23:57_sohail_Chouser, I'll have to read that a bit...
23:58Chouser(map into-array [["foo"]["bar"]]) -> seq of String[]
23:59Chouserpass 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:59ChouserI think. My understanding of Java array types is patchy.
23:59_sohail_thanks :-)