#clojure logs

2008-12-01

00:00notallamaand did you use C-c C-c to try to narrow it down?
00:02technomancynotallama: yeah, the exception happens when I run the last line.
00:02technomancyah... I guess you have to press 1 [CAUSE] a number of times to find the real stacktrace
00:02technomancythe problem seems to be in com.sun.syndication.io.SyndFeedInput.build(SyndFeedInput.java:122)
00:03technomancybut that's outside of my code, and that part works fine when invoked from the regular repl
00:06notallamaunfortunately i have no idea.
00:10technomancyok... what is up with the output of println then? (map println '("foo" "bar"))
00:10technomancythis gives me "(foo\nnil bar\nnil)"
00:10hiredmanclojurebot: map?
00:10clojurebotmap is *LAZY*
00:11technomancywhy are there nils in the output? shouldn't println just get called twice, once with "foo" and once with "bar"?
00:11hiredmanok
00:11technomancyand why is the whole thing surrounded in parens?
00:11hiredmantechnomancy: map is lazy
00:11hiredmanwrap in (doall or whatever
00:12technomancyI thought being lazy just meant it only pulled one element off the list at a time.
00:12technomancyon an as-needed basis
00:12hiredmanlazy means in does things as needed
00:14technomancyI 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?
00:14hiredmantechnomancy: println returns nil
00:14hiredmanmap is a maping of values to other values using a supplied function
00:14hiredmanso the seq map returns is (nil nil)
00:15technomancyoh, so the return value gets interleaved with the output to println then; I see.
00:15hiredmanyes
00:15technomancymakes total sense; thanks. just ... very unexpected.
00:15hiredmanvery faq
00:16hiredmanclojurebot: map?
00:16clojurebotmap is *LAZY*
00:17matzeromap?
00:17technomancyI 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.
00:17technomancyso it's not map that's confusing, it's the REPL.
00:17hiredmanwatch out for sindeffects in the function you pass to map
00:20technomancynow if only I could get this Rome jar to work in slime...
00:44technomancythanks folks
01:24arohnerChouser: this is sort of off topic, but I figure you might have experience since you use git and deal with rhickey's SVN
01:24arohnerhow do I create a patch from a git working copy that will apply to a SVN working copy cleanly?
02:23vaskarenis there a Java graph library shipping with the platform?
02:58Lau_of_DKGood morning gents
04:02AWizzArdMorgen
04:04Lau_of_DKGuten Morgen mein freund :)
04:04AWizzArd:-)
04:35asdfiestfiscchken
08:10AWizzArdDoes 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.
08:13hoeckAWizzArd: it does
08:14hoeckat least under the hood in its insert or so implementation
08:15Chousukethere seems to be a do-prepared function for prepared statements.
08:15AWizzArdhoeck: the question is: how do I put my "GB" arg into the query?
08:16AWizzArd(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.
08:16gnuvinceGood morning
08:17AWizzArdI will try this do-prepared thingy
08:17AWizzArdalthough 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.
08:19hoeckAWizzArd: you're right, contrib sql uses them only for doing inserts
08:22lvijaydoes mibbit kick you out if you're away from the window for an extended period of time?
08:24hoecklvijay: no, it somehow marks you as being "away"
08:30Chousukeprobably using the standard /away command so many people seem to be unaware of :/
08:36hoeckChousuke: aha, nice, didn't know that, and how do i undo /away ?
08:37Chousukejust /away again
08:38Chousukesome clients like to be obnoxious about it and default to publicly broadcasting away status changes to all channels.
08:39Chousukebut most don't.
08:39Chousukeit'll show up if someone whois's you, along with the away reason
08:41hoeckChousuke: aha, thanks for explaining
08:46duck1123_ /nick duck1123
09:28rddhow do i access the previous values at the repl? (like *, ** and *** in cl)
09:32hoeckrdd: *1,*2,*3
09:33rddah, thanks
09:34aperotteyou 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
09:36Lau_of_DKaperotte: News to me, thanks
09:36Lau_of_DKIs this Bill C guy someone famous?
09:36duck1123 he's a blogger
09:37aperotteI actually think he's in the channel, unless the user billc is someone else
09:37Lau_of_DKbillc: are you famous?
09:37Lau_of_DK:)
09:38duck1123he gets plenty of google juice, if that counts
09:38Lau_of_DKIm not sure, does it?
09:39aperotteLau_of_DK: I only learned about him after learning about clojure. He has many posts on clojure, emacs, swank, etc.
09:39duck1123fwiw, I knew who he was before he turned on to clojure and started posting about it
09:40duck1123but that was because I was hunting for emacs bloggers
09:41Lau_of_DKOk - Ive just heard his name pop up in a few different contexts, so I was wondering if he was a character like Paul Graham
09:42duck1123no, he's just bc on the mailing list, and a guy that's popular enough to get on the front page of reddit
09:42rhickeyLau_of_DK: Bill's blog entries speak for themselves, quality-wise
09:43rhickeye.g. excellent
09:43duck1123http://bc.tech.coop/
09:43Lau_of_DKrhickey: Big words :) Im convinced I'll have to read them
09:43hiredmanclojurebot: Paul Graham is the creator of the other new lisp
09:43clojurebotIk begrijp
09:44Lau_of_DKhiredman: but perhaps better known for his creation of ViaWeb
09:44hiredmanclojurebot: context is the essence of humor
09:44clojurebotc'est bon!
09:48danlarkinI love reading the reddit comments on clojure articles
09:53hiredmanit's funny, because the comments say exactly what I thought when I read the title
09:56danlarkinhah
09:56danlarkinyeah, definitely some slashdot style comments
09:56danlarkinthat is, comment first, read article second (or never)
09:59duck1123reading is for wimps.
10:12AWizzArddoes 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:12duck1123(doc format)
10:12clojurebotFormats a string using java.lang.String.format, see java.util.Formatter for format string syntax; arglists ([fmt & args])
10:15AWizzArdthanks
10:16duck1123if you're doing this for sql, beware. SQL injection still applies
10:16SimonAdameitHi
10:17duck1123hello
10:18danlarkinhowdy
10:21AWizzArdduck1123: yes... but unfortunately clojure-contribs sql lib does not support prepared statements for select queries yet.
10:21AWizzArdCurrently I am the only user, so while I'm testing I should be pretty safe :-)
10:21duck1123right, I just realized my own vulnerability earlier and wanted to make sure you didn't do the same thing I did
10:22AWizzArdthx
10:22duck1123AWizzArd: famous last words...
10:23danleiun
10:23danleioops
10:46duck1123there is no way to choose different versions of a macro based on the parameters is there?
10:46duck1123That would have to be done at run time
10:47Chouserduck1123: not sure what you mean. defmacro accepts multiple arity definitions, just like defn
10:47duck1123I'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:49duck1123you would have to switch on the type of the sql param, right?
10:49AWizzArdWhat do you mean?
10:50duck1123with-results takes a var to capture the results, a string sql statement and the forms to run,
10:50AWizzArdright
10:51duck1123I 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:52AWizzArdI 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:53AWizzArd(with-results res ("SELECT birthday FROM persons WHERE name = ?" "Henry") ...)
10:53duck1123that would probably be better for (prepare)
10:54AWizzArdbut also (w-r res ("SELECT bday FROM persons WHERE name='Henry'") ...)
10:54AWizzArdstill fine
10:55duck1123(with-results res (prepare "SELECT birthday FROM persons WHERE name = ?" "Henry") (first (vec res)))
10:55AWizzArdthat won't work I guess, I am not sure
10:55AWizzArdone thing that with-results can't do is to give back the whole result map
10:55duck1123wrap it in vec
10:55AWizzArd(with-results res "SELECT ..." res) ==> Exception
10:56AWizzArdthe connection is already closed or something like that
10:56duck1123otherwise you get errors trying to read after connection is closed
10:56AWizzArdyes
10:56duck1123if you wrap it in vec, it creates a copy of the whole thing
10:56AWizzArdah okay, so (with-results res "SELECT ..." (vec res)) would work you say?
10:56duck1123should
10:56AWizzArdI'll try that now
11:01AWizzArdduck1123: yes, that works
11:02AWizzArdSo 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:05AWizzArdrhickey: 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:06duck1123it doesn't read the info until outside of the connection
11:06duck1123vec reads it while it's still open to make a copy
11:07AWizzArd(identity res) also doesn't work
11:07duck1123you 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:08AWizzArdbut (count res) res works
11:08duck1123hmm... perhaps anything that consumes the whole seq
11:09AWizzArd(doall res) is also fine
11:10AWizzArdIs 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:17ChousukeI doubt gen-class would work from the repl :/
11:17dfg59anyone out there using gorilla?
11:24rhickeyAWizzArd: gen-class is for use with proper namespaces, and currently only operates when compiling
11:29Chouserhas the behavior of 'load' changed at all since right after the initial AOT stuff?
11:30ChouserI thought I had conditional loading of 3rdparty classes working in lazy-xml, but it doesn't seem to at the moment.
11:32dfg59if 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:33rhickeyChouser: 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:34Chouseroh, indeed I do get the same error with just 'require'
11:34danlarkindfg59: the author of gorilla just joined the channel, kotarak
11:35ChouserI have a try block around (load "foo"), and in foo.clj I import classes that may not exist.
11:35Chouserbut the exception appears to escape somehow.
11:36Chouserhm, it looks like a ClassNotFoundException in the stack trace, but if I change the catch to just Exception, then it's caught correctly.
11:38rhickeyChouser: could you paste trace?
11:39lisppaste8Chouser pasted "ClassNotFoundException... or is it?" at http://paste.lisp.org/display/71324
11:40Chouserlooks like it may be wrapped in a CompilerException
11:41Chouseryep, .getCause returns a ClassNotFoundException
11:43dfg59kotarak: can i ask you a question regarding a gorilla error?
11:43dfg59danlarkin: thanks
11:43kotarakdfg59: sure
11:44dfg59kotarak: 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:44dfg59kotarak: this is with gorilla-1.0.0 and svn head of clojure
11:44kotarakdfg59: this is because you use a recent SVN clojure.
11:45dfg59kotarak: ah, i see
11:45kotarakdfg59: the clojure namespace was renamed to clojure.core
11:45kotarakJust a sec
11:45dfg59kotarak: ah, makes perfect sense.
11:46kotarakdfg59: you might try the development version from the hg repository.
11:46kotarakThere I already adapted to the new structure.
11:46kotarakI'm working on a new release.
11:46kotarakBut be prepared for problems. It's still experimental.
11:47dfg59kotarak: of course, i'll give it a try. seems like an awesome tool, just what us vim users are looking for.
11:47lisppaste8craigmcd pasted "Servlet" at http://paste.lisp.org/display/71326
11:47dfg59kotarak: i suppose this means i have to learn hg :)
11:47kotarakno
11:48kotarakYou can use the webinterface to download a snapshot.
11:48dfg59awesome, thanks
11:48kotarakhttp://kotka.de/repositories/hg/gorilla
11:49kotarakohem. And then I'm stuck. I know it's possible....
11:49rhickeyChouser: isn't this exception because your first exception-based flow didn't go as planned?
11:49dfg59kotarak: it seems i can get each file individually ...
11:49kotarakdfg59: now that's bad. It should be automatically possible....
11:50dfg59kotarak: its fine, i think i can learn enough mercurial to pull it down
11:50Chouserrhickey: 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:51kotarakdfg59: if you have mercurial it's simply: hg clone http//.... somedirectory
11:51dfg59kotarak: perfect, just grabbed mercurial, thanks.
11:52Chouserso 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:52kotarakdfg59: np :) Thanks for using.
11:52Chouserstill looking to see if I can compile with xpp in the classpath and get graceful failure at runtime if its not found...
11:54rhickeyChouser: 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:56rhickeyChouser: want to try 1133 on your original recipe?
11:58Chousersure. 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:00AWizzArdIs it expected that (import '(javax.servlet.http Cookie)) ==> java.lang.ClassNotFoundException: javax.servlet.http.Cookie?
12:02lisppaste8Chouser annotated #71324 with "CompilerException svn 1133" at http://paste.lisp.org/display/71324#1
12:04AWizzArdoh Chouser, you also have a xyz class not found problem?
12:04abrooksIs there a way to access "this" Thread? I'll go digging but figured I'd ask if anyone knew off-hand.
12:05kotarakabrooks: I think the Thread class has something like this.
12:05ChouserAWizzArd: not really. I'm specifically excluding the jar I need from the classpath and trying to handle it gracefully in the code.
12:05abrooksOh, wait, so I should just be able to call Thread/getId shouldn't I...
12:05abrooksHm.
12:05ChouserAWizzArd: are you sure you have a javax.servlet package in your classpath?
12:05kotarakabrooks: Thread/currentThread
12:06Chouserabrooks: (.getId (Thread/currentThread))
12:06Chouserabrooks: discovered via (show Thread)
12:06AWizzArdChouser: no, not sure. Is this javax not a standard class that comes with every jdk and is automatically in the classpath?
12:06AWizzArdAt least I find no such folder or .class file in my jdk folder.
12:07abrooksChouser: (show Thread) doesn't work for me. I assume show is a new function?
12:07ChouserAWizzArd: 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:07abrooksChouser, kotarak: Thanks. Thread/currentThread was what I was looking for.
12:09Chouserabrooks: not new. http://groups.google.com/group/clojure/msg/96ed91f823305f02
12:11abrooksChouser: Ah.. It's just not part of core or contrib. :)
12:11Chouserabrooks: right. floating free in the ether.
12:12hiredmanbtw
12:12hiredmanclojurebot: SHOW?
12:12clojurebotGabh mo leithsc?al?
12:12hiredmaner
12:12hiredmanclojurebot: show?
12:12clojurebotshow is http://groups.google.com/group/clojure/msg/96ed91f823305f02
12:13Chouserhiredman: ah, right. thanks!
12:13kotarakChouser: is your macro help page still up? Maybe a candidate for clojurebot
12:13kotarakI mean this pastebin frontend
12:14rincewinddo you find the combinators bi tri and cleave from factor useful?
12:14rincewindIthink they should be ported
12:14mehrheitwhat do they do?
12:14hiredmanI have a webserver named rincewind
12:17Chouserclojurebot: macro help is http://clojure-log.n01se.net/macro.html
12:17clojurebotOk.
12:17rincewindbi applies two functions
12:17kotarakclojurebot: macro help?
12:17clojurebotmacro help is http://clojure-log.n01se.net/macro.html
12:17rincewindits a special case, but is
12:17hiredmanrincewind: eh?
12:18rincewinduseful in factor
12:18hiredmanapplies not composes?
12:18Chouserkotarak: good idea. I'd put that in clojurebot once before, but forgot about it just like he did. :-)
12:18kotarakI think this should be the first point to point to for macro help. Chouser, *two thumps up*.
12:20rincewind(defn bi [f g] (fn [& args] [(apply f args) (apply g args)]))
12:20hiredmanhuh
12:20hiredmanok
12:21rincewindnow that i wrote it it seems like it is a pain to use with explicit args and no currying
12:22hiredmanalso seems like a special case of (map some-func (list of functions))
12:22mehrheitI imagine the operator makes more sense in a stack language like factor
12:22technomancyhiredman: is that gist still the definitive place to get the clojurebot source?
12:23hiredmanyessir
12:23mehrheitalso maybe in a static language, like haskell's (***)
12:23technomancyhiredman: I might try my hand at getting it to announce commits in the channel, what do you think about that?
12:23hiredmannot a lot going on with clojurebot atm, I am sort of mulling over some kind of web wiki tie in
12:24hiredmantechnomancy: that would be cool
12:24technomancyhiredman: great; I'll let you know when I've got something.
12:24hiredmanwheee
12:24hiredmanclojurebot: how much do you know?
12:24clojurebotI know 0 things
12:25RSchulzWow. Clojurebot is honest.
12:25hiredmanclojurebot: how much do you know?
12:25clojurebotI know 58 things
12:25hiredmanmuch better
12:25RSchulzAnd learning fast.
12:25hiredman(doc trampoline)
12:25mehrheitmaybe he's (she's?) intimidated
12:25clojurebottrampoline 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:25technomancyRSchulz: and wise like Socrates.
12:26technomancyhiredman: is clojurebot a "he" or an "it"?
12:26technomancyor a "she"?
12:26hiredmanuh
12:26hiredmanclojurebot: pointer or setter?
12:26clojurebotI don't understand.
12:27hiredmanand "it" I guess
12:27technomancyheh; all right then.
12:28RSchulzWho wrote clojurebot?
12:28RSchulzclojurebot: who created you?
12:28clojurebotExcuse me?
12:28RSchulzI guess...
12:30hiredmanI did
12:30hiredmanclojurebot: creator?
12:30clojurebotPardon?
12:30hiredmanclojurebot: braindump
12:30clojurebotNo entiendo
12:30hiredmanclojurebot: brain dump
12:30clojurebotbrain dump is http://clj.thelastcitadel.com/clojurebot
12:31RSchulzHiredman: how much work was it? How extensible?
12:31hiredmanclojurebot: where are you?
12:31clojurebothttp://gist.github.com/27733
12:31hiredmanit was pretty easy
12:31hiredmanI used the pircbot java lib
12:31RSchulzDoes it delegate to (doc ...) ?
12:31hiredmanno
12:32hiredmanit actually pulls metadata off the vars
12:32hiredmanso it sort it sort of steps around (doc ...)
12:32RSchulzSo it replicates what (doc) does, basically?
12:33hiredmanyes
12:33hiredmanthere are formating issues, and the pircbot lib doesn't like newlines
12:34RSchulzhiredman: 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:34hiredmanuh
12:34hiredmannot *the* compojure guy
12:35RSchulzOh. I popped up a level from the clojurebot braindump and saw your name.
12:35hiredmanyeah, I am runing compojure
12:35RSchulzHow do you like it?
12:35hiredmanit is ok
12:35hiredmanI really like the vector syntax for generating html
12:36technomancyI'm trying it out too. Looks pretty handy, but I've barely scratched the surface.
12:36RSchulzHow mature is it?
12:36hiredmanbut I am not so keen on the everything bundled together approach
12:36technomancyit feels *really* weird for me to be writing web app code without an ORM. =)
12:36RSchulzDo you know much about Grails? Can you compare them?
12:36hiredmanI don't
12:37technomancyseems 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:37RSchulzWhere is the Compojure project?
12:37technomancyclojurebot: compojure?
12:37clojurebotcompojure is http://github.com/weavejester/compojure/tree/master
12:37technomancyclojurebot: botsnack
12:37clojurebotthanks; that was delicious. (nom nom nom)
12:38Kerris7awwww
12:38RSchulzIs there more than just the source??
12:38hiredmanI am am looking at webjure because it seems to integrate more with the java web app stuff
12:38RSchulzI tend to be a glutton for documentation...
12:38duck1123RSchulz: there's the readme
12:39RSchulzOh, great. We've got two web app frameworks to choose from already...
12:39duck1123that's the main documentation atm
12:39hiredmanfrom what I can tell webjure has less doc then compojure
12:39technomancyRSchulz: yeah, it doesn't strike me as heavily-documented
12:39technomancythe examples that ship with the framework are pretty sparse
12:39drewcRSchulz: it's a lisp, expect many more!
12:39RSchulzDo either of these have any kind of persistence or ORM?
12:40duck1123there was talk about someone trying compojure with tomcat... haven't heard anything since
12:40dudleyfdrewc: What's your framework?
12:40technomancyRSchulz: pretty sure compojure is persistence-agnostic. it just handles the web-related stuff.
12:40drewcdudleyf: lisp on lines and uncommon web.
12:40duck1123clojurebot: clinorm?
12:40clojurebotexcusez-moi
12:41dudleyfdrewc: Ah, okay
12:41drewrdrewc: Keep us posted!
12:41technomancyRSchulz: some of the examples mention a "persist" library; not sure where that comes from.
12:41RSchulzOf 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:41duck1123clojurebot: clinorm is http://github.com/pupeno/clinorm/tree/master
12:41clojurebotOk.
12:41drewcdrewr: will do!
12:41RSchulzWhat was that? You taught clojurebot something new?
12:42duck1123yeah
12:42RSchulzCool.
12:42duck1123clojurebot: clinorm?
12:42clojurebotclinorm is http://github.com/pupeno/clinorm/tree/master
12:42RSchulzCan it tell when someone's lying to it?
12:43hiredmanRSchulz: yeah, it monitors pupil dialation
12:43RSchulz"Tell me about your mother."
12:43RSchulz(If you get the reference.)
12:43RSchulzWell, for one thing ORM is handy if your system is O-O. Maybe less so if it's not.
12:43duck1123"my mother? Let me tell you about my mother"
12:43technomancyhiredman: scaling out RDBMSes is very well-understood, so a lot of folks feel comfortable using them for persistence.
12:44hiredmanyeah, but, uh, why are there like a million different orms?
12:44technomancyhiredman: I've used them a lot, but I'm starting to get disillusioned.
12:45RSchulz'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:45RSchulzSo the go out and create them.
12:45rsynnottthere are also 'object databases'
12:45Pupenohiredman: there are a million different lisps.
12:45rsynnottwhich are a little different
12:45hiredmanclojurebot: lisp?
12:45clojurebotLisp isn't a language, it's a building material.
12:45rsynnottthough some of them are ultimately backed by relational database systems
12:45RSchulzI 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:46hiredmanclojurebot: Tell me about your mother is <reply>My mother? I'll tell you about my mother
12:46clojurebotOk.
12:46RSchulzNow you've done it.
12:46technomancyRSchulz: yeah, I think BDB is way under-rated.
12:46rsynnottRSchulz: such serialisers exist for common lisp
12:47RSchulzOr maybe a nice interface to eXist...
12:47RSchulzI could get into that. I'll have to think about it a bit.
12:47hiredmanyou can just prn a lot of stuff
12:47RSchulzMaybe I could ditch Grails...
12:47RSchulz(doc prn)
12:47clojurebotSame as pr followed by (newline). Observes *flush-on-newline*; arglists ([& more])
12:47RSchulz(doc pr) then
12:47clojurebotHuh?
12:47technomancyalso would love to see how clojure and couchDB would work together.
12:47RSchulz(doc pr)
12:47clojurebotPrints 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:47hiredmanfor persistence with clojurebot I just prn stuff to a file
12:48rsynnottdoes it print EVERYTHING in a persistable manner?
12:48hiredman(binding [*out* somefilestream] (prn stuff))
12:48hiredmanno
12:48danlarkintechnomancy: interested in helping me with a couchdb lib, then?
12:48hiredmanjust stuff clojure has a literal notation for
12:48technomancydanlarkin: at some point... I still have to get competent in Clojure first, then learn at least the basics of couchDB. but after that... =)
12:48hiredmanstrings, hashs, lists, vecs, numbers, and so on
12:49RSchulzIsn't using an Erlang program with Clojure considered heresy?
12:49technomancyrsynnott: don't imagine it could persist closures. =)
12:49rsynnotth, hashes at least then :)
12:49technomancyRSchulz: one that embeds Spidermonkey, no less!
12:49hiredmanclojurebot stores everything in a hash
12:49rsynnottRSchulz: only a matter of time before someone implements the erlang wire protocol for clojure :)
12:50hiredmanRSchulz: some posted a sort of api using the java <-> erlang bridge
12:52rsynnottoh, I suppose that'd be a nice approach
12:52rsynnottforgot about the java bridge
12:53rsynnotthas anyone looked into erlang-style distribution for clojure?
12:54technomancyrsynnott: was just reading about that: http://bc.tech.coop/blog/081201.html
12:54RSchulzI think people are thinking about it. Presumably it would be rather orthogonal to existing Clojure capabilities.
12:55technomancyrsynnott: 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:55rsynnottit's the sort of thing that makes a lot of sense to get in early, though
12:55RSchulzThe 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:56RSchulzI assume they meant to be provocative with the title...
12:57rsynnottwell, it is, to an extent, right now
12:57hiredmanclojurebot: erlang is http://clojure.googlegroups.com/web/erlang.clj
12:57clojurebotRoger.
12:58hiredmanthere is a thread on the google group
12:59RSchulzWhat's with that double indirection for files in Google Groups?
12:59hiredman*shrug*
12:59hiredmanask google
12:59ChouserRSchulz: my guess is to prevent using it for general web hosting.
12:59RSchulzYeah, probably something like that. I just find it annoying.
13:00hiredmanalso, there was some talk about terracota
13:00RSchulzDoes 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:00RSchulzI think one of the Terracotta prinicpals sent a message to the Clojure list recently.
13:01hiredmanyeah
13:02hiredmanso there are a few possible solutions
13:02ChouserRSchulz: 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:02RSchulzI should add that it's a scripting / executive "layer" for a mature and large Java application.
13:03RSchulzThat app has a sizeable set of types, many of which are going to be relevant and exposed in the DSL.
13:04RSchulzAnd yes, I want to leverage as much of Clojure's control and concurrency as possible.
13:04technomancyRSchulz: In general I'm of the opinion that thinking of "creating a DSL" as a distinct activity is harmful.
13:04RSchulzElaborate?
13:04technomancywhenever you're writing code, you're extending the language.
13:04technomancyunless you're talking about an "external DSL" that has its own syntax etc.
13:04RSchulzSure, but the point here is to make the system more interactively accessible to non-Java programmers.
13:04RSchulzNo. Embedded.
13:05ChouserRSchulz: 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:05RSchulzRight now, it's always accessed either through its BBI (the Grails app) or the CLI.
13:06RSchulzFortunately, the content language is CLIF, which is a Lispy logic language. So my users are cool with S-Expressions, anyway.
13:07technomancyI 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:07RSchulzTrue. I may be overthinking it. ... That's been known to happen...
13:08rsynnotthas anyone written servers which handle thousands to tens of thousands of connections in clojure, actually?
13:09RSchulzI saw a slide show of some very heavy-duty (thousands of threads) performance tests with Clojure, but I can't quite remember where.
13:09rsynnottI'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:09RSchulzIt 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:09technomancytens of thousands is pretty optimistic for a situation like that.
13:09rsynnottAzul did some sort of benchmarks a while back
13:09rsynnotttechnomancy: it is :)
13:10RSchulzHmmm. That might have been what I saw.
13:10rsynnottbut I'd like to be ready for it (especially once apple starts providing its push for developers thing; allegedly any day now)
13:10RSchulzhttp://groups.google.com/group/clojure/browse_thread/thread/5c7a962cc72c1fe7
13:10rsynnottI could do it in CL, but I'd then practically be restricted to single-thread non-blocking
13:11RSchulzAh. It's coming back. It was a presentation at the JVM summit.
13:12RSchulzhttp://www.sauria.com/blog/2008/09/27/the-first-annual-jvm-language-summit/
13:12rsynnott(basically, I haven't done anything serious in clojure as yet, so am slightly scared of it :) )
13:13technomancythe common logic for such a situation says that if you get that many users, you'll have enough money to scale it up.
13:13RSchulzYou've got to let the seduction of Lisp carry you in...
13:13technomancythat too
13:13rsynnottRSchulz: I'm primarly a CL user at the moment :)
13:14RSchulzThat's way better than many of the alternatives!
13:15rsynnottand I've done work in Erlang before
13:15RSchulzI have a friend who finally landed a CL job. Then after about 6 months the company (a start-up) folded!
13:15rsynnottso I'm happy enough with the language itself
13:16rsynnottI suppose I'm just cautious because I haven't used it for anything serious yet
13:16technomancyRSchulz: common story with start-ups.
13:16rsynnott(also, lack of a mature persistency system is a downside; there are several nice ones for CL)
13:16rsynnottRSchulz: ah, which one was it?
13:17RSchulzYeah. 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:17rsynnottI've only ever really worked for small companies
13:17gnuvincedamn
13:17RSchulzMy friend's company? I can never remember the name. It's out east (MD) and in the medical informatics area.
13:17gnuvincethree guys speaking, and irssi colors their nick the same :-/
13:17rsynnott(though my previous job was for a former startup which got bought by Activision)
13:18rsynnottit remained fairly independent, though
13:18rsynnottthough we did at one point have to fill out an absurd employee survey of the sort that big companies love so much
13:20hiredmangnuvince: yeah
13:20hiredmanwhat is up with that
13:20gnuvincehiredman: not sure how it picks a color, but it's pretty unlucky :)
13:23ChouserMy favorite is Jaro-Winkler distance.
13:24danlarkinI prefer Mandelbrot-Klein
13:25technomancywhen 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:25Chouserhehe
13:25technomancyit's quite effective for folks who use other languages though.
13:25RSchulzI once evaluated a pile of edit-distance measures for matching noisy data. Not really my cup of tea, though.
13:26RSchulzI used R, which is pretty nice.
13:30technomancyhow do you get at the classpath from the Repl?
13:31hiredman(System/getProperties)
13:31hiredmanit's in there somewhere
13:31RSchulzBut I believe that won't reflect dynamic changes to the classpath during exeuction, if that matters to you.
13:32hiredmanyes
13:32hiredmanclojurebot: classpath?
13:32clojurebotexcusez-moi
13:32hiredmanclojurebot: classpath is (get (System/getProperties) "java.class.path")
13:32clojurebotYou don't have to tell me twice.
13:32technomancyI'm trying to debug a slime problem, so I exported CLASSPATH... those entries don't show up in getProperties
13:32RSchulzYour bot has an attitude...
13:33hiredmantechnomancy: are you using clojurebox?
13:33technomancyhiredman: nope; just the latest slime+swank-clojure+emacs all from source
13:33hiredmananyway, I think swank or slime, or whatever adds jars from ~/.clojure to the cp automagically
13:34technomancyinteresting. will try that.
13:34technomancyjust all the jars in that directory?
13:34hiredmanI believe so
13:34technomancynice; thanks.
13:35hiredmanI was digging through, uh, I think it was teh version of swank-clojure that came with clojurebox
13:35technomancyworks fine for me.
13:35hiredmanand that was my first time reading elisp
13:35technomancyheh
13:35hiredmanoh, good
13:36technomancylooks like that did the trick. the problems I was seeing must have been classpath-related.
13:36technomancyvery relieved to be able to use slime again.
13:37technomancyso for automated testing... it looks like compojure uses the fact library, which looks promising.
13:37technomancyare there any other notable test libraries?
13:39hiredmanclojurebot: jar direcotry?
13:39clojurebotGabh mo leithsc�al?
13:39hiredmanclojurebot: jar directory?
13:39clojurebotjar directory is -Djava.ext.dirs=$LIBS
13:40technomancyhandy
13:43RSchulzI 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:43RSchulzhttp://wiki.jvmlangsummit.com/BytecodesForFastJVMs
13:44RSchulzIt came from here: http://wiki.jvmlangsummit.com/Presentations
13:47RSchulzYou 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:48rhickey_RSchulz: It's a TCO program that uses Ant Colony Optimization
13:48rhickey_sorry TSP
13:49RSchulzDid you work with him on that?
13:50rhickey_I wrote it, it's in tsp.zip on the group
13:50RSchulzAh. Thanks.
14:04technomancyso ruby has a ~/.irbrc file that gets loaded at the beginning of every repl session. is there anything similar for clojure?
14:04Chouserrhickey_: do threads ever block at all in a transaction because of ref contention, or do they only ever retry?
14:05danlarkintechnomancy: user.clj somewhere on your classpath
14:05Chousertechnomancy: I have such a beast in the clj shell script I use.
14:05technomancydanlarkin: thanks
14:05rhickey_Chouser: there's blocking in the STM
14:06rhickey_to prevent busy churn
14:06Chousertechnomancy: it just adds ~/.clojurerc.clj before any .clj given on the command line.
14:06Chousertechnomancy: I use this instead of user.clj mainly so I can set *print-length* (user.clj happens too early for that)
14:07technomancycool. what's the status on getting a standardized clj bin in the official distro?
14:07Chouserrhickey_: thanks.
14:08rhickey_Chouser: did 1133 matter for your problem?
14:09Chouserrhickey_: no, I updated the paste.
14:09Chouserrhickey_: http://paste.lisp.org/display/71324#1
14:09rhickey_ok
14:28RSchulzIf they tell, they're no longer lurkers...
14:29RSchulzThey're spies from the other languages...
14:30technomancyand a few from ruby-related channels
14:30danlarkinit's a cabal against clojure!
14:31RSchulzLet 'em try!
14:31technomancy#emacs denizens are generally pretty polyglot-tastic, if I may generalize
14:33RSchulzI have a module / namespace dependency question...
14:34RSchulzIf I write code in a namespace that uses others, it should directly (use ...) or (require ...) them, right?
14:34technomancyI think use wraps require.
14:34RSchulzAnd if I (use) a Clojure Contrib namespace and I get an error, does that mean it's a problem with that module?
14:34technomancythe book recommends use with the :only option to make it clear what you're using from various places
14:35RSchulzRight. The real point is that I tried (use)-ing some Clojure Contribs and get funky error messages at the point where (use) them.
14:35RSchulzE.g.:
14:35RSchulzuser=> (use 'clojure.contrib.enum)
14:35RSchulzjava.lang.Exception: Unable to resolve symbol: gen-and-load-class in this context (enum.clj:42)
14:35RSchulzAm I doing something wrong?
14:35ChousukeRSchulz: probably not
14:36ChousukeRSchulz: gen-and-load-class went away recently.
14:36RSchulzI believe I have my classpath set properly. I can successfully (use) other contrib libraries.
14:36ChousukeRSchulz: is your contrib recent?
14:36RSchulzAh.
14:36RSchulzYes.
14:36Chousuke enum might be broken :/
14:36RSchulzI svn up both the Closure and Closure-contrib at least daily. (or when I hear of a change)
14:37RSchulzSo when everything is kosher, a (use) should stand alone (contingent only on a suitable classpath)?
14:37ChousukeI keep getting told you should use the ns macro instead of use directly.
14:38RSchulzActually, I was. I treid the separate (use) just to test.
14:38RSchulzI was actually doing a big grab-bag (ns ... :use ...) to pull in all of Contrib so I could generate a ctags file.
14:38RSchulzNaturally, I'd rarely if ever use all those contribs at once.
14:39Chousukeanyway, it seems the enum lib is simply broken
14:39RSchulzOK. That's no problem.
14:39technomancyheh
14:41RSchulzIs there any likelihood of getting a bounded comment? #| ... |#, e.g.?
14:41alec(comment ...)?
14:42RSchulzBut that's not textual. The enclosed content must parse, right?
14:42RSchulz(I had a huge argument about this on the Common Logic standards group. I won that one...)
14:43duck1123be 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:45technomancyruby added bounded comments, but nobody uses them.
14:45technomancyEmacs' M-; makes it really easy to toggle commenting of large regions of code.
15:10hiredmanRSchulz: bounded comments are on the todo
15:10hiredmanclojurebot: todo?
15:10clojurebottodo is http://richhickey.backpackit.com/pub/1597914
15:10RSchulzGreat. I think they're a good thing.
15:11technomancyis there any timeframe on 1.0, or is it just "when it's done"?
15:12rhickeytechnomancy: it's really almost done, just want to let people use the latest changes a bit and incorporate any feedback
15:12technomancygreat!
15:12RSchulzFabulous.
15:13technomancyrhickey: is there any chance a shell script wrapper could be included? seems like everyone just rolls their own anyway.
15:13RSchulzIn 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:13rhickeytechnomancy: I don't think so in 1.0
15:14RSchulzMost of them are *something-or-other*
15:14RSchulzPlus identical? in-ns and load-file
15:14technomancyrhickey: 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:14rhickeyRSchulz: some things are created programmatically by the bootstrap
15:15rhickeye.g. in-ns is not defined in Clojure
15:15RSchulzSo 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:16Lau_of_DKGood evening gents
15:16RSchulzConsidering Clojure's define-before-using requirement, there probably wouldn't be any false hits when visiting those tags.
15:20mehrheitif (. Classname member) is going to be deprecated, what would be the equivalent of `(. Classname ~member) etc. in macros?
15:22technomancyisn't it (.Classname member) now?
15:23mehrheitit's (.member instance ...) and (Classname/member ...)
15:24Chousermehrheit: (symbol "Classname" member)
15:24Chouserperhaps
15:25mehrheitthat looks a bit hackish; how about the (. instance member) case?
15:27ChouserI don't think that one has been considered for deprecation.
15:27ChouserI'm actually getting the impression, these days, that (. Classname static) may not be going away either.
15:29mehrheityou're right, it wasn't. Anyway, is there a reason for (. Classname member) to be considered inferior?
15:33Chousermehrheit: in macro expansions or in hand-written code?
15:38mehrheitgenerally; the reason to consider it for deprecation
15:39rhickeymehrheit: 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:39Chousera 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:41mehrheitoh, okay. thank you
15:43rhickeythere really is no problem with it when used as intended
15:45RSchulzRegarding Rich's to-do list: Is everything except the "Long-term" items to be finished before 1.0 is released?
15:46rhickeyRSchulz: oh, no
15:46RSchulzJust the "Hot" items?
15:47rhickeyRSchulz: no, almost done
15:47RSchulzIs there some place where more is said about those items? E.g., what's the "valid in (keyword s) ..." about?
15:47RSchulz("validate" that is)
15:48hiredmanarg
15:48hiredmanI have a dumpdicts fn in clojurebot that uses something like (binding [*out* somefilestream] (prn dict))
15:49rhickeyRSchulz: 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:49RSchulzYou mean validate the arguments to (keyword ...) and (symbol ...)?
15:49hiredmanwhich prints out the hash it uses for look up into a file
15:49RSchulzAh. I see.
15:49hiredmanand it works
15:49hiredmanunless I call it in another thread
15:49hiredmanno exceptions, nothing
15:50RSchulzE.g.:
15:50RSchulzuser=> (keyword "this really shouldn't be a symbol")
15:50RSchulz:this really shouldn't be a symbol
15:50rhickeyRSchulz: right
15:50RSchulz(Though I should have said "be a keyword", I guess)
15:51RSchulzDoes Clojure have a counterpart to CL's |arbitrary name| reader notation?
15:51rhickeyRSchulz: under Hot: arbitrary symbols in | |
15:51AWizzArdrhickey: 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:52rhickeyAWizzArd: yes
15:52RSchulzI can read... Honest! I just choose not to...
15:52AWizzArdgreat, thx
15:53technomancyfor dependencies, does everyone either just use maven or bundle a copy of them with the stuff they distribute?
15:55hiredmanclojurebot: ties
15:55clojurebotties is http://www.bitbucket.org/achimpassen/clojure-ties/wiki/Home
15:55hiredmantechnomancy: ^-
15:55hiredmanI dislike that though
15:55hiredmanbundling, or maven
15:55hiredmanor ties
15:56technomancyhiredman: thanks. I've pretty much decided I'm never, ever going to use maven.
15:56technomancyI have to use it at work, and that's enough
15:56StartsWithKtechnomancy: 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:56hiredmanjust tell me, so I can decide if I can be assed with your stuff or not
15:57technomancyrather, I'm never going to write any XML to configure my projects. religious issue.
15:58StartsWithKtechnomancy: you can use javascript (and some other languages) inside ant build.xml
15:58technomancyhmm... json might be palatable.
16:00StartsWithKthere is also buildr (ruby/jruby) build tool
16:00technomancyyeah, I could use rake, but that's another dependency that can't be automatically handled
16:04StartsWithKmake, scons.. all good tools, but ant works the best in my opinion for clojure
16:04hiredmanat least until one gets written in clojure
16:12kotarakI 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:12technomancyhiredman: that's the idea. =)
16:13technomancyhiredman: there's one in the book as a sample app; I wonder if it's meant to be taken seriously
16:15hiredmankotarak: does the ns have anything in it?
16:15kotarakYep. one private function, one public
16:24kotarakOk. 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:26AWizzArdhmm
16:35hiredmanclojurebot: webjure is http://code.google.com/p/webjure/
16:35clojurebotRoger.
16:39hiredmanif 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:39AWizzArdhiredman: about this sql interface in webjure.. does it support prepared statements for select queries?
16:40kotarakhiredman: I suppose it's better to send-off again. Otherwise you can just use a thread.
16:40hiredmanAWizzArd: dunno
16:40hiredmanI think I really want some kind of mix of compojure and webjure
16:41kotarakI 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:41Chouserhiredman: the ants demo uses send-off, at least partially because that allows you to update the action function while it's running.
16:41hiredmanI see
16:45AWizzArdYes, 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:47Lau_of_DKAWizzArd: thanks for the heads up
16:48AWizzArdLau_of_DK: http://code.google.com/p/webjure/source/browse/trunk/webjure/src/main/resources/webjure/sql.clj
16:48hiredmanI like the idea of being able to deploy a war
16:49hiredmanI don't like all the .java files and the lack of docs
16:59AWizzArdhiredman: in webjure you mean?
17:00Lau_of_DKAWizzArd: It looks good, I need to hit the sack though, catch all ya'll l8r
17:00hiredmanAWizzArd: yes
17:17ChouserI've got a grid of agents sending actions to each other, with a main thread blocking on a semaphore until they're done.
17:19Chouserwhen 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:20ChouserAny 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:20rhickeyChouser: sends are held until after state change - it could send to release the semaphore
17:21Chouserah, 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:22rhickeyChouser: they are held specifically because for situations like this
17:22rhickeybecause/for
17:24Chousergreat, thanks.
17:25ChouserI just solved the same PE problem purely functionally single-threaded and then again using agents.
17:25rhickeyChouser: cool!
17:25ChouserI need to refine the agents one a bit yet, but so far I'm a bit surprised how procedural the agent solutoin feels.
17:29Chouserbut 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:29rhickeyChouser: it should to some degree - agents are stateful
17:30rhickeyyou can make the transitions functions, but messaging is not functional
17:31Chouseryes, most of the calculation code is unchanged, but then there's the agent management baggage.
17:32ChouserI mean it still translates to only 4 or so extra lines of code, so we're not in Java territory or anything...
17:32rhickeyChouser: pmap didn't help
17:32rhickey?
17:32Chouserhm... should have considered that more carefully.
17:34ChouserI may try that once this is working. What I want feels more like a preduce on a mutating queue. :-P
17:35Chouserso perhaps pmap could be used if I put a seq interface around a ref of a queue
17:46duck1123AWizzArd: I really think clojure.contrib.sql needs to support them directly
17:47duck1123do I need to turn in a CA to commit to contrib?
17:47duck1123or send in patches?
17:51AWizzArdduck1123: I agree
17:52AWizzArdas both is open source we could 'steal' them from webjure and put them into contrib
17:53duck1123I've found several neat little functions in compojure that really belong in a different namespace
17:53ChousukeI think contrib requires the CA
17:53rhickeyduck1123: yes, you need a CA
17:54duck1123I 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:54rhickeyAWizzArd: and nothing can be 'stolen' and put in contrib, if the webjure author wants to contribute, he can
17:56AWizzArdrhickey: an long both is open source and both have compatible licenses, then the authors agree that there is no problem I guess.
17:57rhickeyAWizzArd: 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:58AWizzArdokay I see, so my assumption about the compatibility was not correct
17:58rhickeyAWizzArd: not for contrib, downstream people can combine libs via their licenses
18:00hiredmanclojurebot: gen-class?
18:00clojurebotNo, hiredman, you want gen-interface + proxy
18:01hiredmanhoisted on my own petard
18:01AWizzArd:-)
18:14hiredmanclojurebot: for reals now, gen-class?
18:14clojurebotI don't understand.
18:31hiredmananyone know anything about servlets?
18:32hiredmanthe example I see extends javax.servlet.http.HttpServlet but my repl says class not found
18:34danlarkinclojurebot noooo
18:35RSchulzWe mourn the loss of clojurebot. He/shee/it will be missed.
18:35RSchulzClojurebot! You're Alive!
18:35danlarkinclojurebot: how many things do you know?
18:35clojurebotexcusez-moi
18:35danlarkinclojurebot: how much do you know?
18:35clojurebotI know 64 things
18:36RSchulzAt least clojurebot's memory survives his reincarnations...
18:36danlarkinand it's a power of two, rejoice!
18:36RSchulzYes. That occurred to me. We should also celebrate palindromes.
18:36RSchulzclojurebot: what do you know?
18:36clojurebotIt's greek to me.
18:37RSchulzYou'd think he could just dump his memory...
18:37RSchulzclojurebot: braindump
18:37clojurebotIt's greek to me.
18:37RSchulzclojurebot: brain dump
18:37clojurebotbrain dump is http://clj.thelastcitadel.com/clojurebot
18:37danlarkineh nobody wants him to spam the channel with 64 things
18:37RSchulzHe's a bot. He should do what he's told!
18:38RSchulzMore or less...
18:38hiredmanthe brain dump url is in time going to be a wiki sort of interface to clojurebot
18:39danlarkinI like it..
18:39RSchulzThat would be cool.
18:40hiredmanthat is what I said, unfortunately clojurebot and my compojure install are running in serparte jvms right now
18:41RSchulzAnd they say monolithic software architectures are a bad thing...
18:41RSchulzWe need to go back towards _the_ computer. _The_ program. _The_ database. Etc.
18:42RSchulzThat would help, don't you think? Top-down everything.
18:42RSchulzclojurebot: what is blackdog?
18:42clojurebotYou don't have to tell me twice.
18:43RSchulzClojurebot is indulging in koans, it seems.
18:52hiredmanugh
18:52hiredmanthis is so lame
18:52hiredman=> javax.servlet.http.HttpServlet
18:52hiredmanjava.lang.ClassNotFoundException: javax.servlet.http.HttpServlet (NO_SOURCE_FILE:0)
18:59hiredmanclojurebot: servlet is http://www.sitepoint.com/article/java-servlets-1/3/
18:59clojurebot'Sea, mhuise.
19:11Flox_clojurebot: what
19:11clojurebotwhat is blackdog?
19:14danlarkingaha
19:21RSchulzhiredman: You need an actual servlet container to define that class.
19:21RSchulzI 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:22RSchulzYou can use (one of) the Tomact JARs in your class-path. Or that of any other servlet container. Jetty, etc.
19:24RSchulzclojurebot: what is servlet?
19:24clojurebot'Sea, mhuise.
19:25RSchulzclojurebot: what is servlet
19:25clojurebotYou don't have to tell me twice.
19:25RSchulzclojurebot: servlet
19:25clojurebotservlet is http://www.sitepoint.com/article/java-servlets-1/3/
19:25RSchulzClojurebot is kind of telegraphic. Terse, you know...
19:34technomancywhat's the clojure equivalent of __FILE__?
19:34technomancythat is, the current filename being eval'd
19:36SimonAdameitHi
19:36Chousertechnomancy: *file*
19:36technomancyChouser: thanks
19:37SimonAdameitConcerning delay/force, do I have to manually call force, or will the standard clojure methods already do that for me?
19:37technomancyhow do you get just the directory part of the filename?
19:37ChouserSimonAdameit: you will have to do it yourself.
19:37SimonAdameitChouser: oh no :(
19:38rhickeyadded new reference type - Atom, with constructor function atom, swap!, and compare-and-set!
19:38rhickeyAtoms implement IRef, and thus deref/@ and validators
19:38rhickeyAtoms provide independent, synchronous change of individual locations
19:38ChouserSimonAdameit: I'm pretty sure that's the case, as a nod to performance (not having to do an extra check on every value)
19:39SimonAdameitChouser: Yeah, though I thought I could do data parallelism using delay await and agents :)
19:40SimonAdameitonly calling await, when the delay is actually forced
19:43RSchulztechnomancy: The getFile method of File will return only the basename portion of the name with which the File instance was constructed
19:43RSchulzOops... You asked about the directory portion...
19:44RSchulzThe getParent method does that.
19:44technomancyRSchulz: thanks. so I need to instantiate a Java File object for that?
19:45RSchulzYes. That's the only way to get at the functionality of path name manipulation in Java.
19:45technomancya'ight... and that requires importing something, it looks like?
19:45RSchulz(import '(java.io File))
19:46technomancythanks!
19:46RSchulzDenada
19:48RSchulzuser=> (def someFile (new File "foo/bar.bletch")) (.getParent someFile) (.getName someFile)
19:48RSchulz#'user/someFile
19:48RSchulzuser=> "foo"
19:48RSchulzuser=> "bar.bletch"
19:49Chouserrhickey: interesting! atom mutations are side effects that should not be done inside transcactions?
19:50technomancyI 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:50technomancyclojurebot: fact?
19:50clojurebotGabh mo leithsc�al?
19:50rhickeyChouser: correct
19:50RSchulzMutating atoms can lead to radioactive decay...
19:51rhickeyChouser: but atom mutations cannot have race conditions, so more than just a variable, plus validators
19:51rhickeysmall wrapper around AtomicReference
19:51rhickeynote in the implementation the use of proxy
19:53Chouseroh, this is the beginning of the concurrent wrappers, isn't it
19:53rhickeyChouser: yup
19:54rhickeyBut people have difficulty writing a CAS spin, ,so this wraps that up for them, while also getting rid of set
19:54rhickeyswap! works like alter/send
19:54Chouserah, sure -- before recent proxy updates, you would have implemented something like atom in Java.
19:54rhickey(swap! atom fn args) is atomic
19:55RSchulzrhickey: What motivated Atom? Performance considerations or programming convenience?
19:56RSchulz... Or something else?
19:56Chouserhow can that be atomic -- that means no lock, right?
19:56rhickeyChouser: correct, no lock, its a CAS spin inside
19:57rhickeyRSchulz: people have been using Refs for things they will never share, like memoization caches - that's overkill
19:57RSchulzHow 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:57rhickeyRSchulz: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/atomic/AtomicReference.html
19:58SimonAdameitWhat is the idiom for the otherwise path of a cond clause?
19:58RSchulzI see.
19:59SimonAdameit(always-true (do-stuff...))
19:59Chouserrhickey: ok, so if I can use AtomicInteger, that may be faster than (swap! x inc)
19:59ChouserSimonAdameit: :else
19:59rhickeySimonAdameit: :else
20:00SimonAdameitThanks, (the api does not say it at the cond entry)
20:01RSchulzrhickey: Will (doc ...) ever give details for special forms? Most (all?) of them now refer the user to the Web site.
20:01rhickeyChouser: only overhead is validate fn null check, the swap is the same, as is the loop you would have to write
20:01rhickeyRSchulz: 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:02RSchulzUnderstandable. Perhaps (anticipating an enhanced REPL) you might consider including URLs in the (doc ...) strings.
20:02rhickeyChouser: get and conpareAndSet do not go through the proxy dispatch, as they are final
20:03rhickeyit's fast
20:03technomancyRSchulz: that shouldn't be hard to support in SLIME
20:03RSchulzNor Enclosure nor Peter Wolf's IDEA plug-in...
20:04RSchulzSpeaking 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:05Chouserbut 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:05RSchulzOr, e.g., one that does complettion based on globally known symbols.
20:05RSchulzDoes JLine provide completion?
20:05ChouserRSchulz: I understand the rlwrap does
20:05RSchulzAh.
20:06RSchulzWhich is considered more advanced, JLine or RLWrap?
20:06duck1123there are instructions on how to set it up in the wiki
20:06RSchulzduck1123: "it"?
20:06duck1123RSchulz: rlwrap
20:07technomancyrlwrap is more general, so it's probably more mature, but it can't tie into Java at all.
20:07Chousukeon my system rlwrap worked better
20:07Chousukebut I use SLIME
20:07RSchulzYeah. Lucky you. Emacs user...
20:07ChousukeI used to use vim, really. :p
20:07Chousukebut I made my emacs into a vi so it's fine now.
20:07RSchulzLittle did I know, 30 years ago, that Vi wasn't the best choice. (But, in fact, the _only_ choice!)
20:08ChouserRSchulz: don't despair. there is hope for us.
20:08technomancyChouser: I don't know if I'd go *that* far.
20:08RSchulzVi / Vim is not a death sentence, you know....
20:09duck1123just water-torture
20:09ChousukeI have to admit emacs is really impressive. I'd like to see vi try and emulate emacs acceptably
20:09RSchulzSure. Laugh. Waterfowl...
20:09RSchulzduck1123: Does the word "Ductillion" mean anything to you?
20:09Chousukeviper is not perfect but it does away with a lot of the evil emacs key combos.
20:09technomancyI'm just messing around. Vim is not bad. (Vimscript, on the other hand...)
20:10duck1123RSchulz: not without googling
20:10RSchulzDon't bother.
20:10RSchulzIf you don't know, it's nothing.
20:10technomancydoseq changed recently, didn't it?
20:10duck1123fnord
20:12RSchulzNah. It's just an SL name associated with ducks I know.
20:12ChouserRSchulz: there are Chimp and Gorilla for Clojure integration with vim
20:12ChouserRSchulz: and don't tell anyone, but I'm working on a little thing that may help
20:12RSchulzI heard Gorilla was not yet ready for prime time. Is that not correct?
20:12duck1123No, I am Ah Forder on SL. I am duck1123 just about everywhere else
20:14technomancyhas anyone talked about reimplementing Emacs in Clojure?
20:14RSchulzChouser: If I promise not to tell, will you let on about the "little thing?"
20:14duck1123I was just thinking that
20:14technomancynot because I think it's a good idea, but because eventually someone will, and I'm just curious if it's happened yet.
20:15duck1123I've often wondered what would happen if emacs was re-implemented from the ground up
20:16RSchulzWell, for one thing, we wouldn't hear from you for about 3 years...
20:16technomancyduck1123: by the time you'd finished it, Emacs would have had lexical binding, multithreading, and a decent display engine written.
20:16RSchulzBut there are several independent implementions, right? Gnu Emacs. XEmacs. JOVE. Probably other.
20:16duck1123good, then I don't need my version
20:17blackdogand it would probably still use less memory than a java equiv notepad
20:17RSchulzI didn't say that. More is better right?
20:17technomancyRSchulz: 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:17ChouserRSchulz: minimal editor and repl implemented in pure clojure, starting with "regular" editor bindings and minimal vi bindings
20:17blackdogjedit is good, but it's 60mb after starting it up
20:18RSchulzOK. 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:18Chouser...oh, plus strong clojure support (highlight, indent, etc.)
20:19RSchulzWell, at least Clojure is now available as a basis for ... Clemacs?
20:19technomancyyeah, there's nothing like writing code using the language itself. major bootstrap bonus.
20:19RSchulzClomacs?
20:19ChouserI'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:20rhickeyChouser: yes, AtomicInteger etc still have use, atom is just AtomicReference
20:20RSchulzAbsolutely. 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:21RSchulzAnd _anything_ would be better then Eclipse...
20:21RSchulz(I'm not a fan...)
20:22RSchulzReally? That lineage I was not aware of.
20:22blackdogvisualage
20:22duck1123I used to use Eclipse before I switched
20:22RSchulzYeah. VAJA I know about.
20:22blackdogvisualage was implmented in smalltalk i believe
20:22RSchulzBack before the dawn of time, maybe...
20:22walters_eclipse just really needs some equivalent to M-x
20:23walters_and to pick some extension language
20:23technomancyyeah, for a while it translated JVM bytecode to run on the smalltalk VM on the fly IIRC.
20:23RSchulzYeah, right. More finger-twisting key combinations will solve all the problems...
20:23RSchulzWell, we're in the JVM world. The Squeakers have their own realm.
20:48RSchulzblackdog: 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:49blackdogi 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:55RSchulzYeah, 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:56blackdogwhen i say mode, i mean plugin with repl and namspace browser (stolen from enclojure)
20:56blackdogi just got busy and started using emacs :)
20:57blackdogi took the scheme plugin as a starting point
20:58RSchulzThat'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:58blackdogit's a very good editor to use as a alternative to clojurebox
20:58RSchulzBut I'd still prefer everything in IDEA. I'm hoping Peter Wolf will make good progress on his Clojure plug-in for IDEA.
20:58blackdogsmall deployment and you can script the editor in clojure
20:59blackdogbetter fit really than emacs
21:00RSchulzWhich are you referring to? jEdit?
21:00blackdogyea, from a java integration perspective
21:00RSchulzSure.
21:00RSchulzIt's too bad they can't get an official release out...
21:01blackdogi downloaded their latest snapshot and there are some quality issues
21:01RSchulzIt hasn't been the same since Slava moved on.
21:01blackdogon screeen redrawing
21:01blackdogyea, he hangs out here sometimes
21:01blackdoghe's taking some clojure ideas into factor
21:01blackdogthe persistent data structures
21:02RSchulzReally? 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:02RSchulzWhat's "factor?"
21:02blackdoghe moved from jedit to create a forth
21:02blackdogfactor is a forth language
21:03RSchulzForth? As in proto-PostScript?
21:03RSchulzI looked into it once, but it did _not_ appeal to me.
21:03blackdogi don't know anything about forth :) it seems to be lower level than i want to be
21:03RSchulzTo say the least...
21:04RSchulzI'm surprised that Slava would find it interesting. I'd figure him to go _upward_ in the language abstraction dimension.
21:04zakwilsonIs 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:05blackdogi really don't know
21:05technomancyfactor is inspired by forth, but it's supposed to be much higher-level, yeah
21:05blackdoghttp://factor-language.blogspot.com/
21:05RSchulzThanks. I'll check it out.
21:06gnuvince_Factor is much higher level than Forth.
21:06gnuvince_It's mix of Lisp, Smalltalk and Forth.
21:07technomancyfactor was on my list for consideration as my 2009 language
21:07technomancybut clojure won, and I couldn't wait till the next year. =)
21:08RSchulzClojure is fantastic, isn't it?
21:08RSchulzI 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:08blackdogI'm a fan, i'm using it for everything, and a lot less code to manage
21:09blackdogcompared with java
21:09technomancyI'm still easing myself into the immutability mindset. I get it for simpler tasks; still have a lot to learn for bigger stuff.
21:09RSchulzYeah. I can see Java becoming the assembly language of my universe in a year or two!
21:10walters_i would say more "core libraries and infrastructure"
21:10zakwilsonClojure 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:10RSchulzTwo 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:11zakwilsonAnd most things that seem like they should be simpler in other Lisps are in Clojure.
21:11RSchulzBut then, it won't really matter, will it?
21:12blackdogi 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:13RSchulzI'm always fascinated / perplexed by how many people think Lisp (as in CL) is a functional language. I've never accepted that.
21:13RSchulzACL2, sure, but CL? No way.
21:14zakwilsonIt comes from people learning Scheme in some CS course.
21:14RSchulzWell, Scheme is a lot closer, to bure sure.
21:14zakwilsonScheme allows, but doesn't strongly encourage functional programming.
21:14RSchulz... "to _be_ sure..." Can't type...
21:15RSchulzHow 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:15blackdogyes
21:15blackdogyou can add what you want
21:15blackdogafter the fact
21:15RSchulzGreat.
21:16RSchulzIs there any storage efficiency with structs? Or are they syntactic sugar only?
21:16zakwilsonHow? I thought structs were immutable?
21:16blackdogyes
21:16RSchulz(If that qualifies as syntactic sugar.)
21:16RSchulzMaps are immutable!
21:16RSchulzIf you (assoc ...) onto a map, you get a new map. The original remains unchanged.
21:17blackdogstructs are just maps, but rich optimized them for storage somehow
21:17danlarkinit returns a /new/ map
21:17rhickeyRSchulz: there is storage efficiency in that the shared keys are stored once only
21:17RSchulzInteresting. (You lurker). I'm inclined to wonder how you do it, but also I don't much care, as long as it works...
21:18ChouserRSchulz: the code's not too hard to read -- PersistentStructMap.java
21:19zakwilsonIt returns a new PersistentStructMap, not just a map.
21:19RSchulzOK. More things to add to my reading list.
21:19RSchulzSince 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:19zakwilsonso 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:21Chouserzakwilson: yep, keys are stored in the basis object, PersistentStructMap$Def
21:21RSchulzI was wondering if anyone has done MultiSet and / or MultiMap in persistent form?
21:21rhickeyRSchulz: I guess I could, I mention some motivations in my talks. I guess I like Clojure to speak for itself.
21:22RSchulzrhickey: I can see that, and respect it. But sometimes one wonders just what goes on in the mind of a successful language inventor.
21:23RSchulzYou know, so we can steal your creativity and use it as our own. (As if...)
21:25RSchulzConsider 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:25RSchulzIf that.
21:26RSchulzWhat's worse, occasionally these half-assed languages escape the confines of their keepers and go feral. And that's never a good thing...
21:26rhickey:)
21:26Chouser*cough* PHP
21:26RSchulzWell, think about it. Eventually you deserve some kind of respite. Maybe you could throw us a bone.
21:27RSchulz(and write something that can't be considered wrong or "buggy.")
21:28RSchulzWhen 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:28hiredmanheh
21:28RSchulzI'm trying to avoid naming names. I might want to get a job somewhere some day.
21:29hiredmanI 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:30RSchulzAnd no one can complain. It may collapse, but at least it's done.
21:30RSchulzWell... Time for the Simpsons and supper... Ciao.
21:31rhickeyRSchulz: bye
21:40hiredmanrhickey: 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:41hiredmannil works fine
21:54rhickeyhiredman: what svn rev?
21:55hiredman1128
21:56rhickeyhiredman: was fixed since then
21:57hiredmansorry about the false alarm then
22:18duck1123that needs to be added to clojurebot. (rev 1128) => "commit message"
22:19duck1123how hard is it to set up it's code?
22:19duck1123I assume I need the java libs
22:19albinobetter would be a link to the commit message
22:20duck1123that works just as well
22:20duck1123if it has a meaningful api, you wouldn't need to parse anything
22:22duck1123(str "http://clojure.svn.sourceforge.net/viewvc/clojure?view=rev&amp;revision=&quot; rev-id)
22:27technomancyduck1123: I was planning on adding that to clojurebot
22:45technomancyclojurebot: where are you?
22:45clojurebothttp://gist.github.com/27733
22:45technomancyduck1123: ^
22:57technomancystack traces are hard.
22:59Chouserare they?
23:00technomancyChouser: useful ones are.
23:00technomancyI'm much more forgiving of bad stack traces ever since I tried to implement them in my own Scheme though.
23:00Chouserheh
23:01technomancyJRuby is worse though since the Java stack and the Ruby stack get interleaved.
23:01Chouserusually all I need is the very top (or bottom) exception description and then find the first mention of my .clj file
23:06dthomasOn 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:07hiredmantechnomancy: I have to warn you, something somewhere in clojurebot (maybe the pircbot lib) swallows exceptions regularly
23:07dthomasMakes 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:08dthomas(Not that I'm at all sure that would actually work; more of a theory.)
23:37_lvijayi 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_lvijayok that didn't format well
23:37_lvijayany mibbit users?
23:37_lvijayhere's the code:
23:37_lvijay(for [x seq :when (test-fn item (key-fn x))] x)
23:39hiredman_lvijay: I recomend to you the sequences section of the website
23:41_lvijay(doc filter)
23:41clojurebotReturns 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_lvijaythat's what i need
23:42_lvijayhiredman: thanks
23:46technomancyhiredman: do you test on a local IRC server? would such a thing be easy to set up?
23:47hiredmantechnomancy: I test right here
23:47hiredmanI did a lot of testing via privmsg
23:47technomancyhiredman: 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:47technomancymaybe get a test suite of sorts
23:48hiredmandunno
23:49technomancyI guess the individual functions would be easy to test offline. just the integration-level tests would require a server
23:50hiredmanthere must be all kinds of bugs in the parsing
23:51hiredmanripe for refactoring
23:52technomancywill give it a look
23:52hiredmanat least I finaly got the thread that writes out the dict-is hash to work
23:53hiredmanstill don't know why it was not working before
23:53hiredman*sigh*