#clojure log - Dec 01 2008

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

0:00 notallama: and did you use C-c C-c to try to narrow it down?

0:02 technomancy: notallama: yeah, the exception happens when I run the last line.

0:02 ah... I guess you have to press 1 [CAUSE] a number of times to find the real stacktrace

0:02 the problem seems to be in com.sun.syndication.io.SyndFeedInput.build(SyndFeedInput.java:122)

0:03 but that's outside of my code, and that part works fine when invoked from the regular repl

0:06 notallama: unfortunately i have no idea.

0:10 technomancy: ok... what is up with the output of println then? (map println '("foo" "bar"))

0:10 this gives me "(foo\nnil bar\nnil)"

0:10 hiredman: clojurebot: map?

0:10 clojurebot: map is *LAZY*

0:11 technomancy: why are there nils in the output? shouldn't println just get called twice, once with "foo" and once with "bar"?

0:11 hiredman: ok

0:11 technomancy: and why is the whole thing surrounded in parens?

0:11 hiredman: technomancy: map is lazy

0:11 wrap in (doall or whatever

0:12 technomancy: I thought being lazy just meant it only pulled one element off the list at a time.

0:12 on an as-needed basis

0:12 hiredman: lazy means in does things as needed

0:14 technomancy: I don't understand how "as needed" translates into a bunch of nils in the output... is there somewhere I can read about what that means?

0:14 hiredman: technomancy: println returns nil

0:14 map is a maping of values to other values using a supplied function

0:14 so the seq map returns is (nil nil)

0:15 technomancy: oh, so the return value gets interleaved with the output to println then; I see.

0:15 hiredman: yes

0:15 technomancy: makes total sense; thanks. just ... very unexpected.

0:15 hiredman: very faq

0:16 clojurebot: map?

0:16 clojurebot: map is *LAZY*

0:17 matzero: map?

0:17 technomancy: I think I understand lazy; it just totally threw me for a loop that the REPL prints return values in chunks rather than printing the whole list at once.

0:17 so it's not map that's confusing, it's the REPL.

0:17 hiredman: watch out for sindeffects in the function you pass to map

0:20 technomancy: now if only I could get this Rome jar to work in slime...

0:44 thanks folks

1:24 arohner: Chouser: this is sort of off topic, but I figure you might have experience since you use git and deal with rhickey's SVN

1:24 how do I create a patch from a git working copy that will apply to a SVN working copy cleanly?

2:23 vaskaren: is there a Java graph library shipping with the platform?

2:58 Lau_of_DK: Good morning gents

4:02 AWizzArd: Morgen

4:04 Lau_of_DK: Guten Morgen mein freund :)

4:04 AWizzArd: :-)

4:35 asdfiest: fiscchken

8:10 AWizzArd: Does the clojure-contrib sql lib support queries with prepared statements? As in: SELECT * FROM Country WHERE code = ? where I would replace the ? with "GB" or something like that.

8:13 hoeck: AWizzArd: it does

8:14 at least under the hood in its insert or so implementation

8:15 Chousuke: there seems to be a do-prepared function for prepared statements.

8:15 AWizzArd: hoeck: the question is: how do I put my "GB" arg into the query?

8:16 (with-results ..) takes a var, a query and a body. There is no other argument, like a vector for handing over the data for the prepared query.

8:16 gnuvince: Good morning

8:17 AWizzArd: I will try this do-prepared thingy

8:17 although I can't see in the code how it will give back results. Plus the do- prefix suggests that it is for inserts/deletes or updates, but maybe not for selects.

8:19 hoeck: AWizzArd: you're right, contrib sql uses them only for doing inserts

8:22 lvijay: does mibbit kick you out if you're away from the window for an extended period of time?

8:24 hoeck: lvijay: no, it somehow marks you as being "away"

8:30 Chousuke: probably using the standard /away command so many people seem to be unaware of :/

8:36 hoeck: Chousuke: aha, nice, didn't know that, and how do i undo /away ?

8:37 Chousuke: just /away again

8:38 some clients like to be obnoxious about it and default to publicly broadcasting away status changes to all channels.

8:39 but most don't.

8:39 it'll show up if someone whois's you, along with the away reason

8:41 hoeck: Chousuke: aha, thanks for explaining

8:46 duck1123_: /nick duck1123

9:28 rdd: how do i access the previous values at the repl? (like *, ** and *** in cl)

9:32 hoeck: rdd: *1,*2,*3

9:33 rdd: ah, thanks

9:34 aperotte: you guys probably already know this, but I figure I'd give you a heads up that a Bill Clementson blog entry about Clojure is on the front page of reddit

9:36 Lau_of_DK: aperotte: News to me, thanks

9:36 Is this Bill C guy someone famous?

9:36 duck1123: he's a blogger

9:37 aperotte: I actually think he's in the channel, unless the user billc is someone else

9:37 Lau_of_DK: billc: are you famous?

9:37 :)

9:38 duck1123: he gets plenty of google juice, if that counts

9:38 Lau_of_DK: Im not sure, does it?

9:39 aperotte: Lau_of_DK: I only learned about him after learning about clojure. He has many posts on clojure, emacs, swank, etc.

9:39 duck1123: fwiw, I knew who he was before he turned on to clojure and started posting about it

9:40 but that was because I was hunting for emacs bloggers

9:41 Lau_of_DK: Ok - Ive just heard his name pop up in a few different contexts, so I was wondering if he was a character like Paul Graham

9:42 duck1123: no, he's just bc on the mailing list, and a guy that's popular enough to get on the front page of reddit

9:42 rhickey: Lau_of_DK: Bill's blog entries speak for themselves, quality-wise

9:43 e.g. excellent

9:43 duck1123: http://bc.tech.coop/

9:43 Lau_of_DK: rhickey: Big words :) Im convinced I'll have to read them

9:43 hiredman: clojurebot: Paul Graham is the creator of the other new lisp

9:43 clojurebot: Ik begrijp

9:44 Lau_of_DK: hiredman: but perhaps better known for his creation of ViaWeb

9:44 hiredman: clojurebot: context is the essence of humor

9:44 clojurebot: c'est bon!

9:48 danlarkin: I love reading the reddit comments on clojure articles

9:53 hiredman: it's funny, because the comments say exactly what I thought when I read the title

9:56 danlarkin: hah

9:56 yeah, definitely some slashdot style comments

9:56 that is, comment first, read article second (or never)

9:59 duck1123: reading is for wimps.

10:12 AWizzArd: does Java have something similar to Lisps format? I want to have a pattern string that contains placeholders, as in "My name is ~a" and later do (format placeholderstring "Mike").

10:12 duck1123: (doc format)

10:12 clojurebot: Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax; arglists ([fmt & args])

10:15 AWizzArd: thanks

10:16 duck1123: if you're doing this for sql, beware. SQL injection still applies

10:16 SimonAdameit: Hi

10:17 duck1123: hello

10:18 danlarkin: howdy

10:21 AWizzArd: duck1123: yes... but unfortunately clojure-contribs sql lib does not support prepared statements for select queries yet.

10:21 Currently I am the only user, so while I'm testing I should be pretty safe :-)

10:21 duck1123: right, I just realized my own vulnerability earlier and wanted to make sure you didn't do the same thing I did

10:22 AWizzArd: thx

10:22 duck1123: AWizzArd: famous last words...

10:23 danlei: un

10:23 oops

10:46 duck1123: there is no way to choose different versions of a macro based on the parameters is there?

10:46 That would have to be done at run time

10:47 Chouser: duck1123: not sure what you mean. defmacro accepts multiple arity definitions, just like defn

10:47 duck1123: I'm trying to figure out what it would take to allow clojure.contrib.sql/with-results to optionally take a prepared statement as the 2nd param

10:49 you would have to switch on the type of the sql param, right?

10:49 AWizzArd: What do you mean?

10:50 duck1123: with-results takes a var to capture the results, a string sql statement and the forms to run,

10:50 AWizzArd: right

10:51 duck1123: I was thinking, if you tested the type of sql, and it was a prepared statement, use that as the statement instead of creating a new one

10:52 AWizzArd: I think it would be easier to pass the sql arg not as a string but as a list. In that list there is either just one string, or alternatively as many args as questionmarks in the string.

10:53 (with-results res ("SELECT birthday FROM persons WHERE name = ?" "Henry") ...)

10:53 duck1123: that would probably be better for (prepare)

10:54 AWizzArd: but also (w-r res ("SELECT bday FROM persons WHERE name='Henry'") ...)

10:54 still fine

10:55 duck1123: (with-results res (prepare "SELECT birthday FROM persons WHERE name = ?" "Henry") (first (vec res)))

10:55 AWizzArd: that won't work I guess, I am not sure

10:55 one thing that with-results can't do is to give back the whole result map

10:55 duck1123: wrap it in vec

10:55 AWizzArd: (with-results res "SELECT ..." res) ==> Exception

10:56 the connection is already closed or something like that

10:56 duck1123: otherwise you get errors trying to read after connection is closed

10:56 AWizzArd: yes

10:56 duck1123: if you wrap it in vec, it creates a copy of the whole thing

10:56 AWizzArd: ah okay, so (with-results res "SELECT ..." (vec res)) would work you say?

10:56 duck1123: should

10:56 AWizzArd: I'll try that now

11:01 duck1123: yes, that works

11:02 So far I went the complicated way and embedded the with-results call in a let where I had a ref, and then I looped through the results and copied res by res into the ref. Duh!

11:05 rhickey: Why does (sql/with-connection *db* (sql/with-result res "SELECT ..." res)) throw a RuntimeException "Operation not allowed after ResultSet closed", but the same code where the last res is replaced by (vec res) doesn't?

11:06 duck1123: it doesn't read the info until outside of the connection

11:06 vec reads it while it's still open to make a copy

11:07 AWizzArd: (identity res) also doesn't work

11:07 duck1123: you could also loop and stuff to fill your data structure, you just have to make sure it's not lazy, or it'll try to do it after the connection is closed

11:08 AWizzArd: but (count res) res works

11:08 duck1123: hmm... perhaps anything that consumes the whole seq

11:09 AWizzArd: (doall res) is also fine

11:10 Is it okay to have (gen-class :name HelloWorld ...) while still being in the user namespace? Or does gen-class always need some path, with at least one dot in it?

11:17 Chousuke: I doubt gen-class would work from the repl :/

11:17 dfg59: anyone out there using gorilla?

11:24 rhickey: AWizzArd: gen-class is for use with proper namespaces, and currently only operates when compiling

11:29 Chouser: has the behavior of 'load' changed at all since right after the initial AOT stuff?

11:30 I thought I had conditional loading of 3rdparty classes working in lazy-xml, but it doesn't seem to at the moment.

11:32 dfg59: if anyone out there is using gorilla on a mac, let me know. i'm getting an error launching the SocketRepl. I'm using gorilla-1.0.0 and building clojure from svn.

11:33 rhickey: Chouser: probably. I know I just changed nested self-load from an exception to a no-op, but I doubt that;s your problem. This problem happens with no compilation? What is the error?

11:34 Chouser: oh, indeed I do get the same error with just 'require'

11:34 danlarkin: dfg59: the author of gorilla just joined the channel, kotarak

11:34 * kotarak swears and ducks behind cover..

11:35 Chouser: I have a try block around (load "foo"), and in foo.clj I import classes that may not exist.

11:35 but the exception appears to escape somehow.

11:36 hm, it looks like a ClassNotFoundException in the stack trace, but if I change the catch to just Exception, then it's caught correctly.

11:38 rhickey: Chouser: could you paste trace?

11:39 lisppaste8: Chouser pasted "ClassNotFoundException... or is it?" at http://paste.lisp.org/display/71324

11:40 Chouser: looks like it may be wrapped in a CompilerException

11:41 yep, .getCause returns a ClassNotFoundException

11:43 dfg59: kotarak: can i ask you a question regarding a gorilla error?

11:43 danlarkin: thanks

11:43 kotarak: dfg59: sure

11:44 dfg59: kotarak: i'm attempting to launch the socketrepl with gorilla.jar, clojure.jar and clojure-contrib.jar in my classpath, and i'm getting an error saying "No such namespace: clojure"

11:44 kotarak: this is with gorilla-1.0.0 and svn head of clojure

11:44 kotarak: dfg59: this is because you use a recent SVN clojure.

11:45 dfg59: kotarak: ah, i see

11:45 kotarak: dfg59: the clojure namespace was renamed to clojure.core

11:45 Just a sec

11:45 dfg59: kotarak: ah, makes perfect sense.

11:46 kotarak: dfg59: you might try the development version from the hg repository.

11:46 There I already adapted to the new structure.

11:46 I'm working on a new release.

11:46 But be prepared for problems. It's still experimental.

11:47 dfg59: kotarak: of course, i'll give it a try. seems like an awesome tool, just what us vim users are looking for.

11:47 lisppaste8: craigmcd pasted "Servlet" at http://paste.lisp.org/display/71326

11:47 dfg59: kotarak: i suppose this means i have to learn hg :)

11:47 kotarak: no

11:48 You can use the webinterface to download a snapshot.

11:48 dfg59: awesome, thanks

11:48 kotarak: http://kotka.de/repositories/hg/gorilla

11:49 ohem. And then I'm stuck. I know it's possible....

11:49 rhickey: Chouser: isn't this exception because your first exception-based flow didn't go as planned?

11:49 dfg59: kotarak: it seems i can get each file individually ...

11:49 kotarak: dfg59: now that's bad. It should be automatically possible....

11:50 dfg59: kotarak: its fine, i think i can learn enough mercurial to pull it down

11:50 Chouser: rhickey: I'm not sure what you mean. I try to import a class and just want to catch if that fails. Using a plain 'catch Exception' works well enough.

11:51 kotarak: dfg59: if you have mercurial it's simply: hg clone http//.... somedirectory

11:51 dfg59: kotarak: perfect, just grabbed mercurial, thanks.

11:52 Chouser: so now the conditional load works perfectly without AOT, and also works with AOT as long as your runtime environment matches your compile time environment.

11:52 kotarak: dfg59: np :) Thanks for using.

11:52 Chouser: still looking to see if I can compile with xpp in the classpath and get graceful failure at runtime if its not found...

11:54 rhickey: Chouser: let's try to understand this before making it go away. I think the problem was that RT.loadClassForName also used exceptions for flow control (forced to by the inanity that is classForName)

11:56 Chouser: want to try 1133 on your original recipe?

11:58 Chouser: sure. the complexity here is trying to keep the classpath in the right state (with .class files coming and going) for the various combinations of compiling, running from compiled, running from source, and with and without the 3rdparty jar.

12:00 AWizzArd: Is it expected that (import '(javax.servlet.http Cookie)) ==> java.lang.ClassNotFoundException: javax.servlet.http.Cookie?

12:02 lisppaste8: Chouser annotated #71324 with "CompilerException svn 1133" at http://paste.lisp.org/display/71324#1

12:04 AWizzArd: oh Chouser, you also have a xyz class not found problem?

12:04 abrooks: Is there a way to access "this" Thread? I'll go digging but figured I'd ask if anyone knew off-hand.

12:05 kotarak: abrooks: I think the Thread class has something like this.

12:05 * abrooks wants to call (.getId *self*)

12:05 Chouser: AWizzArd: not really. I'm specifically excluding the jar I need from the classpath and trying to handle it gracefully in the code.

12:05 abrooks: Oh, wait, so I should just be able to call Thread/getId shouldn't I...

12:05 Hm.

12:05 Chouser: AWizzArd: are you sure you have a javax.servlet package in your classpath?

12:05 kotarak: abrooks: Thread/currentThread

12:06 Chouser: abrooks: (.getId (Thread/currentThread))

12:06 abrooks: discovered via (show Thread)

12:06 AWizzArd: Chouser: no, not sure. Is this javax not a standard class that comes with every jdk and is automatically in the classpath?

12:06 At least I find no such folder or .class file in my jdk folder.

12:07 abrooks: Chouser: (show Thread) doesn't work for me. I assume show is a new function?

12:07 Chouser: AWizzArd: some things that come with Java are in javax, but I don't think the servlet stuff is included. I believe I had to download a separate package to get them.

12:07 abrooks: Chouser, kotarak: Thanks. Thread/currentThread was what I was looking for.

12:09 Chouser: abrooks: not new. http://groups.google.com/group/clojure/msg/96ed91f823305f02

12:11 abrooks: Chouser: Ah.. It's just not part of core or contrib. :)

12:11 Chouser: abrooks: right. floating free in the ether.

12:12 hiredman: btw

12:12 clojurebot: SHOW?

12:12 clojurebot: Gabh mo leithsc?al?

12:12 hiredman: er

12:12 clojurebot: show?

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

12:13 Chouser: hiredman: ah, right. thanks!

12:13 kotarak: Chouser: is your macro help page still up? Maybe a candidate for clojurebot

12:13 I mean this pastebin frontend

12:14 rincewind: do you find the combinators bi tri and cleave from factor useful?

12:14 Ithink they should be ported

12:14 mehrheit: what do they do?

12:14 hiredman: I have a webserver named rincewind

12:17 Chouser: clojurebot: macro help is http://clojure-log.n01se.net/macro.html

12:17 clojurebot: Ok.

12:17 rincewind: bi applies two functions

12:17 kotarak: clojurebot: macro help?

12:17 clojurebot: macro help is http://clojure-log.n01se.net/macro.html

12:17 rincewind: its a special case, but is

12:17 hiredman: rincewind: eh?

12:18 rincewind: useful in factor

12:18 hiredman: applies not composes?

12:18 Chouser: kotarak: good idea. I'd put that in clojurebot once before, but forgot about it just like he did. :-)

12:18 kotarak: I think this should be the first point to point to for macro help. Chouser, *two thumps up*.

12:20 rincewind: (defn bi [f g] (fn [& args] [(apply f args) (apply g args)]))

12:20 hiredman: huh

12:20 ok

12:21 rincewind: now that i wrote it it seems like it is a pain to use with explicit args and no currying

12:22 hiredman: also seems like a special case of (map some-func (list of functions))

12:22 mehrheit: I imagine the operator makes more sense in a stack language like factor

12:22 technomancy: hiredman: is that gist still the definitive place to get the clojurebot source?

12:23 hiredman: yessir

12:23 mehrheit: also maybe in a static language, like haskell's (***)

12:23 technomancy: hiredman: I might try my hand at getting it to announce commits in the channel, what do you think about that?

12:23 hiredman: not a lot going on with clojurebot atm, I am sort of mulling over some kind of web wiki tie in

12:24 technomancy: that would be cool

12:24 technomancy: hiredman: great; I'll let you know when I've got something.

12:24 hiredman: wheee

12:24 clojurebot: how much do you know?

12:24 clojurebot: I know 0 things

12:25 RSchulz: Wow. Clojurebot is honest.

12:25 hiredman: clojurebot: how much do you know?

12:25 clojurebot: I know 58 things

12:25 hiredman: much better

12:25 RSchulz: And learning fast.

12:25 hiredman: (doc trampoline)

12:25 mehrheit: maybe he's (she's?) intimidated

12:25 clojurebot: trampoline can be used to convert algorithms requiring mutual recursion without stack consumption. Calls f with supplied args, if any. If f returns a fn, calls that fn with no arguments, and continues to repeat, until the return value is not a fn, then returns that non-fn value. Note that if you want to return a fn as a final value, you must wrap it in some data structure and unpack it after trampoline returns

12:25 technomancy: RSchulz: and wise like Socrates.

12:26 hiredman: is clojurebot a "he" or an "it"?

12:26 or a "she"?

12:26 hiredman: uh

12:26 clojurebot: pointer or setter?

12:26 clojurebot: I don't understand.

12:27 hiredman: and "it" I guess

12:27 technomancy: heh; all right then.

12:28 RSchulz: Who wrote clojurebot?

12:28 clojurebot: who created you?

12:28 clojurebot: Excuse me?

12:28 RSchulz: I guess...

12:30 hiredman: I did

12:30 clojurebot: creator?

12:30 clojurebot: Pardon?

12:30 hiredman: clojurebot: braindump

12:30 clojurebot: No entiendo

12:30 hiredman: clojurebot: brain dump

12:30 clojurebot: brain dump is http://clj.thelastcitadel.com/clojurebot

12:31 RSchulz: Hiredman: how much work was it? How extensible?

12:31 hiredman: clojurebot: where are you?

12:31 clojurebot: http://gist.github.com/27733

12:31 hiredman: it was pretty easy

12:31 I used the pircbot java lib

12:31 RSchulz: Does it delegate to (doc ...) ?

12:31 hiredman: no

12:32 it actually pulls metadata off the vars

12:32 so it sort it sort of steps around (doc ...)

12:32 RSchulz: So it replicates what (doc) does, basically?

12:33 hiredman: yes

12:33 there are formating issues, and the pircbot lib doesn't like newlines

12:34 RSchulz: hiredman: I see you're the Compojure guy. How's that coming? I've been using Grails, and it's not really my favorite. I considered Lift, but it wasn't ready at the time I needed it.

12:34 hiredman: uh

12:34 not *the* compojure guy

12:35 RSchulz: Oh. I popped up a level from the clojurebot braindump and saw your name.

12:35 hiredman: yeah, I am runing compojure

12:35 RSchulz: How do you like it?

12:35 hiredman: it is ok

12:35 I really like the vector syntax for generating html

12:36 technomancy: I'm trying it out too. Looks pretty handy, but I've barely scratched the surface.

12:36 RSchulz: How mature is it?

12:36 hiredman: but I am not so keen on the everything bundled together approach

12:36 technomancy: it feels *really* weird for me to be writing web app code without an ORM. =)

12:36 RSchulz: Do you know much about Grails? Can you compare them?

12:36 hiredman: I don't

12:37 technomancy: seems like the compojure guy used Rails a lot, and Grails was heavily influenced by that, so... not sure what that means, but there should be some similarities.

12:37 RSchulz: Where is the Compojure project?

12:37 technomancy: clojurebot: compojure?

12:37 clojurebot: compojure is http://github.com/weavejester/compojure/tree/master

12:37 technomancy: clojurebot: botsnack

12:37 clojurebot: thanks; that was delicious. (nom nom nom)

12:38 Kerris7: awwww

12:38 RSchulz: Is there more than just the source??

12:38 hiredman: I am am looking at webjure because it seems to integrate more with the java web app stuff

12:38 RSchulz: I tend to be a glutton for documentation...

12:38 duck1123: RSchulz: there's the readme

12:39 RSchulz: Oh, great. We've got two web app frameworks to choose from already...

12:39 duck1123: that's the main documentation atm

12:39 hiredman: from what I can tell webjure has less doc then compojure

12:39 technomancy: RSchulz: yeah, it doesn't strike me as heavily-documented

12:39 the examples that ship with the framework are pretty sparse

12:39 drewc: RSchulz: it's a lisp, expect many more!

12:39 RSchulz: Do either of these have any kind of persistence or ORM?

12:40 duck1123: there was talk about someone trying compojure with tomcat... haven't heard anything since

12:40 * drewc will probably port his framework to clojure soon as well.

12:40 dudleyf: drewc: What's your framework?

12:40 technomancy: RSchulz: pretty sure compojure is persistence-agnostic. it just handles the web-related stuff.

12:40 drewc: dudleyf: lisp on lines and uncommon web.

12:40 duck1123: clojurebot: clinorm?

12:40 clojurebot: excusez-moi

12:41 dudleyf: drewc: Ah, okay

12:41 drewr: drewc: Keep us posted!

12:41 technomancy: RSchulz: some of the examples mention a "persist" library; not sure where that comes from.

12:41 RSchulz: Of course the kitchen sink approach is good if you don't want to think too much about your web app--for me, it's not a primary thing and I can't devote a lot of time to it.

12:41 duck1123: clojurebot: clinorm is http://github.com/pupeno/clinorm/tree/master

12:41 clojurebot: Ok.

12:41 drewc: drewr: will do!

12:41 RSchulz: What was that? You taught clojurebot something new?

12:42 duck1123: yeah

12:42 RSchulz: Cool.

12:42 duck1123: clojurebot: clinorm?

12:42 clojurebot: clinorm is http://github.com/pupeno/clinorm/tree/master

12:42 RSchulz: Can it tell when someone's lying to it?

12:42 * hiredman fails to see the big deal about orms

12:43 hiredman: RSchulz: yeah, it monitors pupil dialation

12:43 RSchulz: "Tell me about your mother."

12:43 (If you get the reference.)

12:43 Well, for one thing ORM is handy if your system is O-O. Maybe less so if it's not.

12:43 duck1123: "my mother? Let me tell you about my mother"

12:43 technomancy: hiredman: scaling out RDBMSes is very well-understood, so a lot of folks feel comfortable using them for persistence.

12:44 hiredman: yeah, but, uh, why are there like a million different orms?

12:44 technomancy: hiredman: I've used them a lot, but I'm starting to get disillusioned.

12:45 RSchulz: 'Cause the concept is still young. Why are their so many Web-App frameworks? Everyone knows they need them and lots of people have ideas about what makes (or would make) a good one.

12:45 So the go out and create them.

12:45 rsynnott: there are also 'object databases'

12:45 Pupeno: hiredman: there are a million different lisps.

12:45 rsynnott: which are a little different

12:45 hiredman: clojurebot: lisp?

12:45 clojurebot: Lisp isn't a language, it's a building material.

12:45 rsynnott: though some of them are ultimately backed by relational database systems

12:45 RSchulz: I remember having a nice simple BDB interface in Perl that I could use to save and restore hashes. That might be pretty handy, if simple, for Clojure.

12:46 hiredman: clojurebot: Tell me about your mother is <reply>My mother? I'll tell you about my mother

12:46 clojurebot: Ok.

12:46 RSchulz: Now you've done it.

12:46 technomancy: RSchulz: yeah, I think BDB is way under-rated.

12:46 rsynnott: RSchulz: such serialisers exist for common lisp

12:47 RSchulz: Or maybe a nice interface to eXist...

12:47 I could get into that. I'll have to think about it a bit.

12:47 hiredman: you can just prn a lot of stuff

12:47 RSchulz: Maybe I could ditch Grails...

12:47 (doc prn)

12:47 clojurebot: Same as pr followed by (newline). Observes *flush-on-newline*; arglists ([& more])

12:47 RSchulz: (doc pr) then

12:47 clojurebot: Huh?

12:47 technomancy: also would love to see how clojure and couchDB would work together.

12:47 RSchulz: (doc pr)

12:47 clojurebot: Prints the object(s) to the output stream that is the current value of *out*. Prints the object(s), separated by spaces if there is more than one. By default, pr and prn print in a way that objects can be read by the reader; arglists ([] [x] [x & more])

12:47 hiredman: for persistence with clojurebot I just prn stuff to a file

12:48 rsynnott: does it print EVERYTHING in a persistable manner?

12:48 hiredman: (binding [*out* somefilestream] (prn stuff))

12:48 no

12:48 danlarkin: technomancy: interested in helping me with a couchdb lib, then?

12:48 hiredman: just stuff clojure has a literal notation for

12:48 technomancy: danlarkin: at some point... I still have to get competent in Clojure first, then learn at least the basics of couchDB. but after that... =)

12:48 hiredman: strings, hashs, lists, vecs, numbers, and so on

12:49 RSchulz: Isn't using an Erlang program with Clojure considered heresy?

12:49 technomancy: rsynnott: don't imagine it could persist closures. =)

12:49 rsynnott: h, hashes at least then :)

12:49 technomancy: RSchulz: one that embeds Spidermonkey, no less!

12:49 hiredman: clojurebot stores everything in a hash

12:49 rsynnott: RSchulz: only a matter of time before someone implements the erlang wire protocol for clojure :)

12:50 hiredman: RSchulz: some posted a sort of api using the java <-> erlang bridge

12:52 rsynnott: oh, I suppose that'd be a nice approach

12:52 forgot about the java bridge

12:53 has anyone looked into erlang-style distribution for clojure?

12:54 technomancy: rsynnott: was just reading about that: http://bc.tech.coop/blog/081201.html

12:54 RSchulz: I think people are thinking about it. Presumably it would be rather orthogonal to existing Clojure capabilities.

12:55 technomancy: rsynnott: official answer is it may be part of the language in time, but for now the focus is on local concurrency rather than distributed.

12:55 rsynnott: it's the sort of thing that makes a lot of sense to get in early, though

12:55 RSchulz: The whole STM thing is getting a lot of press lately. Another ACM Queue article today: "Software Transactional Memory: why is it only a research toy?"

12:56 I assume they meant to be provocative with the title...

12:57 rsynnott: well, it is, to an extent, right now

12:57 hiredman: clojurebot: erlang is http://clojure.googlegroups.com/web/erlang.clj

12:57 clojurebot: Roger.

12:58 hiredman: there is a thread on the google group

12:59 RSchulz: What's with that double indirection for files in Google Groups?

12:59 hiredman: *shrug*

12:59 ask google

12:59 Chouser: RSchulz: my guess is to prevent using it for general web hosting.

12:59 RSchulz: Yeah, probably something like that. I just find it annoying.

13:00 hiredman: also, there was some talk about terracota

13:00 RSchulz: Does anybody know any good resources for someone designing their first (Clojure-based) DSL? I'm finding I can think of a zillion little variations and don't yet know enough to to evaluate one vs. the other.

13:00 I think one of the Terracotta prinicpals sent a message to the Clojure list recently.

13:01 hiredman: yeah

13:02 so there are a few possible solutions

13:02 Chouser: RSchulz: I don't know of any, but personally I would try to avoid thinking of it as a whole new language if possible, and instead provide the minimal pieces necessary to extend Clojure into the given domain.

13:02 RSchulz: I should add that it's a scripting / executive "layer" for a mature and large Java application.

13:03 That app has a sizeable set of types, many of which are going to be relevant and exposed in the DSL.

13:04 And yes, I want to leverage as much of Clojure's control and concurrency as possible.

13:04 technomancy: RSchulz: In general I'm of the opinion that thinking of "creating a DSL" as a distinct activity is harmful.

13:04 RSchulz: Elaborate?

13:04 technomancy: whenever you're writing code, you're extending the language.

13:04 unless you're talking about an "external DSL" that has its own syntax etc.

13:04 RSchulz: Sure, but the point here is to make the system more interactively accessible to non-Java programmers.

13:04 No. Embedded.

13:05 Chouser: RSchulz: clojure.contrib.zip-filter is a sort a DSL that I'm (reasonably) pleased with. It ended up requiring no macros or parsers at all.

13:05 RSchulz: Right now, it's always accessed either through its BBI (the Grails app) or the CLI.

13:06 Fortunately, the content language is CLIF, which is a Lispy logic language. So my users are cool with S-Expressions, anyway.

13:07 technomancy: I just don't think there are any separate rules for that kind of situation other than "keep it simple and understand the needs of your users". You're just writing an abstraction layer targeted towards a certain kind of user.

13:07 RSchulz: True. I may be overthinking it. ... That's been known to happen...

13:08 rsynnott: has anyone written servers which handle thousands to tens of thousands of connections in clojure, actually?

13:09 RSchulz: I saw a slide show of some very heavy-duty (thousands of threads) performance tests with Clojure, but I can't quite remember where.

13:09 rsynnott: I'm thinking of writing an iphone app with a server backend, and clojure would suit me better than erlang as a language (I mostly work in cl these days) but I do KNOW that erlang can handle that sort of load

13:09 RSchulz: It might have been from a vendor of massively parallel systems or something like that. Or maybe a proprietary JVM vendor? I don't really remember.

13:09 technomancy: tens of thousands is pretty optimistic for a situation like that.

13:09 rsynnott: Azul did some sort of benchmarks a while back

13:09 technomancy: it is :)

13:10 RSchulz: Hmmm. That might have been what I saw.

13:10 rsynnott: but I'd like to be ready for it (especially once apple starts providing its push for developers thing; allegedly any day now)

13:10 RSchulz: http://groups.google.com/group/clojure/browse_thread/thread/5c7a962cc72c1fe7

13:10 rsynnott: I could do it in CL, but I'd then practically be restricted to single-thread non-blocking

13:11 RSchulz: Ah. It's coming back. It was a presentation at the JVM summit.

13:12 http://www.sauria.com/blog/2008/09/27/the-first-annual-jvm-language-summit/

13:12 rsynnott: (basically, I haven't done anything serious in clojure as yet, so am slightly scared of it :) )

13:13 technomancy: the common logic for such a situation says that if you get that many users, you'll have enough money to scale it up.

13:13 RSchulz: You've got to let the seduction of Lisp carry you in...

13:13 technomancy: that too

13:13 rsynnott: RSchulz: I'm primarly a CL user at the moment :)

13:14 RSchulz: That's way better than many of the alternatives!

13:15 rsynnott: and I've done work in Erlang before

13:15 RSchulz: I have a friend who finally landed a CL job. Then after about 6 months the company (a start-up) folded!

13:15 rsynnott: so I'm happy enough with the language itself

13:16 I suppose I'm just cautious because I haven't used it for anything serious yet

13:16 technomancy: RSchulz: common story with start-ups.

13:16 rsynnott: (also, lack of a mature persistency system is a downside; there are several nice ones for CL)

13:16 RSchulz: ah, which one was it?

13:17 RSchulz: Yeah. Little companies are unstable. But my last corporate gig was at a mega-company, and they just up and pullled the plug on my group one day. I was not pleased...

13:17 rsynnott: I've only ever really worked for small companies

13:17 gnuvince: damn

13:17 RSchulz: My friend's company? I can never remember the name. It's out east (MD) and in the medical informatics area.

13:17 gnuvince: three guys speaking, and irssi colors their nick the same :-/

13:17 rsynnott: (though my previous job was for a former startup which got bought by Activision)

13:18 it remained fairly independent, though

13:18 though we did at one point have to fill out an absurd employee survey of the sort that big companies love so much

13:20 hiredman: gnuvince: yeah

13:20 what is up with that

13:20 gnuvince: hiredman: not sure how it picks a color, but it's pretty unlucky :)

13:21 * technomancy needs to implement edit-distance-influenced nick color choices for rcirc

13:23 Chouser: My favorite is Jaro-Winkler distance.

13:23 * Chouser tries to use Wikipedia to sound smart.

13:24 danlarkin: I prefer Mandelbrot-Klein

13:25 * danlarkin makes up formula that sounds like it belongs on wikipedia

13:25 technomancy: when I want to try to sound smart my approach in the past has been to start talking about Lisp... but that wouldn't really work in this channel.

13:25 Chouser: hehe

13:25 technomancy: it's quite effective for folks who use other languages though.

13:25 RSchulz: I once evaluated a pile of edit-distance measures for matching noisy data. Not really my cup of tea, though.

13:26 I used R, which is pretty nice.

13:30 technomancy: how do you get at the classpath from the Repl?

13:31 hiredman: (System/getProperties)

13:31 it's in there somewhere

13:31 RSchulz: But I believe that won't reflect dynamic changes to the classpath during exeuction, if that matters to you.

13:32 hiredman: yes

13:32 clojurebot: classpath?

13:32 clojurebot: excusez-moi

13:32 hiredman: clojurebot: classpath is (get (System/getProperties) "java.class.path")

13:32 clojurebot: You don't have to tell me twice.

13:32 technomancy: I'm trying to debug a slime problem, so I exported CLASSPATH... those entries don't show up in getProperties

13:32 RSchulz: Your bot has an attitude...

13:33 hiredman: technomancy: are you using clojurebox?

13:33 technomancy: hiredman: nope; just the latest slime+swank-clojure+emacs all from source

13:33 hiredman: anyway, I think swank or slime, or whatever adds jars from ~/.clojure to the cp automagically

13:34 technomancy: interesting. will try that.

13:34 just all the jars in that directory?

13:34 hiredman: I believe so

13:34 technomancy: nice; thanks.

13:35 hiredman: I was digging through, uh, I think it was teh version of swank-clojure that came with clojurebox

13:35 technomancy: works fine for me.

13:35 hiredman: and that was my first time reading elisp

13:35 technomancy: heh

13:35 hiredman: oh, good

13:36 technomancy: looks like that did the trick. the problems I was seeing must have been classpath-related.

13:36 very relieved to be able to use slime again.

13:37 so for automated testing... it looks like compojure uses the fact library, which looks promising.

13:37 are there any other notable test libraries?

13:39 hiredman: clojurebot: jar direcotry?

13:39 clojurebot: Gabh mo leithsc�al?

13:39 hiredman: clojurebot: jar directory?

13:39 clojurebot: jar directory is -Djava.ext.dirs=$LIBS

13:40 technomancy: handy

13:43 RSchulz: I found the slides for that presentation that mentioned using Clojure and its STM on a 600-ant invocation of Rich's Ant Colony Simulator running on a 768-core Azul machine.

13:43 http://wiki.jvmlangsummit.com/BytecodesForFastJVMs

13:44 It came from here: http://wiki.jvmlangsummit.com/Presentations

13:47 You know I mis-read that. It wasn't Rich's Ant Simulator, it was a TSP with "worker ants" (?). I don't know if that's typical terminology for the TSP folks or something the Azul guy invented.

13:48 rhickey_: RSchulz: It's a TCO program that uses Ant Colony Optimization

13:48 sorry TSP

13:49 RSchulz: Did you work with him on that?

13:50 rhickey_: I wrote it, it's in tsp.zip on the group

13:50 RSchulz: Ah. Thanks.

14:04 technomancy: so ruby has a ~/.irbrc file that gets loaded at the beginning of every repl session. is there anything similar for clojure?

14:04 Chouser: rhickey_: do threads ever block at all in a transaction because of ref contention, or do they only ever retry?

14:05 danlarkin: technomancy: user.clj somewhere on your classpath

14:05 Chouser: technomancy: I have such a beast in the clj shell script I use.

14:05 technomancy: danlarkin: thanks

14:05 rhickey_: Chouser: there's blocking in the STM

14:06 to prevent busy churn

14:06 Chouser: technomancy: it just adds ~/.clojurerc.clj before any .clj given on the command line.

14:06 technomancy: I use this instead of user.clj mainly so I can set *print-length* (user.clj happens too early for that)

14:07 technomancy: cool. what's the status on getting a standardized clj bin in the official distro?

14:07 Chouser: rhickey_: thanks.

14:08 rhickey_: Chouser: did 1133 matter for your problem?

14:09 Chouser: rhickey_: no, I updated the paste.

14:09 rhickey_: http://paste.lisp.org/display/71324#1

14:09 rhickey_: ok

14:28 * danlarkin wonders who all the lurkers are

14:28 RSchulz: If they tell, they're no longer lurkers...

14:29 They're spies from the other languages...

14:29 * technomancy recognizes quite a few from #emacs

14:30 technomancy: and a few from ruby-related channels

14:30 danlarkin: it's a cabal against clojure!

14:31 RSchulz: Let 'em try!

14:31 technomancy: #emacs denizens are generally pretty polyglot-tastic, if I may generalize

14:33 RSchulz: I have a module / namespace dependency question...

14:34 If I write code in a namespace that uses others, it should directly (use ...) or (require ...) them, right?

14:34 technomancy: I think use wraps require.

14:34 RSchulz: And if I (use) a Clojure Contrib namespace and I get an error, does that mean it's a problem with that module?

14:34 technomancy: the book recommends use with the :only option to make it clear what you're using from various places

14:35 RSchulz: Right. The real point is that I tried (use)-ing some Clojure Contribs and get funky error messages at the point where (use) them.

14:35 E.g.:

14:35 user=> (use 'clojure.contrib.enum)

14:35 java.lang.Exception: Unable to resolve symbol: gen-and-load-class in this context (enum.clj:42)

14:35 Am I doing something wrong?

14:35 * technomancy doesn't know enough to be helpful and can only parrot what he's read elsewhere.

14:35 Chousuke: RSchulz: probably not

14:36 RSchulz: gen-and-load-class went away recently.

14:36 RSchulz: I believe I have my classpath set properly. I can successfully (use) other contrib libraries.

14:36 Chousuke: RSchulz: is your contrib recent?

14:36 RSchulz: Ah.

14:36 Yes.

14:36 Chousuke: enum might be broken :/

14:36 RSchulz: I svn up both the Closure and Closure-contrib at least daily. (or when I hear of a change)

14:37 So when everything is kosher, a (use) should stand alone (contingent only on a suitable classpath)?

14:37 Chousuke: I keep getting told you should use the ns macro instead of use directly.

14:38 RSchulz: Actually, I was. I treid the separate (use) just to test.

14:38 I was actually doing a big grab-bag (ns ... :use ...) to pull in all of Contrib so I could generate a ctags file.

14:38 Naturally, I'd rarely if ever use all those contribs at once.

14:39 Chousuke: anyway, it seems the enum lib is simply broken

14:39 RSchulz: OK. That's no problem.

14:39 technomancy: heh

14:41 RSchulz: Is there any likelihood of getting a bounded comment? #| ... |#, e.g.?

14:41 alec: (comment ...)?

14:42 RSchulz: But that's not textual. The enclosed content must parse, right?

14:42 (I had a huge argument about this on the Common Logic standards group. I won that one...)

14:43 duck1123: be careful with comment, if you comment out the last part of your function, the function will return nil. I had that one bite me

14:45 technomancy: ruby added bounded comments, but nobody uses them.

14:45 Emacs' M-; makes it really easy to toggle commenting of large regions of code.

15:10 hiredman: RSchulz: bounded comments are on the todo

15:10 clojurebot: todo?

15:10 clojurebot: todo is http://richhickey.backpackit.com/pub/1597914

15:10 RSchulz: Great. I think they're a good thing.

15:11 technomancy: is there any timeframe on 1.0, or is it just "when it's done"?

15:12 rhickey: technomancy: it's really almost done, just want to let people use the latest changes a bit and incorporate any feedback

15:12 technomancy: great!

15:12 RSchulz: Fabulous.

15:13 technomancy: rhickey: is there any chance a shell script wrapper could be included? seems like everyone just rolls their own anyway.

15:13 RSchulz: In creating my tags files, I notice several core Clojure names (Vars) have no :file or :line. Is that an oversight of some sort? I thought the compiler added it.

15:13 rhickey: technomancy: I don't think so in 1.0

15:14 RSchulz: Most of them are *something-or-other*

15:14 Plus identical? in-ns and load-file

15:14 technomancy: rhickey: the lack of one strikes me as pretty odd... but then again, this is my first foray into the JVM, so maybe it's less common there? dunno.

15:14 rhickey: RSchulz: some things are created programmatically by the bootstrap

15:15 e.g. in-ns is not defined in Clojure

15:15 RSchulz: So I could default the :file in that case to core.clj (even if I don't have a line number. I guess I could use a search instead of as line number)

15:16 Lau_of_DK: Good evening gents

15:16 RSchulz: Considering Clojure's define-before-using requirement, there probably wouldn't be any false hits when visiting those tags.

15:20 mehrheit: if (. Classname member) is going to be deprecated, what would be the equivalent of `(. Classname ~member) etc. in macros?

15:22 technomancy: isn't it (.Classname member) now?

15:23 mehrheit: it's (.member instance ...) and (Classname/member ...)

15:24 Chouser: mehrheit: (symbol "Classname" member)

15:24 perhaps

15:25 mehrheit: that looks a bit hackish; how about the (. instance member) case?

15:27 Chouser: I don't think that one has been considered for deprecation.

15:27 I'm actually getting the impression, these days, that (. Classname static) may not be going away either.

15:29 mehrheit: you're right, it wasn't. Anyway, is there a reason for (. Classname member) to be considered inferior?

15:33 Chouser: mehrheit: in macro expansions or in hand-written code?

15:38 mehrheit: generally; the reason to consider it for deprecation

15:39 rhickey: mehrheit: people get confused by the use of an unevaluated classname there, vs everywhere else where a classname evaluates to a class object, and don;t understand static scope in general and try to call Class methods that way

15:39 Chouser: a static member of a class is much more like an item in a namespace than it is a method call, so to have a syntax that reflects that is beneficial.

15:41 mehrheit: oh, okay. thank you

15:43 rhickey: there really is no problem with it when used as intended

15:45 RSchulz: Regarding Rich's to-do list: Is everything except the "Long-term" items to be finished before 1.0 is released?

15:46 rhickey: RSchulz: oh, no

15:46 RSchulz: Just the "Hot" items?

15:47 rhickey: RSchulz: no, almost done

15:47 RSchulz: Is there some place where more is said about those items? E.g., what's the "valid in (keyword s) ..." about?

15:47 ("validate" that is)

15:48 hiredman: arg

15:48 I have a dumpdicts fn in clojurebot that uses something like (binding [*out* somefilestream] (prn dict))

15:49 rhickey: RSchulz: I admit this isn't the best interface for others, and this list thingy doesn't support description text. someone complained about (keyword s) accepting non-valid keyword names

15:49 RSchulz: You mean validate the arguments to (keyword ...) and (symbol ...)?

15:49 hiredman: which prints out the hash it uses for look up into a file

15:49 RSchulz: Ah. I see.

15:49 hiredman: and it works

15:49 unless I call it in another thread

15:49 no exceptions, nothing

15:50 RSchulz: E.g.:

15:50 user=> (keyword "this really shouldn't be a symbol")

15:50 :this really shouldn't be a symbol

15:50 rhickey: RSchulz: right

15:50 RSchulz: (Though I should have said "be a keyword", I guess)

15:51 Does Clojure have a counterpart to CL's |arbitrary name| reader notation?

15:51 rhickey: RSchulz: under Hot: arbitrary symbols in | |

15:51 AWizzArd: rhickey: I compiled a gen-class where I added one function. It worked, I've now got 3 .class files: HelloWorld.class, HelloWorld__init.class and HelloWorld$_processElement__1234.class. Does the HelloWorld.class somehow call/import the others automatically?

15:52 rhickey: AWizzArd: yes

15:52 RSchulz: I can read... Honest! I just choose not to...

15:52 AWizzArd: great, thx

15:53 technomancy: for dependencies, does everyone either just use maven or bundle a copy of them with the stuff they distribute?

15:55 hiredman: clojurebot: ties

15:55 clojurebot: ties is http://www.bitbucket.org/achimpassen/clojure-ties/wiki/Home

15:55 hiredman: technomancy: ^-

15:55 I dislike that though

15:55 bundling, or maven

15:55 or ties

15:56 technomancy: hiredman: thanks. I've pretty much decided I'm never, ever going to use maven.

15:56 I have to use it at work, and that's enough

15:56 StartsWithK: technomancy: i found ant+ivy to be a good combination, with svn for clojure checkout and http get inside the build for libs that don't have maven repository

15:56 hiredman: just tell me, so I can decide if I can be assed with your stuff or not

15:57 technomancy: rather, I'm never going to write any XML to configure my projects. religious issue.

15:58 StartsWithK: technomancy: you can use javascript (and some other languages) inside ant build.xml

15:58 technomancy: hmm... json might be palatable.

16:00 StartsWithK: there is also buildr (ruby/jruby) build tool

16:00 technomancy: yeah, I could use rake, but that's another dependency that can't be automatically handled

16:04 StartsWithK: make, scons.. all good tools, but ant works the best in my opinion for clojure

16:04 hiredman: at least until one gets written in clojure

16:12 kotarak: I try to iterate over the ns-interns. However I get an obscure NullPointerException in the map call. With ns-publics it works fine. Isn't ns-publics interchangeable to ns-interns (besides the fact that the former only lists public Vars)?

16:12 technomancy: hiredman: that's the idea. =)

16:13 hiredman: there's one in the book as a sample app; I wonder if it's meant to be taken seriously

16:15 hiredman: kotarak: does the ns have anything in it?

16:15 kotarak: Yep. one private function, one public

16:24 Ok. I'm confused. Loading from the Repl works fine. I get two Vars. Loading in a script gets also additional Vars like -hashcode. Which come from gen-class, I suppose. But why don't they show up, when loading the namespace in the Repl?

16:26 AWizzArd: hmm

16:35 hiredman: clojurebot: webjure is http://code.google.com/p/webjure/

16:35 clojurebot: Roger.

16:39 hiredman: if I have something I have sent off to an agent that I want to just keep looping, is it better to send-off again at the end, or recur?

16:39 AWizzArd: hiredman: about this sql interface in webjure.. does it support prepared statements for select queries?

16:40 kotarak: hiredman: I suppose it's better to send-off again. Otherwise you can just use a thread.

16:40 hiredman: AWizzArd: dunno

16:40 I think I really want some kind of mix of compojure and webjure

16:41 kotarak: I think an action is a function of the agent's state. So it doesn't really fit to loop in the action. (At least for indefinite amount of time)

16:41 Chouser: hiredman: the ants demo uses send-off, at least partially because that allows you to update the action function while it's running.

16:41 hiredman: I see

16:45 AWizzArd: Yes, webjure supports prepared statements for select queries. That is nice, as clojure-contribs sql package can't do this. This could be interesting for Lau_of_DK or duck1123

16:47 Lau_of_DK: AWizzArd: thanks for the heads up

16:48 AWizzArd: Lau_of_DK: http://code.google.com/p/webjure/source/browse/trunk/webjure/src/main/resources/webjure/sql.clj

16:48 hiredman: I like the idea of being able to deploy a war

16:49 I don't like all the .java files and the lack of docs

16:59 AWizzArd: hiredman: in webjure you mean?

17:00 Lau_of_DK: AWizzArd: It looks good, I need to hit the sack though, catch all ya'll l8r

17:00 hiredman: AWizzArd: yes

17:17 Chouser: I've got a grid of agents sending actions to each other, with a main thread blocking on a semaphore until they're done.

17:19 when the last agent is done, it should release the semaphore, but the main thread may then race to read its new state value before it has returned it.

17:20 Any suggestions on how the agent should prevent this race? I feel like I want to set the agent's state from within the action, before the release and return, but I can't, can I? And why not, come to think of it, since nobody else can be setting the agent's state?

17:20 rhickey: Chouser: sends are held until after state change - it could send to release the semaphore

17:21 Chouser: ah, ok. I should have checked the docs -- I knew sends were held until after transactions, but had forgotten that was true for actions as well.

17:22 rhickey: Chouser: they are held specifically because for situations like this

17:22 because/for

17:24 Chouser: great, thanks.

17:25 I just solved the same PE problem purely functionally single-threaded and then again using agents.

17:25 rhickey: Chouser: cool!

17:25 Chouser: I need to refine the agents one a bit yet, but so far I'm a bit surprised how procedural the agent solutoin feels.

17:29 but maybe that's because I'm approaching it wrong -- perhaps the same root cause as why it returns too early some percentage of the time. hm...

17:29 rhickey: Chouser: it should to some degree - agents are stateful

17:30 you can make the transitions functions, but messaging is not functional

17:31 Chouser: yes, most of the calculation code is unchanged, but then there's the agent management baggage.

17:32 I mean it still translates to only 4 or so extra lines of code, so we're not in Java territory or anything...

17:32 rhickey: Chouser: pmap didn't help

17:32 ?

17:32 Chouser: hm... should have considered that more carefully.

17:34 I may try that once this is working. What I want feels more like a preduce on a mutating queue. :-P

17:35 so perhaps pmap could be used if I put a seq interface around a ref of a queue

17:46 duck1123: AWizzArd: I really think clojure.contrib.sql needs to support them directly

17:47 do I need to turn in a CA to commit to contrib?

17:47 or send in patches?

17:51 AWizzArd: duck1123: I agree

17:52 as both is open source we could 'steal' them from webjure and put them into contrib

17:53 duck1123: I've found several neat little functions in compojure that really belong in a different namespace

17:53 Chousuke: I think contrib requires the CA

17:53 rhickey: duck1123: yes, you need a CA

17:54 duck1123: I had one printed, but then it got ruined, I need to send in another one just in case I come up with something patch-worth

17:54 rhickey: AWizzArd: and nothing can be 'stolen' and put in contrib, if the webjure author wants to contribute, he can

17:56 AWizzArd: rhickey: an long both is open source and both have compatible licenses, then the authors agree that there is no problem I guess.

17:57 rhickey: AWizzArd: not so, contrib is for contributions under the CA, which requires original work, and a grant of copyright sharing, so I can change/add licenses later.

17:58 AWizzArd: okay I see, so my assumption about the compatibility was not correct

17:58 rhickey: AWizzArd: not for contrib, downstream people can combine libs via their licenses

18:00 hiredman: clojurebot: gen-class?

18:00 clojurebot: No, hiredman, you want gen-interface + proxy

18:01 hiredman: hoisted on my own petard

18:01 AWizzArd: :-)

18:14 hiredman: clojurebot: for reals now, gen-class?

18:14 clojurebot: I don't understand.

18:31 hiredman: anyone know anything about servlets?

18:32 the example I see extends javax.servlet.http.HttpServlet but my repl says class not found

18:34 danlarkin: clojurebot noooo

18:35 RSchulz: We mourn the loss of clojurebot. He/shee/it will be missed.

18:35 Clojurebot! You're Alive!

18:35 danlarkin: clojurebot: how many things do you know?

18:35 clojurebot: excusez-moi

18:35 danlarkin: clojurebot: how much do you know?

18:35 clojurebot: I know 64 things

18:36 RSchulz: At least clojurebot's memory survives his reincarnations...

18:36 danlarkin: and it's a power of two, rejoice!

18:36 RSchulz: Yes. That occurred to me. We should also celebrate palindromes.

18:36 clojurebot: what do you know?

18:36 clojurebot: It's greek to me.

18:37 RSchulz: You'd think he could just dump his memory...

18:37 clojurebot: braindump

18:37 clojurebot: It's greek to me.

18:37 RSchulz: clojurebot: brain dump

18:37 clojurebot: brain dump is http://clj.thelastcitadel.com/clojurebot

18:37 danlarkin: eh nobody wants him to spam the channel with 64 things

18:37 RSchulz: He's a bot. He should do what he's told!

18:38 More or less...

18:38 hiredman: the brain dump url is in time going to be a wiki sort of interface to clojurebot

18:39 danlarkin: I like it..

18:39 RSchulz: That would be cool.

18:40 hiredman: that is what I said, unfortunately clojurebot and my compojure install are running in serparte jvms right now

18:41 RSchulz: And they say monolithic software architectures are a bad thing...

18:41 We need to go back towards _the_ computer. _The_ program. _The_ database. Etc.

18:42 That would help, don't you think? Top-down everything.

18:42 clojurebot: what is blackdog?

18:42 clojurebot: You don't have to tell me twice.

18:43 RSchulz: Clojurebot is indulging in koans, it seems.

18:52 hiredman: ugh

18:52 this is so lame

18:52 => javax.servlet.http.HttpServlet

18:52 java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet (NO_SOURCE_FILE:0)

18:59 clojurebot: servlet is http://www.sitepoint.com/article/java-servlets-1/3/

18:59 clojurebot: 'Sea, mhuise.

19:11 Flox_: clojurebot: what

19:11 clojurebot: what is blackdog?

19:14 danlarkin: gaha

19:21 RSchulz: hiredman: You need an actual servlet container to define that class.

19:21 I always thought there should be a stub library against which to build your Java code, but apparently the standards-powers-that-be don't agree.

19:22 You can use (one of) the Tomact JARs in your class-path. Or that of any other servlet container. Jetty, etc.

19:24 clojurebot: what is servlet?

19:24 clojurebot: 'Sea, mhuise.

19:25 RSchulz: clojurebot: what is servlet

19:25 clojurebot: You don't have to tell me twice.

19:25 RSchulz: clojurebot: servlet

19:25 clojurebot: servlet is http://www.sitepoint.com/article/java-servlets-1/3/

19:25 RSchulz: Clojurebot is kind of telegraphic. Terse, you know...

19:34 technomancy: what's the clojure equivalent of __FILE__?

19:34 that is, the current filename being eval'd

19:36 SimonAdameit: Hi

19:36 Chouser: technomancy: *file*

19:36 technomancy: Chouser: thanks

19:37 SimonAdameit: Concerning delay/force, do I have to manually call force, or will the standard clojure methods already do that for me?

19:37 technomancy: how do you get just the directory part of the filename?

19:37 Chouser: SimonAdameit: you will have to do it yourself.

19:37 SimonAdameit: Chouser: oh no :(

19:38 rhickey: added new reference type - Atom, with constructor function atom, swap!, and compare-and-set!

19:38 Atoms implement IRef, and thus deref/@ and validators

19:38 Atoms provide independent, synchronous change of individual locations

19:38 Chouser: SimonAdameit: I'm pretty sure that's the case, as a nod to performance (not having to do an extra check on every value)

19:39 SimonAdameit: Chouser: Yeah, though I thought I could do data parallelism using delay await and agents :)

19:40 only calling await, when the delay is actually forced

19:43 RSchulz: technomancy: The getFile method of File will return only the basename portion of the name with which the File instance was constructed

19:43 Oops... You asked about the directory portion...

19:44 The getParent method does that.

19:44 technomancy: RSchulz: thanks. so I need to instantiate a Java File object for that?

19:45 RSchulz: Yes. That's the only way to get at the functionality of path name manipulation in Java.

19:45 technomancy: a'ight... and that requires importing something, it looks like?

19:45 RSchulz: (import '(java.io File))

19:46 technomancy: thanks!

19:46 RSchulz: Denada

19:48 user=> (def someFile (new File "foo/bar.bletch")) (.getParent someFile) (.getName someFile)

19:48 #'user/someFile

19:48 user=> "foo"

19:48 user=> "bar.bletch"

19:49 Chouser: rhickey: interesting! atom mutations are side effects that should not be done inside transcactions?

19:50 technomancy: I like the look of the "fact" library that ships with compojure, but I can't find docs for it anywhere... anyone know where that comes from?

19:50 clojurebot: fact?

19:50 clojurebot: Gabh mo leithsc�al?

19:50 rhickey: Chouser: correct

19:50 RSchulz: Mutating atoms can lead to radioactive decay...

19:51 rhickey: Chouser: but atom mutations cannot have race conditions, so more than just a variable, plus validators

19:51 small wrapper around AtomicReference

19:51 note in the implementation the use of proxy

19:53 Chouser: oh, this is the beginning of the concurrent wrappers, isn't it

19:53 rhickey: Chouser: yup

19:54 But people have difficulty writing a CAS spin, ,so this wraps that up for them, while also getting rid of set

19:54 swap! works like alter/send

19:54 Chouser: ah, sure -- before recent proxy updates, you would have implemented something like atom in Java.

19:54 rhickey: (swap! atom fn args) is atomic

19:55 RSchulz: rhickey: What motivated Atom? Performance considerations or programming convenience?

19:56 ... Or something else?

19:56 Chouser: how can that be atomic -- that means no lock, right?

19:56 rhickey: Chouser: correct, no lock, its a CAS spin inside

19:57 RSchulz: people have been using Refs for things they will never share, like memoization caches - that's overkill

19:57 RSchulz: How do you do that? At the Java / bytecode level? Or are you stating what you know about how synchronization is implemented _by_ the JVM?

19:57 rhickey: RSchulz: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/atomic/AtomicReference.html

19:58 SimonAdameit: What is the idiom for the otherwise path of a cond clause?

19:58 RSchulz: I see.

19:59 SimonAdameit: (always-true (do-stuff...))

19:59 Chouser: rhickey: ok, so if I can use AtomicInteger, that may be faster than (swap! x inc)

19:59 SimonAdameit: :else

19:59 rhickey: SimonAdameit: :else

20:00 SimonAdameit: Thanks, (the api does not say it at the cond entry)

20:01 RSchulz: rhickey: Will (doc ...) ever give details for special forms? Most (all?) of them now refer the user to the Web site.

20:01 rhickey: Chouser: only overhead is validate fn null check, the swap is the same, as is the loop you would have to write

20:01 RSchulz: only the web site has sufficient details to understand the special forms - I don't want to support people who haven't read http://clojure.org/special_forms

20:02 RSchulz: Understandable. Perhaps (anticipating an enhanced REPL) you might consider including URLs in the (doc ...) strings.

20:02 rhickey: Chouser: get and conpareAndSet do not go through the proxy dispatch, as they are final

20:03 it's fast

20:03 technomancy: RSchulz: that shouldn't be hard to support in SLIME

20:03 RSchulz: Nor Enclosure nor Peter Wolf's IDEA plug-in...

20:04 Speaking of the REPL. Has anybody contemplated a more capable one? E.g. one that simply repeats the prompt when a blank line is typed?

20:05 Chouser: but if I'm just doing + or - (no more complicated function) I can do .addAndGet on an AtomicInteger with no fails or loops at all

20:05 RSchulz: Or, e.g., one that does complettion based on globally known symbols.

20:05 Does JLine provide completion?

20:05 Chouser: RSchulz: I understand the rlwrap does

20:05 RSchulz: Ah.

20:06 Which is considered more advanced, JLine or RLWrap?

20:06 duck1123: there are instructions on how to set it up in the wiki

20:06 RSchulz: duck1123: "it"?

20:06 duck1123: RSchulz: rlwrap

20:07 technomancy: rlwrap is more general, so it's probably more mature, but it can't tie into Java at all.

20:07 Chousuke: on my system rlwrap worked better

20:07 but I use SLIME

20:07 RSchulz: Yeah. Lucky you. Emacs user...

20:07 Chousuke: I used to use vim, really. :p

20:07 but I made my emacs into a vi so it's fine now.

20:07 RSchulz: Little did I know, 30 years ago, that Vi wasn't the best choice. (But, in fact, the _only_ choice!)

20:08 Chouser: RSchulz: don't despair. there is hope for us.

20:08 technomancy: Chouser: I don't know if I'd go *that* far.

20:08 RSchulz: Vi / Vim is not a death sentence, you know....

20:09 duck1123: just water-torture

20:09 Chousuke: I have to admit emacs is really impressive. I'd like to see vi try and emulate emacs acceptably

20:09 RSchulz: Sure. Laugh. Waterfowl...

20:09 duck1123: Does the word "Ductillion" mean anything to you?

20:09 Chousuke: viper is not perfect but it does away with a lot of the evil emacs key combos.

20:09 technomancy: I'm just messing around. Vim is not bad. (Vimscript, on the other hand...)

20:10 duck1123: RSchulz: not without googling

20:10 RSchulz: Don't bother.

20:10 If you don't know, it's nothing.

20:10 technomancy: doseq changed recently, didn't it?

20:10 duck1123: fnord

20:12 RSchulz: Nah. It's just an SL name associated with ducks I know.

20:12 Chouser: RSchulz: there are Chimp and Gorilla for Clojure integration with vim

20:12 RSchulz: and don't tell anyone, but I'm working on a little thing that may help

20:12 RSchulz: I heard Gorilla was not yet ready for prime time. Is that not correct?

20:12 duck1123: No, I am Ah Forder on SL. I am duck1123 just about everywhere else

20:14 technomancy: has anyone talked about reimplementing Emacs in Clojure?

20:14 RSchulz: Chouser: If I promise not to tell, will you let on about the "little thing?"

20:14 duck1123: I was just thinking that

20:14 technomancy: not because I think it's a good idea, but because eventually someone will, and I'm just curious if it's happened yet.

20:15 duck1123: I've often wondered what would happen if emacs was re-implemented from the ground up

20:16 RSchulz: Well, for one thing, we wouldn't hear from you for about 3 years...

20:16 technomancy: duck1123: by the time you'd finished it, Emacs would have had lexical binding, multithreading, and a decent display engine written.

20:16 RSchulz: But there are several independent implementions, right? Gnu Emacs. XEmacs. JOVE. Probably other.

20:16 duck1123: good, then I don't need my version

20:17 blackdog: and it would probably still use less memory than a java equiv notepad

20:17 RSchulz: I didn't say that. More is better right?

20:17 technomancy: RSchulz: XEmacs was a fork, so it's not independent. I don't think Jove actually implements a lisp, and if it does it doesn't support a fraction of the features.

20:17 Chouser: RSchulz: minimal editor and repl implemented in pure clojure, starting with "regular" editor bindings and minimal vi bindings

20:17 blackdog: jedit is good, but it's 60mb after starting it up

20:18 RSchulz: OK. I don't claim to be an insider in the Emacs world. To refer to a much earlier topic today, I just throw out words and hope to appear intelligent...

20:18 Chouser: ...oh, plus strong clojure support (highlight, indent, etc.)

20:19 RSchulz: Well, at least Clojure is now available as a basis for ... Clemacs?

20:19 technomancy: yeah, there's nothing like writing code using the language itself. major bootstrap bonus.

20:19 RSchulz: Clomacs?

20:19 Chouser: I'm hoping to make it just good enough that I can stand to use it instead of vim when working on clojure code, at which point having a repl should allow me to start adding features...

20:20 rhickey: Chouser: yes, AtomicInteger etc still have use, atom is just AtomicReference

20:20 * technomancy wonders what he's started here

20:20 RSchulz: Absolutely. I was a huge MPW fan. The scripting language was atrocious, but the fact that it integrated a simple CLI/ worksheet with programmable menus made up for the abject naivete of the scripting language it used.

20:21 And _anything_ would be better then Eclipse...

20:21 (I'm not a fan...)

20:21 * technomancy can't mock Eclipse *too* much since it came from Smalltalk.

20:22 RSchulz: Really? That lineage I was not aware of.

20:22 blackdog: visualage

20:22 duck1123: I used to use Eclipse before I switched

20:22 RSchulz: Yeah. VAJA I know about.

20:22 blackdog: visualage was implmented in smalltalk i believe

20:22 RSchulz: Back before the dawn of time, maybe...

20:22 walters_: eclipse just really needs some equivalent to M-x

20:23 and to pick some extension language

20:23 technomancy: yeah, for a while it translated JVM bytecode to run on the smalltalk VM on the fly IIRC.

20:23 RSchulz: Yeah, right. More finger-twisting key combinations will solve all the problems...

20:23 Well, we're in the JVM world. The Squeakers have their own realm.

20:48 blackdog: Hey, I just noticed your mention of jEdit. I used it for years. It's really good, but for what I do now, IDEA is invaluable and nothing available for jEdit comes close.

20:49 blackdog: i did some stuff on a clojure mode for jedit, it's on the google group, but it's pretty incomplete - need to get back to it

20:55 RSchulz: Yeah, jEdit's modes are like Vim's modes: Arcane and obscure. I did one for CLIF, but it's pretty poor. Possibly better than nothing, but definitely flawed.

20:56 blackdog: when i say mode, i mean plugin with repl and namspace browser (stolen from enclojure)

20:56 i just got busy and started using emacs :)

20:57 i took the scheme plugin as a starting point

20:58 RSchulz: That's more than what I think of as a mode, anyway. That would be great, and I'd start using jEdit again if it were availalble. Right now, even Enclosure is broken, and I would (and will) use NetBeans if that's what it takes.

20:58 blackdog: it's a very good editor to use as a alternative to clojurebox

20:58 RSchulz: But I'd still prefer everything in IDEA. I'm hoping Peter Wolf will make good progress on his Clojure plug-in for IDEA.

20:58 blackdog: small deployment and you can script the editor in clojure

20:59 better fit really than emacs

21:00 RSchulz: Which are you referring to? jEdit?

21:00 blackdog: yea, from a java integration perspective

21:00 RSchulz: Sure.

21:00 It's too bad they can't get an official release out...

21:01 blackdog: i downloaded their latest snapshot and there are some quality issues

21:01 RSchulz: It hasn't been the same since Slava moved on.

21:01 blackdog: on screeen redrawing

21:01 yea, he hangs out here sometimes

21:01 he's taking some clojure ideas into factor

21:01 the persistent data structures

21:02 RSchulz: Really? I was wondering if that was him, but Slava isn't a rare name in his part of the world, so I figured it wasn't too likely.

21:02 What's "factor?"

21:02 blackdog: he moved from jedit to create a forth

21:02 factor is a forth language

21:03 RSchulz: Forth? As in proto-PostScript?

21:03 I looked into it once, but it did _not_ appeal to me.

21:03 blackdog: i don't know anything about forth :) it seems to be lower level than i want to be

21:03 RSchulz: To say the least...

21:04 I'm surprised that Slava would find it interesting. I'd figure him to go _upward_ in the language abstraction dimension.

21:04 zakwilson: Is it fair to call factor Forth? I thought it was largely a different language that simply shares a stack-based model and postfix syntax.

21:05 blackdog: i really don't know

21:05 technomancy: factor is inspired by forth, but it's supposed to be much higher-level, yeah

21:05 blackdog: http://factor-language.blogspot.com/

21:05 RSchulz: Thanks. I'll check it out.

21:06 gnuvince_: Factor is much higher level than Forth.

21:06 It's mix of Lisp, Smalltalk and Forth.

21:07 technomancy: factor was on my list for consideration as my 2009 language

21:07 but clojure won, and I couldn't wait till the next year. =)

21:08 RSchulz: Clojure is fantastic, isn't it?

21:08 I can't wait to really get my head wrapped around it. To really get into the functional programming mindset. I remember when I first really grokked Lisp, and it was incredible.

21:08 blackdog: I'm a fan, i'm using it for everything, and a lot less code to manage

21:09 compared with java

21:09 technomancy: I'm still easing myself into the immutability mindset. I get it for simpler tasks; still have a lot to learn for bigger stuff.

21:09 RSchulz: Yeah. I can see Java becoming the assembly language of my universe in a year or two!

21:10 walters_: i would say more "core libraries and infrastructure"

21:10 zakwilson: Clojure really hit a sweet spot for me. I was using CL and Scheme a lot, but making coss-platform GUI apps that were easy to distribute was hard.

21:10 RSchulz: Two things need to click for me: Functional programming and multimethods. When they're second nature, I'm sure I'll find Java quite painful.

21:11 zakwilson: And most things that seem like they should be simpler in other Lisps are in Clojure.

21:11 RSchulz: But then, it won't really matter, will it?

21:12 blackdog: i think what's interesting with clojure is it's hitting sweetspots of many audiences, i'm from java/javascript - no lisp or functional programming at all, and then there are the lispers - quite an interesting mix

21:13 RSchulz: I'm always fascinated / perplexed by how many people think Lisp (as in CL) is a functional language. I've never accepted that.

21:13 ACL2, sure, but CL? No way.

21:14 zakwilson: It comes from people learning Scheme in some CS course.

21:14 RSchulz: Well, Scheme is a lot closer, to bure sure.

21:14 zakwilson: Scheme allows, but doesn't strongly encourage functional programming.

21:14 RSchulz: ... "to _be_ sure..." Can't type...

21:15 How about a concrete question: In Clojure, can an instance of a struct have extra key / value pair, or is it limited to those that define the struct prototype?

21:15 blackdog: yes

21:15 you can add what you want

21:15 after the fact

21:15 RSchulz: Great.

21:16 Is there any storage efficiency with structs? Or are they syntactic sugar only?

21:16 zakwilson: How? I thought structs were immutable?

21:16 blackdog: yes

21:16 RSchulz: (If that qualifies as syntactic sugar.)

21:16 Maps are immutable!

21:16 If you (assoc ...) onto a map, you get a new map. The original remains unchanged.

21:17 blackdog: structs are just maps, but rich optimized them for storage somehow

21:17 danlarkin: it returns a /new/ map

21:17 rhickey: RSchulz: there is storage efficiency in that the shared keys are stored once only

21:17 RSchulz: Interesting. (You lurker). I'm inclined to wonder how you do it, but also I don't much care, as long as it works...

21:18 Chouser: RSchulz: the code's not too hard to read -- PersistentStructMap.java

21:19 zakwilson: It returns a new PersistentStructMap, not just a map.

21:19 RSchulz: OK. More things to add to my reading list.

21:19 Since you're here, I was wondering if you'd be willing to pen a little article on what led you to create Clojure. It's clearly not something a neophyte wanna-be language designer could do. Or have you already written such a thing?

21:19 zakwilson: so I'm guessing the shared keys are stored in one place, and the new ones you added with assoc are stored like a normal map?

21:21 Chouser: zakwilson: yep, keys are stored in the basis object, PersistentStructMap$Def

21:21 RSchulz: I was wondering if anyone has done MultiSet and / or MultiMap in persistent form?

21:21 rhickey: RSchulz: I guess I could, I mention some motivations in my talks. I guess I like Clojure to speak for itself.

21:22 RSchulz: rhickey: I can see that, and respect it. But sometimes one wonders just what goes on in the mind of a successful language inventor.

21:23 You know, so we can steal your creativity and use it as our own. (As if...)

21:24 * rhickey wonders what he was thinking too

21:25 RSchulz: Consider that probably 1 in 100 programmers thinks they have a language inside them (sort of like how many liberal arts majors think they have the next War and Peace inside them) but in fact only 1 in 1,000,000 really do!

21:25 If that.

21:26 What's worse, occasionally these half-assed languages escape the confines of their keepers and go feral. And that's never a good thing...

21:26 rhickey: :)

21:26 Chouser: *cough* PHP

21:26 RSchulz: Well, think about it. Eventually you deserve some kind of respite. Maybe you could throw us a bone.

21:27 (and write something that can't be considered wrong or "buggy.")

21:28 When I retire, I want to create things that are actually _done_. Software is never done. It's either dead, or its users demand "improvements" and "enhacnements" and "extensions" and on and on...

21:28 hiredman: heh

21:28 RSchulz: I'm trying to avoid naming names. I might want to get a job somewhere some day.

21:29 hiredman: I made a bookcase once, the shelves are too long, so they bow in the middle, I stuck some big hardbacks in the middle to make a support column and called it done

21:30 RSchulz: And no one can complain. It may collapse, but at least it's done.

21:30 Well... Time for the Simpsons and supper... Ciao.

21:31 rhickey: RSchulz: bye

21:40 hiredman: rhickey: trying to use :gen-class if I have :main false (docs say boolean I put false without thinking) I get a can't make an iseq from boolean exception

21:41 nil works fine

21:54 rhickey: hiredman: what svn rev?

21:55 hiredman: 1128

21:56 rhickey: hiredman: was fixed since then

21:57 hiredman: sorry about the false alarm then

22:18 duck1123: that needs to be added to clojurebot. (rev 1128) => "commit message"

22:19 how hard is it to set up it's code?

22:19 I assume I need the java libs

22:19 albino: better would be a link to the commit message

22:20 duck1123: that works just as well

22:20 if it has a meaningful api, you wouldn't need to parse anything

22:22 (str "http://clojure.svn.sourceforge.net/viewvc/clojure?view=rev&revision=" rev-id)

22:27 technomancy: duck1123: I was planning on adding that to clojurebot

22:45 clojurebot: where are you?

22:45 clojurebot: http://gist.github.com/27733

22:45 technomancy: duck1123: ^

22:57 stack traces are hard.

22:59 Chouser: are they?

23:00 technomancy: Chouser: useful ones are.

23:00 I'm much more forgiving of bad stack traces ever since I tried to implement them in my own Scheme though.

23:00 Chouser: heh

23:01 technomancy: JRuby is worse though since the Java stack and the Ruby stack get interleaved.

23:01 Chouser: usually all I need is the very top (or bottom) exception description and then find the first mention of my .clj file

23:06 dthomas: On the subject of stack traces, I'm right in saying that code eval'ed from SLIME gives you a stack trace without file names or line numbers within the code you eval'ed? That's the behavior I've been seeing, which often makes it hard to figure out where the problem is.

23:07 hiredman: technomancy: I have to warn you, something somewhere in clojurebot (maybe the pircbot lib) swallows exceptions regularly

23:07 dthomas: Makes me want to trick swank-clojure into writing out a temp file and eval'ing that, at least when doing slime-eval-buffer, just so that I can get line numbers.

23:08 (Not that I'm at all sure that would actually work; more of a theory.)

23:37 _lvijay: i have this function that i use to find all elements that satisfy some condition in a sequence. (defn find-all "(for [x SEQ :when (TEST-FN ITEM (KEY-FN x))] x)" ([item seq test-fn key-fn] (for [x seq :when (test-fn item (key-fn x))] x)) ([item seq test-fn] (find-all item seq test-fn #'identity)) ([item seq] (find-all item seq #'= #'identity))) is there a standard library function that does the sam

23:37 ok that didn't format well

23:37 any mibbit users?

23:37 here's the code:

23:37 (for [x seq :when (test-fn item (key-fn x))] x)

23:39 hiredman: _lvijay: I recomend to you the sequences section of the website

23:41 _lvijay: (doc filter)

23:41 clojurebot: Returns a lazy seq of the items in coll for which (pred item) returns true. pred must be free of side-effects.; arglists ([pred coll])

23:41 _lvijay: that's what i need

23:42 hiredman: thanks

23:46 technomancy: hiredman: do you test on a local IRC server? would such a thing be easy to set up?

23:47 hiredman: technomancy: I test right here

23:47 I did a lot of testing via privmsg

23:47 technomancy: hiredman: makes sense. I hack on the commute to work w/ no uplink, so I wonder how hard it would be to get a local server going.

23:47 maybe get a test suite of sorts

23:48 hiredman: dunno

23:49 technomancy: I guess the individual functions would be easy to test offline. just the integration-level tests would require a server

23:49 * technomancy hates programming w/o a test suite

23:50 hiredman: there must be all kinds of bugs in the parsing

23:51 ripe for refactoring

23:52 technomancy: will give it a look

23:52 hiredman: at least I finaly got the thread that writes out the dict-is hash to work

23:53 still don't know why it was not working before

23:53 *sigh*

Logging service provided by n01se.net