#clojure log - Dec 15 2009

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

0:05 hamza: guys, what is the best way to add 1 to a list contaning (2 3) so that i get (1 2 3), tried (concat 1 '(2 3)) but does not work?

0:06 _ato: ,(cons 1 '(2 3))

0:06 hamza: _ato: thanks.. that worked..

0:07 hiredman_: ,(cons 1 '(2 3))

0:07 clojurebot: (1 2 3)

0:07 hiredman_: _!

0:07 good lord freenode

0:32 hiredman: clojurebot: ping?

0:32 clojurebot: PONG!

0:33 Raynes: hiredman: ping?

0:38 KirinDave1: Hmm

0:38 Compojure+enlive's performance is damn impressive if you don't run the template every time.

0:39 I wonder if I could genericize this into a macro.

1:20 hamza: guys i am kinda at lost, how would you turn a list such as ((1) (2 3 4)) into (1 (2 (3 4))) or reverse ((1 2 3) (4)) into (((1 2) 3) 4) ?

1:23 arbscht: ,(reduce #(list %1 %2) (clojure.contrib.seq-utils/flatten '((1 2 3) (4))))

1:23 clojurebot: (((1 2) 3) 4)

1:23 hiredman: :|

1:23 list

1:24 the anonymous function is not needed

1:25 arbscht: hm yes

3:27 LauJensen1: Morning team

3:55 tomoj: I wonder what the probability is that I will someday find a clojure job

3:56 esj: morning all

4:09 hoeck: tomoj: not that low, I think

4:10 tomoj: at least I am very confident :)

5:26 shantanu: did anybody encounter this error while compiling Clojure sources through Maven?

5:26 org.apache.maven.lifecycle.LifecycleExecutionException: Clojure failed.

6:00 ordnungswidrig: hi

6:01 esj: yo

6:03 ordnungswidrig: that was hard work. irc over ejabberd. connecting as a osx newbie trouble

7:35 aldebrn: Hi, I'm trying to use git clojure, and "ant clean jar" gives me hundreds of warnings, plus some errors in clojure/src/jvm/clojure/lang/Numbers.java all complaining about methods on toBigDecimal(x). This is on OpenJDK java version "1.6.0_0", any hints?

7:37 hamza: just a guess, but maybe some methods on suns api not availible on openjdk..

7:41 aldebrn: Thanks hamza. What's the difference between the clojure and the "clojure (new)" entities at build.clojure.org ?

7:43 the-kenny: aldebrn: new is based on the "new" branch on github. It has some new things like defprotocol/deftype

7:43 hamza: here is some more info if you are intrested,

7:43 http://stuartsierra.com/2009/12/14/objects-are-not-adts?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+StuartSierra+(Digital+Digressions+by+Stuart+Sierra)

7:44 talks about the new features in new branch

7:44 the-kenny: _ato: ping

7:44 aldebrn: Is new strictly a superset of non-new?

7:44 _ato: the-kenny: pong

7:44 the-kenny: _ato: Is that you compojure-jar on clojars?

7:45 *your

7:45 _ato: the one with ato in it?

7:45 yeah

7:45 the-kenny: Yes.

7:46 It looks like it's broken because clojure was renamed to "1.1.0-master-SNAPSHOT"

7:46 _ato: egh.. annoying. Yeah that pretty much broke everything, I wish they symlinked it

7:48 the-kenny: hm.. maybe someone will symlink it.

7:49 _ato: hrmm..

7:49 I wonder if I can do it in Clojars actually

7:50 oh well, probably betters to just update all the jars, hopefully it won't get renamed again

7:51 liebke: the-kenny: I uploaded a version of Compojure to address that problem: [org.clojars.liebke/compojure "0.3.1-master"]

7:52 the-kenny: liebke: Ah, sounds good. That one wasn't listed in my search for "compojure"

7:53 liebke: yeah, the search doesn't seem exhaustive

7:56 _ato: search doesn't work if there's no description set. Damn have I still not pushed out the fix for that. I gotta stop tinkering with this widefinder stuff and give Clojars some more work

7:57 ugh... all the tutorials and such are going to be pointing at 1.1.0-alpha as well, aren't they?

7:57 perhaps I should upload the old snapshot

7:58 I guess it's better that people are out of date than can't get things to work at all

8:00 aldebrn: liebke, I'm about to send a message to incanter group asking about an error in compiling Incanter: it breaks with 'Exception in thread "main" java.lang.ClassFormatError: clojure.contrib.pprint.PrettyWriter (erroneous identifier) (io.clj:22)' and I wanted to apologize in advance for asking what must have a very simple answer...

8:00 Chousuke: aldebrn: you might want to try recompiling clojure-contrib

8:01 hamza`: i had this error, when i compiled clojure-contrib without pointing clojure.jar

8:01 even if clojure.jar is in your classpath for some reason it won't pick it.

8:01 aldebrn: That's where I know it from too, but incanter build includes clojure

8:01 liebke: aldebrn: yes, Chousuke and hamaza' are right

8:01 which build script are you using?

8:01 ant or maven?

8:10 * the-kenny likes compojure

8:10 _ato: ok, I've just pushed the old-named clojure jar to clojars' repository: http://clojars.org/repo/org/clojure/clojure/

8:10 liebke: aldebrn: if you're using maven, I wonder if you have a version of clojure-contrib in your repository that isn't pointing to the clojure jar. If you're using ant (and ant deps), then I don't know what's wrong :-(

8:10 _ato: that should at least serve as a temporary measure

8:11 come on 1.1 so we can all start pointing everything at stable version numbers

8:11 liebke: _ato: nice :-)

8:17 Chousuke: _ato: until everyone starts using defprotocol and deftype and then you need git master for everything again ;P

8:18 Hm, I wonder if it's right to call transient things "transient values"

8:19 I don't want to call them mutable because they're more than that.

8:20 ordnungswidrig: Chousuke: more than mutable?

8:20 cemerick: Chousuke: if they're mutable, it's hard to call them 'values'

8:20 IMO

8:20 Chousuke: ordnungswidrig: yeah. they're really mutable only as an implementation detail .)

8:21 ordnungswidrig: Chousuke: I see. No third state after immutable and mutable

8:22 Chousuke: I just think it's important that people not think of them as mutable things.

8:23 because you can't use them to write imperative algorithms.

8:23 esj: is there simpler way to select a subset of values from a hash-set directly, or is (into [] (map #({:a 3 :b 3 :c 4} %) '(:c :a))) the way ?

8:23 Chousuke: esj: (into [] the-map [:c :a])

8:24 hm

8:24 forgot map

8:24 oh well.

8:24 I think there's something in the clojure.set namespace too. maybe.

8:24 chouser: "transient collections"?

8:25 esj: ,(into [] {:a 3 :b 3 :c 4} [:a :c])

8:25 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: core$into

8:25 Chousuke: chouser: yeah, but the intermediate things? :/

8:25 chouser: esj: select-keys

8:25 Chousuke: esj: yeah, you need the map still. I was just too hasty :P

8:25 esj: :)

8:26 Chousuke: ,(into [] (map {:a 1 :b 2 :c 3} [:a :c]))

8:26 clojurebot: [1 3]

8:26 chouser: Chousuke: what intermediate things?

8:26 ,(select-keys {:a 1 :b 2 :c 3} :a :c)

8:26 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: core$select-keys

8:26 Chousuke: chouser: those values you get when you're actually building the data structure.

8:26 esj: ,(select-keys {:a 1 :b 2 3} [:a :c])

8:26 clojurebot: 5

8:26 chouser: those are transients, aren't they? transient collections.

8:26 esj: thanks guys, in business now.

8:27 Chousuke: collections is too long a name ;P

8:27 chouser: heh

8:28 Chousuke: I don't think "transient value" is too bad a name. it's immutable for the duration of its lifetime :)

8:28 which is exactly until you try to mutate it.

8:29 ordnungswidrig: Chousuke: ant then?

8:31 Chousuke: hm?

8:32 cemerick: 'value' has a very specific implication of immutability AFAIK. Consider, would "mutable integer" make sense?

8:32 rhickey: transient value is a contradiction

8:32 ordnungswidrig: Chousuke: argl, I meant, "and then?" after you try to mutate them

8:33 Chousuke: ordnungswidrig: the reference becomes invalid and using it again means undefined behaviour.

8:33 all the functions return new transient things that you should use.

8:33 ordnungswidrig: Chousuke: i see

8:36 chouser: just leave off the second word like we do with locals. They are transients.

8:36 "transient" is a noun in this case

8:42 asking for donations apparently gets you some money and *lots* of opinions. :-)

8:43 Chousuke: heh

8:43 rhickey: actually I'm glad it hasn't devolved into arguments about open source and free software in general

8:44 cemerick: rhickey: mostly ;-)

8:44 rhickey: right

8:45 praptak: A quick syntax question - does (fn [] 3) have a #() equivalent?

8:45 Chousuke: not really.

8:46 #(do 3) is the closest you can get :)

8:46 chouser: praptak: not really. You can say #(do 3) but that's rather ugly

8:46 praptak: Thanks, I was just curious.

8:46 chouser: praptak: (fn [] 3) is fine. Or (constantly 3)

8:46 cemerick: I usually use constantly -- code == docs.

8:47 rhickey: yes

8:47 praptak: @chouser: Thanks, I didn't know about constantly.

8:47 ordnungswidrig: i like constantly

8:50 praptak: Ah, it even works for any number of arguments

8:51 chouser: right, so not exactly the same as (fn [] 3)

8:53 cemerick: rhickey: have you bothered to look at any of the jdk7 closure stuff since devoxx?

8:53 ordnungswidrig: Chouser: taken any number of args is not bad in this case

8:54 cemerick: Seems like everything's going to be in flux for an extended period of time from what I've read.

8:54 rhickey: cemerick: I've read the blog posts - there's a long road ahead

8:55 cemerick: that's what I figured you'd say

8:56 There's going to be a lot of jdk7-esque forks come next year, I'll wager.

8:56 rhickey: http://mail.openjdk.java.net/pipermail/lambda-dev/2009-December/000023.html

8:59 cemerick: yeah, i saw that

8:59 I don't grok it all fully, of course. The process seems right broken though.

9:00 rhickey: it's a difficult thing to retrofit

9:01 although, now that Java is behind C#, maybe the borrowing could go the other way

9:02 ordnungswidrig: Anything to whatch out for regarding aquamacs and clojure?

9:02 rhickey: will always be more verbose than in a language built around it

9:02 ordnungswidrig: that's my combo, though I don't use Slime

9:04 cemerick: it seems like this is Java's last hurrah w.r.t. attempting big changes. The gridlock seems intense, and I can't imagine it getting any better.

9:05 rhickey: checked exceptions are proven a terrible idea by closures

9:08 ordnungswidrig: rhickey: clojure-mode with elpa works fine? What do you use if not slime? *wonder*

9:09 rhickey: ordnungswidrig: brute force

9:09 ordnungswidrig: rhickey: never considered this. you mean, just a repl

9:10 rhickey: ordnungswidrig: yes, just clojure-mode + repl

9:10 cemerick: rhickey: how's the intellij clojure stuff these days?

9:11 ordnungswidrig: rhickey: then, you can be sure to receive a donation from me :-) I'll declare it as solatium

9:11 rhickey: cemerick: I just got IDEA 9 installed - haven't done much Clojure editing but debug seems much smoother

9:11 ordnungswidrig: thanks :)

9:17 fliebel: Is there any Markdown thing for Clojure? The only thing I found was Javascript ran through Rhino.

9:18 karmazilla: fliebel: there's markdownj for Java

9:19 fliebel: karmazilla: I read it has serious issues, but I might try it…

9:20 chouser: fliebel: we're using markdownj for the book. Hasn't been a problem yet, afaik.

9:20 fliebel: "the book"?

9:21 hamza`: i use markdownj from clojure, the only problem i had is if i put a list just before a code block it messes up.

9:22 chouser: fliebel: the book about Clojure that Fogus and I are writing.

9:22 markdown as a spec is creaking a bit under our ever-growing requirements, but markdownj as an implementation hasn't cause us any problems I'm aware of.

9:22 fliebel: chouser; ah, that book, cool!

9:23 chouser: yeah, no link for the book yet. hopefully this week...

9:25 fliebel: I think the Showdown+Rhino is a very creative solution… I'm not sure how MarkdownJ compares with that…

9:31 hmmm, showdown+rhino looks good!

9:48 devlinsf: (doc future-canceled)

9:48 clojurebot: I don't understand.

9:48 devlinsf: (doc future-cancelled)

9:48 clojurebot: Gabh mo leithscéal?

9:48 devlinsf: (doc future-cancelled?)

9:48 clojurebot: "([f]); Returns true if future f is cancelled"

9:49 devlinsf: rhichey: cancelled is spelled w/ 1 l

9:49 err... rhickey

9:49 oops

9:50 cypher23: devlinsf, both are correct. 2 l is british, one l is american spelling

9:50 djork: what's up with clojure.contrib.http.agent

9:50 devlinsf: Oh...

9:50 djork: "java.lang.IllegalStateException: bytes already refers to: #'clojure.core/bytes in namespace: user (NO_SOURCE_FILE:0)"

9:50 trying to use it

9:50 devlinsf: Firefox is yelling at me. Nevermind

9:50 the-kenny: djork: I think that's fixed in a newer version of clojure-contrib

9:50 esj: djork: it crashes with an existing symbol

9:51 cypher23: devlinsf, you probably have an american-english dictionary :)

9:51 esj: djork: I'm excluding it on require

9:51 (:use compojure

9:51 clojure.contrib.json.write

9:51 [clojure.contrib.http.agent :exclude (bytes)]))

9:51 djork: huh

9:51 seems like it might be better to fix http.agent :)

9:51 devlinsf: cypher23: Well, seeing how I live in the US :)

9:52 esj: I mailed Stuart at the time, I think.

9:52 the-kenny: djork: It's fixed: http://github.com/richhickey/clojure-contrib/blob/master/src/clojure/contrib/http/agent.clj#L66

9:52 djork: hmm

9:53 rhickey: devlinsf: that's one spelling where I agree with the brits

9:53 fliebel: cypher23: I'd love to have java.awt.colour :D

9:53 devlinsf: rhickey: Okay, cool. It'll be fun to watch this issue pop up on the list occasionally :)

9:54 rhickey: Should I create an assembla ticket & immediately close it to document this non-issue?

9:55 djork: the-kenny: I still seem to be getting the error after pulling and rebuilding the jar

9:55 rhickey: devlinsf: probably not, I wonder if people really look for closed issues on things like that

9:55 the-kenny: djork: hm... strange

9:55 djork: it may be my own classpath problem

9:56 devlinsf: rhickey: Okay, no problem

9:57 djork: both clojure.jar and clojure-contrib.jar are up-to-date from master

10:02 when I change the name of 'bytes' in http.agent, I can use it

10:02 BTW I'm trying to use it in a REPL

10:02 (use 'clojure.contrib.http.agent)

10:03 do I need to use it :as something else?

10:04 fliebel: How would this convert to clojure code? Runtime.getRuntime().exec(Command)

10:05 angerman: (. Runtime/getRuntime exec Command) ?

10:05 chouser: (.exec (Runtime/getRuntime) Command)

10:05 angerman: right. should proably wrap the Runtime/getRuntime.

10:06 fliebel: ,(.exec (java.lang.Runtime/getRuntime) "ls")

10:06 clojurebot: java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)

10:06 scgilardi: The fix to contrib allows "require 'clojure.contrib.http.agent" to work, but by using "use" you're trying to bring bytes into the user namespace.

10:06 chouser: angerman: I don't really like using the naked . operator in regular code anymore.

10:07 scgilardi: you can either require it and use its full namespace to qualify its names, require it :as to use an alias to qualify its names, or use it and exclude bytes yourself.

10:07 fliebel: angerman & chouser: gives back #<UNIXProcess java.lang.UNIXProcess@1629ce8c>

10:07 angerman: chouser: guess that's personl preference. though I hardly do interop, so I don't really have an opinion on it.

10:07 chouser: fliebel: congrats! success!

10:07 angerman: fliebel: so? what did you expect?!

10:07 scgilardi: user=> (use '[clojure.contrib.http.agent :exclude [bytes]])

10:07 nil

10:08 fliebel: I expected to see the output of the command… but it's java anyway, so I guess I should fetch some io reader somewhere... :S

10:09 chouser: fliebel: you might be interested in clojure.contrib.shell-out

10:09 fliebel: chouser: might be :D Thanks!

10:11 chouser: angerman: not a huge deal, but http://clojure.org/java_interop mentions the forms at the top of the page are "preferred"

10:13 djork: so I should require http.agent instead of use

10:16 scgilardi: require will work well and is generally preferable to use. require with an :as will make typing more convenient.

10:17 djork: so that's the best way to use a lib that may have namespace conflicts, then?

10:17 I've always been using (use)

10:17 but I guess use is kind of heavy-handed

10:18 chouser: yeah, unadorned 'use' is unfortunately very convenient at first but often causes trouble in the long run.

10:18 * drewr favors use/:only

10:19 devlinsf: Depends on the lib

10:19 chouser: I'm now in the habit of always using 'use', but always with :only and/or :as

10:19 devlinsf: e.g. , I'll use clojure.test in test code

10:19 drewr: the only time I use require is when I'll use most of the publics in an ns

10:19 scgilardi: at the repl, I think it's fine to utilize whatever is convenient. When writing an "ns" form for a lib, it's nice for a (human) reader to be able to trace the origin of every non-core name used. That means either using require, require with :as, or :use with only.

10:20 chouser: scgilardi: yes, good point. naked 'use' at the repl is fine.

10:22 scgilardi: one thing I don't do enough is "enter" the namespace I'm working in at the repl using "in-ns". That makes all of its names available without namespace-qualifying.

10:22 fliebel: what is the preferred way in clojure to handle files? just plain java.io?

10:23 scgilardi: clojure.contrib.duck-streams makes lots of file and stream-related work very easy.

10:23 devlinsf: Hey, question about PersisentStructMap

10:23 scgilardi: clojure.contrib.java-utils has some helpful functions

10:24 aldebrn: liebke, I've made an "fft.clj" in the same vein as stats.clj and core.clj in the incanter/src/main/clojure/incanter directory, is there something else I need to do before clj will pick it up?

10:24 scgilardi: and java.io and java.nio are there to use as well.

10:24 fliebel: scgilardi: thanks

10:24 devlinsf: I have an instance of a struct map and I'm trying to get at the definition

10:25 Similar to how I'd get at a comparator w/ a PeristantSortedMap

10:25 chouser: devlinsf: yeah, you can't get anything useful there.

10:25 devlinsf: Well, looking at the class def it seems I should

10:26 (.def (my-instance)) should do the trick

10:26 Would patching in a simple getDef method do the trick?

10:26 chouser: it's not public

10:27 liebke: aldebrn: use load-file

10:27 chouser: devlinsf: yes, making it public would let you get at it.

10:27 if you just want a list of the keys, you can do (keys (empty a-struct))

10:46 rhickey: devlinsf: I don't want to enhance structmaps, rather people move to deftype

10:48 devlinsf: rhichey: Okay. I'll review deftype, and let you know if I need to request an enhancement

10:48 Ah

10:48 rhickey

10:49 Hacker news calls you Rick... I call you Hichey.. k & h are confusing!

10:50 Anyone: How do I browse the new branch on github?

10:50 chouser: devlinsf: theres a 'brnaches' dropdown

10:50 devlinsf: Ah, got it

10:51 rhickey: devlinsf: there are definitely differences between defstruct and deftype, but defstruct has problems (AOT, serialization) that deftype solves, plus perf is better, can implement protocols etc

10:53 cypher23: devlinsf, use the power of tab completion? :)

10:53 devlinsf: rhickey: Right now I'm intereted in the map-like abilities of defstruct.

10:53 cypher23: Using a brower right now :(

10:54 cypher23: oh

10:54 devlinsf: rhickey: What did you decide about types supporting keyword lookup?

10:55 rhickey: devlinsf: they do

10:56 devlinsf: Okay. What class implements IDynamicType? Or is that compile time magic?

10:56 rhickey: devlinsf: you shouldn't need to fiddle with IDynamicType

10:57 devlinsf: rhickey: Okay, here's what I'm really looking for. defstruct had the associated PersistentStructMap class. What is the analog of PersistentStructMap for types?

10:59 Oh, wait.... do I need to look in clojure.asm?

10:59 rhickey: devlinsf: you should read through this: http://www.assembla.com/wiki/show/clojure/Datatypes and try them - they can implement IPersistentMap just by requesting it and not defining the methods

11:00 shantanu: hi all

11:00 chouser: deftypes don't have to share any common superclass except Object

11:00 devlinsf: Ah.

11:00 chouser: shantanu: hi

11:01 shantanu: am wondering if anybody encountered something like thjis: java.io.FileNotFoundException: Could not locate org/bitumenframework/jettify/clj__init.class or org/bitumenframework/jettify/clj.clj on classpath

11:01 devlinsf: Hmmm... so I think this answer my underlying question.

11:01 shantanu: this is while compiling clojure code with maven

11:01 chouser: shantanu: looks like something you want isn't in your classpath.

11:01 devlinsf: There probably is NOT the need to use a map operation over a type the same way there is in a hashmap

11:02 Thanks rhickey & chouser

11:03 chouser: devlinsf: if the type doesn't implement IPersistentMap, then probably not.

11:03 shantanu: the same code compiled fine with Ant....seems related to maven-clojure-plugin

11:03 devlinsf: chouser: Even if does, it's a completely different beast

11:03 chouser: That, and this discussion can wait until 1.2 is closer to release

11:04 * chouser hopes 1.2 is very close.

11:04 devlinsf: Then let's finish documenting 1.1 :)

11:05 rhickey: we seem to be stuck on 1.1. In the old days I would just zip up the latest and ship it :)

11:05 actually I always did a (painful) doc day

11:05 devlinsf: Ha! the old days

11:05 Shows how fast things have changed

11:06 rhickey: now I'm afraid of all the maven stuff - all the numbers have to align with I don't know what, artifacts etc

11:06 devlinsf: rhickey: Could you help use write the chuncked seqs section?

11:06 *us

11:07 chouser: it's probably unavoidable anyway, but I was hoping to not have to include structs in the book.

11:07 devlinsf: is the chunked seqs section started somewhere?

11:08 devlinsf: Yeah, follow SS' link

11:08 http://groups.google.com/group/clojure-dev/browse_thread/thread/5a5a9aa1352f12f4

11:08 Well, it's outlined

11:10 rhickey: transients section should just refer to http://clojure.org/transients rather than paraphrase, I think

11:11 devlinsf: rhickey. Okay, could you add the last part, where how to properly use them is discussed

11:11 cemerick: rhickey: I'm sure you've seen the writing on the wall that maven is the one true way these days? ;-)

11:12 we'll actually be 95% maven by the end of the week, which is a little crazy

11:13 * rhickey remembers when he pushed a button in IntelliJ and Clojure existed 3 seconds later - no XML

11:14 cemerick: "We need something to manage all this incidental complexity!" :-P

11:15 rhickey: you mean, to introduce it?

11:15 cemerick: that was a joke, there, son!

11:15 * cemerick is in a foghorn leghorn mood today

11:16 rhickey: I'm too afraid of Maven to laugh

11:16 cemerick: I was too until about 12 days ago. Used ant for ~10 years.

11:17 devlinsf: cemerick: Wow. I just had netbeans do it for me

11:17 cemerick: devlinsf: builds, you mean?

11:17 chouser: ant scares me too though

11:17 devlinsf: Yeah

11:17 chouser: we use cmake at work.

11:17 cmake scares me

11:18 cemerick: IDEs beg for you to tie your build to a local environment. That's why I went with NB years ago, it didn't have its own build circus.

11:18 rhickey: devlinsf: I'm fearful of overdoing it as far as release notes etc. There are docs on the functions. Some things are best not said twice. But transients and chunks are topics. See prior release notes - they were just gussied up commit logs. Special notes only to highlight new features, or document breakage/deprecation. I think we need to KISS. Right now, not knowing what maven will need is the dark area for me

11:18 cemerick: chouser: you prefer to use butterflies?

11:18 ;-)

11:19 chouser: cemerick: make. I like make.

11:19 rhickey: cemerick: clojure used to build with a javac one-liner

11:19 chouser: well, gnumake

11:19 cemerick: My only sustained exposure to make is via autoconf. The one time I had to actually screw with a makefile was not pleasant. At that point, I longed for XML.

11:20 chouser: the chunk functions don't seem to have docstrings

11:22 rhickey: I assume you'd take a ticket/patch for chunk fn docstrings?

11:22 hugod: is using extend the expected way to define a protocol method implementation on a deftype that calls the deftype's own factory function?

11:33 Kjellski: When will clojure turn 2.0? I mean, have you a better guess then "When it´s done" ?

11:34 danm_: does anyone even know what 2.0 means for clojure yet? why would the timeline for 2.0 be important to you right now?

11:34 shantanu: chouser: it seems i found out why the maven build was breaking -- whenever the namespace contains an underscore, it barfs

11:35 Kjellski: danm_ : no not really... I´m just interested... ^^

11:35 shantanu: chouser: i faced similar issue when compiling with Ant earlier

11:35 danm_: Kjellski: fair enough, I was just sort of confused

11:35 chouser: shantanu: really? hm.

11:36 shantanu: chouser: i just removed the underscore from the namespace -- it now compiles fine

11:36 bjorkintosh: what happens if people don't start supporting clojure's daddy?

11:36 does it mean it dies and never turns 2.0?

11:37 shantanu: chouser: i suspect this may have to do with Clojure's compile module (the way it resolves namespaces)

11:39 Chousuke: bjorkintosh: probably development just won't be as rapid as it could be.

11:40 bjorkintosh: ah that's sad.

11:40 it seems the language has generated a lot of excitement and it's a shame the creator of it hasn't been banished to an ivory tower :P

11:40 okay okay that was mean.

11:41 lisp and ivory towers seem to go together though.

11:41 chouser: Clojure is not that kind of lisp. :-)

11:41 Chousuke: I suppose Rich just doesn't feel like spending 15 years slowly building up momentum.

11:41 danm_: seems fair

11:44 cemerick: shantanu: what version of clojure-maven-plugin are you using?

11:45 shantanu: chouser: it is <groupId>com.theoryinpractise</groupId> <artifactId>clojure-maven-plugin</artifactId> <version>1.0</version>

11:45 chouser: oops! bad copy-paste

11:46 cemerick: another oops! hi cemerick

11:47 cemerick: well, clojure-maven-plugin is up to 1.1 in releases, so that's a good first thing to try

11:47 Further, the 1.2 snapshots (not sure if they're around anywhere, I just have them deployed internally) have a lot of good improvements.

11:48 shantanu: cemerick: i just decided to learn Maven today, and gave this plugin a try :-) -- i will try 1.1 out

11:48 cemerick: it's worked well for me :-)

11:48 shantanu: and 1.2 as well

11:49 cemerick: (and I have plenty of libs with dashes in the ns, FWIW)

11:49 shantanu: dashes seem to cause problems when compiling with Ant, but underscores were fine with Ant

11:50 so i fell back to underscores

11:50 seems i should experiment a bit more

11:51 rhickey: chouser: I'm not sure I want people using chunk fns yet, maybe label experimental

11:51 ditto transients - experimental (more on this in a sec)

11:52 devlinsf: sorry, I got called away - anyway, your outline is good, but fn docs need to make it into fns and concept docs onto the clojure.org site - I don't want people searching for release notes for docs

11:54 devlinsf: rhickey: Okay, makes sense

11:54 rhickey: should there be a PSA in the mailing list when you release 1.1, though?

11:55 rhickey: devlinsf: sure

11:56 ericthorsen: I want to define a symbol called 'Class in a namespace. I put (:refer-clojure :exclude (Class)) in the ns decl and call (ns-unmap *ns* 'Class). Loads dynamically but won't AOT. Keep getting "Class already refers to: class java.lang.Class in namespace:"

11:56 Is this possible to do?

11:56 rhickey: I'd also like to try release candidates this time around, so we know the zip and naming is all ok for downstream things

11:57 ericthorsen: dunno

11:57 ericthorsen: rhickey: Doh!

11:57 rhickey: sounds scary remapping Class

11:58 Chousuke: at least making source tarballs is relatively easy. github does them for you :P

11:58 devlinsf: rhickey: Sounds cool. What else exactly needs to happen, besides fleshing out the docs? Is there a concrete to do list before RC1?

11:58 ericthorsen: rhickey: I know...I could "want something else" but it will make what I'm doing not uniform

11:58 shantanu: cemerick: the underscores still don't cut it with the 1.1 plugin, but it works with dashes

11:59 Chousuke: hm, right, docs.

11:59 devlinsf: ericthorsen: Steal a trick from Ruby. name your fn klass

11:59 cemerick: shantanu: wait, namespaces with underscores fail, but ns' with dashes are OK?

11:59 Chousuke: IIRC I saw some reference in clojure.test docstrings to subversion and google code. Should probably fix that.

11:59 shantanu: yes

12:00 cemerick: huh. Well, I can't say I've ever made an ns with an underscore in it.

12:00 rhickey: devlinsf: http://groups.google.com/group/clojure-dev/browse_frm/thread/be3f0a7c26ee2fd6

12:00 shantanu: i admit that's unusual...i did so because i ran into issues with Ant with dash-in-filenames

12:01 devlinsf: rhickey: Yeah, I remember that. Do these items have human names attached to them?

12:01 shantanu: i guess avoiding dashes and underscores is a good idea

12:02 rhickey: devlinsf: like code names? :)

12:02 devlinsf: Lol

12:03 That'd be fun. I was think of a much mor boring version, though

12:03 cemerick: dashes are right and proper, IMO. An ns with an underscore is a tad ugly, I'd say. *shrug*

12:03 aldebrn: To make sure I'm remembering correctly: one should try to use deftype instead of structmaps as of now

12:03 devlinsf: Like "Who is responsible for this"?

12:03 subhadeep: clojure rocks

12:03 rhickey: don't use underscores in ns names

12:04 replaca: Q (cause I'm too lazy to read right now): is = on a persistent data structure equivalent to lisp eq or lisp equal? (Seems like eq would be just as effective for persistent structures and a whole lot faster, but I just want to check my logic before I get too deep.)

12:04 rhickey: devlinsf: stuartsierra was supposed to be marshaling the process

12:04 devlinsf: Ah

12:05 rhickey: What about "A Plan for release candidates"? SS or you?

12:06 rhickey: replaca: there's no guarantee that 2 = data structures have a shared genesis and thus a shared root - can't be eq

12:06 devlinsf: I've gotta run right now - my preference is for an absolute minimum of ceremony and fuss

12:06 devlinsf: k

12:06 tttyl

12:07 replaca: rhickey: ahh, yes I thought there was a hole in my thinking! I was thinking the other way around. Thanks.

12:09 aldebrn: To make sure I'm remembering correctly: one should try to use deftype instead of structmaps as of now

12:10 rhickey: very nice response so far: http://clojure.org/funders

12:10 fliebel: For those who suggested using markdownj: I got this issue as well: http://code.google.com/p/markdownj/issues/detail?id=6 and in my tests showdown+rhino runs nearly as fast.

12:11 rhickey: maybe you should put up a donation button, or am I overlooking it?

12:12 cypher23: fliebel, right on the front page? http://clojure.org/

12:12 cemerick: fliebel: big honkin' image in the middle of clojure.org ;-)

12:13 fliebel: ok, mi fault, I was just looking on the funders page… my mind ignores buttons and adds for the rest of the time ;)

12:14 replaca: rhickey: Great to hear! I'll be there too, next time I'm sitting in front of my computer at home. Though I think Clojure actually *costs* me money :-)

12:14 Chousuke: rhickey: where do you think :pre and :post should be documented? defn?

12:15 drewr: rhickey: you might want to list the people that donated through sourceforge back in the day

12:15 I'll definitely be donating again though

12:23 qed: http://cr.openjdk.java.net/~mr/lambda/straw-man/

12:26 freenode has been absolutely unbearable the last couple of days

12:30 bjorkintosh: hide join/part messages :)

12:30 is it that freenode is b0rked or buggy?

12:30 nuba: and netsplits

12:30 bjorkintosh: can't the netsplits be done cleanly?

12:31 nuba: from [Global Notice] >we're still experiencing heavy ddos directed at a variety of locations where we have infrastructure hosted.

12:31 bjorkintosh: oh.

12:31 that's not nice.

12:32 nuba: nope

12:32 set yourself to +w if you want to receive these notices

12:32 /mode bjorkintosh +w

12:34 fliebel: Who made clojurebot?

12:36 chouser: clojurebot: who's your daddy?

12:36 clojurebot: who is x

12:36 chouser: fliebel: hiredman

12:37 fliebel: chouser: It's written in Clojure I guess? :D

12:37 chouser: fliebel: I believe so, yes. :-)

12:37 clojurebot: where are you?

12:37 clojurebot: http://github.com/hiredman/clojurebot/tree/master

12:39 fliebel: It would be cool if it had some voicemail functionality…

12:41 qed: why voicemail?

12:41 are you calling irc channels or something?

12:42 "hello, yes, this is fliebel, im looking to speak with chris houser"

12:42 Chousuke: hm.

12:42 fliebel: I mean that you can leave a message for someone who's not online

12:42 qed: "ahhh, he's away from his desk...very well then"

12:42 fliebel: ahh :)

12:42 Chousuke: it might be useful to have "dummy vars" to document some features of Clojure that apply to multiple functions.

12:43 qed: Chousuke: clojurebot !

12:43 oops

12:43 clojurebot: !

12:43 clojurebot: CLABANGO!

12:44 qed: heh heh, whatever happened to Madison Square Clabango

12:46 Chousuke: that makes sense to me

12:48 clojurebot: outback steakhouse

12:48 clojurebot: I want to go to there

12:59 qed: clojurebot: whose job isthat

12:59 clojurebot: that's romanb's job

12:59 polypus: clojurebot: who are you?

13:00 clojurebot: You will not become skynet

13:00 the-kenny: clojurebot: skynet?

13:00 clojurebot: Gabh mo leithscéal?

13:00 the-kenny: clojurebot: skynet

13:00 clojurebot: I don't understand.

13:00 the-kenny: Hm... I thought I've told him he *will* become skynet

13:00 polypus: clojurebot: wanna come back to my pad for a drink?

13:00 clojurebot: for is not used enough

13:01 qed: heh

13:01 clojurebot: e4

13:01 clojurebot: I resign

13:01 polypus: lol

13:02 qed: clojurebot: curious

13:02 clojurebot: /nick other-clojure-bot

13:02 polypus: maybe he (she?) could do better: http://psycochess.sourceforge.net/

13:03 qed: clojurebot: sex?

13:03 clojurebot: It's greek to me.

13:04 polypus: greek sex?

13:04 qed: kinky

13:06 clojurebot: historical ninja robots

13:06 clojurebot: historical ninja robots are so 1999...

13:06 qed: clojurebot: futuristic ninja robots

13:06 clojurebot: sooo much better than any of the historical ninja robots

13:06 qed: agreed

13:07 StartsWithK: 3000 users on ml :)

13:07 qed: clojurebot: twitteronia

13:07 clojurebot: twitteronia is where shaq lives

13:10 bagucode: clojurebot: seen ztellman?

13:10 clojurebot: no, I have not seen ztellman

13:10 bagucode: clojurebot: thank you

13:10 clojurebot: You will not become skynet

13:10 qed: heh

13:11 he's got an attitude today

13:11 bagucode: That's rude

13:12 cp2_: hrm, im surprised this iphone didnt burn through my desk yet

13:12 Benchmarking: FreeBSD MD5 [32/32 X2]... DONE

13:12 Raw: 434 c/s real, 444 c/s virtual

13:12 er

13:12 http://pastie.org/private/rjhods0x4h9ocwr2mazq1g

13:12 the-kenny: clojurebot: I will become skynet

13:12 clojurebot: Titim gan éirí ort.

13:12 the-kenny: :(

13:13 qed: clojurebot: the-kenny is <reply>I heard he's becoming skynet.

13:13 clojurebot: c'est bon!

13:13 qed: clojurebot: the-kenny

13:13 clojurebot: I heard he's becoming skynet.

13:13 the-kenny: qed: No, I wanted to bring him to say he will become skynet

13:13 Not me ;)

13:13 qed: oh, hehe

13:13 the-kenny: qed: I told him "You will become skynet" and he got it wrong

13:13 qed: clojurebot: forget the-kenny

13:13 clojurebot: I forgot the-kenny

13:15 qed: i suppose i should quit playing with the bot now...

13:16 clojurebot: leiningen is <reply>http://github.com/technomancy/leiningen

13:16 clojurebot: Ack. Ack.

13:16 KirinDave: So I was reading http://blog.higher-order.net/2009/11/23/clojure-circuit-breaker/

13:16 Cool code

13:17 But is deftype going to become part of idiomatic clojure?

13:17 I thought the point of it was to allow folks to plumb clojure to java with maximum performance

13:17 devlinsf: kirindave: Yes, it is slated for 1.2

13:17 KirinDave: devlinsf: I mean, culturally.

13:17 I worry that everyone will use it in preference to what exists now because it's more familiar to java programmers.

13:18 "I know this, this is an Object System"

13:18 Are there concerns about that?

13:18 qed: i wont use it because i don't like Java

13:18 ;)

13:18 Raynes: 1.2? Not 1.1 :(.

13:18 Chousuke: deftype and protocols are not java things.

13:18 they're Clojure things.

13:18 KirinDave1: yes, I know.

13:18 Chousuke: They're not really object-oriented either.

13:19 Raynes: I wish it would appear sooner. Feels kind of silly using structs when something that will replace them is right around the corner.

13:19 KirinDave1: They're more similar than pure functional.

13:19 hiredman: protocols don't create an is-a relationship

13:19 KirinDave1: Chousuke: See what Raynes just said?

13:19 Chousuke: objects couple methods with data, which neither deftype nor protocols do.

13:19 KirinDave1: deftype, now replacing structs.

13:19 hiredman: KirinDave1: yes

13:20 KirinDave1: Is that the intent of deftype tho?

13:20 hiredman: KirinDave1: in idiomatic clojure deftypes will be like better structs

13:20 just holders for data

13:20 Chousuke: structmaps never were anything besides a size-optimised map

13:20 maps

13:20 hiredman: with a type

13:21 Raynes: And then we have reify. Isn't that going to replace proxy or something?

13:21 Chousuke: most of it.

13:21 polypus: http://stuartsierra.com/2009/12/14/objects-are-not-adts

13:21 hiredman: like datatypes in haskell or erlang

13:21 Chousuke: reify is a mostly java interop thing though I think

13:22 Raynes: I would just use the new branch of Clojure, but it still seems to break swank for me for some reason. Phil can't reproduce it.

13:22 polypus: http://www.cs.utexas.edu/~wcook/Drafts/2009/essay.pdf

13:23 Chousuke: I suppose deftype feels like object-orientation because it creates things that would be objects in Java and most OOP languages :/

13:23 KirinDave: It just seems like what's going to happen is that idiomatic clojure is going to go from using a set of generic types to using a set of predeclared types.

13:23 chouser: structmaps don't really have a type

13:23 KirinDave: While I understand that sometimes that makes sense.

13:24 In general, it's unnecessary.

13:24 For example, in that circuit breaker example, it didn't seem necessary.

13:25 I'm as big a fan of Wittgenstein's ladder as the next guy, but I am concerned about how readable most clojure code will be if everyone thinks they need a ton of types for every program.

13:25 Chousuke: you'll still be using maps and vectors, don't worry.

13:26 KirinDave: I know _I_ will.

13:26 And 90% of the time that'll make sense

13:26 Chousuke: Well, at first everyone will be excited about the new playthings.

13:26 KirinDave: But I'd hate to start seeing other clojure code senselessly use deftype.

13:26 Chousuke: but I'm sure it'll settle down eventually.

13:26 chouser: most application-level deftypes will implement IPersistentMap

13:26 cemerick: ah, things are coming together now http://twitter.com/jvanzyl/statuses/6703401181

13:28 KirinDave: Well, I admit to some trepidation.

13:28 After years of trying to get java developers to look at lisp and failing.

13:29 I suspect, so crassly, that if you give people a familiar construct they'll prefer it. :)

13:32 Chousuke: there are over 100 contributors already it seems.

13:39 dysinger: cemerick: we setup invoiced support with rich yesterday - did you beat me to it ?

13:39 ;)

13:40 cemerick: dysinger: Yeah, I think we beat you, but ours isn't a monthly commitment -- we don't have all that shiny VC money ;-)

13:40 dysinger: I qualified my tweet with "first _invoiced_ monthly" just in case :P

13:40 cemerick: yeah, I saw that :-)

13:40 drewr: ugh, swank-clojure-find-package is the bane of my existence

13:41 cemerick: I'm hoping to make a monthly contribution, essentially backing into a regular royalty based on clojure-based app sales

13:41 polypus: ugh

13:46 dysinger: holy netsplit x2

13:47 lghtng_away_away: it's DDOS

13:47 lghtng: freenode is under assault atm

13:47 hiredman: dysinger: are you guys still hiring?

13:48 dysinger: hiredman: on going yes

13:49 lghtng: maybe flks didnt hear the 'pikes to the boards' calls a few days back...

13:50 hiredman: dysinger: I sent my resume into the jobs@ address a week or two ago, and had't heard back, so I was just kind of curious

13:50 lghtng: i'd be checking me some updates on critical servers that get referenced alot in freenode traffic, there may be some flanking and spillover onto ircops and allies

13:51 dysinger: hiredman: ok thanks for the reminder

13:51 jasapp: dysinger: likewise

13:51 dysinger: hiredman: I'll go check it out - I may have missed it.

13:51 hiredman: jasapp: he'll snap a pool cue in half and make us fight for it

13:52 dysinger: jasapp: hiredman - real names ?

13:52 jasapp: I didn't write clojurebot, so I'm sure it won't be much of a fight :-)

13:52 dysinger: (so I can match up the emails)

13:52 hiredman: Kevin Downey

13:52 jasapp: Jeff Sapp

13:52 dysinger: ok - I'll setup calls with you today

13:53 hiredman: exciting

13:54 cemerick: heh, sonian is going to swallow the clojure jobs market whole ;-)

13:55 hiredman: pull a google

13:56 drewr: I'm sure dysinger wouldn't mind

13:56 jasapp: I always wondered about when google had to let go of their hiring curve philosophy

13:56 cemerick: We'll just have to grow a new batch when we're ready :-)

13:56 dysinger: We don't have endless slots but there is work

13:57 :) I am just happy there is jobs

13:57 These are just the beginning

13:57 cemerick: absolutely, it helps everyone

13:57 I was a little surprised by Sonatype. They weren't on my radar at all.

13:58 dysinger: same here

13:58 They do maven right ?

13:58 cemerick: right

13:58 dysinger: Nexus server & consulting

13:58 cemerick: I think @talios has done work there before, and he's behind clojure-maven-plugin, so I guess the conversations came easily enough.

14:00 devlinsf: cemerick, dysinger: where is this mythical clojure job market?

14:00 dysinger: devlinsf: @ home

14:00 devlinsf: Ah

14:00 cemerick: devlinsf: dysinger has ~415 devs, we've got two ;-)

14:00 devlinsf: :)

14:00 dysinger: hehehe

14:00 We only have 5

14:01 cemerick: yeah, but that's not nearly as wry

14:01 jasapp: are both of you at snowtide?

14:01 cemerick, and devlinsf?

14:01 cemerick: no, dysinger is with Sonian

14:01 devlinsf: Ha, no I'm somewhere else

14:02 jasapp: ahh, ok

14:02 bagucode: dnolen: ping

14:02 dnolen: bagucode: hola

14:03 bagucode: pong, rather

14:03 bagucode: dnolen: I just updated the default path mappings for :native-path in my leiningen fork. Turns out the "send a function from project.clj that gives back a path" was kinda tricky since everything in defproject is quoted.

14:04 dnolen: bagucode: yeah, I thought about it some more, and I think settling for a uniform lein native path standard is probably the best approach. Sorry haven't had a chance to follow up on the lein ML thread.

14:04 bagucode: But I threw in a fn? check anyway in eval-in-project so if someone manages to pass it a function it will work ;)

14:06 dnolen: bagucode: thx for working this stuff out, it's makes working with Penumbra so much simpler. So do you think supporting LWJGL will be a big project? Or mostly a swap?

14:07 bagucode: dnolen: Actually, ztellman contacted me to tell me that he was planning on switching to lwjgl! So I'm going to leave that to him obviously :)

14:08 dnolen: This is a direct quote "Just FYI, since I noticed the comment in your project.clj file. I plan to begin work on it this weekend."

14:08 dnolen: bagucode: wow, cool.

14:22 cemerick: is DoSing freenode just an exercise in griefing, or is there a real objective?

14:25 dnolen: bagucode: i was thinking about taking a stab it, but if you are going to anyway, I'll just follow your progress ;)

14:25 technomancy: cemerick: sounds like it's targeting a host that's co-located with freenode servers

14:26 cemerick: oh, I see

14:26 mee_: cemerick: I think it's usually just griefing, or perhaps it's the staging environment for botnet developers

14:26 taking down freenode is one of the functional tests in their suite

14:26 ;)

14:28 bagucode: dnolen: Alright, I'll just keep at it then. But I don't have much time (between actual work and some stupid contest I agreed to enter). But I'll tell you if I don't think I'll finish it so you can do something about it yourself if that is the case.

14:29 dnolen: bagucode: actually I'm totally up for collaboration, sorry, didn't know if you want to figure it out yourself.

14:29 bagucode: I will definitely help.

14:30 bagucode: dnolen: I just want it to work :) I think we have the same goal here so I'll gladly take help

14:30 dnolen: bagucode: fetching your latest now ;)

14:32 * stuartsierra is finally back in action after a busy week(end).

14:36 alexyk: what's the idiomatic ways to do this: (merge-with (fn [vr v] (conj (if (seq? vr) vr [vr]) v)) {:a 1 :b 2} {:a 0.5 :c 4})

14:36 ,(merge-with (fn [vr v] (conj (if (seq? vr) vr [vr]) v)) {:a 1 :b 2} {:a 0.5 :c 4})

14:36 clojurebot: {:c 4, :a [1 0.5], :b 2}

14:37 chouser: alexyk: the first map may have seqs as values, but the second may not?

14:38 polypus: it'd be nice if you could go:

14:40 (defmulti name fun (:thing-to-match [args] ...))

14:40 i mean (defmulti name fun (:thing-to-match [args] ...) ...)

14:40 devlinsf: alexy: use group-by

14:40 alexyk: (Sorry) Check clojure.contrib.seq-utils

14:40 Something like (group-by key a-coll-of-maps)

14:40 polypus: w/o always having to rewrite the method names and defmethod

14:41 chouser: polypus: should be an easy enough macro to write. :-)

14:42 devlinsf: alexyk: Hmm... maybe...

14:43 alexyk: no, I like your version

14:44 I can't get group-by to work w/o a second mapping operation

14:44 mee_: except re: chouser's comment, i think 'v' should be replaced with an if to handle v being a seq-providing-thing

14:44 devlinsf: Well... maybe a pivot....

14:45 Yeah

14:45 Check this out:

14:45 My Pivot: http://groups.google.com/group/clojure-dev/browse_thread/thread/9a518c853bfbba8b#

14:46 Or Alex Osborne's Map reduce by

14:46 mee_: oh, conj handles that, nm

14:46 devlinsf: Alexyk: http://groups.google.com/group/clojure/browse_thread/thread/7a17676521019237

14:47 Alexyk: Yeah, use alex's version

14:48 polypus: chouser: yep, just thought it'd be good in core

14:48 irc = fail

14:51 stuartsierra: I feel like there was not a consensus on whether or not we were doing anything with contrib in conjunction with 1.1.

14:51 mefesto: hey everyone. is there some procedure i need to go through in order to be able to post to the clojure google group? I'm already registered as a member but my replies don't seem to go through.

14:51 stuartsierra: mefesto: new members are moderated

14:52 devlinsf: stuartsierra: I think we're supposed to bundle contrib as-is

14:52 stuartsierra: At least something is frozen

14:52 mefesto: stuartsierra: ok, thanks.

14:52 stuartsierra: devlinsf; Bundle, as in, put contrib in clojure.jar?

14:52 That would mean big changes to the build/packaging process.

14:52 rhickey: stuartsierra: I think it got muddled between making a branch of contrib, bringing parts of contrib into core, and the original question (for me at least), bundling some parts of contrib in the release zip

14:53 stuartsierra: rhickey: Right. So what do you want to do?

14:53 My inclination is to get Clojure 1.1 out the door, then deal with contrib.

14:57 devlinsf: Would freezing contrib "as-is", and calling contrib 1.1 be good enough?

14:57 2 different jars

14:58 mattrepl: anyone been working on a queue protocol/interface for passing messages between threads and/or VMs?

14:58 stuartsierra: devlinsf: I'm not thrilled by that prospect, but it would help out with the dependency issues, at least.

14:58 chouser: Java comes with queues for passing between threads. BlockingQueues

14:59 mattrepl: agents have queues inside, too.

14:59 devlinsf: stuartsierra: That's my main concern. At least there would be a common jar to build applications against

15:00 stuartsierra: devlinsf; Yeah, probably the best we can achieve before the end of '09.

15:00 mattrepl: chouser: you mean in the sense that there's a pool of agents?

15:00 devlinsf: stuartsierra: I'd be very happy with that.

15:00 It's above my pay grade, though :)

15:00 chouser: agents queue up to use threads from the pool (when using 'send' not 'send-off'), but also actions queue up to be serviced by the agent they were sent to.

15:01 mattrepl: chouser: cool, didn't realize the latter

15:01 stuartsierra: devlinsf: It's above everyone's pay grade; we're hackers, not release managers. ;)

15:02 devlinsf: stuartsierra: Too true.

15:02 technomancy: it's unfortunate that it's impossible to build a project that uses both Clojure 1.0 and contrib using automated dependency mechanisms

15:02 chouser: well, except stuartsierra's been deputized. He's a release manager now.

15:02 technomancy: hopefully 1.1 can avoid that fate

15:02 stuartsierra: Oh, yeah. :|

15:02 devlinsf: technomancy: Would this plan help lien?

15:03 technomancy: devlinsf: it would help everyone using stable releases who doesn't want to build and copy their jars around by hand.

15:03 stuartsierra: We could even back-release "contrib 1.0", but I'll put that off 'till january.

15:03 technomancy: leiningen, clojure-maven-plugin, and ivy alike.

15:04 devlinsf: stuartsierra: Awesome. how did you feel about my proposal here: http://groups.google.com/group/clojure-dev/browse_thread/thread/c0b9b7857f19001c

15:05 stuartsierra: It's basically what we're saying

15:05 stuartsierra: devlinsf: need to test maven/ant/build stuff first, and finish the changes doc, but otherwise yes

15:06 devlinsf: Okay

15:06 stuartsierra: Rich was talking about removing the transients section, and linking to the clojure page directly

15:07 stuartsierra: devlinsf: I wondered about that myself.

15:07 devlinsf: stuartsierra; Hmmmm... at the very minimum we should provide a link

15:10 Link inserted

15:12 stuartsierra, rhickey: After thinking a bit, I like the idea of leaving the transients section in. Have more than one explanation in place would help people pick up the concept. Hearing it explained differently will help different people.

15:14 stuartsierra: "mvn install" doesn't work in current Clojure master; even after "ant"

15:17 cemerick: yeah, the poms are just wrong

15:18 stuartsierra: I'm tempted to rewrite as a Maven-based build, calling out to Ant for scripting.

15:19 ericthorsen: cemerick: Are you referring to the default source root in the pom files (or lack thereof)

15:20 albino: why not call out to clojure :)

15:20 cemerick: stuartsierra: I floated that last week, rhickey didn't sound receptive

15:20 stuartsierra: albino: because we're building Clojure!

15:20 cemerick: ericthorsen: to start, yes

15:20 stuartsierra: cemerick: ok, I can probably hack the POM so it works with the ant build

15:21 alexyk: hey guys, I know it's almost cast in stone, but contrib is really stdlib

15:21 albino: stuartsierra: so we can't call out to the previous version of clojure while building the newer version?

15:21 cemerick: stuartsierra: I think 1.2 is a reasonable goal for lobbying for a maven-driven build

15:21 alexyk: perhaps a similar mechanism can be deployed as for clojure-lang to rename it

15:21 with an alias to c.c. until deprecated

15:21 stuartsierra: albino: theoretically we could, but the we'd need to include the old version in the build

15:21 cemerick: *parts* of contrib are a stdlib. Other parts, not so much.

15:22 albino: stuartsierra: okay, I'll stop harping, but I'd rather install a previous version of clojure over ant and maven :)

15:22 ericthorsen: cemerick: I was going to submit a patch until I saw that having more than one source root for a maven project was not supported out of the box (I know little about MAven)

15:22 alexyk: cemerick: exactly. So perhaps a smaller, fixed stdlib can be carved out of contrib.

15:22 stuartsierra: albino: you'll probably only need ant

15:22 cemerick: ericthorsen: multiple source roots aren't a problem, that's a simple fix

15:22 devlinsf: alexyk: See here:

15:22 stuartsierra: alexyk: that's a goal in my mind for 1.2

15:23 cemerick: getting the compilation and install/deployment of the various artifacts will take a little bit of work

15:23 devlinsf: http://groups.google.com/group/clojure-dev/browse_thread/thread/e5083948af33939f#

15:23 cemerick: devlinsf: thank you

15:23 * technomancy would love to see a clojure.io namespace in 1.2 gathering useful fns from contrib

15:23 * stuartsierra too

15:23 * cemerick thirds

15:24 devlinsf: me 4....

15:24 cemerick: I think that's a more productive path than promoting libs

15:24 devlinsf: Just don't know how to set status in irc...

15:24 stuartsierra: I've got a whole set of standard libs laid out in my head.

15:24 devlinsf: type /me then your status

15:24 alexyk: ah ok, link covers it

15:24 * devlinsf sets status

15:24 devlinsf: stuartsierra: Thanks

15:24 stuartsierra: devlinsf: welcome

15:25 But first, 1.1 or bust!

15:25 devlinsf: Yes, 1.1

15:25 stuartseirra: Want to talk to you about str-utils for 1.2... but it can wait

15:26 cemerick: I'd actually rather see a real stdlib discussion hold off until 1.3 or whatever -- get the types, protocols, reify under our belt

15:26 chouser: also, parts of clojure.jar are stdlib

15:26 clojure.xml, clojure.zip

15:26 devlinsf: clojure.test

15:27 stuartsierra: rhickey: I'm going to make a ticket for Maven-related stuff in 1.1, ok?

15:29 cemerick: good point re types/protocols/reify

15:29 In the interim, numbered contrib releases might help some people out.

15:30 cemerick: If a transition to maven can be made, then that's *almost* not necessary.

15:30 stuartsierra: cemerick: almost

15:30 cemerick: ...or, so easy to do as to make it a non issue :-)

15:30 stuartsierra: Right.

15:30 Chousuke: hmm

15:31 stuartsierra: Here's an easy fix for a Java person: http://www.assembla.com/spaces/clojure/tickets/218-Deprecate-old-launch-Classes

15:31 alexyk: stuartsierra: will maven releases cover cases for different branches? in Scala, it's solved by suffixing the maven artifactId with a version, e.g. scala-json-2.7.7 vs scala-json-2.8-SNAPSHOT. Then the version field is a true version. This is the consensus for Maven-centric tools after a lot of trying.

15:31 Chousuke: I wrote some documentation for function pre- and postconditions but I still don't like that it all is in the fn docstrings

15:32 alexyk: E.g. I'd like to try protocols in an easy to build way, having clojure-new, contrib-new all properly stuffed into maven

15:32 stuartsierra: alexyk: We're close to that with build.clojure.org

15:32 Chousuke: ideally you should be able to do something like (doc preconditions) and (doc postconditions) :/

15:33 stuartsierra: Chousuke: could you copy that into the Changes doc?

15:33 Chousuke: stuartsierra: Sure.

15:33 stuartsierra: Chousuke: thanks

15:33 alexyk: stuartsierra: how close? :) is the convention the same? I've seen clojars kinda tossig namespaces, suggesting same naming for groupId and artifactId. Doesn't help with language branches at all.

15:34 i.e., where does the "new" branch suffix go?

15:34 btw "new" is quite a terrible branch name

15:34 stuartsierra: alexyk: I don't have answers for you, I'm afraid.

15:35 alexyk: stuartsierra: you're the first person not spitting nails about maven but rather wanting something to do with it, hence my asking :)

15:36 stuartsierra: alexyk: I will continue to push for regular Maven-based releases, but there's a lot of organizing to do.

15:36 alexyk: stuartsierra: good

15:37 hiredman: alexyk: new refers to new new, the main feature the branch was originally for work on

15:38 alexyk: hiredman: right, but in maven, it better be called clojure-proto or something meaningful. There's also something new, and nothing's new under the Sun.

15:39 always new, I mean

15:39 stuartsierra: ok, I'm off for a bit, I'll try to tackle the 1.1 POM this evening

15:40 hiredman: alexyk: the feature that the new branch was originally made to work was called "new"

15:40 * hiredman feels like he is in an abbet and castello skit

15:40 alexyk: hiredman: ah, ok. Well it takes 3 iterations to penetrate a head. :)

15:41 It's like a person called Andwhatsyourname.

15:42 "-- My name is John. -- Andwhatsyourname! -- John, and yours? Andwhatsyourname! ..."

15:48 devlinsf: alexyk Who's on first?

15:48 alexyk: devlinsf: I don't get baseball, so that makes no sense to me :)

15:49 devlinsf: gasp!

15:49 It's a classic!

15:50 alexyk: devlinsf: I know, still makes no sense! :)

15:51 * devlinsf shakes head

15:54 lghtng: baseball is a test of coolness under pressure

15:55 unlike continuous action sports that arent quite as dependent on actual 'zero to 60' quickness

16:01 KirinDave: oh man

16:01 alexyk: lghtng: baseball is middle-aged men in tight pants leisurely walking around for 8 hours

16:01 KirinDave: This is not a good conversation to have in #clojure.

16:01 devlinsf: So it doesn't belong in this ball park?

16:02 alexyk: ok, back to basics. How do I merge a seq of tiny maplets, ({:a 1} {:b 2}) into one huge map, {:a 1 :b 2} most concisely & fast? My seq is long.

16:02 arohner: ,(doc merge)

16:02 clojurebot: "([& maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result."

16:03 alexyk: ,(merge ({:a 1} {:b 2}))

16:03 clojurebot: nil

16:03 KirinDave: And also

16:03 chouser: ,(apply merge ({:a 1} {:b 2}))

16:03 clojurebot: nil

16:03 KirinDave: ,(doc merge-with)

16:03 clojurebot: "([f & maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping(s) from the latter (left-to-right) will be combined with the mapping in the result by calling (f val-in-result val-in-latter)."

16:03 chouser: ,(apply merge [{:a 1} {:b 2}])

16:03 clojurebot: {:b 2, :a 1}

16:03 alexyk: I don't need -with, I'm guaranteed to have distinct keys.

16:04 ,(merge {:a 1} {:b 2})

16:04 clojurebot: {:b 2, :a 1}

16:04 KirinDave: Lol

16:04 alexyk: works for literals, not for enclosing seq

16:04 danm_: ,(reduce merge '({:a 1} {:b 2} {:c 3}))

16:04 clojurebot: {:c 3, :b 2, :a 1}

16:05 danm_: yay?

16:06 the-kenny: ,(apply merge '({:a 1} {:b 2} {:c 3}))

16:06 clojurebot: {:c 3, :b 2, :a 1}

16:06 alexyk: danm_: leaves me with only the last element of real data, which I test with (take 5 bigseq)...

16:07 danm_: hmm, worked for clojurebot though

16:08 hiredman: alexyk: are you sure you are using it correctly?

16:09 alexyk: hiredman: no :)

16:09 hiredman:

16:10 alexyk: wtf: http://paste.pocoo.org/show/157258/ ?

16:10 doh

16:10 I need to invert keys...

16:10 hiredman:

16:11 djork: reduce + merge?

16:11 are you positive?

16:11 hiredman: djork: his keys are not unique

16:11 devlinsf: alexyk: clojure.set

16:11 alexyk: djork: works, my data was inverted

16:11 I fetch from Mongo and just need to insert into the map differently

16:12 btw that was justinbieber dominating twitter pagerank. How many of you know who that is? (instant poll)

16:13 or, does *anybody* know who Justin Bieber is?

16:14 ...there's nothing wrong in admitting you do! :) For the betterment of science.

16:29 is there a filter-not predefined?

16:30 chouser: remove

16:30 alexyk: thx!

16:35 lghtbt: hrm

16:36 lghtng: the sparlq might be a little steep for me at this point

16:36 i need something simpler

16:36 as a learning project

17:02 mabes: ,(let [foo (transient {})] (doseq [i (range 15)] (assoc! foo i i)) (persistent! foo))

17:02 clojurebot: {0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7}

17:03 mabes: does anyone know why I could only assoc! 8 times within a doseq? ^^ (I'm using transients to count stuff)

17:03 Chousuke: mabes: that's abuse of transients

17:04 mabes: you can't reuse the reference.

17:05 mabes: Chousuke: well, I have a version that is not using transients and just uses maps with persistent structures but the memory use is an issue

17:05 Chousuke: mabes: no, I mean

17:05 mabes: so, I found this post that suggested using transients for something similar: http://www.bestinclass.dk/index.php/2009/12/clojure-vs-ruby-scala-transient-newsgroups/

17:05 Chousuke: mabes: you can't write imperative code with transients.

17:05 mabes: oh

17:05 hrm.

17:05 Chousuke: mabes: it's mutable, but it still needs to be functionally structured.

17:06 mabes: treat it as it were a regular immutable map and everything will be fine.

17:06 mabes: Chousuke: ok, so I would need to restructure the comprehension into maps or something?

17:08 alexyk: liebke: how do I plot 4 mllion [x y] pairs?

17:08 * mabes reading http://clojure.org/transients

17:08 liebke: very carefully :-)

17:08 Chousuke: mabes: http://gist.github.com/257351

17:09 alexyk: liebke: I mean, what's the fun for scatter plot? And will JFreeCharts take 4 mil?

17:09 Chousuke: mabes: build it just as if it were a functional map, just substituting assoc for assoc! and wrapping the final return value with (persistent! ..)

17:10 the-kenny: alexyk: Maybe just write them to a file and call gnuplot on it

17:10 alexyk: the-kenny: the whole point of using incanter is to dispense with files :)

17:10 liebke: the function is incanter.charts/scatter-plot. I would be (pleasantly) surprised if it handled 4 mil points

17:10 alexyk: liebke: need I sort them anyhow?

17:11 liebke: no

17:11 Chousuke: mabes: the whole point is that you don't need to change the way you write algorithms just to use transients :)

17:11 alexyk: liebke: well, histogram can handle millions; I wonder how can I bucket points to plot fewer...

17:12 mabes: Chousuke: right. Thanks for the info and gist. Reading up on transients now..

17:12 liebke: alexyk: try it with the full set, see how it goes

17:13 alexyk: liebke: My data is a seq ([1 2][3 4]...), should I just call scatter-plot repeatedly with it?

17:13 * the-kenny has to try incanter some day

17:14 liebke: scatter-plot takes two sequences, x and y -- you'll need to convert your data format a bit

17:14 alexyk: ah ok

17:14 technomancy: it seems like a lot of the confusion over transients stems from confusion between "persistent" and "immutable" data structures.

17:15 I understand why they are often conflated, but if you focus on the fact that transients are simply not persistent then it's much clearer

17:15 Chousuke: that's why I like the naming.

17:15 rhickey_: yes, the idea is that they are opposites

17:16 in that dimension

17:16 technomancy: if people don't understand what persistence means, it's no wonder transients are confusing.

17:17 Chousuke: rhickey_: btw, how about extending the assert macro to accept an optional message argument? Could make error messages much clearer.

17:17 the-kenny: It's helpful to read the text about the falling tree :)

17:17 Chousuke: wouldn't be a breaking change either.

17:20 rhickey_: I have some documentation stuff in my git tree, and I think the pre/postcondition failure messages are a bit too generic. "assertion failure: (> x y)" is not very nice :/

17:22 lghtng: 'creating identities out of things that should be values'

17:22 man. that's deep.

17:23 * lpetit things he understands how to correctly use transients, and in the same time was not aware one must not conflate "persistent" and "immutable" :-$

17:23 polypus: is there something like finite? implemented for seqs and collections?

17:25 lghtng: you know, i sort of have a theory that object oriented paradigm creep has damaged the business model, which has given birth to the Cloud. a sort of mass retreat behind the firewalls.

17:25 technomancy: polypus: See http://en.wikipedia.org/wiki/Halting_problem =)

17:26 polypus: haha

17:26 hiredman: ~the halting problem?

17:26 clojurebot: "There is no problem in computer programming which cannot be solved by an added level of indirection." -- Dr Maurice Wilkes

17:27 drewr: technomancy: you noticed that swank-clojure-find-package doesn't work for namespaces with meta?

17:27 polypus: this could be done though if one knoew the origin of a seq. like (map f [1 2 3]). metadata could indicate that the seq is finite.

17:27 knew*

17:27 hiredman: ~halting problem?

17:27 clojurebot: not a problem, the average bid for it on getacoder is $821.00

17:27 technomancy: drewr: I don't work with any namespaces that have metadata (other than docstrings), so I haven't noticed that myself.

17:27 waiting for someone who does use them to submit a patch. =)

17:28 drewr: I don't work with them either until I try to patch code that does, e.g. clojure.core :-)

17:28 polypus: if it is unknown whether it is finite false could be returned from finite?

17:29 drewr: envisioning the regexp that mimics the clojure reader is giving me a headache

17:29 alexyk: liebke: can I first do (def myplot (scatter-plot xs ys)) and then (view ..) it?

17:29 liebke: yes

17:29 technomancy: drewr: boo; when did that get added to core.clj. =(

17:29 lpetit: polypus: in the case of a seq, how do you know it is unknown ? :-)

17:29 alexyk: well it's ingesting 4 mil points, let's see :)

17:30 polypus: (:finite (meta a-seq))

17:30 technomancy: drewr: not supporting it was my subtle way of discouraging people from adding useless metadata, but I guess if it's made its way into core that battle is lost. =(

17:32 polypus: map could set the meta of a new seq from a finite collection to true. if it is mapping a seq onto a seq it could inherit the meta

17:32 cycle could return a seq with #^{:finite false} etc.

17:33 is there some reason this could not work?

17:33 liebke: alexyk: cool, I need to go now, let me know later if it works.

17:33 alexyk: liebke: yeah, still ingesting...

17:34 liebke: alexyk: I imagine it will take a while. talk to you later

17:34 alexyk: liebke: ttyl

17:34 tomoj: polypus: it bottoms out

17:34 lpetit: polypus: i don't know

17:34 tomoj: and where it bottoms out, I'm sometimes going to have to say for myself whether it's finite or infinite

17:35 arohner: tomoj: what do you mean by 'bottoms out'?

17:35 polypus: tomoj: in cases where it is unknown it just just return false

17:36 hiredman_: polypus: if you want a finite seq, use a list

17:36 tomoj: polypus: ok, that could work

17:36 arohner: polypus: another way to think of this is seqs have two methods: give me the next, and give me the rest

17:37 "give me the rest" is a function that is almost arbitrary

17:37 tomoj: arohner: I mean that eventually the value for :finite has to come from somewhere, and there are places where there is no way for it to automatically be provided

17:37 lpetit: polypus: use case for this new "functionality" ?

17:37 tomoj: (unless you just are conservative and have it be false when you don't know)

17:37 polypus: tomoj: example of a place

17:38 arohner: polypus: I can construct a valid lazy seq that is infinite on Tuesdays, and finite the rest of the days of the week

17:38 tomoj: :)

17:38 polypus: lpetit: when designing an api where the user can supply a collection and you need to know whether it is finite w/o the user having to specify it explicitly.

17:38 arohner: so it does come down to the halting problem

17:39 tomoj: suppose we have a predicate that returns true if the number passed to it is the sum of two primes, false otherwise

17:39 technomancy: polypus: calling it "finite?" is misleading; the best you can do is "known-finite?"

17:39 polypus: sure the name is not set in stone

17:39 hiredman_: if it is finite, use a list

17:39 tomoj: now (take-while goldbach? (iterate (partial + 2) 2))

17:39 hiredman_: ,(list? (iterate inc 0))

17:39 clojurebot: false

17:39 tomoj: no one knows whether this seq is finite or infinite :(

17:39 hiredman_: ,(seq? (iterate inc 0))

17:39 clojurebot: true

17:40 hiredman_: ,(apply list (take 5 (iterate inc 0))))

17:40 clojurebot: (0 1 2 3 4)

17:40 * arohner really wants a function to represent (iterate inc 0)

17:40 arohner: that needs to die as an idiom

17:41 tomoj: yeah

17:41 Chousuke: hmm

17:41 ,(range)

17:41 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: core$range

17:41 technomancy: arohner: why a function? why not just a var? positive-integers

17:41 hiredman_: technomancy: var would hold the head

17:41 Chousuke: technomancy: head holding

17:41 technomancy: doh

17:42 lpetit: polypus: as hiredman said, in your api, either expect your user to pass a real collection (finite), or a seq (possibly infinite) + the explicit flag saying if it's finite or unknown ?

17:42 tomoj: something for just generating arithmetic sequences would be cool

17:43 [2,4,..]

17:44 lpetit: technomancy: can you explain to me the difference between "persistent" and "immutable", or more interestingly, where the difference is important ?

17:45 hiredman_: tomoj: uh, what is iterate then?

17:46 technomancy: lpetit: in a nutshell, persistent means "old versions are still available for use without performance penalties", which means that persistent data structures are immutable, but not neccessarily vice versa

17:46 it probably deserves a blog post. we'll see. =)

17:46 chouser: but transients are still their own thing.

17:46 technomancy: actually not 100% sure if the "without perf penalties" is part of a strict definition of persistent, but in the context of clojure it's true

17:46 chouser: not immutable and therefore not persistent. But also cannot be treated as mutable.

17:47 technomancy: chouser: but their mutability is an implementation detail that the user shouldn't be aware of. the user should just be aware of their non-persistence

17:47 IIUC

17:47 rhickey_: technomancy: yes, that's the better way to think about it.

17:48 because mutability is a weak concept

17:48 tomoj: hiredman_: something I can use to make something which is for generating arithmetic sequences

17:48 aldebrn: Noob question about mutability. How should I think about Java numerical libs that operate on arrays in-place? Should my wrapper function somehow copy the input, send that to the Java lib, and return the processed copy to the caller?

17:49 rhickey_: I didn't have time earlier, but I have some new ideas around transients

17:49 technomancy: it doesn't help that to many developers coming from OO, persistence means "saving to disk". (all the good words have been used)

17:50 rhickey_: yeah

17:51 hiredman_: ~latex \sum_{i=0}^{∞} i+1

17:52 notallama: is there a conventional way to name types with deftype? Like-this, OrThis, or-this?

17:53 lpetit: technomancy: so "persistent", beyond conveying the meaning of immutability, also conveys the meaning that derivative objects can be made cheaply from the datastructure at hand ?

17:55 technomancy: lpetit: more or less. and that old versions persist for free.

17:56 rhickey_: lpetit: the performance promises are those of the data structure. persistence really gets to the fact that 2 versions have independent lifetimes, both preserving those promises

17:57 vs implementations that cheat and have perf degrade for older versions, or older versions are read-only etc

17:58 for me, full persistence means older is as good as newer

18:13 KirinDave: Hm

18:14 I am trying to read that monad tutorial for clojure.

18:14 (at http://onclojure.com/2009/03/06/a-monad-tutorial-for-clojure-programmers-part-2/)

18:14 The "mystery" exercise is eluding me though

18:15 Does anyone know what the intent was there?

18:18 hiredman_: man

18:18 clojure cds!

18:18 like a relase of clojure + contrib on a cd with a printed picture on it

18:19 the swirly λ logo thing

18:22 technomancy: mwoichandising!</space-balls>

19:02 notallama: so i need to run some functions sequentially. order doesn't matter, but only 1 should run at a time. agents don't fit, because i need the value, not the side-effect. atoms don't work because it shouldn't retry. any suggestions?

19:07 arohner: notallama: do you need some kind of threading? Why not just a normal function?

19:07 [(funA) (funB) (funC)]

19:09 notallama: arohner: i'm trying to wrap a side-effectful, mutable-stateful library. so i'm calling the function from multiple threads, but i want it to block if another thread is doing so.

19:10 arohner: ,(doc promise)

19:10 clojurebot: "([]); Experimental. Returns a promise object that can be read with deref/@, and set, once only, with deliver. Calls to deref/@ prior to delivery will block. All subsequent derefs will return the same delivered value without blocking."

19:10 arohner: or maybe

19:10 ,(doc future)

19:10 clojurebot: "([& body]); Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block."

19:14 notallama: not quite what i need. i think i know what i need now, though. it just occured to me that this thing is basically an iterator, so a lazy-seq should work.

19:15 arohner: ah, that's interesting. you're right though, one instance of a lazy seq will evaluate each item once, in order

19:16 notallama: i think repeatedly will make this crap much easier to deal with.

19:20 mabes: I am trying to use pmap on some big chunks of data. It seems to work great and churns through everything but after it outputs the data the process just hangs for several seconds.. does that sound familiar to anyone?

19:22 _ato: mabes: add (shutdown-agents) to the end of your program

19:22 mabes: _ato: ahh, so pmap use agents under the hood that you have to shutdown explicitly... thanks for the tip

19:26 _ato: mabes: yeah, well I don't think it uses agents exactly but it uses the same thread pool. That's something that I trip over all the time. Not sure why it can't happen automatically.

19:27 mabes: _ato: ok. many thanks, that was very frustrating but we are now seeing major win with pmap :)

19:28 notallama: future uses the agent pool as well (the send-off pool)

19:31 arohner: _ato: AFAIK, java doesn't have a "it's time to shut down now" hook, so code can't clean itself up automatically

19:31 ah, nm. I has one, but has been deprecated since 1.2

19:31 s/I has/it has/

19:31 hipertracker: how tu run clojure script from the shell? What shebang I can use?

19:35 technomancy: hipertracker: there's a shell script in contrib, but there's really no single good way to do that unfortunately. everyone seems to end up rolling their own launchers. =(

19:36 hipertracker: technomancy: its is strange. even Scala has simple shebang

19:37 twbray: _ato: Waiting with bated breath for your WF writeup.

19:42 _ato: twbray: I'm on the final section. :-) Sorry, I'm a terribly slow writer

19:42 twbray: _ato: nag, nag nag

19:45 hipertracker: technomancy: I create simple bash file cljrun: java -cp /opt/local/share/java/clojure/lib/clojure.jar clojure.main $1. it work

19:45 er, it works

20:03 technomancy: hipertracker: there's no standard location for the jar(s) though. plus most programs at least use contrib. and then many use other third-party jars as well.

20:04 hipertracker: technomancy: I know. I use clojure from macport

20:04 macports

20:06 hiredman_: technomancy: you can replace the system classloader with something you can add stuff to

20:08 (I happen to have such a classloader am looking for feedback)

20:20 technomancy: hiredman_: O RLY? send 'er on over.

20:20 sounds intriguing

20:21 hiredman_: http://gist.github.com/255766 if you run that, it will create a cl.jar in the pwd, and print instructions for use

20:21 technomancy: will take a look later tonight; thanks

20:22 hiredman_: let me know what you think

20:29 aldebrn: Any right way to do complex numbers in Clojure? (I'm using JTransform, it stores complex number arrays as [real1 imag1 real2 imag2 real3 imag3])

20:31 defn: aldebrn: check out http://commons.apache.org/math/userguide/complex.html

20:32 aldebrn: if you're going for speed, Java might not be the right direction

20:34 aldebrn: also, just out of curiosity i found there is a clojure-contrib library in the works for

20:35 aldebrn: defn, thanks. I guess I'm looking for the same kind of speed Python and Matlab give, by farming out heavy math stuff to custom C/Fortran libraries

20:35 defn: ah

20:35 for it*

20:35 aldebrn: I saw that too, and was discouraged by clojure-contrib's complex support as limited to arithmetic/compare

20:36 defn: *nod* -- as far as speed goes it looks like C, C++, etc. is probably the best route

20:38 aldebrn: I want to emphasize that scientific computing in Python/Matlab (this latter is heavily Java-based) is very fast computationally (thanks to external libraries) and very fast coding (thanks to high-level language)

20:38 Are you suggesting I find what C/C++/Fortran libraries are used and write wrappers for Clojure?

20:39 defn: aldebrn: i dont know enough to give you a definite answer

20:39 but that seems like a possible route, no?

20:41 aldebrn: Anything is possible :). liebke is gathering a lot of functionality in Incanter, let's hope the complex-number work has been done

20:41 defn: aldebrn: sure, it's hard to imagine incanter wouldn't at some point have complex numbers

20:42 liebke: aldebrn: Parallel Colt has complex number support, I just haven't needed it, so I haven't wrapped it

20:43 aldebrn: liebke, that's great. I'll look into it

20:43 Hard to do FFTs without easy complex numbers

20:46 Parallel Colt todo item: 'Port PLASMA 2.0 and implement all the wrappers (include complex arithmetic in single and double precision).'

20:46 But the basic stuff is there :)!

21:11 dnolen: _ato: ping

21:12 _ato: so there a 10mb limit on Clojars uploads? I'm trying to get jogl2 up there so I can hack on :native-dependencies support, can this be upped just a tad?

21:12 _ato: my jogl2 jar is 11.8mb

21:17 _ato: dnolen: ah sure. I just set a conservative 10mb to start with. Just a sec

21:18 dnolen: _ato: thx!

21:22 _ato: dnolen: give it a try now

21:22 dnolen: _ato: working like a charm.

21:23 _ato: cool. :)

21:23 * Raynes yawns while listening to people whine about Emacs.

21:25 Raynes: I'm surprised people still use the whole "OMG but it's a better OS than it is a text editor." thing anymore.

21:27 dnolen: _ato: how do you delete something you've pushed? does pushing something again wipe out the old one?

21:27 _ato: dnolen: if it's the same version then yeah it'll overwrite it

21:28 a delete function is on my TODO list but I haven't gotten around to it yet.

21:28 dnolen: _ato: ok cool.

21:36 tomoj: is it safe to try leiningen again yet?

21:42 defn: error in process filter: Wrong number of arguments: called-interactively-p, 1

21:43 im getting that when i run swank-clojure-project

21:56 _ato: twbray: http://meshy.org/2009/12/13/widefinder-2-with-clojure.html

22:01 hiredman_: _ato: #^"Ljava[.lang.String;" should be #^"[Ljava.lang.String;"

22:04 _ato: hiredman_: ah thanks

22:08 hiredman_: _ato: excellent write up

22:11 rhickey_: 3000 members on the google group!!

22:12 _ato: hiredman_: thanks. :-)

22:12 danlarkin: _ato: ya just finished reading, supergrats

22:12 _ato: rhickey_: woohoo!! I was watching the count down last night... 2994... 2995...

22:14 stuartsierra: rhickey_: I dropped my Maven ticket, instead added ZIP distribution target to the Ant build.

22:15 chouser: _ato: "We open first open"

22:16 alexyk: stuartsierra: why? maven is very useful!

22:16 _ato: chouser: ah, thanks

22:16 stuartsierra: alexyk: Current build supports maven via Maven Ant Tasks

22:17 Not ideal, in my opinion, but good enough for 1.1.

22:17 alexyk: stuartsierra: oh well

22:17 Raynes: Haha. It's moved from hating on Emacs, to hating on Lisp and other dynamically typed languages. (in #haskell)

22:18 alexyk: Raynes: I found #haskell very disconcerting compared to #ocaml, #scala and #clojure. Probably size matters.

22:18 ..wait until script kiddies arrive en masse

22:19 we need a pack of strict disciplinarians ready

22:19 Raynes: Most of them are rather smart people. It just gets on my nerves when they pretend Haskell is the only viable language out there.

22:19 hiredman_: clojurebot: whose job is it to keep them in line?

22:19 clojurebot: that's weihsiu's job

22:20 Raynes: It's sort of like the Java, C#, etc coders pretending that object orientation is the only way to do things.

22:20 rhickey_: stuartsierra: my maven concerns had to do with artifact naming etc. I think there was some problem last time with the svn tag not matching or something.

22:21 we should still build with ant definitely

22:21 stuartsierra: rhickey_: Ok, I submitted a patch to build a distribution ZIP with Ant.

22:21 rhickey_: also ericthorsen has brought up an issue with our pom which was never resolved

22:21 something about it messes up Netbeans

22:22 stuartsierra: ~seen ericthorsen

22:22 clojurebot: ericthorsen was last seen joining #clojure, 237 minutes ago

22:22 alexyk: funny, I was pondering using jruby in my JVM stable, and tried to see if I have all the standard map, filter, list routines in it. What OO briings there is . notation left to right and the do...end block, possibly as { } -- that's a good contribution to functional. The question is, can you translate most of the goodness between clojure and ruby.

22:25 stuartsierra: Found ericthorsen's msg: http://groups.google.com/group/clojure-dev/browse_thread/thread/c8cec4225fecd01d/3d39f207754cb263

22:25 technomancy: _ato: looks like a stray "nnnn" snuck into your WF2 article

22:25 (happens to me all the time)

22:25 stuartsierra: The problem appears to be that Netbeans sees a pom.xml and assumes that the project is Maven-based.

22:26 Which it isn't, so Netbeans assumes a different directory structure than what's there.

22:26 rhickey_: zip with ant a good idea

22:27 stuartsierra: yes, I didn't know enough about either to help him, but no one ever chimed in

22:27 alexyk: how do you materialize a lazy seq in the same way as (count xs)?

22:27 _ato: technomancy: thanks. yeah.. I just recently disabled arrow keys to force myself to do navigate the proper way so I keep doing that all the time now :P

22:27 alexyk: _ato: Clojurnne beginners :)

22:27 stuartsierra: rhickey_: It should be better now that we have pom-template.xml instead of pom.xml

22:28 alexyk: _ato: nice writeup

22:28 rhickey_: stuartsierra: ok

22:29 stuartsierra: rhickey_: sent ericthorsen an email about that

22:29 rhickey_: the new zip file should nest the stuff in a clojure directory, got complaint about the old one

22:30 stuartsierra: Yes, I made sure to do that.

22:30 It creates clojure-{VERSION}.zip, expanding to clojure-{VERSION}/...

22:31 rhickey_: makes sense

22:31 stuartsierra: Changes doc is coming along nicely; Chousuke wrote up pre/post conditions.

22:40 defn: (defn merge-rows [a b] (map + (map #(apply max %) (partition 2 1 a)) b)) (map #(apply max %) (partition 2 1 (reverse [[1] [2 3 4] [5 6 7]])))

22:40 err (merge-rows (reverse [[1] [2 3] [4 5 6]]))

22:40 why doesnt merge-rows blow up here? im only giving it one arg

22:41 hiredman_: it should, if it doesn't then it is not defined or being called as you described

22:41 defn: oops nevermind

22:42 hiredman_: :)

22:42 defn: what i was surprised about i guess is:

22:42 ,(partition 2 1 [[4 5 6] [2 3] [1]])

22:42 clojurebot: (([4 5 6] [2 3]) ([2 3] [1]))

22:43 defn: so merge-rows understands the first arg to be [4 5 6] and [2 3], yes?

22:43 err the first and second args

22:44 hiredman_: eh?

22:45 defn: (defn merge-rows[a b]

22:45 (map + (map #(apply max %) (partition 2 1 a)) b))

22:45

22:45 (reduce merge-rows (reverse routes))

22:45 bleh sorry

22:46 the only arg there, in my eyes, is the array of arrays, which is routes: [[4 5 6] [2 3] [1]]

22:46 hiredman_: not arrays

22:46 vectors

22:46 defn: blahhhh im sorry man my brain is mush

22:46 tomoj: reduce is not calling the function with (reverse routes)

22:46 hiredman_: and partition being a seq function calls seq on it's argument

22:46 defn: oh right

22:47 im going to quit on that note, i cant believe i missed that :\

22:47 hiredman_: so you get '([4 5 6] [2 3] [1]) and partition operates on a seq of values

22:48 defn: yeah, reduce is really what gives us the ability to apply that function across routes

22:49 anyways, thanks for showing me the error of my ways

22:52 http://meshy.org/2009/12/13/widefinder-2-with-clojure.html

22:52 _ato: nice.

22:53 _ato: :)

22:56 defn: _ato: this is awesome. thanks for posting it. can i add an rss feed to your blog, or should i download this so i dont lose it :)

22:57 _ato: defn: there's an atom thingy here: http://meshy.org/atom.xml

22:57 which may or may not be valid

22:57 defn: yeah i found it after a bit of trial and error

22:57 it looks valid to me

22:58 i guess my main question was, do you plan to keep this blog up?

22:59 _ato: yeah probably. I don't expect to post that often, but there's some clojars stuff I'd like to write up

22:59 defn: *nod* -- what are you using for writing your post? it looks like... pygments + markdown maybe?

23:00 twbray: Hey _ato, is http://meshy.org/ your canonical URL?

23:00 _ato: twbray: yep

23:01 twbray: Yes, your feed is valid, http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fmeshy.org%2Fatom.xml

23:01 _ato: defn: yeah, I tried jekyll after you were talking about it. I'm a big fan of markdown and pygments just works. Here's what the source looks like: http://meshy.org/~ato/tmp/2009-12-13-widefinder-2-with-clojure.markdown.txt

23:03 twbray: _ato: Was that 13 minutes really your *first* run?

23:03 * technomancy had no idea that pmap used the agent thread pool

23:03 technomancy: should that be mentioned in the docstring?

23:04 twbray: _ato: You want an affiliation if I mention you? "Alex Osborne, of XXX..."

23:05 hiredman_: of #clojure :P

23:05 _ato: twbray: I think it was my first run that completed on the full dataset. That may not be the exact timing but it was around that. I'd done a fair bit of testing on the smaller version, and didn't give it enough RAM in my real first run so it just got stuck.

23:05 defn: _ato: cool, what this {% highlight clojure %} line? I've been using a verion of markdown in python where you specify code blocks with a #!clojure or :::clojure depending on if you want line nos

23:06 twbray: hiredman: I like that

23:08 _ato: twbray: you could say "National Library of Australia" as the affiliation

23:08 http://www.nla.gov.au/

23:08 twbray: OK

23:08 Canberra is an unsuspected hotbed of functional programming I'm sure

23:09 _mst: our clojure user group has two members!

23:09 but we're marketing aggressively...

23:09 _ato: _mst: we should add Mark Reid to it

23:09 defn: heh, i cant find anyone around here interested in clojure

23:09 _mst: *three* members!

23:09 shoover: technomancy: It uses the cached (growable) thread pool used by send-off, so it shouldn't affect anything related to agents

23:09 _mst: (the third doesn't know he's in yet... the initiation may come as a shock)

23:10 defn: _mst: haha

23:10 is this '_' business preceding your nicks a gang sign?

23:10 _mst: hm... isn't that just something erc does?

23:10 a gang of sorts...

23:10 tomoj: erc doesn't do it to me

23:11 _mst: I mean, since "mst" was already taken by someone more deserving :)

23:11 _ato: yeah.. same for me

23:11 technomancy: shoover: I just was noticing that _ato's code calls shutdown-agents after using pmap

23:11 tomoj: I get a backtick on the end if I try to connect when I'm still here

23:12 technomancy: if that's required it should be stated somewhere

23:12 shoover: technomancy: true, you would need to know that

23:12 twbray: There are a few things in _ato's code that you "need to know" :)

23:12 Now more people will.

23:13 shoover: I like how _ato put the appropriate emphasis on "don't rewrite split unless you have to!"

23:13 defn: yeah, kudos _ato for not just the great code, but an excellent explanation

23:14 _ato: yeah, I think pmap uses the same thread pool as agents. I guess it's called shutdown-agents just because agents existed before pmap

23:14 shoover: technomancy: my question is if we can get rid of shutdown-agents by using daemon threads and making the programmer call await to purposely block on running agent threads

23:15 in other words, use threads that don't intrinsically block System/exit

23:15 _mst: shoover: it's come up before: http://www.assembla.com/spaces/clojure/tickets/124

23:16 shoover: _mst: thanks, I wasn't aware

23:17 technomancy: _ato: hey, I hope you haven't been waiting on me for that clojars browse functionality I said I was going to write.

23:18 I'm going to have to retract my offer to implement it; too busy with lein and swank and holidays etc.

23:18 _ato: technomancy: nope, I've been distracted by this widefinder stuff. I've got 6 clojars emails sitting in my inbox that I need to deal with now that's out of the way

23:18 technomancy: or at least to implement it in a timely manner

23:18 * technomancy would be thrilled to have only 6 to deal with =)

23:18 _ato: technomancy: okay, no worries :)

23:20 technomancy: actually that's not fair; I'm glad there are a lot of people discussing/contributing to leiningen and swank

23:20 I just can't keep up. =)

23:22 chouser: _ato: great writeup!

23:24 _ato: chouser: thanks. :-)

23:32 defn: _ato: will you be submitting this to the results page for WF?

23:32 _ato: you mention you inched past single-threaded C, but you also beat one of the OCaml implementations

23:34 _ato: ah, I guess I should

23:34 hmm

23:37 defn: it looks like you're supposed to email tim.bray@sun.com with your results for a 100,000 line sample, but seeing as tim is in here, im not sure that's necessary

23:37 * mabes is reading _ato's awesome post.

23:38 _ato: yeah, I think that's just to get an account on the box. probably I just need to create a sun account and I'll be able to edit the wiki

23:38 going for lunch though first, I'm starving, writing really takes a lot of energy

23:38 defn: _ato: again, great job, enjoy your lunch :)

23:41 tomoj: mabes: hey, are you a clojurian now?

23:41 devlinsf: Where is _ato's post?

23:41 mabes: tomoj: heh, getting there ;) I have some people on board at work so we've been doing some prototyping with it to get a feel for it

23:42 devlinsf: http://meshy.org/2009/12/13/widefinder-2-with-clojure.html

23:42 tomoj: cool

23:42 mabes: tomoj: what about you?

23:42 tomoj: seems to me that people here aren't as obsessed with testing

23:42 I miss webrat :(

23:43 mabes: also getting there, but much more slowly probably

23:43 mabes: tomoj: I think we are probably going to keep all of out webapps in ruby for the time being.. we are just using clojure for the backend heavy lifting stuff

23:43 tomoj: yeah, makes sense

23:44 defn: tomoj: im interested in testing more, but for now im focused on learning forms and playing with the pieces

23:44 tomoj: I hope someday for a clojure webapp ecosystem that makes me as happy as ruby's

23:44 mabes: there is a clojure webdriver adapter currently.. and you can use cucumber with clojure so that will get you pretty far

23:44 tomoj: wat

23:44 shit, I've been working on a webdriver adapter, didn't know someone already did it

23:45 mabes: heh, yeah... lemme get the link...

23:45 devlinsf: _ato: Good stuff

23:45 defn: what is the biggest step between where clojure's web development tools are now and where ruby's are?

23:45 tomoj: mikitebeka's?

23:45 devlinsf: defn: I'd say front end

23:45 mabes: tomoj: http://github.com/mikitebeka/webdriver-clj yep

23:46 tomoj: thanks

23:46 devlinsf: defn: It's really easy to make Rails look great

23:46 defn: Of course, I'm a CSS + HTML nerd

23:47 tomoj: I started with an htmlunit adapter because there I could use enlive style selectors easily, which was awesome. with webdriver I don't think I can do that efficiently, but oh well :(

23:47 frontend? you mean like sass/erb/haml stuff?

23:47 devlinsf: Yeah

23:48 The "What people see" stuff

23:48 I like erb

23:48 Of course, I'm no compojure expert

23:49 tomoj: I think I have been convinced of enlive's style of doing things over erb's

23:49 defn: my personal concern currently is acceptance testing

23:49 hiredman_: if I recall correctly webdriver uses htmlunit

23:49 (htmlunit is nice)

23:50 tomoj: yeah but it abstracts over it so that it can also use firefox etc

23:50 technomancy: erb is horrible

23:50 mabes: hiredman_: thats correct- and you can have it switch to seleniun

23:50 tomoj: which means I can't do what I did when using htmlunit directlly

23:50 devlinsf: technomancy: It's what I know

23:51 technomancy: I mean it's obvious, but it's ugly and impossible to write good tool support for

23:51 mabes: erb is nice for designers... if you think your designer complained about writing haml just let them try the compojure html syntax :p

23:51 technomancy: since ruby's grammar is insane to begin with; embedding it inside HTML just pushes it over the edge

23:51 tomoj: mabes: let them try enlive :)

23:52 there they just hand you the html mockup with fake data and everything

23:52 devlinsf: I haven't wrote HTML in 6 months

23:52 I DO like clojure's XML stuff way better

23:52 mabes: tomoj: yeah, it looked interesting but I haven't tried it.. are you working on a project that is available on github?

23:53 defn: devlinsf: yeah ive used rails a lot and ive enjoyed it, im trying to use compojure right now, but ive found it pretty kludgey

23:53 tomoj: nope, I am at the just-playing-around stage

23:53 mabes: yeah...

23:53 danm_: wow, 8 minutes for WF2?

23:53 great writeup

23:53 defn: definitely

23:53 ato is a rockstar

23:53 danm_: no kidding

23:53 defn: to use the parlance of our times

23:54 danm_: that's pretty cool

23:54 technomancy: if his avatar is any reflection of reality, he's got the hair to match

Logging service provided by n01se.net