#clojure log - Dec 08 2008

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

0:19 Kerris7: finished red black tree

0:20 oops wrong channel

3:04 Lau_of_DK: Good morning gents

3:22 hiredman: show

3:22 er

3:22 clojurebot: show

3:22 clojurebot: show is http://groups.google.com/group/clojure/msg/96ed91f823305f02

3:39 AWizzArd: When I have a (def x (new javax.swing.JFrame)) object visible as a window, close it and do (def x nil), will this object then get gc'ed sooner or later? Or does Java somehow keep track of those guys and they live long?

3:41 hiredman: gui stuff is weird, because whatever windowing system also can have a ref

3:41 (I don't know)

3:47 AWizzArd: hiredman: why don't you sleep? ;-)

3:47 arbscht: we didn't hire him to sleep!

3:47 AWizzArd: weren't we just talking about find-factors and how fast it runs on our systems?

3:48 (or: "how slow it runs when it is the Clojure version" *g*)

3:52 hiredman: eh?

3:52 I slept, then someone called me (the bastards), so now I am awake

3:55 AWizzArd: Okay, so like me you got only a few moments of sleep.

3:56 hiredman: it was a few hours I think

3:56 AWizzArd: 4-5

3:56 hoeck: hi all, for the germans here: has anyone tried a clojure version for http://blog.fefe.de/?ts=b7c295e7 ?

3:57 hiredman: neo4j sounds cute, maybe clojurebot can use it

3:59 clojurebot: neo4j is http://github.com/JulianMorrison/neo4j-clojure/tree/master

3:59 clojurebot: Ack. Ack.

4:29 hiredman: svn rev 1145

4:31 svn rev 1145

4:31 clojurebot: svn rev 1145; made RT.DEFAULT_COMPARATOR use Util.compare

4:31 hiredman: clojurebot: botsnack

4:31 clojurebot: thanks; that was delicious. (nom nom nom)

6:41 AWizzArd: Is there something in Java/Clojure for variably adding data to an url? Like (make-url ip port data), for example: (make-url "localhost" 8080 {:name "David" :lang "Clojure" :age 24}) ==> "http://localhost:8080/?name=David&lang=Clojure&age=24"

6:49 hmm, probably java.net.URI comes closest

6:49 Hi black

6:49 blackdog: hi AWizzArd how's rife?

6:53 AWizzArd: I didn't continue yet. My next step is to write a report tonight and post it to the Rife mailing list, so that the author of Rife can reproduce my problem.

6:53 It will probably need some .java code in Rife to make Clojure accessible.

6:54 blackdog: yuck :)

6:56 AWizzArd: What is this # sign in (.toString (new java.net.URI "http" "foo.com" "/hello world/" "name=blackdog"))?

6:56 ==> "http://foo.com/hello%20world/#name=blackdog"

6:56 blackdog: an html anchor?

6:58 AWizzArd: ok, probably right

7:04 blackdog: I am not interested in these fragment parts of an URI. Unfortunately both constructors that allow me to specify a query also take a fragment string. How can I get rid of that # in the uri?

7:07 blackdog: why don't you just pass a sinlge string

7:07 there is a constructor for that

7:08 AWizzArd: because I want to let java correctly encode my variable data. I don't know how many vars I want to put into the url. Sometimes it is just name=blackdog, but sometimes also age=29 and lang="a b c"

7:10 (.create java.net.URI "http://foo.com/path?var=some spaces") ==> IllegalArgumentException

7:12 But the URI class can do this correctly for me, and I can call (.toASCIIString on-it) and get the correctly encoded result, even for unicode chars in my data.

7:14 blackdog: I use org.apache.commons.httpClient.util.URIUtil.encodeAll

7:14 there must be something similar in the jdk but i was using that anyway

8:14 gnuvince: morning

8:14 AWizzArd: Hi Vince

8:16 Is there something like CLs equalp or string-equal for strings? (string-equal "clojure" "CLoJure") ==> true

8:18 duck1123: AWizzArd: have you been doing any gen-class yet?

8:20 AWizzArd: yes

8:20 duck1123: I see you said something about needing to write Java code. I was wondering if you tried just using gen-class and discarded that approach.

8:21 AWizzArd: duck1123: the web development framework Rife (for Java) can read .class or .java files. I wanted to make it work with Clojure. As a first step I hoped that .class files, compiled by Clojure would be accepted. But that wasn't the case.

8:22 duck1123: I'm still having a hell of a time getting gen-class to produce a class file that can be read by Tomcat

8:22 AWizzArd: For me it is a .class file for Jetty (+ Rife)

8:22 doesn't work for me right now

8:23 Although I don't know if it is Jetty or Rife that can't handle Clojures .class files.

8:23 duck1123: AWizzArd: looks like we may be getting hit by the same problem. (whatever that may be)

8:23 AWizzArd: maybe

8:24 duck1123: have you tried running your class through javap?

8:24 AWizzArd: blackdog was able to make Jetty run with .clj files, by starting Jetty from Clojure, instead of going the other way, as I do.

8:24 No, never heared of javap

8:24 duck1123: That's how Compojure works

8:24 javap is the java classfile decompiler

8:24 you give it the name of your classfile, and it spits out the method signatures

8:25 AWizzArd: Compojure works by making use of javap or by starting Jetty/Tomcat from Clojure?

8:25 duck1123: Compojure starts jetty within clojure

8:25 and makes use of proxy to generate the classes

8:26 AWizzArd: duck1123: can you try to make your example run in Jetty instead of Tomcat? Do you still get the same error message(s) then?

8:26 I remember that I got some error that said that my HelloWorld class can't be instantiated

8:27 duck1123: I was just thinking about giving that a try. My application is not giving me an error. (which is frustrating) it's just refusing to load and gives a 404

8:28 AWizzArd: Rife tells me about some error messages at least, which I will soon send to Rifes mailing list. Maybe the author knows more about what to do.

8:28 duck1123: AWizzArd: the reason I mentioned javap is because I'm getting a method signature of "public static {};" which looks really weird.

8:29 AWizzArd: Did you ask rhickey about that?

8:30 duck1123: no, he wasn't around when I discovered it yesterday. When I see him, I'll make sure to ask

8:31 it's odd, because all of the other signatures are of the form: public java.lang.String toString();

8:34 AWizzArd: Possible that we have the same challenge right now.

8:35 I just have not much time to look into this for some time *sigh*

8:36 rhickey: duck1123: isn't that just a static initializer?

8:37 duck1123: rhickey: yeah, looking at the decompiled code, it looks like it interns all the vars

8:38 I've just never seen anything like that before, and it was the only thing that stood out for me as being out of place

9:26 Chousuke: AWizzArd: you asked about string comparison earlier: java strings have the .equalsIgnoreCase method.

9:30 AWizzArd: thx Chou

9:33 Chousuke: It's worth looking through the java docs for types such as maps, strings and numbers. the java api provides a lot of functionality that isn't mentioned in the clojure docs.

9:34 duck1123: AWizzArd: Jetty is giving me an error. (which is actually a positive thing) Looks like I have an IllegalArgumentException

9:35 AWizzArd: You are getting closer!

9:36 Chous: yes thanks, I will look at this more often. I was not used to the javadocs so far, but instead I used http://www.lispworks.com/documentation/HyperSpec/Front/index.htm :-)

9:37 How can I remove the first occurence of a char in a string efficiently?

9:38 Chousuke: strings are immutable, so that would most likely involve copying the string in any case.

9:38 AWizzArd: right

9:39 I just would like to do it in one run, and not traverse it several times

9:39 duck1123: (apply str (rest (seq "Hello"))) perhaps?

9:40 walters: AWizzArd: i wouldn't worry about those kinds of things unless it's an actual bottleneck in your app

9:40 Chousuke: if you want to remove just the first character the substring method is probably the best.

9:42 It seems StringBuffer is what you want.

9:42 it has a delete method.

9:43 blackdog: ii think stringBuilder is meant to be faster than StringBuffer

9:44 Chousuke: StringBuilder isn't thread-safe though. 

9:45 blackdog: slurp and str use stringbuilder

9:45 Chousuke: well, they don't use the instance across multiple threads I suppose

9:46 blackdog: depends on AWizzArd usage I guess

9:46 Chousuke: but other than the thread-safety difference, sbuilder and sbuffer are identical, so pick whichever works

10:00 rhickey: don't use StringBuffer anymore

10:03 duck1123: interesting... I have a Hello World in jetty

10:05 Chouser: duck1123: still no love fromtomcat?

10:05 duck1123: I don't know yet. I need to move my code back home and try

10:06 Chouser: oh, ok.

10:08 duck1123: but it works on jetty 6.1.14 on Ubuntu... That's farther than I've gotten before

10:09 AWizzArd: Why no StringBuffers? Will they be deprecated?

10:10 rhickey: StringBuilder is proof that StringBuffer is wrong

10:14 duck1123: Chouser: still no love from Tomcat :(

10:14 rhickey: duck1123: what happens?

10:15 duck1123: rhickey: I'm getting a 404 when I try to load the app

10:16 No errors that I can see. I can load static content, and manager shows the app as being loaded

10:17 rhickey: duck1123: that could be anything

10:17 is this a simple hello world or a more involved thing?

10:17 AWizzArd: What is the function called that makes (? :a :b :c 10 20 30) ==> {:a 10 :b 20 :c 30}?

10:18 i have used it yesterday but can't remember its name

10:19 Chouser: (doc zipmap)

10:19 clojurebot: Returns a map with the keys mapped to the corresponding vals.; arglists ([keys vals])

10:20 AWizzArd: thanks Chous

10:20 lisppaste8: duck1123 annotated #71768 with "latest attempt at getting Tomcat to work" at http://paste.lisp.org/display/71768#2

10:39 RSchulz: Is there something special about function names that begin with a hyphen? Or is it just a naming convention of some sort?

10:40 duck1123: that's how genclass identifies the functions

10:40 the default prefix is "-"

10:40 RSchulz: What is the difference between those with and those without the hyphen?

10:43 duck1123: I think gen-class only looks for implementations of the for (str prefix methodname) other functions are just normal functions

10:43 rhickey: RSchulz: when you gen some class Foo, with a method bar, and say the implementing ns is my.baz, then the Foo stub will look for my.baz/-bar at runtime when bar is called. If you define it, it will get called. You can still define anything else you want in my.baz. You can pick any prefix you want with :prefix

10:44 RSchulz: So the prefixed functions become public methods in the generated class? Is that it?

10:45 It establishes the connection between Clojure functions and generated class methods?

10:45 duck1123: if it's an override of the base class, or specified in :methods

10:45 RSchulz: The first time I saw it, I thought it signified static methods, 'cause it was a "main" that had it.

10:45 duck1123: check out http://clojure.org/api#toc247

10:46 RSchulz: And then I guessed it meant private (as in (defn- ...))

10:46 rhickey: http://clojure.org/api#gen-class works too

10:46 RSchulz: I did read that, but I didn't grok it.

10:46 rhickey: RSchulz: well, there is a hint of that interpretation - the prefix is used to prevent collisions

10:47 RSchulz: What happened to the distinction between generating and writing a class file? Didn't there use to be two differen gen-...-class functions?

10:48 rhickey: but nothing you write in the implementation shapes the stub, the gen-class drives everything

10:48 RSchulz: gen-and-load-class engendered bad behavior and false expectations

10:48 cemerick: rhickey: I noticed that the Reflector requires that all fields/methods it invokes are public. That caught me by surprise when I was trying to invoke a method on an instance of a package-private class from a clojure impl of a genclass in the same package. It'd be nice if the invocation context were threaded through the reflector usage.

10:50 rhickey: cemerick: this is a reflection limitation - there is no threading of context through reflection

10:51 cemerick: rhickey: you mean just of the clojure impl, right? I seem to vaguely remember using reflection to forcefully invoke a private method on an object many years ago...

10:52 rhickey: cemerick: you can't with default privileges call anything other than public members via reflection

10:55 cemerick: ah, I forgot about ReflectPermission

10:56 drewolson: hey all, i'm trying to read an rss feed from my internal cruisecontrol box, any idea why i'm getting nothing from this: http://gist.github.com/33497

10:56 it just hangs

10:56 and i can curl the url just fine

10:57 cemerick: rhickey: isn't that only relevant if the jvm was configured to use a security manager?

10:59 danlarkin: drewolson: works for me with http://www.reddit.com/.rss

10:59 drewolson: danlarkin: hrm, strange...maybe java is being funky with respect to the proxy

10:59 although it's an internal site

10:59 and i don't have my http_proxy env var set

11:00 duck1123: authentication, maybe?

11:00 drewolson: duck1123: naw, i can hit it from ruby just fine

11:00 using open-uri

11:03 AWizzArd: Is there something similar to doseq, but which stops as soon one of the sequences is traversed (like map). (doseq [x (range 5) y (repeat 0)] (println x y)) <-- this should print 5 lines

11:05 Chouser: AWizzArd: you could add ':while x', though I guess that's not exactly the same thing.

11:05 rhickey: cemerick: I'm really not interested in going there

11:06 Chouser: oh, wait, that doesn't even make sense.

11:06 AWizzArd: Chouser: I think this won't help, as x will begin to cycle from the beginning.

11:06 Chouser: y is an inner loop -- goes forever.

11:06 AWizzArd: yes

11:07 Chouser: so what do you want again? When should y stop?

11:07 or do you want x and y traversed in parrallel, instead of nested?

11:07 cemerick: rhickey: fair enough. I might submit some patches to make the associated error msgs more descriptive, then.

11:07 AWizzArd: yes, like (map vector (range 10) (repeat 4)), but for doing side effects

11:07 (such as appending to a StringBuilder)

11:08 Maybe there exists already some function to do that.

11:08 Chouser: AWizzArd: currently I think the only thing that takes seqs in parallel like that is 'map' (or I guess zipmap)

11:09 AWizzArd: so: (doseq [[x y] (map list (range 5) (repeat 0))] ...)

11:10 AWizzArd: sure, I can work around it, just thought there could be something like (domap ...)

11:36 hiredman: clojurebot: latest?

11:36 clojurebot: latest is 1147

11:36 hiredman: svn rev 1147

11:37 clojurebot: svn rev 1147; added unchecked-remainder

11:42 AWizzArd: Oh, that is cool stuff!

11:43 Chouser: do you know who added the unchecked-remainder?

11:45 duck1123: I wonder why the github mirror is falling behind. It used to be really good, but it says the latest is 1146

11:46 hiredman: AWizzArd: I think it was rhickey, he was in last night with his own factor using all the unchecked stuffs

11:51 danlarkin: interesting talk: http://www.infoq.com/presentations/click-fast-bytecodes-funny-languages

11:54 Chouser: For the record, only Rich can add anything to clojure svn, and I wouldn't expect that to change anytime soon.

11:55 If what he adds is entirely or mainly from a patch submitted to the google group, he's careful to give credit in the checking comment. No attribution generally means it all his.

13:16 clojurebot: svn rev 1147; added unchecked-remainder

13:16 svn rev 1147; added unchecked-remainder

13:17 svn rev 1147; added unchecked-remainder

13:17 svn rev 1147; added unchecked-remainder

13:18 svn rev 1147; added unchecked-remainder

13:19 svn rev 1147; added unchecked-remainder

13:19 rhickey: clojurebot: stop

13:20 clojurebot: excusez-moi

13:20 svn rev 1147; added unchecked-remainder

13:20 abrooks: rhickey: /kick clojurebot

13:20 clojurebot: svn rev 1147; added unchecked-remainder

13:20 gnuvince: wth?

13:21 clojurebot: svn rev 1147; added unchecked-remainder

13:21 duck1123: clojurebot: klaatu barada nikto

13:21 clojurebot: I don't understand.

13:21 svn rev 1147; added unchecked-remainder

13:22 duck1123: clojurebot: latest?

13:22 clojurebot: latest is 1147

13:22 abrooks: rhickey: Which brings up something I've been meaning to mention in the Google group but want to know how you feel about it: Branching off a #clojure-dev for developers and quiet lurkers, having #clojure as a place for general user questions and runaway bots?

13:22 hiredman: oh

13:22 rhickey: so sorry

13:22 rhickey: hiredman: no problem

13:23 hiredman: I was messing with it and wonder why it wasn't responding to me in my privmsg window

13:24 rhickey: abrooks: clojure-dev would be for contributors?

13:25 abrooks: rhickey: That's the general idea - contributors and people interested in quietly watching the contribution process. Other opensource projects are set up with a #foo and #foo-dev channel scheme.

13:26 rhickey: abrooks: fine by me - you want to set it up?

13:26 abrooks: rhickey: The tradeoff is that developers (contributors) sometimes withdraw to the #foo-dev channel by habit and won't pay as much attention to #foo. It's desirable that they still be in both but have a high signal-to-noise ratio in #foo-dev when the want to communicate together but still get stuff done.

13:26 rhickey: Who set up #clojure?

13:26 * rhickey never used irc before someone set up #clojure

13:27 gnuvince: jcowan

13:27 abrooks: rhickey: Ah. It would probably be good to make you and tomhickey (and perhaps some others) operators so you can kick/ban runaway bots and users if the need emerges.

13:28 Lau_of_DK: Evening gents

13:28 Gentlemen, wonderful news: Emacs 23 is stable!! :)~~~

13:29 gnuvince: Lau_of_DK: post it to reddit!

13:29 abrooks: Chouser: Do you still have reservations about starting a #clojure-dev at this point?

13:32 danlarkin: abrooks: is there reason enough? Does this channel get too chatty for discussion of clojure development?

13:33 duck1123: is this channel really that busy that it needs to be split in two? I could see that more with the mailing list, but not so much here.

13:35 * danlarkin agrees with duck1123

13:35 blackdog: i don't think it's busy enough

13:35 Lau_of_DK: I will say though, that Im having a hard time keeping up with the mailing list

13:39 jvoorhis: hello

13:39 Lau_of_DK: hello jvoorhis

13:40 jvoorhis: i've just started liking clojure, and wondered what the story is with java generics

13:41 how does one go about instantiating a generic collection, for example http://java.sun.com/j2se/1.5.0/docs/api/java/util/PriorityQueue.html

13:42 drewr: jvoorhis: In Clojure you would do well to use j.u.concurrent. http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/LinkedBlockingQueue.html

13:42 abrooks: danlarkin, duck1123: Perhaps not. I intend to raise this question in the Google group to get wider feedback. I think it's getting chattier all the time. The real question is: Do rhickey and the contributors feel that it's a distraction.

13:43 rhickey: jvoorhis: just leave off the generic part: (java.util.PriorityQueue.)

13:43 jvoorhis: drewr, rhickey: thanks, that's helpful

13:43 rhickey: abrooks: I would appreciate it if people stayed on topic, when they do it's fine

13:44 If we create a culture of that, we'll all be better off

13:44 drewr: Anybody watch any football yesterday?

13:44 * drewr kids

13:44 rhickey: I just don't want to be the 'can we please stop talking about editors/vcs?' police :)

13:46 abrooks: rhickey: So it sounds like you'd want to try to keep the focus on #clojure and keep #clojure focused. More easily said than done but it's a good goal. I suspect that if enough of the regulars give gentle nudges to the others to stay on-topic we can avoid #clojure-dev for a while.

13:46 rhickey: abrooks: sounds like a plan

13:47 danlarkin: a little healthy chatter when the channel is otherwise silent is okay I'd think... helps build community :)

13:48 abrooks: drewr: STAY ON TOPIC, DARN YOU!!! ;-)

13:48 * abrooks tests the plan

13:48 abrooks: Oh.. I said gentle didn't I...

13:48 danlarkin: Agreed. It's a tricky blance though.

13:48 Lau_of_DK: abrooks: The only one not staying on topic for the last 10 minutes is.. can you guess? :)

13:49 * abrooks wonders if the off-topic topic is off-topic

13:49 abrooks: Lau_of_DK: Ack -- you beat me to it. :)

13:49 Lau_of_DK: Anyway, back to Emacs23

13:49 abrooks: Ha!

13:50 * drewr git-pulls in src/emacs :-)

13:50 Lau_of_DK: HA!

13:50 :)

13:51 AWizzArd: Lau_of_DK: did you find out more about Clojure+JavaFX? Do you think it's possible to write FX apps with exclusively using Clojure as lang?

13:52 Lau_of_DK: AWizzArd: Im not deep enough into it to confirm one way or the other, but 1) I _think_ its possible, 2) its worth pursuing, so I will most likely spend some time on it, once I wrap up another project

13:52 AWizzArd: would be cool :-)

13:53 Lau_of_DK: Yes, would be awesome :)

13:54 gnuvince: Emacs 23 was officially released?

13:54 link?

13:56 whidden: how do you make a "reference" to a java enum/constant from within clojuer, e.g. something to java.util.concurrent.TimeUnit.MILLISECONDS?

13:56 Lau_of_DK: gnuvince: not official, just stable

13:56 cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co -r emacs-unicode-2 emacs

13:56 cvs update -A

13:56 gnuvince: Lau_of_DK: what's the difference?

13:57 stable is like RC or something?

13:57 RSchulz: whidden: java.util.concurrent.TimeUnit/MILLISECONDS

13:57 Lau_of_DK: gnuvince: I'll explain later when Rich isnt looking, go check it out :)

13:57 RSchulz: Assuming MILLISECONDS is static.

13:57 whidden: RSchulz... ah forgot the '/' thanks.

13:58 stuarthalloway: whidden: you could also (import-static java.util.concurrent.TimeUnit MILLISECONDS)

13:59 RSchulz: Where is import-static defined?

13:59 stuarthalloway: contrib

13:59 it will be in the book (macros chapter) in the next beta

13:59 RSchulz: Sounds like it ought to be in core. Why isn't it?

14:00 stuarthalloway: whoa man, book prose written, don't go "improving" things :-)

14:00 RSchulz: http://www.infoq.com/presentations/click-fast-bytecodes-funny-languages is much more interesting than the slides alone!

14:00 rhickey: stuarthalloway: who me?

14:01 stuarthalloway: rhickey: no, you should improve as much as you like! I was giving RSchulz a hard time

14:01 RSchulz: Stu, if you wanted to write a book that could be "correct" and "complete", you should write abount ancient Rome.

14:02 duck1123: ok, no more bug fixes for stuarthalloway's sake

14:02 stuarthalloway: duck1123: Nooooo!

14:02 I have a test suite now, break what you want, I can take it

14:08 whidden: stuarthalloway, right now your chapter on macros is a little thin :) and if Mr. Hickey keeps making late Sunday night addtions to the core you might have a difficult time finishing your book :)

14:08 stuarthalloway: whidden: you will have a macro chapter by tomorrow, mehopes

14:09 RSchulz: stuarthalloway: Are you saying beta4 will be out tomorrow??

14:09 stuarthalloway: I am going to ship the prose to the prags today

14:10 whidden: is there a way to load all of contrib in one fell swoop?

14:10 stuarthalloway: they usually turn it around in hours

14:10 RSchulz: Great. How long does it take them to get it to the gerbils?

14:10 Hours! Then they'll send out notice to us pre-purchasers? Fabulous.

14:10 stuarthalloway: I'd be done already except I let Chouser look at it first. :-)

14:11 RSchulz: Something you do no doubt at your own peril.

14:12 whidden: yeah.. i realize that. but REPL emacs connection is only inferior-lisp and not swank so name completion doesn't work so well :(

14:14 RSchulz: rhickey: Why isn't import-static in core? Is it somehow inappropriate?

14:15 rhickey: RSchulz: I haven't looked at it much

14:15 RSchulz: Does anyone know why import-static presents static methods as macros? It hardly seems intuitive.

14:18 AWizzArd: rhickey: thanks for reacting so fast and providing an unchecked-remainder *thumbs-up*

14:18 rhickey: AWizzArd: np

14:18 danlarkin: RSchulz: you'll have to ask Stuart Sierra I suppose

14:18 RSchulz: rhickey: Did you give any thought to a TRUNCATE counterpart for Clojure?

14:18 rhickey: RSchulz: I imagine perf - wrapper fns would hide types

14:19 RSchulz: yes, I used to have that

14:19 got lost during numbers reworking a while back

14:19 RSchulz: Are you considering reinstating it?

14:20 Lau_of_DK: AWizzArd: Did you ever figure out why that function you did was super slow ?

14:20 RSchulz: Lau_of_DK: You mean the one Rich made super fast...?

14:20 Lau_of_DK: Could be

14:21 AWizzArd: Lau_of_DK: I made some changes. Two type hints #^Long and an unchecked-divide and an unchecked-remainder.

14:21 rhickey: RSchulz: sure - patch welcome

14:21 Lau_of_DK: AWizzArd: And I mathced Java in terms of speed?

14:21 RSchulz: I started looking at it, but I'm even more relucant to fiddle with the Java. ... Why, I don't know. At least I know that language...

14:21 Do patches require a CA?

14:22 Lau_of_DK: RSchulz: considering that Rich is American, I imagine even posting to the googlegroup will eventually require signing on some type of legal document :)

14:22 AWizzArd: These four changes made the runtime going from 1360 msecs runtime down to now 124 msecs

14:22 Lau_of_DK: wow

14:22 RSchulz: Are you suggesting Americans are excessively legalistic?

14:23 Lau_of_DK: Have you pasted it somewhere AWizzArd, with the annotations?

14:23 RSchulz: We're a little beyond suggestions :)

14:23 AWizzArd: Lau_of_DK: well, the Java version still runs at 29 msecs, but now the Clojure version is fast enough. It's a good result now.

14:23 rhickey: RSchulz: yes please

14:23 RSchulz: Does anyone know if Java 7 is going to use escape analysis to effect stack-local allocations?

14:24 Lau_of_DK: AWizzArd: Why such overhead? In % its still masive

14:24 RSchulz: Cliff Click's talk (is that really his name?) was pretty interesting, especially the part about how much allocation Clojure demands.

14:25 Lau_of_DK: RSchulz: You got a link to that talk ?

14:25 lisppaste8: AWizzArd annotated #71780 with "Update on find-factor" at http://paste.lisp.org/display/71780#1

14:25 RSchulz: http://www.infoq.com/presentations/click-fast-bytecodes-funny-languages

14:25 danlarkin posted it earlier today. Up 'til then, I'd only seen the slides.

14:25 AWizzArd: Lau, there you can see the changes

14:25 Lau_of_DK: Thank you Mr. Schulz

14:25 Thanks alot AWizzArd

14:25 RSchulz: Eh? My father isn't here.

14:26 duck1123: I hate that you can't download the infoq videos

14:26 RSchulz: But thank _you_ for spelling it correctly.

14:26 Yeah. In that case, the slides are sychronized in a separate Flash animation on the same page, which is kinda' nice.

14:26 duck1123: for some reason my box here at work won't play sound in flash. I have to wait till I get home to watch any videos like that

14:30 RSchulz: You know, even the latest version of find-factors still produces the wrong value for my numeric-pad mash: 43587438757

14:30 user=> (find-factors 43587438757)

14:30 [21517]

14:30 According to Gnu "factor:"

14:30 factor 43587438757

14:30 43587438757: 21517 2025721

14:31 AWizzArd: RSchulz: maybe it is not doing what you expect, but anyway, this was the function that was posted in c.l.l

14:31 RSchulz: Yes, but since it clearly has a bug, that should be addressed, don't you think?

14:31 AWizzArd: I just mimiced that, without wanting to correct it, as I wanted a comparison between those. So by definition, that program is behaving correctly.

14:32 RSchulz: So your contention is that it's just misnamed...

14:32 AWizzArd: one could maybe rename it to: find-some-factors :-)

14:39 abrooks: find-factors-<=-sqrt-of-n

14:43 AWizzArd: rhickey: let's say a company has a codebase in CL. Now we imagine they want to slowly begin to rewrite their app in Clojure. Both sides would have to communicate with each other during the transition phase.

14:43 How should they do this? Sockets? Trying Kawa or ABCL?

14:44 danlarkin: AWizzArd: seems like that isn't a decision for rich to make... wouldn't it depend on what the app is doing, etc?

14:44 AWizzArd: What approach would be the one about which you would think first? I ask you because you were there, you even developed jfli and so on.

14:44 rhickey: AWizzArd: if it runs under ABCL, they could at least share a VM. Kawa isn't CL, so just another port

14:45 depends totally on the granularity of the conversations

14:46 AWizzArd: Would be cool if both sides could use code developed by the other. So, sitting inside the same vm sounds nice.

14:49 dmiles_afk: i am very interested in finding ways of using ABCL and clojure together

14:49 Lau_of_DK: rhickey: Are you putting any focus on the bytecode emission issues that Mr. Click raises in his talk in infoq ?

14:50 rhickey: Lau_of_DK: what issues?

14:50 AWizzArd: And jfli could maybe also be helpful? Parts of the app that were rewritten in Clojure could be called from the Lisp side with it, and the Lisp code could work as it did before.

14:50 Lau_of_DK: rhickey: If you didnt see the talk you should, he explains it very well, but it seems that Clojure bytecode emission has some odd holes in it, compared to going straight to inline

14:50 rhickey: AWizzArd: there was a jFli port to ABCL for Java interop

14:51 Lau_of_DK: I saw the talk and spent a lot of time talking to Cliff over 3 days

14:51 Lau_of_DK: rhickey: Ok, did you learn anything interesting?

14:51 rhickey: Lau_of_DK: yes

14:51 Lau_of_DK: hehe

14:51 ...that youre willing to share?

14:51 rhickey: seriously, trying to work here

14:52 Lau_of_DK: Ok

14:52 dmiles_afk: what the benefits of clozure and ABCL working together?

14:54 well the benefits to cojure it seems to use java w/o the boxing of primitives it looks like.. where ABCL is still boxing everything

14:55 i like Kawa because it attempts to do more than just Lisp.. but yet it doenst make it all the way to common lisp the way abcl does

14:56 ABCL has enough jclass/jstatic/jcall etc it could use cojure pretty well.. and clojure is smart enough to use user defined types (the ones that are from ABCL)

14:58 clojure seems like some routines on Conses since in clojure they are immuatble they probably faster operations?

14:59 AWizzArd: Well, I should have a look at both then, abcl and jfli

15:02 dmiles_afk: yeah i'd start out by making sure their code ran in ABCL first

15:03 it probly will, but still you can undo any tangles that come up from abcl if any

15:03 Lau_of_DK: AWizzArd: Can you explain unchecked-remained for me please?

15:03 AWizzArd: Lau_of_DK: it is modulo. 10%3 = 1

15:03 (rem 10 3) ==> 1

15:03 (unchecked-remainder 10 3) ==> 1

15:05 Lau_of_DK: How does their implementation differ?

15:06 AWizzArd: the unchecked-remainder simply uses the % from Java

15:08 Lau_of_DK: hmm, odd, I would have expeced rem to do that ?

15:08 AWizzArd: compare it: (let [#^Long x 9999999999999999999999999999999999999999999999999, #^Long y 17] (unchecked-remainder x y))

15:08 ==> -7

15:09 but try rem instead, and it will give you the correct result

15:09 no overflow of cpu registers and so on

15:09 rem does not simply call Javas % operator, because that one is broken and only works for a fraction of possible cases

15:10 where the number of possible cases increases with the amount of ram you have available

15:10 Lau_of_DK: oh, thats surprising

15:10 AWizzArd: well, a long consumes about 8 bytes of ram, something like that. Only very few numbers can be represented with 64 bit

15:11 But if you have gigabytes of ram you could encode much bigger numbers, for example a 400 megabyte number. Javas modulo does not always work for those.

15:12 Lau_of_DK: Sloppy coders

15:12 AWizzArd: genau

15:12 Lau_of_DK: ?

15:12 AWizzArd: well, they just cared about efficiency

15:13 Lau_of_DK: hehe

15:13 AWizzArd: it's efficient when you do it only for cases for which the cpu gives you direct support

15:14 although I have to admit that in my programs not often numbers greater than a few billions are needed

15:14 so for lot's of cases this unchecked-remainder guy comes in handy

15:14 Lau_of_DK: Thats true - Its just not typically seen in public libraries that they knowingly flunk in certain areas.

15:15 Chousuke: flunk?

15:16 Lau_of_DK: flunk, as in produce incorrect results

15:16 Chousuke: oh, well % not working for arbitrarily large numbers is quite normal.

15:17 after all, on very few platforms you have "true" arbitrary precision integers.

15:17 Lau_of_DK: k

15:18 Chousuke: some techniques could be used to automatically decide if native number types can be used, and fall back to bigints when the native precision isn't enough though, but the JVM doesn't offer that as far as I know :/

15:22 Lau_of_DK: Its surprising Chousuke, that in 2008 we're still struggling with lowlevel prolems like that

15:23 I mean, in the 80's people were anticipating flying cars in the new millenium, and here we still have work out when to use ints and bigints :)

15:24 cemerick: when implementing a genclass method that has a boolean return type, it looks like one needs to wrap values with (boolean ...) in order to avoid a classcastexception. It seems that the genclass machinery should automatically convert logical truth values to booleans on their way out of clojure-land.

15:27 Chousuke: Lau_of_DK: computer hardware doesn't get magically smarter. :)

15:27 Lau_of_DK: software tricks can help, but those come at the expense of efficiency.

15:29 Lau_of_DK: Well aint that just a fact :)

15:40 kib2: Hi. Is there any equivalent to CL's atom ?

15:41 Chouser: kib2: (not (coll? x)) is pretty close

15:41 gnuvince: (not (coll? x))

15:41 oops

15:41 too slow

15:41 kib2: thanks Chouser and gnuvince :)

15:53 * Lau_of_DK waves fondly at Mr. kotarak :)

15:53 Lau_of_DK: Hellooo kota :)

15:53 kotarak: Zdravej, Lau.

16:10 RSchulz: Hey, Meikel, I'd watch out for Lau. He has disclosed Denmark's imperial designs... You guys are just about first in line!

16:10 Lau_of_DK: haha

16:11 Our mission was simple - Try to make germany collapse on itself by imposing ugly hair-do's and an unmistakeable Arnold Schwartzenegger accent on the population

16:11 So far its an immense success

16:15 danlarkin: ours was to creep angela merkel out with unsolicited back rubs

16:16 kotarak: oh dear. Maybe I should think about emmigrating...

16:18 When she became chancellor a newspaper had a picture of her with the label "Miss Germany". A colleague from Auburn Hills took it with him to shock his colleagues.

16:20 Lau_of_DK: kotarak: Is it true, that since she became the new leader of your Empire, that you start a cold war every month around 28/29/30.th ?

16:20 kotarak: ?? Not that I am aware of. She actually does ... well ... nothing.

16:21 Lau_of_DK: k

16:21 danlarkin: lol @ Miss Germany

16:22 kotarak: danlarkin: It's rather depressing....

16:22 Lau_of_DK: /names #clojure-dev

16:22 ERC> abrooks

16:22 Hmm.. maybe we should talk about Clojure :)

16:23 danlarkin: haha yeah rich is itching to tell us to shut up

16:23 kotarak: o.O What's clojure-dev?

16:23 Lau_of_DK: Kota, abrooks gave a 40 minute lecture today on why #clojure should be pure code :)

16:23 It was good too

16:23 (maybe it was 20)

16:24 * kotarak goes checking the log

16:24 Lau_of_DK: around 19:00

16:26 kotarak: when youre done, have a look at this http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.11.4048

16:27 kotarak: Lau_of_DK: yes. I know this.

16:28 whidden: is there a sqrt function for bigints/bignumbers in clojure?

16:39 Chouser: whidden: (Math/sqrt x) works, I believe.

16:52 stuarthalloway: how hard would it be to make the :reload option to use/require recursive?

17:00 Chouser: to recurse into dependencies?

17:01 stuarthalloway: as easy as saying :reload-all perhaps?

17:02 stuarthalloway: sound of head-slapping

17:02 Chouser: I didn't know it was there either, if that saves your head any pain.

17:03 stuarthalloway: in the best spirit of Clojure, I am now a lazy reader, and was never forced to read past the "," in the doc for require

17:03 rhickey: stuarthalloway: me too, I was going to suggest it should be called something different - maybe :reload-all

17:03 :)

17:04 stuarthalloway: more people will care about that flag once people are writing unit tests

17:04 and debugging them in the REPL

17:11 Lau_of_DK: Can somebody remind me, why did we want this confusion of (ns foo.bar.baz) and elsewhere (in-ns 'foo.far.baz) ?

17:14 danlarkin: because ns is macro that calls in-ns

17:17 rhickey: ns sets up a namespace declaratively, in-ns just puts you in one

17:18 Lau_of_DK: Sure - But why not just either skip the ' as a whole, or use it in every instance. To other way around seems confusing

17:19 s/To/The

17:31 stuarthalloway: and in similar vein, find-doc could take an unquoted symbol

17:32 Lau_of_DK: true - Like cgrandes javadoc

17:42 Ok, lets say I have a regex that finds ints, and I run it on "a b c 1 2 3", is there a function which will return [1 2 3] to me ?

17:43 RSchulz: Isn't that just an application of (filter ...)?

17:43 AWizzArd: I think only for digits

17:43 RSchulz: Oh, you mean starting from the string?

17:43 Lau_of_DK: I need regex

17:43 AWizzArd: Lau_of_DK: yes, it is possible. No, I don't remember how :-)

17:44 Chouser: re-seq?

17:44 *sigh*

17:44 AWizzArd: I need regexps 2-3 times per year, and every time I basically have to learn from scratch how to use them: http://www.regular-expressions.info/

17:44 Chouser: 'reseq'?

17:44 're-seq'?

17:44 RSchulz: I thought there was an re-split, but it doesn't turn when I (find-doc "re-")

17:44 AWizzArd: but Lau, one easy thing you could do, although not really efficient: split the string on each position that is *not* a digit char

17:44 Lau_of_DK: Thats the one Chouser

17:44 Thanks alot! :)

17:45 Chouser: (map #(Integer. %) (re-seq #"\d+" "a b c 1 2 3"))

17:45 Lau_of_DK: AWizzArd: Like I said, I need regex :)

17:45 RSchulz: But (re-seq ...) should work.

17:45 Lau_of_DK: Its in the bag

17:45 AWizzArd: Lau: that's what I mean

17:45 Lau_of_DK: Thats alot guys

17:45 Chouser: RSchulz: re-split is in clojure.contrib.str-utils I think

17:46 RSchulz: Got regex? "Mastering Regular Expressions" is pretty good, and comprehensive. It's in its 3rd ed. now. I have the 2nd (I passed on my copy of the 1st ed. to a friend who always finds REs troublesome.)

17:46 REs are like FP: A mind-set thing.

17:46 Lau_of_DK: I'll look into it Mr. Schulz - I need it

17:47 AWizzArd: Chouser: yes, and I used it to clean a string from unwanted chars

17:47 RSchulz: Chouser: Yup. There it is. In contrib.str-utils, as you said.

17:47 AWizzArd: just split on everything that is not in ^[0-9a-z���] or something like that

17:47 and then one can (filter #(not (empty? %)) result)

17:48 RSchulz: AWizzArd: For that approach, you'd be much better off inverting the character class you want, rather than trying to enumerate ever non-numeric Unicode character.

17:48 Chouser: #(seq %) is shorter and clearer than #(not (empty? %))

17:49 AWizzArd: yes

17:50 Chouser: or simply seq instead of #(seq %)?

17:50 Chouser: AWizzArd: oh, of course.

17:50 http://clojure-log.n01se.net/date/2008-09-05.html#13:21b

17:51 Lau_of_DK: pictures (re-seq #"(?<=<(img.*)>).*(?=</img>)" raw-page)]

17:51 Guys, how would you write this, so that it actually works? :)

17:51 stuarthalloway: with an xml parser :-)

17:51 AWizzArd: i c

17:51 Chouser: ding ding ding stuarthalloway wins

17:51 Lau_of_DK: hmm

17:52 Would xml-> work straight on a html ?

17:52 stuarthalloway: on good html :-)

17:52 Lau_of_DK: but I love xml-> :)

17:52 AWizzArd: Lau: html can do things that are not possible with xml or s-expressions

17:52 hiredman: what is xml-> ?

17:53 pjb3: Just saw this on twitter: http://www.turbojugend-cossebaude.de/clojure/clojure-logo.svg

17:53 RSchulz: Lau: What are you trying to do with that?

17:53 (I love an RE challenge.)

17:53 Lau_of_DK: Mr. Schulz - I need to extract links and pictures specifically, in order to crawl a website and make local copies

17:54 RSchulz: pjb3: I see a Java logo when I view that URL.

17:54 pjb3: RSchulz: look carefully, you'll see the lambda

17:54 RSchulz: pjb3: I was wondering about that. It's very similar to the origina, no? Probably a copyright infringement.

17:55 Lau: You want the attribute value, right?

17:55 Lau_of_DK: Yes sir

17:55 pjb3: RSchulz: yeah, probably, it's cool anyway :)

17:55 RSchulz: I've not totally figured out the escaping requirements for the look-ahead and look-behind sub-patterns.

17:56 I think that may be what you're bumping into.

17:56 Lau_of_DK: RSchulz: Theyre actually easy, but Clojure does it a little differently than others

17:56 RSchulz: Could you give me a sample that should be matched?

17:57 What's different about Clojure? It just passes everything on to java.util.Pattern, right?

17:57 (or java.util.regex.Pattern, as the case may be)

17:57 Lau_of_DK: I dunno

17:57 Try this (re-seq #"(?<=<(\w+)>).*(?=<\/\1>)" some-html)

17:57 RSchulz: It's just that with #"..." you don't have to go through the rigamarole of extra escaping.

17:57 Lau_of_DK: You'll get a regex error, but it would work fine in C# or Perl

17:57 RSchulz: I'm looking for the some-html to use to test.

17:58 Lau_of_DK: (defn get-data

17:58 [url]

17:58 (let [s (.openStream (java.net.URL. url))]

17:58 (apply str

17:58 (map char (take-while pos? (repeatedly #(.read s)))))))

17:58

17:58

17:58 (def some-html (get-data "http://www.google.com"))

17:58 RSchulz: Unmatched delimiter.

17:59 The very first close-paren is being seen as ending the zero-width look-behind, yes?

17:59 That leaves the second open paren unmatched.

17:59 That's what I meant by escaping nested patterns in the look-behind notation.

18:00 Also, an unbounded look-behind appears to be a no-no.

18:00 Lau_of_DK: I can read the error also, but the point is, this works in C#

18:01 RSchulz: So what? It has its own RE syntax, no doubt.

18:01 Besides, what are you trying to capture in the look-behind?

18:01 sarcher|work: how do you run a clojure program so that it exits when it's one?

18:01 i'm a newbie

18:01 when it's done

18:01 sorry

18:01 Lau_of_DK: In this particular, anything between <htmltag> ... </htmltag>

18:02 RSchulz: sarcher|work: You can just call (System/exit status-value)

18:02 sarcher|work: thanks

18:02 Lau_of_DK: RSchulz: How do I fix it ?

18:02 sarcher|work: i knew it would be something easy, i just didn't see an (exit) or (close)

18:02 RSchulz: Lau_of_DK: How generic does it need to be? What can be assumed about what appears inside the element?

18:03 The tag itself is fixed, right? Say, <img ...>...</img> ?

18:03 Lau_of_DK: Specifically I need <img src="****"> and <a href="****">

18:03 RSchulz: OK. And to be clear, you want the value of the src= or href= attributes, not the content of the element, right?

18:03 hiredman: uh

18:04 Lau_of_DK: Exactly right

18:04 (I know the last example was the opposite, but the current task is the most important)

18:04 RSchulz: OK. Give me a minute. In the mean time, consider that the only context you care about is the <img on the left and the very next > on the right.

18:12 Lau_of_DK: OK. Here goes:

18:13 Lau_of_DK: oops

18:13 RSchulz: (def img-src-RE #"<img\b[^>]+src=['\"]([^'\">]+)['\"]")

18:13 (def some-html "this is stuff with an <img foo='bar' src=\"http://foo.bar/image.img\"> in the middle")

18:13 user=> (re-find img-src-RE some-html)

18:13 ["<img foo='bar' src=\"http://foo.bar/image.img\"" "http://foo.bar/image.img"]

18:13 duck1123: parsing html with regex is almost always a bad idea

18:14 RSchulz: (I don't know where that &lt; came from. It's a literal < in the RE I pasted.

18:14 duck1123: which is a shame, because it's so handy most of the time

18:14 RSchulz: duck1123: I agree, but snippet extraction of this very limited sort is manageable.

18:14 kib2: Is there any html lib like the PCL one here : http://www.gigamonkeys.com/book/practical-an-html-generation-library-the-interpreter.html ?

18:15 RSchulz: Someone recently posted something like that on the Google groups / list.

18:15 duck1123: there are tons of good java libs you could use to tidy up bad html, and the xml lib to take care of the well-formed ones

18:17 RSchulz: duck1123: You convince Lau to change his approach.

18:17 kib2: RSchulz: any hint about when it has been posted ?

18:17 Lau_of_DK: RSchulz: thats amazing

18:17 RSchulz: I'm just a RE hired gun!

18:17 kib2: Let me check. BRB.

18:17 Lau_of_DK: Im dead tired and its past midnight here, so I hope I can return tomorrow for a walkthrough

18:17 kib2: RSchulz: thanks

18:18 RSchulz: Subject: Clojure template library; Initial posting date: 2008-12-03@10:04

18:18 (that's 10:04 PST)

18:19 Lau_of_DK: Mr. Schulz, have a good night sir, and thank you for your help, youve been instrumental

18:19 kib2: RSchulz: thanks a lot, I'm looking for it

18:20 AWizzArd: Will clojure compile to the same bytecode for (filter seq x) and (filter #(seq %) x)?

18:20 duck1123: I'm sure everyone's seen it, but it seems relevant: http://xkcd.com/208/

18:21 RSchulz: I wonder if I can guess which that one is before I look (I've read them all...)

18:22 Wrong. I was thinking it was the one where God admits he hacked the universe toget in Perl instead of using Lisp...

18:22 duck1123: And I'm flattered at the comparison!

18:23 http://xkcd.com/224/

18:25 AWizzArd: never saw those before

18:27 duck1123: he made a shirt out of the regex one

18:31 dmiles_afk: RSchulz, are you from Teknowlege?

18:31 RSchulz: Howdy, Doug.

18:31 dmiles_afk: Hey :)

18:31 RSchulz: Teknowledge was long in the past, though.

18:32 dmiles_afk: clojure doing you well?

18:33 RSchulz: My brain has yet to warp itself to fit. Even Lisp has been quite a while. But FP really stretches you.

18:33 But I like (Clojure, that is)

18:33 dmiles_afk: i am working on the java port of Cyc (cycorp sanctioned) and seeing what bit of clojure helps

18:34 RSchulz: Interesting. This is based on the openCyc KB?

18:34 dmiles_afk: well its based on ResearchCyc, but the OpenCyc works from the same code when the port source is protected enough to be released as OpenCyc

18:35 the OpenCyc/ResearchCyc/FullCyc are the same codebase.. SubLisp translated to C or Java.. then compiled to make the binary

18:35 RSchulz: That could work.

18:36 dmiles_afk: i was researching a SubLisp -> Clojure port .. still waiting on something 2 weeks late from the "vendor" cycorp

18:37 its be the same amount of work for anyone deciding if they could indomatically translate Common Lisp to Cojure for the same effect

18:38 I keep waiting for anyone in here to undertake something like this :) LISP2CLOJ

18:38 SimonAdameit: Hi

18:39 How can I define a local function?

18:39 let does not allow recursion

18:40 dmiles_afk: RSchulz, i still have to say your implmentation of a indexed KB using java int[]s still beats everything i've seen

18:40 AWizzArd: SimonAdameit: with fn or loop

18:40 anonymous functions can call themselves in Clojure

18:40 RSchulz: Did I do that?

18:40 SimonAdameit: how?

18:41 AWizzArd: with (recur ...)

18:41 so, no Y-Combinator needed ;-)

18:41 SimonAdameit: cool, thanks :)

18:41 AWizzArd: Just think about recur as if it were the name of the function.

18:41 dmiles_afk: RSchulz, well the Teknowleedge Sigma code arround SKBs .. i figured was your authorship

18:42 RSchulz, up until three months ago someone exposed the Tek Web CVS for annonymous browsing for 6 years of public unfetered access

18:42 SimonAdameit: AWizzArd: "Can only recur from tail position"

18:45 Ok, got it, fn takes a "name" argument. Though it is somewhat unexpected at first doing it this way (when you're comming from lisp)

18:53 AWizzArd: SimonAdameit: you don't need the name argument

18:53 and yes, you should use recur only in a tail position, so that it can optimize the overhead away

18:54 SimonAdameit: How do I do non tail recursion without the name?

18:54 AWizzArd: well, for that you need a name

18:55 I just don't see why you would want to do it ;-)

18:56 SimonAdameit: Ahh, come on, I'll paste to have some fun :)

19:00 lisppaste8: SimonAdameit pasted "cfg parser" at http://paste.lisp.org/display/71828

19:02 hiredman: SimonAdameit: (fn somename [args] body)

19:02 you can use (somename x) in the body

19:02 I normally use "this"

19:03 SimonAdameit: hiredman: thanks, I already discovered that one :)

19:17 Chouser: hiredman: earlier versions of clojure bound 'thisfn' for you.

19:29 hiredman: I remember

19:35 powr-toc: Is there a function in clojure that returns a seq where only the first item to match a predicate is removed?

19:40 blackdog: powr-toc, (doc some)

21:39 danlarkin: can someone give an example of fnseq? Not sure why (fnseq 4 #(vector 45)) throws a ClassCastException

21:41 Chouser: a vector is not an ISeq

21:42 (fnseq 4 #(list 45))

21:45 danlarkin: ah perhaps the documentation should be updated to reflect the need for an ISeq?

21:49 Chouser: The exception described the need pretty emphatically. :-)

21:55 jvoorhis: i noticed some similarities between the doc strings in src and the website -�is there a clojure documentation tool?

22:02 joha1: I'm testing compojure and want to add a function from the REPL, but I get an unresolved error when calling defservlet. Probably just a namespace problem, but I'm new to clojure and can't figure out what to do. Help?

22:02 Chouser: you have a .clj file that's working?

22:03 joha1: I'm just testing from the repl script supplied in compojure

22:03 Chouser: jvoorhis: there's 'doc' and 'find-doc' -- I don't know what's used to convert that to a web page.

22:04 jvoorhis: thanks

22:04 Chouser: (doc doc)

22:04 clojurebot: Prints documentation for a var or special form given its name; arglists ([name])

22:04 jvoorhis: begs the question, is the website code checked into the main repo?

22:05 Chouser: jvoorhis: it's a wiki of some sort

22:05 rhickey: wikispaces

22:05 jvoorhis: cool, thanks

22:07 looking forward to writing some more clojure code :) so far, i've been able to send midi messages to ableton live from the repl

22:07 rhickey: jvoorhis: neat

22:07 jvoorhis: with little effort: http://gist.github.com/32973

22:09 it's cool to see others are doing multimedia stuff with clojure, too

22:09 someday, i expect to see a processing demo

22:10 Chouser: jvoorhis: like this? http://github.com/rosado/clj-processing/tree/master

22:11 jvoorhis: Chouser: that's it

22:15 Chouser: the example code is nice

22:16 Chouser: Great. I've not done anything with it -- just saw it go by on the group.

22:17 jvoorhis: oh, i see

22:17 Chouser: joha1: sorry, I'm apparently just as lost as you are.

22:18 joha1: np

22:18 jvoorhis: i should probably subscribe, and poke around in clojure-contrib while i'm at it

22:21 Chouser: joha1: shot in the dark: (use 'compojure.http)

22:22 joha1: cool, it worked. I'm a real n00b at this :) thanks

22:25 Chouser: np

23:02 danlarkin: http://nothings.org/computer/iterate.html -- it's funny, the title is "Iteration is hard" but it should really be "State is hard"

23:19 Chouser: that's a great link for when anybody complains about how "hard" it is to "just set a variable" in clojure.

23:19 You want mutable state? Really?

23:24 danlarkin: sadly it's too verbose for the type of person complaining about that :-/

23:26 Chouser: hm.

23:29 danlarkin: hopefully that didn't come off as insulting

23:38 Chouser: no, you probably have a point. And stated sufficiently broadly that we can each justify our own exclusion from that group.

23:42 RSchulz: Along the lines of of the "talking Barbie" shtick, remember the line uttered by the talking Malibu Stacie doll: "Thinking give you wrinkles!"

Logging service provided by n01se.net