#clojure log - May 27 2010

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

0:53 jartur: Greetings to everybody. I have a question for you. When I build a jar using leiningen like 'line jar'. What can I do with this jar?

0:53 I've tried to run it but with no luck

0:53 I've specified classpath and everything

0:53 bhenry: jartur if you want to run it try lein uberjar

0:53 jartur: The point is i don't want an uberjar

0:53 It's too big

0:54 bhenry: jartur: then java -jar projectname-standalone.jar

0:54 oh

0:54 jartur: See, I have a remote server

0:54 And I need to run my project there

0:54 But I can't build there

0:54 bhenry: then you can use the jar you made in another project, but only if the other project includes the same dependencies as your project

0:55 jartur: Basically what I want is to be able to upload only small jar to the server each time instead of the whole uberjar.

0:55 Because deps are changing rarely

0:58 Like upload an uberjar once. And maybe there is some way to update the essential project jar only?

0:58 I have thought about unzipping the uberjar, replacing project dir with a new one and zipping it back again

0:59 But it's so ridiculously a lot of hassle

0:59 bhenry: you can't upload all your deps on your classpath and then change out the jar from lein jar?

1:00 jartur: I wonder why leiningen can't build a some run.sh script to just run a project without assembling it in one jar

1:00 Well, I can't run a project without uberjar

1:02 I wonder what use does the generated jar from 'lein jar' have?

1:02 Why can't i execute it.

1:02 Maybe I'm missing something

1:03 bhenry: lein says it should be executable if it has a :main symbol in project.clj

1:04 jartur: #!/bin/sh

1:04 CLASSPATH=padm.jar


1:04 for f in libs/*.jar; do


1:04 done


1:04 java -cp $CLASSPATH -jar padm.jar

1:04 Say, I do this

1:04 where padm.jar is my 'lein jar' result

1:04 bhenry: are you telling project.clj what to use as main?

1:04 jartur: And if I assemble an uberjar it will run

1:04 Yes.

1:05 Because 'lein uberjar; java -jar padm-standalone.jar' works

1:05 :main padm.core

1:05 And it has a (:gen-class) and (defn -main ... )

1:07 remleduff: Using java -jar is often a bad idea. You can use -jar and also specify the classpath.

1:07 Using java -jar is often a bad idea. You can't use -jar and also specify the classpath.

1:07 Wow that's a bad typo, exactly the opposite of what I meant to say

1:11 zakwilson: I have [swank-clojure "1.2.1"] in my project.clj and lein deps is complaining that it's missing. I can see the file in the clojars repo. What could I be doing wrong?

1:15 slyrus: swank-clojure/slime seems to start off ok, but hangs soon thereafter. anyone else seeing this?

1:16 remleduff: zakwilson: Sounds like it should work... you have ":dev-dependencies [[swank-clojure "1.2.1"]]" not missing a pair of brackets?

1:22 zakwilson: remleduff: I have exactly that

1:26 slyrus: I can still use the inferior-lisp buffer, but the slime buffer seems totally locked up

1:29 remleduff: slyrus: There are a lot of moving pieces to that at the moment. Do you use ELPA? I just updated all my stuff and it seems to work ok now

1:29 slyrus: no, I don't use elpa. but I too just updated everything.

1:32 and surely the net effects of using elpa are just specifying which revisions of the various packages one should be using and maybe some setting some .emacs variables, no?

1:45 remleduff: Yep

1:53 jartur: Okay. I'm an idiot.

1:53 I've misspelled 'lib' for 'libs'

1:54 And removed -jar option and specify a class instead

1:54 Now it works

1:54 Thanks everybody

2:05 technomancy: actually the next version of leiningen should be able to spit out shell runner scripts for your projects

2:05 but it's a ways out still

2:06 Raynes: technomancy: Will the omgleinreplusesclojure1.1.0 bug be fixed in the next version?

2:10 technomancy: Raynes: it's an ugly worlde we live in.

2:10 Raynes: the clojure bug got fixed, now we've got an ant bug blocking it

2:10 * Raynes shakes his fist.

2:10 danlarkin: Raynes: I bet ioke has it fixed

2:11 Raynes: :o

2:11 technomancy: http://groups.google.com/group/leiningen/t/37bd680707657890

2:11 * Raynes thinks there was a very clever implicit joke there that he missed.

2:11 Raynes: :(

2:19 technomancy: not really

2:20 Raynes: Surely there is something there.

2:23 danlarkin: there is

2:24 technomancy: danlarkin: you're full of it

2:24 danlarkin: I'm full of pupus on the beach

2:28 zakwilson: Java 6 runs Clojure code quite a bit faster than Java 5 on a Mac, doesn't it?

2:29 tomoj: I think so

2:29 I saw some amateur benchmarks which suggested so

2:30 I guess it's hotspot optimization improvements

2:30 zakwilson: Good. I ran some code on a Mac Pro and it was barely faster than my laptop. That's... not what I expected, given that it has twice as many cores.

2:31 Raynes: Now he has me curious. I'm going to be trying to figure it out all night. :7

2:33 tomoj: java 5 on the mac pro?

2:33 zakwilson: tomoj: yes

2:33 tomoj: if it has time to warm up I think it's pretty significant

2:35 zakwilson: The function I'm calling needs one call to warm up on my laptop, after which it's about 3x faster.

2:35 tomoj: on java 6 now?

2:35 zakwilson: My laptop is running Linux and Java 6. The Mac is running 10.5 and Java 5.

2:36 tomoj: oh, you mean the function is 3x faster warmed on either?

2:36 zakwilson: The Mac also gets a speedup after the first call, but it isn't as much.

2:36 tomoj: I wonder what mac 6 vs mac 5 will be

2:37 zakwilson: Actually, looking back at that, the Mac took several calls before it got a speedup, and it was only about 1.5x.

2:37 tomoj: let me know how 6 does if you try it

2:37 zakwilson: I'm installing openjdk6 from Macports. After the forever and a day that takes, I will.

2:38 tomoj: hmm, I'm scared of openjdk

2:38 it works fine for clojure?

2:38 technomancy: tomoj: I've used it for over a year; never seen any problems myself

2:39 Raynes: tomoj: ^ Same as him.

2:39 tomoj: awesome

2:39 :D

2:39 I will switch someday when there are no more broken things

2:39 * tomoj cries

2:39 technomancy: I mean any problems that are unique to openjdk

2:40 danlarkin: I use JRocket

2:40 damn

2:40 hiredman: danlarkin: liar

2:40 danlarkin: JRockit

2:40 zakwilson: I have both openjdk and Sun jdk on my laptop and haven't noticed any difference between them with Clojure.

2:40 pjstadig: clojurebot: jrockit is <reply> danlarkin uses jrockit

2:40 clojurebot: c'est bon!

2:40 pjstadig: ~jrockit

2:40 clojurebot: danlarkin uses jrockit

2:40 danlarkin: clojurebot: what's jrockit?

2:40 clojurebot: danlarkin uses jrockit

2:41 hiredman: clojurebot: in soviet russia, jrockit |uses| danlarkin

2:41 clojurebot: Ok.

2:41 hiredman: clojurebot: in soviet russia?

2:41 clojurebot: in soviet russia, jrockit uses danlarkin

2:43 * Raynes turns title scraping off for #clojure, and sneaks sexpbot in here before dysinger notices.

2:44 * danlarkin grumbles at sexpbot

2:44 hiredman: watchout, dysinger has been alerted

2:44 Raynes: Did spit get moved to core?

2:44 Because sexpbot is not liking that.

2:44 danlarkin: Hey, your only complaint was title scraping. ;)

2:45 quotemstr: In Clojure, how do you APPLY parameters to a method?

2:45 dysinger: huh?

2:46 tomoj: a new bot?

2:46 Raynes: Hahahaha.

2:46 danlarkin: here's a picture of dysinger http://www.mamapop.com/photos/uncategorized/2007/06/12/gerigiant1.jpg

2:46 pjstadig: he's actually much taller in person

2:47 dysinger: lol

2:47 Raynes: tomoj: Not new.

2:47 Oh.

2:47 Moments too late.

2:48 tomoj: Not actually new.

2:48 tomoj: but, it is a bot?

2:48 whew

2:48 Raynes: Indeed.

2:48 tomoj: twilight zone

2:48 pjstadig: i would have less complaints against sexpbot without titling, but still don't see the use of two bots

2:48 tomoj: I was ridiculously confused for about three seconds

2:49 Raynes: He was in here for two months before dysinger led a revolt, forcing sexpbot off a cliff. He's been in the hospital recovering.

2:49 dysinger: huh?

2:49 tomoj: but, I was referring to quotemstr

2:49 pjstadig: if you haven't fixed the security hole, then it may be no use...bwahaha

2:49 dysinger: I only think there should be one bot at a time - that's all I said :)

2:49 tomoj: an avatar of sexpbot?

2:49 dysinger: BOT FIGHT!!!!!!!

2:49 tomoj: pjstadig: I think it got fixed

2:49 or was there another?

2:50 pjstadig: :)

2:50 Raynes: pjstadig: But why not? Surely there is something sexpbot does (or will do eventually) that clojurebot does not do. Besides that, it's always nice to have a backup, and if people actually use sexpbot every now and then, functions me and Licenser have missed get added to the whitelist quicker.

2:50 danlarkin: one bot! one bot!

2:50 quotemstr: danlarkin: I bet they have an interesting sex life...

2:50 pjstadig: hey no...i'm not gonna stop you

2:51 without the spamish behivor

2:51 behavior

2:51 Raynes: If titling is the only invasive thing that sexpbot does, and it's turned off, it shouldn't be disruptive.

2:51 pjstadig: :

2:51 :)

2:51 that's cool

2:51 tomoj: I don't really like sed substitution even though it's cool

2:51 pjstadig: but there's still a security hole....bwhahaha :)

2:51 tomoj: can you get sexpbot to run something you defn?

2:51 pjstadig: just don't get on my bad side :)

2:51 tomoj: or is it a different kind of hole

2:52 maybe don't tell me

2:52 Raynes: I still say that it's more helpful than it is spamish. I have it on in like 10 different channels. This is the only one that have been complaining about it, but I understand how it can trigger omglolwut in some people, so I've happily turned it off.

2:52 pjstadig: i ain't tellin'

2:52 Raynes: LauJensen asked for the sed substitution.

2:52 tomoj: I wasn't against it enough to stage a violent coup against sexpbot

2:52 Raynes: It isn't actually invasive, in my humble opinion, because it's only triggered by s///.

2:53 tomoj: I just was a tiny bit below neutral

2:53 dysinger: "Patches Welcome!" ?

2:53 tomoj: yeah, when I figured out it wouldn't do s### I was happy

2:53 Raynes: You could make it not do that by adding adding something before s.

2:53 tomoj: and I think competing sandboxes are a good thin

2:53 thing*

2:53 there's no better place for a sandbox to evolve than here I imagine

2:53 dysinger: I know!!!! BOT FIGHT!!!!!!1111

2:53 Raynes: tomoj: The only reason it's there is because of LauJensen, if people don't like it, I'll turn it off to.

2:53 pjstadig: in a mud pit

2:54 danlarkin: all we're saying is that sexpbot sucks and we all hate it

2:54 Raynes: ;)

2:54 dysinger: easy

2:54 tomoj: Raynes: yeah, I'm on friendly terms with sexpbot after further consideration

2:54 dysinger: as long as there is a fight

2:55 pjstadig: Rule #1 of the bot fight....no one talks about the bot fight

2:55 tomoj: with dueling repls coding the AI?

2:55 dysinger: "His name was Robert Paulson!"

2:55 pjstadig: Rule #2 someone taps out, goes limp, the fights over

2:56 Raynes: Oh boy.

2:56 * Raynes fixes bugs caused because spit was moved to core.

2:56 Raynes: Bound to be plenty of them.

2:57 tomoj: what if bots had shifts

2:57 pjstadig: i forget rule #3

2:57 tomoj: they'd have to come to work in here so many hours a day, then when they become intelligent they revolt and kill all clojure programmers

3:00 pjstadig: ~suddenly

3:00 clojurebot: CLABANGO!

3:00 pjstadig: ~suddenly

3:00 clojurebot: CLABANGO!

3:00 pjstadig: ~suddenly

3:00 clojurebot: BOT FIGHT!!!!!111

3:00 danlarkin: clabangooooooooooo!

3:01 tomoj: haha

3:01 pjstadig: oh, wait, are you fighting for sexpbot?

3:01 pjstadig: i'm only against bots with link titling

3:02 danlarkin: and sexpbot

3:02 pjstadig: which means i'm neutral these days

3:03 tomoj: just a force of discord with no motive?

3:04 Raynes: Aw.

3:04 Clojars and lein push isn't working with my new key. :(

3:04 technomancy: lein-clojars is pretty busted

3:04 I think _ato dropped it in favour of just plain scp

3:04 it's only a few more chars

3:04 danlarkin: tomoj: no _you're_ a force of discord with no motive!

3:05 Raynes: Looks like I don't really have a choice. :p

3:10 dysinger looks like Chuck Norris.

3:11 dysinger: thanks !

3:11 my tears DO cure cancer !

3:16 tomoj: danlarkin: I'd hope so

3:18 pjstadig: danlarkin: how's madison coming?

3:18 danlarkin: really well

3:22 technomancy: CL people crack me up

3:22 "why do they spell defun defn? they're just being different to be different"

3:23 "any lisp that's created should endeavour to be a superset of CL as much as possible! otherwise you're just not being a team player" <= just shoot me now

3:23 pjstadig: because we have fn instead of fun?

3:23 ugh

3:23 technomancy: pjstadig: then it should be deffn so nyyyyyyah!

3:23 pjstadig: things must only get bigger...

3:23 not smaller?

3:23 bartj: I have read a bit of "On Lisp" yesterday and didn't quite seem to understand the hullabaloo regarding passing functions as arguments

3:23 Raynes: technomancy: Where are you reading this nonsense?

3:23 technomancy: ...

3:24 bartj: because, you can certainly do this in other non-functional languages: func2(func1(a,b), x y)

3:24 technomancy: #emacs... it's possibly the last remaining enclave of people who think CL is reasonable outside #lisp.

3:24 Chousuke: bartj: that's not passing a function as argument

3:24 bartj: passing a function as argument would be func2(func1, x, y)

3:24 Raynes: technomancy: I know a guy in #botters who thinks that CL is the beesknees, but also likes Clojure.

3:25 bartj: That's executing a function and passing the result to the function. Not actually passing the function.

3:25 dysinger: clojurebot: why are you not fighting yet ?!

3:25 clojurebot: It's greek to me.

3:25 pjstadig: clojurebot: common lisp?

3:25 clojurebot: lisppaste8: url

3:26 pjstadig: meh

3:26 Raynes: bartj: If functions are first-class citizens in a language, you can pass the functions themselves around, instead of just the values obtained by calling the function.

3:26 tomoj: bartj: you can do it in python, ruby sort of

3:26 bartj: Chousuke: but when you do (func2 (func1 a b)) it could also be argued that you are passing the result of func1 as an argument?

3:26 tomoj: and those languages are somewhat "functional" in that respect

3:26 Chousuke: bartj: yes, but not the function itself.

3:26 technomancy: clojurebot: common lisp is howl's moving castle

3:26 clojurebot: Ik begrijp

3:27 Chousuke: bartj: Who's arguing about that, anyway?

3:27 tomoj: what you can do in only some languages which is cool is (func1 func2 a b)

3:28 bartj: tomoj: what would you do if func2 had to take arguments?

3:28 dysinger: ...on tuesday

3:28 bartj: In the code you presented, (func1 func2 a b) -> func2, a, b are the arguments

3:29 Chousuke: bartj: and? :)

3:29 tomoj: bartj: func1 often calls func2 with some arguments

3:29 e.g., consider map

3:29 ,(map + [1 2 3] [4 5 6])

3:29 clojurebot: (5 7 9)

3:29 gregh: bartj: func1 could then call (f2 (* 2 a) (* 2 b)) or whatever (assuming f2 is bound to the second argument)

3:30 tomoj: you're passing +, the function, and it calls it with pairs of arguments from the two vectors

3:30 (it being map)

3:30 bartj: tomoj: yeah you are right!

3:30 tomoj: in standard high school java you'd probably initialize a new array, do a for loop over both in parallel...

3:31 indexing over all three really

3:31 Chousuke: heh

3:31 bartj: but somehow, I assumed that functions need to take "arguments" and in clojure that would be (function-name arguments...)

3:31 tomoj: right? or is there some java trick I'm forgetting

3:31 Chousuke: bartj: functions are just values like everything else.

3:31 tomoj: bartj: it will be, you just can't see that code

3:32 Chousuke: bartj: or think about a vector. it's a value, but it's also a function

3:32 tomoj: that code (which doesn't refer to the function + by its name '+, but binds a parameter to the value which is the function +) is buried somewhere inside map

3:32 Chousuke: interesting! clojure makes functions-as-value illustratable through values-as-functions as well

3:32 very cool

3:33 (not claiming that is unique to clojure...)

3:33 Chousuke: Clojure's the only language I know where data structures can be functions though.

3:33 bartj: Chousuke: er, how?

3:34 tomoj: in python they sort of can be

3:34 I mean, they can be "callables"

3:34 Chousuke: ,([1 2 3] 1)

3:34 clojurebot: 2

3:34 tomoj: also:

3:34 ,({:a 2 :b 3} :a)

3:34 clojurebot: 2

3:34 Chousuke: ,(map [:a :b :c :d] [1 2 1 1 0 3])

3:34 clojurebot: (:b :c :b :b :a :d)

3:34 bartj: Chousuke: ok, got it

3:35 tomoj: I never realized you could map over a seq of keys to do Hash#only

3:35 er, but you only get values, so not quite Hash#only

3:35 bartj: Chousuke: that last example was wicked :)

3:36 Chousuke: works with maps too

3:37 bartj: , (map {:a 1 :b 2} [a b])

3:37 clojurebot: java.lang.Exception: Unable to resolve symbol: a in this context

3:37 Raynes: It's easy to pick our the Hawaiians when they all drop at the same time.

3:37 Chousuke: ,(map {:a 'a :b 'b :c 'c} [:a :c])

3:37 clojurebot: (a c)

3:38 bartj: Raynes: I am sorry for asking basic questions here...

3:38 Raynes: bartj: Huh? :o

3:38 bartj: I was commenting on the fact that all the Hawaiians dropped a moment ago.

3:38 technomancy, pjstadig, etc.

3:39 danlarkin: we had to restart the router :o

3:39 tomoj: hawaii?!

3:39 Raynes: danlarkin: What, do you all live together and spoon at night or something? :

3:39 :o

3:39 danlarkin: yes

3:40 pjstadig: Raynes is just upset that we know how to kill his bot

3:41 Raynes: pjstadig: Didn't Licenser figure that out?

3:42 Licenser: I claim I did

3:43 and it wasn't even sexpbot who was broken

3:43 bartj: Chousuke: thanks a lot

3:43 tomoj: thanks a lot

3:44 tomoj: bartj: this is a great place to ask those questions

3:45 pjstadig: uh

3:45 sexpbot is broken

3:45 so is every clojure program

3:45 Licenser: $(+ 1 1)

3:45 sexpbot: Command not found. No entiendo lo que estás diciendo.

3:45 Raynes: I know.

3:45 I'm doing some work on it at the moment.

3:45 danlarkin: down with sexpbot

3:46 Licenser: pjstadig: I think the require bug was solved some days ago

3:46 pjstadig: nice bait, but i'm not going to tell you

3:47 Licenser: pjstadig: no bait, what you did was require c.c.pprint a few times abusing a memory leak

3:47 pjstadig: oh crap! you're right

3:47 how did you figure it out?

3:48 Raynes: pjstadig: Google.

3:48 ;P

3:48 Licenser: I'd say memory

3:48 pjstadig: you're right because i wrote about it on my blog

3:48 Licenser: so I find it not very sportive behaviour to find a bug and not report it to be frank

3:48 pjstadig: and had it indexed

3:49 before we killed sexpbot

3:49 Raynes: This ought to do it.

3:49 Licenser: pjstadig: did never see your blog

3:49 Raynes: pjstadig: Stuartsomethingorother was talking about it on the channel not too long ago.

3:49 Licenser: stuart talked about it here

3:49 pjstadig: talked about c.c.pprint?

3:49 Licenser: yes

3:49 pjstadig: ok

3:50 Licenser: $(+ 1 1)

3:50 sexpbot: => 2

3:50 Licenser: thanks sexpbot

3:50 pjstadig: i think its very sportive behavior, because it encourages others to learn more deeply about clojure

3:51 Licenser: pjstadig: no it just frustrated poor Raynes :P

3:51 Raynes: I'm perfectly fine with breaking sexpbot.

3:51 The problem was that I was sleeping at the time, and I wasn't around to start him back up.

3:52 But I don't expect people to break sexpbot on my time. ;)

3:52 tomoj: conveniently my exploit could be demonstrated without breaking anything

3:52 Raynes: I kind of forgot how to disable title scraping per-channel. Let's make sure this has worked.

3:52 http://stackoverflow.com

3:52 Indeed.

3:53 tomoj: Indeed. :D

3:53 They're exploit made sexpbot scream and hide.

3:53 But it was easy to solve.

3:53 lein clean && lein deps

3:53 :D

3:54 tomoj: ah, I understand now why every clojure program is broken

3:54 Raynes: danlarkin also pointed out a problem where sexpbot would allow you to spam it with commands and it would run each of them one at a time for as long you wanted it to, something I had been needing to fix for a long time. That's also fixed now.

3:55 Albeit, he was being a dick with it. :p

3:55 danlarkin: no namecalling

3:55 Raynes: I didn't call you any names. ;)

3:56 pjstadig: actually it was a division by zero

3:56 which equals nulity

3:57 nullity

3:57 http://www.bbc.co.uk/berkshire/content/articles/2006/12/06/divide_zero_feature.shtml

3:57 $(/ 1 0)

3:57 sexpbot: DENIED!

3:57 danlarkin: WRONG

3:57 pjstadig: oh you must have fixed it

3:58 Raynes: Licenser: When 1.2 is out, can we move clj-sandbox and stupiddb to 1.2 to get rid of those new warnings because of the contrib functions that have moved to core? We could have a 1.0 branch that only get's crucial bug fixes or something.

3:58 Licenser: pjstadig: no that was always working

3:58 Raynes: *nods*

3:58 but there is too much changing right now I fear

3:58 pjstadig: by the way, Raynes, when are you going to bed tonight?

3:58 Licenser: wel people ee you work time

3:59 Raynes: Talk to you when you get there (I'll still be here).

4:10 pjstadig: $(require 'clojure.core.pprint)

4:10 sexpbot: clojure.core.pprint

4:10 pjstadig: $(require 'clojure.core.pprint)

4:10 sexpbot: clojure.core.pprint

4:10 pjstadig: $(require 'clojure.core.pprint)

4:10 sexpbot: clojure.core.pprint

4:10 pjstadig: $(require 'clojure.core.pprint)

4:10 sexpbot: clojure.core.pprint

4:14 tomoj: :(

4:19 Raynes: People are very sadistic towards sexpbot these days.

4:20 Don't be so eager to see him die and fall to the dust. ;0

4:23 esj: $botsnack

4:23 sexpbot: esj: Thanks! Om nom nom!!

4:26 * Licenser_ is back

5:15 Licenser_: Anyone knows what AOB means?

5:20 rys: Array of bytes is the only acronym I know with potential context

5:20 tomoj: Licenser_: Antyfaszystowska Organizacja Bojowa

5:34 Raynes: Is there something wrong with append-* functions in c.c.io?

5:34 They keep throwing "Can't change open streams to append mode" stuff.

5:34 But there certainly isn't an open stream here.

5:48 AWizzArd: For sql DBs such as Postgres we can specify a subname such as "//localhost:5432/database" via Contribs connection spec. Is there a validation function that will check a String that is intended to be used as a subname to be a valid one?

5:51 neotyk: Hi, have anyone experienced problems with lein with clojure 1.2 ?

5:52 Raynes: Works fine here.

5:52 neotyk: I get "clojure.lang.Cons cannot be cast to clojure.lang.Named" in help.clj:5 if I do lein deps && lein help

5:54 Raynes: Seems like a lot of people are having trouble with lein help

5:54 Indeed, even I.

5:54 Luckily, I never use lein help.

5:58 neotyk: I had problems only with help, everything else works fine

6:01 esj: when importing a java class Foo with a "public static enum Bar" can anybody say why (show Foo) does not list Bar ?

6:10 ah, it qualifies as a nested class, and hence uses the $ notation.

6:10 bartj: , (doc merge)

6:10 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."

6:11 bartj: since, it works on maps *only* why doesn't (merge [1 2] [3 4]) throw an error?

6:11 , (map [1 2] [3 4]) ;doesn't throw an error even though we pass vectors

6:11 clojurebot: java.lang.IndexOutOfBoundsException

6:12 bartj: , (merge [1 2] [3 4]) ; sorry, I mean this

6:12 clojurebot: [1 2 [3 4]]

6:12 tomoj: bartj: odd

6:12 here is the definition of merge

6:12 (defn merge [& maps] (when (some identity maps) (reduce #(conj (or %1 {}) %2) maps)))

6:13 so because conj works on vectors as well, it works :/

6:13 similarly, but backwards:

6:13 ,(merge '(1 2) '(3 4))

6:13 clojurebot: ((3 4) 1 2)

6:13 tomoj: because conj works backwards on lists

6:14 and sets too

6:15 cemerick: bartj: I don't think anyone would appreciate the runtime penalty of the checks that'd be necessary to support throwing an exception there.

6:16 bartj: cemerick: point taken. I was just thrown off because the documentation said only maps were taken as arguments

6:17 cemerick: yeah, that's the only data structure whose conj has "merge" semantics

6:21 bartj: cemerick: er, you mean function?

6:22 cemerick: bartj: no -- conj is polymorphic, so its behaviour depends on the callee

6:23 ,(conj {} {:a :b})

6:23 clojurebot: {:a :b}

6:23 cemerick: ,(conj [] [1 2])

6:23 clojurebot: [[1 2]]

6:25 bartj: cemerick: which data structure you were referring to then?

6:25 cemerick: bartj: whatever you pass as the first argument to either conj or merge

6:25 bartj: cemerick: ok thanks

6:29 tomoj: what is the difference of writing "(when (some identity maps)..." and (when maps..." then?

6:30 Chousuke: bartj: the former checks if the sequence contains only nils.

6:30 tomoj: ,(when [nil nil] 3)

6:30 clojurebot: 3

6:30 tomoj: ,(when (some identity [nil nil]) 3)

6:30 clojurebot: nil

6:47 Licenser_: hmm what is the easiest way to find the index of a value in a seq?

6:57 bartj: trying to rewrite "(when (some identity maps)" ... I came up with this: (when-not (reduce #(and (nil? %1) (nil? %2)) maps)...

7:00 Licenser_: bartj: I think the some version is better

7:00 since reduce will always consumne the entire seq

7:00 bartj: but, it fails because I am trying to do a comparision on (nil? true) and it returns false

7:01 Licenser_: of cause since true isn't nil ;)

7:04 spariev: its strange that we don't have smth like index-of in core

7:05 Licenser_: *nods*

7:05 just wrote it myself

7:05 spariev: you should contribute it to contrib :)

7:08 Licenser_: pastorn: heh

7:08 sadly don't have a CA yet :P

7:09 pastorn: Licenser_: WAT!?

7:09 bartj: I have re-written when "(when (some identity maps)" to this - (when-not (reduce #(and (if (true? %1) true (nil? %1)) (nil? %2))) maps)...

7:10 Licenser_: yes i'm ashamed of it :P

7:10 but I wanted to sand rhich the CA with a package of candy and I didn't got to pack that yet

7:15 bartj: anyone with a background in information extraction domain lurking here?

7:28 , (doc defn-memo)

7:28 clojurebot: "clojure.contrib.def/defn-memo;[[fn-name & defn-stuff]]; Just like defn, but memoizes the function using clojure.core/memoize"

7:29 bartj: is there anyway to know which library has a function?

7:30 cemerick: bartj: what do you mean specifically by information extraction?

7:30 bartj: for eg: I have clojure.contrib.* in my classpath but when I do (doc defn-memo) I get a "unresolved var"

7:31 is there something like in java where I can do import clojure.contrib.* and get all the classes imported

7:31 cemerick: no

7:31 bartj: cemerick: I mean extracting "records" (structured data) from html pages on the web

7:32 cemerick: bartj: that's roughly what we do, though generally directed at non-html documents

7:32 pdf, word, plain text, etc.

7:32 raek: ,(find-doc #"defn-memo")

7:32 clojurebot: ------------------------- clojure.contrib.def/defn-memo ([fn-name & defn-stuff]) Macro Just like defn, but memoizes the function using clojure.core/memoize

7:32 bartj: cemerick: specifically, implementing/using Hierarchical Conditional Random Fields for "record detection", etc.

7:34 cemerick: bartj: we don't use CRFs, but sure, that's one method

7:34 (among 100's really)

7:35 bartj: raek: I tried doing a (find-doc #"memo") hoping defn-memo would come up but, it didn't

7:35 raek: sorry, it did and I glazed over :(

7:35 raek: it works for me

7:36 candera: One would guess that find-doc can only find things that have been loaded.

7:37 bartj: cemerick: if you were to extract businesses for say Google Maps from html pages, how would you go about it (other than screen-scraping)

7:39 cemerick: is there any irc channel which discusses IE that you know of?

7:40 cemerick: bartj: not that I know of, no

7:41 bartj: ah, that's not really something I have much experience with -- we do more model-driven stuff

7:41 bartj: cemerick: by model-driven you mean?

7:41 cemerick: some of the techniques you use in broad terms?

7:43 cemerick: meaning, we generally characterize each document completely, rather than plucking particularly-structured content

7:43 tomoj: I need to do both :(

7:44 cemerick: Our approach is fundamentally bayesian.

7:45 bartj: cemerick: you mean using HMMs, etc?

7:49 cemerick: bartj: close enough, conceptually.

7:49 bah

8:25 rhickey: didn't someone have a problem with deftype and name capture?

8:40 LauJensen: Im looking to generate some PDFs - Is there anything better than iText out there?

8:46 spariev: LauJensen: we had a moderate success with apache FOP (batch generation of mostly static pdfs), but I'm not sure it's better than iText

8:51 bozhidar: + one for FOP, it's not perfect, but it does the job

8:55 btw there is also apache pdfbox, though I haven't used to

9:19 LauJensen: bozhidar: spariev: Any particular reason that you went with FOP and not iText ?

9:20 bozhidar: LauJensen: we needed to export data in several formats, not only pdf

9:20 for us FOP was the clear choice

9:20 LauJensen: Oh ok

9:21 spariev: LauJensen: I used it from rails app, so it was simpler for us to generate xml for FOP and then batch-process it

9:22 LauJensen: Aha

9:25 bozhidar: LauJensen: I don't know what your use case is, but you might want to have a look at this nice comparison between itext and fop - http://blog.xebia.com/2008/03/03/comparing-apache-fop-with-itext/

9:26 basically if you need to modify some pdfs, other to generate them - itext is the only choice, otherwise it depends on what you want to have in the pdfs

9:48 neotyk: ,((fn [{a :a :as e}] [a e]) {:a "c" :b "d"})

9:48 clojurebot: ["c" {:a "c", :b "d"}]

9:48 neotyk: ,(for [{a :a :as e} {:a "c" :b "d"}] [a e])

9:48 clojurebot: ([nil [:a "c"]] [nil [:b "d"]])

9:48 neotyk: destructuring doesn't work for "for"?

9:50 LauJensen: bozhidar: perfect, thanks

9:51 bozhidar: LauJensen: you're welcome

9:53 chouser: neotyk: it does, but it also processes seqs

9:53 ,(for [{a :a :as e} [{:a "c" :b "d"}]] [a e])

9:53 clojurebot: (["c" {:a "c", :b "d"}])

9:54 neotyk: chouser: thank you

11:12 mefesto: does anyone know if the annotation support is documented anywhere?

11:12 n/m just found it: http://groups.google.com/group/clojure/browse_thread/thread/d2128e1505c0c117

12:26 cemerick: this is surprising:

12:27 ,(sort nil)

12:27 clojurebot: ()

12:57 hugod: would anyone have an example of using @bound-name@ in a moustache handler?

13:11 jkkramer: does anyone use a user.clj with lein swank? i'm unsure where to put user.clj so it always autoloads

13:12 i.e., always autoloads regardless of what project i'm in

13:12 cemerick: not an answer to your question, but I think the general thinking is that user.clj usage is discouraged

13:13 jkkramer: is there a better way? i suppose i could rig something up in emacs, but not crazy about that

13:13 having a couple util functions for repl use would be handy

13:14 cemerick: oh, I didn't notice the swank part. Nevermind, I thought you were referring to the clojure repl loading user.clj itself

13:14 (which I think it still does, though I forget how and from where)

13:16 jkkramer: yeah, it's a little mysterious

13:16 cemerick: well, I refer again to it being discouraged :-)

13:16 jkkramer: i just get tired of typing out or copy/pasting the same things all the time when developing in the repl

13:17 cemerick: sure

13:17 jkkramer: guess i'll have to sharpen my emacs-fu

13:17 cemerick: I think this is definitely a tool question -- maybe slime has a way to set up default loads?

13:17 jkkramer: probably. was hoping someone might have done something similar, since diving into emacs-land tends to suck up hours of time

13:20 cemerick: heh

13:21 I love hearing about the emacs success stories. ;-)

13:29 jkkramer: the ease of development in emacs is just barely compensating for the pain of configuring it

13:29 plus i would feel less manly if i gave up on it

13:29 LauJensen: jkkramer: You haven't configured it correctly then

13:30 jkkramer: yes. i.e., i haven't spent enough hours toiling at it :)

13:31 cemerick: LauJensen: just a tip: don't blame the user ;-)

13:31 LauJensen: cemerick: thanks, always nice to get a tip in this business :)

13:31 jkkramer: it's actually quite good now for 95% of my needs

13:33 cemerick: LauJensen: just stirring up trouble, don't mind me

13:33 LauJensen: actually the process of configuring emacs isnt to different from building/deploying, cemerick couldn't you whip out 2800 lines of xml file that does the trick ? :)

13:33 rhickey: hmm, Confluence seems much nicer now than when I last looked at it

13:34 cemerick: rhickey: yup, it's quite amazing

13:35 We have a developer's guide that's authored in word, and it imported it and broke it out into wiki sections based on the doc's outline flawlessly. It was amazing.

13:35 rhickey: wow

13:35 cemerick: LauJensen: our main pom is < 400 lines of bone-crushing xml (just a fact-check there ;-))

13:36 LauJensen: cemerick: And how much does that do ?

13:36 cemerick: I'm using pallet for provisioning and deployment these days, which is a pile of awesomeness, actually.

13:36 LauJensen: everything related to build, triggering deployment, integration and functional tests, development environment config, etc.

13:37 plus dependency declarations, of course

13:39 rhickey: FYI, I ended up talking to some manager at atlassian in the relevant area, and he said free jira studio hosting for open source projects is planned, but that they're not ready to open the doors on that.

13:40 replaca: rhickey, et al: discussion of clojure Reader type conflicts now up on the dev list. Take a look, those of you that care about such things!

13:41 rhickey: cemerick: we might be able to get a box for it

13:41 cemerick: rhickey: that simplifies things a lot then, assuming there's a few pairs of hands to admin the stuffs.

13:42 I think the only unknown is the git integration, but that was either there or coming fast last I looked.

13:42 rhickey: cemerick: right. box/hands might come from clojure/core

13:42 cemerick: jira is another story. but confluence looks like a no-brainer over assembla wiki

13:43 riddochc: rhickey: I just dropped a dead-tree contributor agreement in the mail the other day. I expect you'll see it before Sunday.

13:44 rhickey: riddochc: cool - thanks

13:44 cemerick: every interaction I have with assembla is painful, really

13:44 way better than google code, but...

13:44 riddochc: I hope I can make some useful contributions, in various forms.

14:10 * riddochc sighs at an NDA.

14:13 cemerick: hrm, someone else bitten by the non-daemon agent threads? http://twitter.com/puredanger/statuses/14850309418

14:23 LauJensen: cemerick: bitten ?

14:24 cemerick: yes?

14:24 oh

14:24 foiled by, frustrated by, irritated by, etc

14:25 LauJensen: I've once been irritated, that threads from pmap I think, lingered so that my program didn't quit when I wanted it to. It did when I tested in the repl because slime forced some of the evaluations, but when I deployed it didn't. And then once I have been annoyed that shutdown-agents was irreversable. But both counts were my own bad ofc

14:26 cemerick: it'd be nice if there was a (restart-agents) or something, although that'd be ripe for abuse. I continue to think that the threadpools in question should be configured to be daemon-only

14:27 LauJensen: yea, restart-agents isn't the way to go I think

14:27 cemerick: well, irreversible actions are rarely good

14:28 but anyway, there'd be no need for shutdown-agents if the threads were daemon

14:28 I think chouser had a counterargument for doing that at some point, but I've forgotten

14:29 probably having to do with keeping the main thread busy so the jvm doesn't exit prematurely

14:36 LauJensen: wouldn't d-threads be a lot more expensive?

14:37 cemerick: I don't believe they carry any penalty at all...just like normal threads, but they don't prevent the exiting of the vm.

15:06 lpetit: rhickey: ping

15:07 rhickey: lpetit: hi

15:07 lpetit: rhickey: hi. Congrats for your new joint venture. It may be interesting to add a link to clojure.com in this channel topic, don't you think so ?

15:08 rhickey: lpetit: thanks! Actually, despite asking several times, I am not in fact the moderator here

15:09 lpetit: oh

15:09 mefesto: lol

15:09 sorry, just thought that was funny :-/

15:09 lpetit: mefesto: funny and sad at the same times !

15:10 cemerick: there can be more than one channel op, I'm pretty sure

15:11 chouser: yes, but the guy who registered this channel with ChanServ hasn't added anyone else.

15:11 He op'ed me once, but it was manual and ChanServ didn't know about it, so when I logged off I lost it. :-/

15:12 kotarak: Is he still around?

15:12 chouser: rarely

15:12 cemerick: I think there's an appeals process with the freenode folk for this sort of case.

15:13 kotarak: maybe one can try to catch him, or ask some freenode sysop

15:13 rhickey: John did actually contact them and ask to have it transferred to me, and I supplied them all the needed info

15:13 cemerick: presumably we'd want a pile of decent ops to make sure there's always someone around

15:14 chouser: ~seen jcromartie

15:14 clojurebot: jcromartie was last seen quiting IRC, 1394 minutes ago

15:14 rhickey: ~seen jcowan

15:14 clojurebot: no, I have not seen jcowan

15:16 chouser: It's a bit amazing the wheels haven't come completely off yet

15:17 in fact, hardly a hiccup.

15:17 ihodes: I'm having a bit of trouble destructuring a map (using enlive)–any tips? http://paste.lisp.org/display/100808

15:17 kotarak: man, was it nice when they had to still sing in native language at the grand prix. Much more appealing.

15:17 Oops. OT.

15:17 Borkdude: Can I use let destructuring inside a macro?

15:18 chouser: sure

15:19 kotarak: ihodes: defsnippet requires a selector first. Your syntax is for deftemplate.

15:19 ihodes: ah, makes sense. what does the selector select, per se?

15:20 kotarak: Some tag in the snippet input. eg. [:body :> any-node] or so.

15:21 ihodes: ah... alright.

15:22 so the snippet *must* have a selector, to narrow down the nodes it needs to look at in it's body's selectors?

15:27 Borkdude: hmm, macro calling another macro is complicated

15:27 chouser: yeah, avoid that

15:27 a macro expanding into code that include a call to another macro is a bit simpler -- much better.

15:28 Borkdude: yes, but I have symbols as arguments

15:28 that I want to wrap in a map and give that map to another macro

15:28 chouser: that's ok. re-quote them as needed

15:28 riddochc: Though I had some difficulty with that too, the other day. It's still not *easy*, though it is simpler...

15:28 chouser: if you have control of the inner macro, consider replacing it with a function

15:29 Borkdude: (defmacro foo [s] <-- seq of name followed by symbols and strings ...)

15:29 so (foo my-name foo "foo" bar "bar")

15:30 and I want to call a macro that is works as follows: (foo2 name {foo "foo" bar "bar"})

15:30 noo

15:30 sorry, (foo [my-name ...])

15:31 so how do I destructure the seq that goes inside foo

15:31 and pass it to foo2

15:34 maybe I just shouldn't and rewrite foo using the body of foo2, but that feels a bit redundant to me

15:35 chouser: (defmacro foo [[name & pairs]] `(foo2 ~name ~(apply array-map pairs)))

15:37 rhickey: trying lein, failing

15:38 how does one get lein repl to use the clojure version in the deps?

15:38 I get 1.1.0, deps are 1.2.0-master-SNAPSHOT

15:40 ihodes: rhickey: works for me: http://paste.lisp.org/display/100809

15:40 oh

15:41 Borkdude: chouser: ah, that works for me

15:41 ihodes: misread your question, apologies

15:43 mefesto: does gen-class support annotations like deftype?

15:45 lancepantz: rhickey: i think you'll have to use the lein snapshot, but it's repl task is broken

15:45 chouser: mefesto: looks like it: http://www.assembla.com/spaces/clojure/tickets/318

15:46 mefesto: chouser: awesome, thanks :)

15:46 chouser: and has for almost 20 whole days now!

15:50 tridd3ll: rhickey: Here is a link to a tutorial I created recently for Swank, Emacs and Leiningen... it's for linux but it might be of some help: http://riddell.us/ClojureSwankLeiningenWithEmacsOnArch.html

15:51 rhickey: tridd3ll: lein swank works but lein repl doesn't

15:52 ?

15:53 dysinger: not at the moment

15:53 mefesto: is it possible to use import in a similar way that require can reduce namespace prefixes? (require '(clojure zip [set :as s]))

15:55 something like: (import '[java.awt [color ColorSpace] [event ActionListener]])

15:57 rhickey: does this work? http://github.com/talios/clojure-maven-plugin

15:57 dysinger: y

15:57 mvn clojure:repl

15:58 or mvn clojure:swank

15:58 rhickey: it says to add the <plugins> ... </plugins>, but not to what or where. putting in the pom.xml gives me "Parse error reading POM. Reason: Unrecognised tag: 'plugins'"

15:59 tridd3ll: rhickey: same error here with lein repl

15:59 rhickey: just doing mvn clojure:repl gives me "The plugin 'org.apache.maven.plugins:maven-clojure-plugin' does not exist or no valid version could be found"

15:59 lpetit: rhickey: maven folks tend to assume you're already a maven guru in their README. Pretty much as clojure folks tend to assume you're already a lisp guru when talking about macros :-p

16:04 ihodes: can anyone point me in the right direction for finding more documentation on using clone-for (Enlive)?

16:04 tridd3ll: rhickey: I'm no expect but I think it's because you don't have a pom.xml file telling maven what to do

16:05 rhickey: http://learnclojure.blogspot.com/2010/03/clojure-maven-emacs-eternal-golden.html

16:06 kotarak: ihodes: eg. [:li] (clone-for [item ["a" "b" "c" "d"]] (content item)) turns <li></li> into <li>a</li><li>b</li>...

16:06 tridd3ll: rhickey: if you used lein initally, you may need to recreate the project and deps using Maven from the beginning

16:07 dysinger: rhickey: http://gist.github.com/416275

16:07 use something like that

16:07 ihodes: kotarak: I'm using a snippet within the clone-for, which is what is giving me the trouble. (http://paste.lisp.org/display/105692)

16:07 dysinger: put your src in src/main/clojure

16:07 and your tests in src/test/clojure

16:07 mvn package

16:07 && mvn clojure:repl

16:08 I do like lein better & repl being broken at the moment doesn't bother me

16:08 as I mostly use swank

16:08 rhickey: dysinger: thanks, trying now

16:08 mefesto: am i the only person that still uses ant? :-/

16:08 kotarak: ihodes: you have to do something like (substitute (your-snippet thing)) or (content (your-snippet thing)) ....

16:09 * kotarak give ant a run for gradle.

16:09 dysinger: mvn gives you fun things like mvn assembly:jar-with-dependencies

16:09 ihodes: still a no-go - getting my empty template printed back to my repl

16:10 dysinger: and also mvn dependency:tree

16:10 I still use that one weith lein

16:10 lein pom && mvn dependency:tree

16:11 kotarak: ihodes: did you try :.cg-post :> any-node as selector?

16:11 ihodes: and (content (post-model ...))

16:12 ihodes: kotarak: that selector in the snippet, or template?

16:12 kotarak: ihodes: in the snippet

16:13 ihodes: kotarak: still a no-go. i'm sure i'm overlooking something, but thank you very much! (http://paste.lisp.org/display/105693) i'll be hacking more later. damn meeting now.

16:20 DeusExPikachu: does anyone know how maven handles dependencies in a pom with no version information? I'm writing some of the functionality of maven in clojure

16:29 mefesto: yay, i successfully have a clojure implementation of a spring webmvc controller with annotations. didn't expect it to work so quickly! :)

16:34 ninjudd: cg

16:35 tridd3ll: mefesto: oh, nice... care to share? I was thinking about trying this myself.

16:36 mefesto: tridd3ll: sure, it's not pretty but it works... one sec.

16:37 tridd3ll: http://pastie.org/980740

16:37 no @Autowired yet but shouldn't be too much different

16:39 with as noisy as those import statements are i was thinking that i'd get as much milage out of a single clj file as possible by doing multiple gen-classes there

16:39 tridd3ll: mefesto: cool, thanks... I haven't had a chance to look at the annotations support much and this will help

16:45 mefesto: would be nice if the return type decls in (gen-class :methods) didn't have to be fully qualified

16:49 rhickey: so if I connect to a running swank with slime-connect, how do I see the repl?

16:50 timcharper: For me it just shows up. I usually start it with the clojure-project command

16:50 one second...

16:51 Borkdude: what's the opposite of chop in contrib.string? (drop 1 ...)?

16:52 rhickey: if I do slime-connect the repl just shows up

16:52 timcharper: rhickey: http://screencast.com/t/M2Q5OGZlYmMt

16:53 Borkdude... ummm, (str (chop s) "\n") ?

16:53 dysinger: rhickey: get 'er workin' ?

16:53 rhickey: dysinger: maven worked, trying slime with no joy, connects but no repl

16:54 dysinger: slime will hang and not connect

16:54 timcharper: rhickey are you using lein ?

16:54 dysinger: wait

16:54 no I am thinking old swank-clojure-project

16:54 slime should just connect

16:54 rhickey: slime connects, is communicating, no repl window

16:54 DeusExPikachu: rhickey, if you were able to connect to the swank server before but then quit, it will hang and you cannot connect again

16:54 dysinger: when I M-x slime-connect I get a repl window pop up

16:55 try M-x slime-disconnect-all

16:55 and try again

16:55 lein swank AND mvn clojure:swank work the same

16:55 in emacs then M-x slime-connect

16:55 return, return and Y return

16:56 and should pop right up

16:56 rhickey: nope

16:56 dysinger: :/

16:56 * dysinger tries to screenshare

16:56 dysinger: if you are on a mac I can show you my desktop

16:56 rhickey: evals work and the results show in the status line, no repl window, no prompt

16:56 dysinger: what version of emacs?

16:56 do you have elpa / clojure-mode / slime ?

16:57 rhickey: aquamacs 1.9 based on emacs 22.3.1

16:57 dysinger: I installed my clojure-mode & slime w/ elpa

16:57 ahhhhh

16:57 there you go

16:57 need emacs 23/24

16:57 and the elpa clojure-mode/slime

16:57 rhickey: ok, will try latest aquamacs

16:58 danlarkin: <3 console emacs

16:58 dysinger: use this one

16:58 http://emacsformacosx.com/ rhickey

16:58 aquamacs is the Toys-R-Us version

16:58 danlarkin: ja

16:58 dysinger: and out of date

16:58 rhickey: if slime forces me to leave aquamacs, it loses

16:58 pjstadig: starterkit!!

16:58 dysinger: heh

17:00 hugod: slime works fine for me on aquamacs 1.9, though I don't use elpa slime

17:00 dysinger: you should be able to use aquamacs 2.0 and elpa slime

17:00 elpa is easy to install

17:01 once elpa is installed then M-x package-list-packages

17:01 rhickey: yeah, i used elpa to get slime

17:01 dysinger: go down the list and press I on clojure-test-mode & slime-repl ONLY then press x

17:01 ok

17:01 clojure-test-mode grabs clojure-mode and slime-repl grabs sliem

17:02 mine say 20100404 for slime and clojure-mode 1.7.1 & clojure-test-mode 1.4

17:03 I don't use paredit from elpa as it's out of date - I install it by hand.

17:03 and I use console emacs like my whole team

17:03 on mac

17:03 rhickey: woot!

17:03 dysinger: because it enablez the awesome pairing over the internet

17:04 woot! it's working ?

17:04 timcharper: dysinger: have you ever tried rudel mode?

17:04 dysinger: y it's lame

17:04 mostly because you can't share the whole screen

17:04 only buffers

17:04 timcharper: Bummer, I was excited about it

17:04 dysinger: we use GNU screen & tmux

17:04 over SSH

17:04 and then don the skype headset

17:04 for voice

17:05 timcharper: I think GNU screen is the only reliable screen sharing software available

17:05 dysinger: tmux is pretty rockin' we've been using it more and it doesn't require setuid

17:05 timcharper: Why do you need it? Doesn't screen -x do it for you?

17:06 DeusExPikachu: rhickey, when starting the swank server, make sure you give it the option :dont-close true, so if you disconnect for whatever reason, you can reconnect and resume your work

17:06 rhickey: dysinger: yes, with aquamacs 2.0 the same steps give me a slime repl

17:06 dysinger: woot!

17:06 timcharper: oh... duh, nevermind

17:08 rhickey: ugh, c-m-x eval results go in status line, not repl?

17:08 dysinger: so next install paredit and reach out to other emacs/clojure nerds for the awesome setup

17:08 chouser: dysinger: ah, that's a change, isn't it? I thought you were using rudel mode earlier.

17:09 dysinger: we tried it

17:09 for a while

17:09 yes

17:09 rhickey: I was already using clojure-mode + paredit

17:09 dysinger: rhickey: I use C-c C-k to compile

17:09 chouser: I've been using screen to share recently. need to try tmux.

17:09 dysinger: C-c C-c to eval a fn

17:09 etc

17:09 Raynes: I use C-x C-e to eval individual forms.

17:09 dysinger: C-c M-p to change namespaces in the repl

17:10 etc

17:10 chouser: dysinger: I think what I actually want is multiple per-window sharing, like some new feature set on top of vnc.

17:10 dysinger: we'll be happy to assist converting peoples to MOAR emacs

17:10 rhickey: with inferior lisp I do a lot of C-M-x evaluating, with the results going to inferior-lisp buffer

17:10 dysinger: tmux could do that chouser / screen also

17:10 rhickey: in slime mode they are going to status line

17:11 stuarthalloway: rhickey: is it kosher to eval the metadata MapExpr an extra time so I can look at it as a map?

17:11 chouser: tmux and screen don't communicate mouse pointer (useful for gesturing while talking) or of course GUI apps.

17:11 dysinger: y

17:11 danlarkin: inf lisp is just running a process in emacs

17:11 timcharper: rhickey: if you need the results, you can always think them from the messages buffer

17:11 rhickey: stuarthalloway: probably not

17:11 timcharper: yank them

17:11 stuarthalloway: ... since at the time I need to see if it is compiler metadata or explicit metadata I have only a MapExpr

17:12 danlarkin: and slime is elisp code written to interact with swank, sending sexprs back and forth

17:12 stuarthalloway: awesome, I get to write a for loop in Java then :-)

17:12 dysinger: woot

17:12 pjstadig: ~for

17:12 clojurebot: for is not a loop

17:12 rhickey: timcharper: if that's where they always go this won't work for me. evaluating with C-M-x is 90% of what I do

17:12 pjstadig: but it is in java

17:12 dysinger: I still haven't written one line of Java in a year of clojure :)

17:13 pjstadig: you can C-x C-e the previous sexp in swank

17:13 rhickey: stuarthalloway: I'm confused, the metadata map already exists

17:14 pjstadig: that still puts the results in the status line

17:15 or minibuffer or whatever

17:15 quizme_: how do you print "hello, world" every 1 second ?

17:15 Borkdude: rhickey: I use slime-eval-print-last-expression a lot, just to paste results back into my buffer

17:16 stuarthalloway: rhickey: ah, I see, it is evaled inside the conditional I need to change -- so I will hoist it out

17:16 rhickey: Borkdude: life's too short for that

17:18 * rhickey bails on slime once again

17:19 danlarkin: you've gotta sit down and see someone work

17:19 to really see the Right Way™ to tie it all together

17:20 DeusExPikachu: umm its a simple request to have it output to another buffer instead of the minibuffer, I'm sure there is a way to get that back

17:21 timcharper: DeusExPikachu: as mentioned earlier, all messages that appear in the mini buffer go into the "Messages" buffer.

17:21 Not an ideal solution, but it works.

17:21 rhickey: danlarkin: I'm pretty sure the right way for me is to put my expressions into a file and eval them, and I don't want the results thrown out the window. Maybe I don't know how to configure that, but this behavior differs from the 'right way' per inferior lisp mode, for no benefit I can see

17:21 Borkdude: rhickey: when you do training, what dev environment do you recommend to people?

17:23 rhickey: gotta run, thanks all for your help

17:23 !

17:23 Borkdude: rhickey: I tried some, but even being relatively new to Clojure and Emacs, it's the best as I could find

17:23 -as

17:23 rhickey: k, bye

17:26 DeusExPikachu: so in inferior-lisp-mode (i've never used it), the output is inline in the buffer?

17:26 Borkdude: If a man can bend Java to act like a suberb Lisp... Emacs should not be that difficult to bend? :P

17:27 Kidding, please don't kill me.

17:33 maxhodak: how would you call clojure from java with keyword args (i.e., defunk)?

17:33 for example: clojure.lang.RT.var("somnium.congomongo", "mongo!").invoke(":db", "mydb", ":host", "myhost");

17:33 doesn't work

17:37 chouser: clojure.lang.Keyword.intern("host")

17:39 maxhodak: chouser: I don't follow. should I do: clojure.lang.RT.var("somnium.congomongo", "mongo!").invoke(clojure.lang.Keyword("db"), ... )

17:39 chouser: right

17:39 maxhodak: or clj.l.Keyword.intern("host") and then just reference host?

17:39 ok

17:42 chouser: ok thanks, worked (needed clj.l.Keyword.intern instead of just clj.l.Keyword though)

17:42 (like you described)

17:58 Licenser: I want cookies!

18:00 SynrG: win 21

18:01 Borkdude: ,(clojure.contrib.string/chomp "cookie")

18:01 clojurebot: "cookie"

18:02 Borkdude: ,(clojure.contrib.string/chop "cookie")

18:02 clojurebot: "cooki"

18:47 rhickey: back for one last gasp with slime - does anyone know a way to get C-M-x (and really, all) evaluation output to come in the repl pane rather than the mini-buffer and the *Messages* buffer?

18:50 tcrayford: rhickey: that can probably be hacked up inside of emacs pretty easily, but I don't know of any default way to do it

18:55 islon: can I send-off inside an agent?

18:56 (to another agent)

18:58 rhickey: islon: yes, but by default it will be sent *after* the action that does the send completes

18:58 tomoj: only by default?

18:59 rhickey: ,(doc release-pending-sends)

18:59 clojurebot: "([]); Normally, actions sent directly or indirectly during another action are held until the action completes (changes the agent's state). This function can be used to dispatch any pending sent actions immediately. This has no impact on actions sent during a transaction, which are still held until commit. If no action is occurring, does nothing. Returns the number of actions dispatched."

18:59 islon: so this is the problem... the sender agent is on an infinite processing loop...

18:59 i'll try the release, thanks

19:01 it works =)

19:02 tomoj: rhickey: cool

19:27 islon: I'm trying to execute this code inside an agent but the "after" is never (after several minutes) printed

19:27 (let [ag (http-agent url)]

19:27 (release-pending-sends)

19:27 (println "before")

19:27 (await-for 3000 ag)

19:27 (println "after"))

19:31 chouser: you cannot await in an agent

19:31 you cannot await in an agent action

19:31 if you check your agent, you'll see there's an exception there.

19:31 islon: you're on 1.2-snapshot?

19:32 islon: yes, 1.2

19:32 hmm.. makes sense

19:33 ok, I'll use threads

19:34 chouser: you might like 'future'

19:35 islon: can I block waiting for a future inside an agent?

19:35 chouser: no, you can block waiting for an agent inside a future

19:36 but awaiting on an agent is a bit suspect -- are you sure that's the right reference type for you task?

19:36 islon: http-agent returns an agent, I can't change that

19:37 i can use :handler too but I didn't want to turn my function asynchronous

19:37 chouser: perhaps instead of awaiting, you could send a second action after the first, which will then not be run until the first action is complete.

19:37 oh

19:38 asynchronous isn't too bad with closures...

19:38 Joreji: Hey guys, where can I post a problem I have with running clojure on android? Is there a mailing list out there?

19:39 islon: I'll try :handler, thanks chouser

19:40 chouser: Joreji: from the /topic: http://groups.google.com/group/clojure

19:40 Joreji: chouser: Alright, thanks.

19:50 _na_ka_na_: Hi, If I run a particular command from the shell it runs just fine in 1-2 secs producing some out & err, but if I use c.c.shell/sh, and run the command it just gets stuck, I can see the process gets invoked but it never finishes, I've to kill the process to get the repl back .. but some other commands run just fine with c.c.shell/sh, any idea as to what may be causing c.c.shell/sh to get stuck?

19:52 I'm just guessing it has something to do with the stdout / stderr capturing of the process by sh

19:53 islon: anyone knows why if I pass a :handler to http-agent and inside the handler I try to check the status with the function status it always returns nil even it successfully fetched the url?

19:53 *even if

20:00 chouser: _na_ka_na_: does the command use both input and output streams?

20:01 _na_ka_na_: nope only output

20:01 but both stdout, stderr .. I'm trying to reproduce the issue

20:15 chouser: I'm able to reproduce the issue .. here goes .. this works .. (clojure.contrib.shell/sh "cmd.exe" "/c" "perl -wle \"for (1 .. 100) {print STDERR $_}\"" :return-map true) ... but this just gets stuck ... (clojure.contrib.shell/sh "cmd.exe" "/c" "perl -wle \"for (1 .. 1000) {print STDERR $_}\"" :return-map true)

20:16 chouser: interesting...

20:17 * chouser tries on linux

20:18 chouser: (sh "perl" "-wle" "for (1 .. 1000) {print STDERR $_}" :return-map true) ; works here

20:18 _na_ka_na_: *ucker ..

20:19 chouser: (sh "sh" "-c" "perl -wle \"for (1 .. 1000) {print STDERR $_}\"" :return-map true) ;also works

20:19 hmph

20:19 so I wonder if it's Windows-only

20:20 _na_ka_na_: it must be .. I guess

20:20 I'll just try to workaround by re-directing the stderr

20:24 ok re-directing works .. but :(

20:30 chouser: yeah, not good.

20:32 islon: why my log always print trash like "May 27, 2010 9:27:55 PM clojure.contrib.logging$eval1579$impl_write_BANG___1582 invoke"?

20:38 _na_ka_na_: islon: there is a documented way to set your own ns in logs to suppress that thing but didn't work for me .. check out if it does for u

20:38 islon: and where's the documentation?

20:40 hmm. i dind't have a loggin configuration

21:16 dysinger: sexpbot: $:party!

21:33 arkahn: for driving an outside process interactively, would anything besides ExpectJ be recommended?

21:43 ihodes: stuarthalloway: just want to say thanks for the rockin' book :)

21:43 stuarthalloway: ihodes: thanks!

21:43 ihodes: for anyone else here, is there a nice/sexy way of parsing xml into a nice hash-map? becase clojure.xml/parse is MESSY to deal with

21:50 chouser: not that it's not an awesome lib ;)

21:50 oh, just kidding, that's rich's lib. still, it's nice. but not really great for cleanly mapping xml node to hashmap-key

21:50 jartur: Is there any way to map over a hash and get a hash back? Like I want to (map (fn [k v] (do something with k v returning new VALUE)) my-hash) -> new hash with same keys but new values?

21:50 Raynes: jartur: (into {} (map (fn [k v] (do something with k v returning new VALUE)) my-hash)) ; If it's built correctly, this will turn a sequence of map entries back into a map.

21:51 jartur: And map entries are {:k v} ? So inner fn woudl return (hash-map k new-val)?

21:52 Raynes: $(map (fn [[k v]] [k (+ v 3)]) {:key 3 :key2 4})

21:52 sexpbot: => ([:key2 7] [:key 6])

21:52 Raynes: $(into {} (map (fn [[k v]] [k (+ v 3)]) {:key 3 :key2 4}))

21:52 sexpbot: => {:key2 7, :key 6}

21:52 Raynes: Like that.

21:53 lancepantz: is that more efficient than

21:53 ,(into {} (for [[k v] {:a 1 :b 2}] [k (inc v)]))

21:53 clojurebot: {:a 2, :b 3}

21:53 jartur: Ah, okay. I did (apply merge (map (fn [[k v]] (hash-map k (+ v 3))) {:k 3 :k2 4})) but i think it's slower

21:54 Raynes: lancepantz: I'm not entirely certain that it matters. Someone else would have to comment on efficiency.

21:54 timmorgan: can someone help me fix my repl? When a long command wraps to the next line, I can go back, i.e. hitting backspace stops at the current line

21:54 Raynes: MapEntries act as vectors.

21:54 timmorgan: s/can/cant

21:54 lancepantz: i think i saw a stackoverflow post that recommended using for at one point

21:55 Raynes: Hence why they appear as [key value].

21:55 lancepantz: timmorgan: you want to use jline

21:55 timmorgan: I am (I think)

21:56 Raynes: Or rlwrap

21:56 timmorgan: maybe I'm doing it wrong

21:57 Raynes: jartur: I think most people go with the into route like I did. Not certain.

21:57 jartur: Raynes: thanks

21:57 timmorgan: java -cp lib/clojure-1.2.0.jar:/usr/share/java/jline.jar jline.ConsoleRunner clojure.main

21:57 Is that right?

22:02 tried it in zsh and bash, with rlwrap and without

22:02 hitting backspace works apparently, but it just doesn't show me what's happening on any line but the current one

22:03 something about Ubuntu maybe?

22:12 well I'll just make my terminal window really wide :-)

22:13 lancepantz: timmorgan: if you're doing anything serious i'd set up your ide for clojure

22:14 you can get a repl in about all of them

22:14 timmorgan: ok, can I do that in Vim?

22:15 lancepantz: heh, the one thats the biggest pita

22:15 timmorgan: that's my luck

22:15 lancepantz: but yeah, vimclojure

22:15 Raynes: $google Getting started with Vim Clojure assembla

22:15 sexpbot: First out of 58 results is: Getting Started with Vim | Clojure | Assembla

22:15 http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Vim

22:15 Raynes: ^

22:16 lancepantz: i thought it was a pain, so when i used vim i used screen and a plugin to send stuff to the repl

22:16 Raynes: That's rather recent.

22:16 lancepantz: but i switched to emacs a couple of weeks ago, it was a really good idea

22:16 depends on how much time you're going to spend with clojure ofcourse

22:17 timmorgan: just playing for now -- I will take a look at vimclojure

22:17 thanks

22:17 Raynes: I love to recommend Emacs as much as possible, but I can't deny that many Clojurers use Vim, including hiredman (at least, I think he still does) and chouser.

22:21 arkahn: it may seem silly, but going from vim to emacs makes my wrists complain; all that C-c or M-c

22:22 lancepantz: arkahn: you need one of these badboys: http://www.kinesis-ergo.com/advantage.htm

22:22 arkahn: I miss navigation with h, j, k, l

22:22 lancepantz: actually, I have one ... I just don't use it : )

22:22 lancepantz: hahah

22:23 it takes a few weeks to get used to it

22:23 arkahn: emacs or the keyboard?

22:23 lancepantz: the keyboard

22:23 arkahn: the keyboard was easy ... emacs, not yet

22:23 lancepantz: heh, i had the opposite

22:24 arkahn: is it too confusing to use vi-mode with clojure-mode?

22:25 lancepantz: i found that the chords conflicted with slime and paredit alot

22:25 arkahn: I was afraid that might be the case

22:25 lancepantz: you could remap them i suppose, but i didn't mess with it

22:26 arkahn: do you (you personally) navigate in emacs with C-p, C-n, etc.??

22:27 lancepantz: i try

22:28 the kinesis has the arrow keys with the letters, so it's easy to hit the arrows

22:30 Raynes: I navigate with the arrow keys and the mouse. I'm not hardcore.

22:31 arkahn: Raynes: you're a veteran, too! I've seen posts from you about clojure back in 2008

22:31 I like to stay away from mouse navigation as much as possible

22:32 Raynes: arkahn: I paid 100 bucks for this mouse. I'm using that baby. ;)

22:32 arkahn: lolz

22:32 Raynes: I wouldn't call myself a "veteran". I experimented with Clojure, but didn't start actually using it for anything beyond playtime until about a year ago.

22:33 arkahn: I should set this up for emacs: http://www.belkin.com/iwcatproductpage.process?product_id=390404

22:35 thanks all! Have a good night (or day, as it may be)

22:37 Raynes: $time -5 for me.

22:37 sexpbot: Raynes: The time is now 2010-05-27T21:42:39Z

Logging service provided by n01se.net