#clojure log - Jan 15 2010

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

0:06 qbg: ,(#(mapcat (fn [[k v] b] (concat (repeat (- k b 1) 0) [v])) % (cons -1 (map first %))) [[0 1] [3 4]])

0:06 clojurebot: (1 0 0 4)

0:09 qbg: That is cleaner

0:10 chouser: qbg: yes, nice!

0:13 tomoj: I intend to talk with Manning about the possibility of a kind of donation "bundle" where giving $100 to Rich would get you some kind of deep discount on the book.

0:14 That way you'd get the book, plus the clear concience of a full one-years donation and therefore your name (if you want) on the funders page. Would something like that interest you?

0:14 or would it have it it had been available before you bought it. :-/

0:18 tomoj: chouser: it would have been

0:18 would have interested me, I mean

0:18 chouser: ok. I haven't brought it up with the publisher yet, but I will.

0:20 tomoj: I can actually hold off on buying the book now (I hadn't yet made it into the room with my credit card), since I'm busy with non-clojure stuff right now anyway

0:20 if the possibility doesn't come up before I can stop resisting my urge to get a sneak peek, I'll just buy it and donate some later.

0:21 (no hurry intended, I can keep myself busy for a couple months at least)

0:21 chouser: well, I'm glad I could talk you out of buying the book tonight. :-P

0:21 I'll let people know what we're able to work out, if anything.

0:22 tomoj: I shouldn't have bought it now anyway, as I shouldn't really devote the time to reading it, but it looks so attractive :)

0:22 kanak: Is it possible to create clojure datastructures in clojure (e.g. implement Vector, Maps etc)? What kind of a speed penalty (if any) would that incur?

0:22 tomoj: I think that is a long term goal of c-in-c, yes?

0:23 so that these data structures can be automatically provided to various implementations

0:24 instead of having to port every new feature or bugfix in clojure to your favorite implementation

0:24 chouser: it depends a little on what you mean. to get builtin functions like pop, conj, nth, etc. to work on your new datastructure, as of today you'd have to implement Java interfaces.

0:25 tomoj: oh, and you can do that en clojure eh

0:25 (on the jvm)

0:25 kanak: chouser: is this even with features such as reify, deftype and others that were recently introduced?

0:25 chouser: in Clojure 1.0 and 1.1 the best way to do that is with 'proxy', and that is substantially less fast than the current builtins (at least an extra hash-map lookup per method call)

0:25 kanak: you're on the right track...

0:26 tomoj: is the eventual plan then to provide clojure implementations of these new features?

0:26 or will that be something the non-jvm developer will have to worry about, I wonder

0:26 chouser: with today's master branch, you could use deftype, reify, and extend to get the very close to the same performance as the builtin collections. I think the only thing missing there is a way to do "volatile" fields.

0:27 tomoj: (I am particularly interested in dalvik for obvious reasons)

0:27 chouser: once the pieces are all in place, I think the plan is to rewrite all the .java code in clojure, including all the collections.

0:28 tomoj: ok, and deftype/reify/whatever are included in that rewrite?

0:28 kanak: chouser, what kind of pieces still remain?

0:28 chouser: I don't know if that will happen before or after the java interfaces are phased out in favor of protocols.

0:29 kanak: not sure exactly. I mentioned "volatile" -- dunno if there are others.

0:29 tomoj: well, good to know if it's in the works

0:29 I mean, that it might be in the works..

0:30 kanak: clojure in clojure would be very interesting. Porting of the STM, persistent data structures, agents etc would make for excellent idiomatic clojure code samples :)

0:30 chouser: mmm, indeed!

2:22 albino: anyone tried clojure on jrockit

2:57 "Perhaps you're a season Java or Lisp veteran" <- should be 'seasoned'

4:13 * esj just cracked open "The Joy of Clojure"

4:15 AWizzArd: esj: is this a book title? :-)

4:16 Raynes: :D

4:16 AWizzArd: It's chouser and fogus' book.

4:16 And I don't have a MEAP of it because I'm broke. :<

4:16 esj: http://www.joyofclojure.com/

4:16 * esj wants to know how chouser got a pic of me for the front cover...

4:20 Chousuke: the shipping costs are iffy. Almost a third of the total price, with the coupon. :/

4:22 AWizzArd: Wait a minute, is this a fake or are they serious?

4:22 esj: yeah, its a bit rich, but still 40 USD for a programming tract is a good deal.

4:23 AWizzArd: Why not just ordering the "e version"?

4:23 Chousuke: I like real books :P

4:24 AWizzArd: try the Bilo E-Reader

4:24 Blio

4:24 Raynes: I'll be getting the EBook. I can't even afford it right now, much less the print version.

4:25 esj: I'm old. I like to read off paper.

4:25 AWizzArd: well, just safe 8$ per month and in 3-4 months you can order it

4:25 ,(/ 8.0 30)

4:25 clojurebot: 0.26666666666666666

4:25 Raynes: I'm going to try to pre-order the E version at the beginning of next month.

4:26 I never get print versions of these types of books.

4:26 esj: but your bookshelf ! Knuth must get lonely.

4:27 Raynes: My bookshelf is a folder on a flash drive.

4:33 AWizzArd: I could imagine that in this decade books and e-readers will become outdated and replaced by Retina Displays. Though mostly geeks will have this by the end of the decade.

4:39 eivindu: what is the most idiomatic way to create a new sequence which is n items long with equal members: given the number 3 I want the following vector -> ["a" "a" "a"]

4:40 esj: ,(repeat 3 "a")

4:40 clojurebot: ("a" "a" "a")

4:40 esj: ,(into [] (repeat 5 "a"))

4:40 clojurebot: ["a" "a" "a" "a" "a"]

4:41 eivindu: esj: thanks! (I was using map and range...)

4:41 esj: np

4:43 unfo-: esj, difference between (into [] (repeat 5 "a")) and (vec (repeat 5 "a")) ?

4:44 esj: unfo-: no idea :)

4:44 chousuke ?

4:44 hiredman: vec maybe faster

4:44 ~def vec

4:45 clojurebot: ?

4:45 into does essential a reduce using conj over a transient vector

4:46 vec just drops the collection right into a vector

4:46 unfo-: ah and vec just basically is a call to the constructor

4:46 esj: cool

4:47 lypanov: omgz. joy of is on 37% discount

4:48 spariev: i noticed the discount too :) wonder if it's permament or there are some kind of time limitations

4:50 lypanov: spariev: not sure. usually they last a day. but this one on twitter say something about a "weekly offer" so dunno.

4:50 they didn't give a time limit other than something about the word week in the tweet.

4:50 * lypanov buying it now

4:52 * spariev bought the book

4:55 Raynes: spariev: Buy one for me.

4:55 :)

5:00 spariev: Raynes: well , I'd like to, but I saving money to donate to rhickey from now on :) maybe a bit later :)

5:00 Raynes: Heh heh heh. :>

5:07 unfo-: damnit. typoing (if case) constantly with C# now that i've grown used to parens on the outside ;D

5:11 esj: haha : i keep going (help func) in R

5:21 is there a way to get the docs for a namespace in the repl ?

5:22 as in (doc clojure.test)

5:22 brings up the metadata defined in the (ns ...) form

6:01 LauJensen: ~doc print-namespace-doc

6:01 clojurebot: Pardon?

6:01 LauJensen: ,doc print-namespace-doc

6:01 clojurebot: java.lang.Exception: Can't take value of a macro: #'clojure.core/doc

6:01 LauJensen: esj: I think you should be able to call (print-namespace-doc 'clojure.xml)

6:02 esj: negatory :(

6:02 LauJensen: w00t?

6:03 Raynes: It gives nil.

6:03 For everything.

6:03 Same as trying to use doc on it.

6:03 LauJensen: There's a bug in core?!

6:03 Raynes: zomg

6:04 I would fix it, but I don't have have a CA. :\

6:05 LauJensen: Is it problematic to obtain one?

6:05 Raynes: LauJensen: When you live in the middle of nowhere and don't have a printer, indeed.

6:05 LauJensen: So you have to print it out, and snail mail it to Rich ?

6:06 Raynes: I'll print it out next time I go the library, but that doesn't help me right now.

6:06 LauJensen: Apparently. :\

6:06 esj: Raynes: I like your style.

6:06 Raynes: esj: 8)

6:06 LauJensen: Ok - If you dont have a printer, så handwrite it - I think Rich would be flattered that you'd go to all the trouble

6:06 Raynes: Hehe.

6:06 arbscht: Raynes: hey, if I managed to send one in from the south end of the pacific, you can too!

6:06 Raynes: Oh, I'll get one out, just not right now.

6:07 LauJensen: esj: I think you caused an Internet Anomaly somewhere by saying 'Raynes' and 'Style' in the same byte-seq

6:07 Raynes: :\

6:07 * esj wonders if there is not a web print-and-smail-mail app, such as there are for postcards

6:07 Raynes: Write one.

6:07 In Clojure.

6:08 tomoj: that sounds like fun

6:08 esj: i might suggest that I'm not the one with the itch

6:08 tomoj: trying to get printers at your office to print out submitted pdfs/word docs/etc?

6:08 esj: of course, you don't have the printer, to its turtles all the way down

6:09 tomoj: you use your own service designed to print stuff for people to print stuff for them?

6:10 that sounds like lots of "fun"

6:10 get things to print in a distributed way across lots of little centers where people send them off

6:10 and where failures or overloads at one center can be rerouted to failovers

6:11 and the system tracks it all by using a mobile device app which scans something affixed to the envelope when packaged for sending

6:12 too bad that wouldn't make any money :(

6:12 esj: get cheap snail-mail by pulling a Skype, where instead of voice you have letters

6:12 for international stuff

6:12 tomoj: oh, international would be cool

6:12 but it would require lots of people out there

6:13 even in international stuff is there enough demand for sending snail-mail?

6:13 Raynes: Skype is written in Delphi. *shudder*

6:13 tomoj: maybe people sending stuff home to their poor families? I dunno

6:13 esj: laywers

6:13 s/laywers/lawyers/

6:14 tomoj: why do lawyers need to send snailmail?

6:14 Raynes: Laywers. Haha.

6:14 That's a good 'en.

6:14 esj: signatures

6:14 i dunno, they do weird things

6:14 tomoj: so, you sign it, scan it, then send it off to be snailmailed?

6:15 if you don't have a printer seems unlikely you'd have a scanner

6:15 esj: no: you skype it, they sign, and snail it back.

6:15 tomoj: ok, I see, so you send off the blank form

6:20 LauJensen: There are public services in Denmark which send you a letter per snail mail with your code. I'm wondering if I sign up for one of those using Rich's adress and the username "Hey Rich, I agree to the CA" if that'll do the trick...

6:30 lypanov: LauJensen: love your screencasts. excellently done.

6:30 LauJensen: lypanov: Thanks a lot!

6:40 lypanov: LauJensen: which emacs do you run on your osx machine?

6:40 Raynes: ,(conj '(:x) :y)

6:40 clojurebot: (:y :x)

6:40 Raynes: Damn it. I wish I had known that conj added to the front of lists.

6:41 LauJensen: I stay clear of OsX as far as humanly possible - But when I am there, and on a rare occasion edit something textual, I use Aquamacs

6:41 ,(reduce conj '() [9 8 7 6 5 4 3 2 1])

6:41 clojurebot: (1 2 3 4 5 6 7 8 9)

6:42 lypanov: LauJensen: i'd have installed ubuntu already on the mac if not for the apparent overheating when using it.

6:42 * lypanov has slowly been getting more and more annoyed with osx, but hasn't yet been driven insane

6:42 LauJensen: oh

6:42 Tried Arch ?

6:43 lypanov: you have that on your mac?

6:43 LauJensen: Hmm.. now that I think of it - I think I actually mangled the cstate kernel parameters when I first installed Ubuntu - You might need to look into that

6:43 yes

6:43 lypanov: ah, not just vbox?

6:43 battery life is okay?

6:43 LauJensen: No also on its own partition

6:43 lypanov: Haven't checked

6:44 lypanov: maybe i'll give it a try in the coming months.

6:44 LauJensen: Ubuntu gives you about 25% of the battery life that osx does

6:44 lypanov: yeah. thats what i've heard

6:44 but people managed to sort out the major issues so its getting saner now. around 50%

6:44 LauJensen: arch is simple to install, use the default and add sudo and wifi_tools, then install gamin instead of fam and DONT configure X at all - everything works

6:45 hmm, reading that its not actually that simple I see

6:45 lypanov: i'll give a arch install inside parallels a try first.

6:45 then when i'm comfortable i'll make the jump. i'd prefer to wipe my machine first.

6:46 last time i tried using the resize stuff i heavily regretted it.

6:46 LauJensen: oh - that worked great for me

6:46 lypanov: probably just my previous machine. the damn thing halts if you try to run a check disk on it.

6:46 LauJensen: first I shrunk my osx partition to 40gb from within osx, then I handle the rest from gparted

6:46 lypanov: what boot loader are you using?

6:46 LauJensen: GRUB

6:47 I tried 2.0 but I'm really truely unhappy with it

6:47 lypanov: any magic needed for all the efi stuff? what tool did you use for that?

6:48 LauJensen: background, ex gentoo using kde developer. but at some point i got simply sick of the terrible situation with hw compat on linux and ditched it for an ibook with insane battery life.

6:48 LauJensen: k

6:48 I used rEFIt

6:48 lypanov: i've been told arch is a good choice by many.

6:48 LauJensen: But looking back I think thats unnecessary - Letting Grub handle all OS's is probably the best way to go

6:49 (but, refit 'just worked')

6:58 tomoj: I had arch on an imac for a while

6:58 it was nice

6:58 with refit

6:58 then my hard drive died and I haven't bothered to try it again

7:17 {newbie}: Hi! I have a question about type hints

7:18 one of the arguments passed to my function is an abstract class

7:18 even if I add a type hints

7:18 the compiler complains it uses reflection

7:19 rhickey: {newbie}: can you paste an example?

7:19 {newbie}: I took the exemple from this article

7:20 http://pixel-shaker.fr/en/2010/01/plugin-imagej-minimal-en-clojure-inverser-une-image/#sec1

7:20 I was testing the straight foward clojure version with the type anotation

7:21 .putPixel is an abstract method of ImageProcessor

7:21 and that is where the compiler complains

7:22 rhickey: where re the online Javadocs for ImageProcessor?

7:23 {newbie}: http://rsb.info.nih.gov/ij/docs/source/ij/process/ImageProcessor.java.html

7:23 o

7:23 this method is overloaded

7:24 nvm

7:24 it's not overloaded

7:24 rhickey: yes it is

7:25 in,int,int and int,int,int[]

7:25 {newbie}: putPixel with iArray

7:25 I see

7:26 can I annotae the result of an expresison

7:33 rhickey: you could just wrap the unchecked-subtract or the 255 in (int ...)

7:40 {newbie}: well apparently the problem was with the u v types

7:41 Raynes: build.clojure.org/snapshots desperately needs a clojure-contrib-1.2.0-master-SNAPSHOT.

7:42 {newbie}: http://paste.pocoo.org/show/165676/

7:44 aha

7:44 no rewrite into nested loop required

7:44 Raynes: Who does the snapshot builds anyways?

7:44 {newbie}: just the type ints made it very fast

7:46 jcromartie: {newbie}: just the one type hint?

7:47 {newbie}: no

7:47 jcromartie: for ImageProcessor

7:47 {newbie}: acctualy it was the type int for the Processor the (int ..) for the indexes

7:47 and the unchecked subtract

7:50 the last let ins ugly though

7:51 lypanov: anyone think i should read the practical common lisp book before reading joy of closure

7:51 ?

7:55 jcromartie: I like how Maven had to download 13 files to run 'mvn clean'

7:55 LauJensen: lypanov: One is for learning Common Lisp, the other for Clojure

7:55 lypanov: LauJensen: *nod* just thought it might be a good idea to get some lisp backgrounding

7:56 jcromartie: lypanov: PCL is very practical... hence the name. I'd avoid it unless you wanted to learn more about CL specifically.

7:56 LauJensen: lypanov: You can go through PCL in not too many hours - I say give it an evenings attention, then move on

7:56 jcromartie: It does give some insight into idiomatic Lisp though.

7:56 the naming of variables, etc.

7:56 LauJensen: Thats just my oppinion. Lisp is very simple at its core and CL and Clojure are two different implementations of the main principles

7:58 I've never sat down to learn Scheme specifically, but when I see Scheme code I understand it intuitively

8:00 jlr`: chouser: typo in MEAP version of The Joy of Clojure: ebook page 17 (aka bottom of section 1.3.3 Functional Programming) - "While chapter 7 may again change your view of how to build software, the discussion of macros in chapter 8 ***whould*** make for a truly amazing experience indeed."

8:01 lypanov: LauJensen: i've done scheme in the past. so i guess i'll grok most.

8:02 LauJensen: lypanov: PCL is a fun read though, so I can recommend that

8:02 I think there's also a Clojure port of the code floating around

8:02 (but its ooold)

8:11 jcromartie: OK, Maven dependencies and repositories do, in fact, rock.

8:11 I assume that clojure.org has its own repo.

8:12 Raynes: jcromartie: build.clojure.org

8:12 jcromartie: already there :)

8:13 Raynes: Also, build.clojure.org/snapshots. For some reason, there is no clojure-contrib 1.2.0-master-SNAPSHOT yet, so if you're using Clojure from master you'll have to build clojure-contrib against it yourself.

8:23 cemerick: cgrand-rec: would you accept a patch to enlive that added a bindable var for the classloader to use in get-resource?

8:31 jcromartie: hah wow "My practical experience from two large projects is that we have spent 1000 - 1500 hours for each project on maven related problems"

8:31 lypanov: hehe

8:31 sounds about right :P

8:31 how is the clojure one?

8:32 jcromartie: 37.5 man-weeks managing maven? that's scary

8:32 Raynes: jcromartie: This is why we have Leiningen.

8:32 cemerick: That's silly. Ask me about how many hours I've put into ant over the years.

8:33 jcromartie: OK. cemerick: How many hours have you put into ant over the years?

8:33 cemerick: heh

8:33 lots. and lots and lots :-)

8:33 That doesn't mean ant is a bad tool. That means that building software isn't easy.

8:34 jcromartie: I've only done a bit of Java dev. Actually I was always the one to introduce ant and CI tools and things on Java projects. It wasn't really a problem after we got it working

8:34 {newbie}: the problm I have with and is that it ends up using xml as a programing language

8:34 jcromartie: yeah

8:34 that's never a good situation

8:35 lypanov: ant is pretty okay. maven is nuts though.

8:35 {newbie}: does maven use xml too?

8:35 lypanov: i like rake the most up to now.

8:35 newbie, yes, but more declarative.

8:36 cemerick: lypanov: maven has solved so many problems for us, it *is* nuts. ;-)

8:36 jcromartie: In the discussion I am reading, people cite the standard directory structure as a *bad* thing.

8:36 {newbie}: '-.- they just dont learn from the mistakes of the past do they?

8:36 jcromartie: They don't want to be told what to do.

8:36 {newbie}: rake is very nice though

8:36 cemerick: jcromartie: is this the canonical stackoverflow thread?

8:36 jcromartie: yeah

8:36 that one

8:36 lypanov: cemerick: i have to be honest, i prefer ant + ivy to maven.

8:36 cemerick: right

8:36 jcromartie: lotta bullshit in here

8:37 I haven't even built my first maven project and I already know about -o

8:37 lypanov: std dirs are great.

8:37 jcromartie: -o is such bullshit.

8:37 jcromartie: oh, it doesn't work?

8:37 lypanov: mavens speed is utter shit.

8:37 jcromartie: half the time you need it something else goes wrong.

8:37 jcromartie: well yeah

8:37 hah

8:37 cemerick: lypanov: There's lots of solutions for a given situation, it's impossible to say that anything is better than anything else in all cases.

8:38 LauJensen: You guys should mind your language a little bit

8:38 Raynes: Not many people around here like maven. Leiningen.

8:38 * lypanov turns on the dutch half of his blood and turns the english side off

8:38 lypanov: (i never swear in dutch, swear all the time in english)

8:38 Raynes: LauJensen: Join the FCC.

8:38 jcromartie: sorry LauJensen

8:39 Raynes: I think you guys offended his honor.

8:39 :<

8:39 jcromartie: this is a family channel :)

8:39 LauJensen: np guys

8:39 cemerick: Raynes: I wouldn't say that. Lein is nice, but the cleanliness of its solution is due to the fact that it's narrowed the problem scope.

8:39 jcromartie: Raynes: Leiningen seems nice, but I am trying to follow the "sane web dev" from cemerick

8:40 cemerick: A *totally* sane thing to do, of course.

8:40 jcromartie: cemerick: do you have your whole pom.xml for a web project anywhere to see?

8:40 * lypanov is currently more into scala and really likes sbt, but lein looks cute

8:41 Raynes: Scala's syntax is appalling. :<

8:41 cemerick: jcromartie: no. The jetty config is the biggest chunk of it by far, though. Everything else is very straightforward.

8:41 jcromartie: I'm just not clear on the "holistic" view of web dev with clojure, I gues.s

8:41 Or web dev with Java.

8:41 cemerick: Worth noting is that our webapp starts up an enclojure repl server at startup as well, so we've got multiple routes into it.

8:41 lypanov: Raynes: after 6 years of watching poor ruby devels mess up projects. i'd rather use a lang that idiots simply can't use tbh.

8:42 Raynes: I'm sure idiots can use Scala.

8:42 jcromartie: Is there a "one-sentence summary" of web development with Clojure and servlets?

8:42 lypanov: Raynes: and clojure?

8:42 * lypanov hopes they can't, hopes there is a stumbling block at the entrance

8:42 Raynes: lypanov: Of course. Lisps are easy.

8:43 lypanov: ahh, to suck. i think i should go learn haskell then.

8:43 {newbie}: jcromartie: I'll give you an one word summary

8:43 lypanov: s/to/teh/

8:43 {newbie}: "gen-class"

8:43 Raynes: lypanov: Haskell is great, but you'll have to get over the "Every language but Haskell sucks!" barrier.

8:43 I was watching them bash Lisp in #haskell earlier.

8:43 cemerick: jcromartie: http://bitbucket.org/jimdowning/hello-mvn-clj/src/tip/src/main/clj/example/MyApp.clj

8:44 Raynes: It's best for me to stay out of those discussions. They're smarter than me.

8:44 lypanov: Raynes: hehe.

8:44 Raynes: That's another thing, those guys always seem smarter than you.

8:44 You think you've accomplished something and then see them doing something that you can't even comprehend.

8:44 Part of the reason I love Clojure. I can actually help people here.

8:45 Man... It's getting early.

8:45 lypanov: whats the best deployment strategy for clojure web dev?

8:46 jcromartie: lypanov: I am sitting here trying to get started with building web apps in Clojure, but I know that I am destined to get stuck in Rails anyway. We have an "offshore team" that does PHP and Rails, and they would be utterly hopeless trying to navigate Clojure (based on the voodoo code I've seen them write).

8:46 tcrayford: compojure is really quite nice

8:46 lypanov: jetty? anyone have experience with getting nginx talking to jetty?

8:46 tcrayford: not quite as pretty as sinatra

8:46 LauJensen: yea compojure is fantastic

8:46 tcrayford: but still very nice

8:46 LauJensen: lypanov: nginx speaks fluently jettish

8:47 jcromartie: I think that Enlive is probably the most appealing part to me.

8:47 lypanov: via custom protocol or just the normal proxying situation?

8:47 tcrayford: is that an html templating lib?

8:48 jcromartie: I feel that we'll see selector-based templates all over the place soon.

8:48 It'll be the next big thing.

8:48 lypanov: enlive has me interested. i can't stand this move towards html generators.

8:48 jcromartie: it's the first time I've seen total separation of presentation and logic

8:49 lypanov: (i think having html structures in my source is about the only thing i can imagine thats worse than erb's ala rails)

8:49 tcrayford: that looks pretty nice

8:49 jcromartie: because even the template tools that claim total separation still use custom elements or syntax

8:49 tcrayford: yeah

8:49 my current project has no seperation

8:49 and its more like controller > view > model than proper MVC

8:49 jcromartie: hah

8:49 somnium: what about all html generated on the client and only json from the server?

8:50 tcrayford: that has its problems on clients that don't have JS

8:50 lypanov: for my app thats fine. so its what we're doing.

8:50 tcrayford: but aye

8:50 yeah

8:50 somnium: tcrayford: what client doesnt have js?

8:50 tcrayford: my app has to have js enabled as well

8:50 somnium: lots of mobile browsers (non iphone/droid)

8:50 lypanov: somnium: people that like "security" and enable noscript.

8:51 tcrayford: heh

8:51 somnium: ah yeah, low end phones

8:51 lypanov: yay. "security".

8:51 no one browses on those phones.

8:51 tcrayford: quite the contrary

8:51 somnium: people savvy enough to turn off js can turn it back on

8:51 lypanov: its a corner case market thats not worth the extra effort.

8:51 tcrayford: but yeah tis true

8:51 lypanov: all depends *massively* on the app you're building.

8:51 tcrayford: for most products

8:51 lypanov: if you need complete coverage. then you need it to work on them.

8:51 tcrayford: yep

8:51 not for me

8:52 my app's only for personal exploration of clojure/tdd/compojure anyway

8:52 jcromartie: lypanov: the noscript people are a minority

8:52 lypanov: somnium: we have people that refuse to do so for "security" reasons. but we ignore them ;)

8:52 vocal though.

8:52 jcromartie: they're d*ks

8:52 :) language filter

8:52 somnium: lypanov: thats my policy :)

8:53 lypanov: yup.

8:53 lau left anyway :(

8:53 * lypanov had a question for him

8:53 lypanov: anyone around using jetty + nginx + compojure in production?

8:53 or just clojure in general.

8:54 hows clojures speed vs scala btw?

8:54 tcrayford: briancarper.net

8:54 blog, all in compojure

8:54 source code is available as well

8:54 jcromartie: I want to try to compose this "one-sentence summary" of web dev in clojure just for my edification.

8:55 tcrayford: Its really really fast to get features developed

8:55 like crazy fast

8:55 lypanov: "doesn't suck as much as rails"?

8:56 (I'm not bitter at all! no, really!)

8:56 tcrayford: depends if you think rails sucks :P

8:56 somnium: Ive found its faster than ruby, though thats not surprising

8:56 tcrayford: agreed on that

8:56 lypanov: but as fast as scala?

8:56 somnium: scala gives me a headache so no idea

8:56 tcrayford: scala has lift, which is pretty nice (so I've heard)

8:57 lypanov: bit scared by the whole reflection thing

8:57 tcrayford: eh

8:57 lypanov: ah, sorry, two conversations.

8:57 jcromartie: Simple web development in clojure is achieved through using the gen-class feature of the ns function to create a single Java class that is used by an external Java component called a servlet container, which routes incoming HTTP requests to your generated class, calling certain methods on it (which are typically handled at a high level by a web framework like compojure) and returning the results as an HTTP response.

8:57 tcrayford: type hints and *warn-on-reflection* are your friend

8:57 jcromartie: how is that

8:57 speed != speed

8:57 lypanov: Clojure is about as fast as Scala in performance terms.

8:58 tcrayford: about right, but compojure can do all of that without using gen-class

8:58 jcromartie: oh really

8:58 tcrayford: c

8:58 jcromartie: but there has to be a class somewhere, right?

8:58 tcrayford: nop

8:58 jcromartie: or does compojure handle that gen-class too?

8:58 lypanov: jcromartie: k. that was the question i had. but then the fast as in devel speed conversation started and i got confused ;)

8:58 tcrayford: you never see anything to do with classes

8:58 jcromartie: how does the servlet container route the requests?

8:58 it's gotta go to some servlet class somewhere

8:58 tcrayford: you make servlets using compojure's defroutes

8:59 jcromartie: so it configures the servlet container dynamically?

8:59 tcrayford: which is like sinatra's blocks with http verbs

8:59 yeah

8:59 jcromartie: or are they "compojure servlets"

8:59 {newbie}: jcromartie: compujure uses and embbed jetty instance

8:59 somnium: tcrayford: it uses proxy

8:59 {newbie}: you can pass a proxy to it I guess

8:59 jcromartie: OK so compojure dynamically sets up Jetty... but what if you wanted to roll it into an existing server?

9:00 You'd need to be able to point the server to a class.

9:00 tcrayford: you can probably compile a jar with lein and run it

9:00 and gen-class would be used then

9:00 somnium: jcromartie: then you need gen-class

9:00 jcromartie: k

9:00 I'm going off of this, by the way http://bitbucket.org/jimdowning/hello-mvn-clj/src/tip/src/main/clj/example/MyApp.clj

9:01 tcrayford: for example of how you might do it dynamically, see http://github.com/briancarper/cow-blog/blob/master/blog/server.clj

9:02 he runs that behind apache using swank and emacs

9:04 jcromartie: that looks nice

9:04 I especially like how easy it is to "fake" static routes

9:10 Raynes: ^bang.

9:10 Mission complete.

9:10 * Raynes hunts down some food.

9:54 rfgpfeiffer: is there a clojure jar with defprotocol available in a repo for leiningen?

10:01 dabd: unlike Common Lisp, Clojure doesn't support keyword params. However it occured to me that a Map can be used to achieve the same effect. Is this the reason why keyword params were left out?

10:03 tcrayford: there's a thing in contrib that lets you do keyword params

10:04 ,(doc clojure.contrib.def/defnk)

10:04 clojurebot: "([fn-name & fn-tail]); Define a function accepting keyword arguments. Symbols up to the first keyword in the parameter list are taken as positional arguments. Then an alternating sequence of keywords and defaults values is expected. The values of the keyword arguments are available in the function body by virtue of the symbol corresponding to the keyword (cf. :keys destructuring). defnk accepts an optional docstring as w

10:05 tcrayford: but yeah, they were left out as destructuring kinda eliminates the need for them

10:12 cemerick: dabd: If I remember correctly, keyword params were left out before map destructuring became what it is today. The original reason is that keyword params would require an extra level of indirection for every function invocation, whereas Rich's objective was to make clojure fn invocation and the clojure stack be one and the same as java method invocation and the java stack, respectively.

10:13 but yeah, map destructuring being what it is makes providing "keyword args" trivial, straightforward, and more flexible, without the perf impact of a dedicated actual keyword args mechanism.

10:24 stuartsierra: And map destructuring doesn't need to create the intermediate hash-map at runtime like defnk.

10:39 cemerick: what are folks using as a sane alias for the compojure ns? #theperilsofnotusinguse

10:43 dysinger: nobody sean the one and only stuart s. today ?

10:45 cemerick: dysinger: he's right over here: stuartsierra

10:45 dysinger: bah I didn't see him I guess :( oops

10:46 stuartsierra: up for a phone call for 5 min ?

10:47 lypanov: um. clojure is cute.

10:49 dysinger: looks like I can drop 'new' builds from build.clojure.org now

10:55 stuartsierra: dysinger: yes

10:58 fliebel: Inspired by Clojure I have started to think about my own language, not with the intention of writing it, but just for fun. Where can I learn more about language design? (rhickey?)

10:58 dysinger: stuartsierra: 339-225-4551 is my line here at the moment

10:59 stuartsierra: dysinger: ok, dialing

10:59 Raynes: dysinger: You know this is logged right? >.>

10:59 rhickey: fliebel: http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH

10:59 dysinger: Raynes: tis ok :)

10:59 lypanov: only cool people would call anyway.

10:59 :P

11:00 Raynes: I should totally write a book in Emacs with muse-mode.

11:01 fliebel: rhickey: thanks, which ones are particularly interesting for learning how to design a language?

11:07 dysinger: I have been in Guatemala for a couple weeks not paying attention

11:07 but it appears that I can kill the 'new' branches from build.clojure.org

11:07 somebody say "whoa" if you disagree

11:08 rhickey: dysinger: kill away

11:09 fliebel: none of them are recipe books for how to design. I think you learn best from looking at other designs. But CTM and EOPL are more survey-like

11:09 dysinger: the new is dead, long live the new new

11:09 rhickey: CTM = http://www.amazon.com/Concepts-Techniques-Models-Computer-Programming/dp/0262220695/ref=pd_sim_b_5

11:09 EOPL = http://www.amazon.com/Essentials-Programming-Languages-Daniel-Friedman/dp/0262062178/ref=cm_lmf_tit_10

11:10 fliebel: Thanks :)

11:10 rhickey: How did you start designing Clojure?

11:14 rhickey: fliebel: it wasn't like I ever sat down with that intention. Clojure is sort of the expression of biases and ideas accumulated over a long time

11:15 cemerick: rhickey: did anyone ever pick up the jfli, jfoil work you did years back?

11:16 fliebel: So you just code and code and code until you collected loads ideas and dislikes for features and get started?

11:16 rhickey: cemerick: I'm not sure anyone ever used Foil, at least no one told me they did. Nick Levine made some enhancements to jFli and used it on some client work AFAIK

11:17 cemerick: I remember tinkering with (and liking) both of them back when I was seeing if working with CL was at all possible given an existing java codebase. Didn't get too far before thinking the combination was a little nutty. :-)

11:20 rhickey: fliebel: 2003 - http://dotlisp.sourceforge.net/dotlisp.htm, 2004 - http://jfli.sourceforge.net/, 2005 - http://foil.sourceforge.net/, 5/2005... Clojure

11:20 _fogus_: rhickey: Is it true that Norvig's JScheme was the motivation for dotLisp?

11:20 rhickey: cemerick: I see, nutty

11:22 _fogus_: yes, and acknowledged on that page

11:22 cemerick: rhickey: Not particularly rigorous, I know. That feels like a *long* time ago, and memory is faded.

11:22 fliebel: It would be cool to see a history page on Clojure.org :)

11:22 _fogus_: fliebel: +1

11:23 rhickey: cemerick: there are definitely insurmountable problems with the approaches of jFli and Foil, and they were drivers in the (IMO, nuttier :) decision to write a new language

11:23 _fogus_: rhickey: Ahhh, I knew I had read that somewhere. :)

11:24 cemerick: rhickey: my biggest problems were with CL itself as a reasonable place to call home, rather than the bridges themselves. Given that, a new language makes all the sense in the world to me.

11:24 rhickey: but it is not as if DotLisp is really a precursor or early version of Clojure. DotLisp was toying around, interpreter etc, just a rite of passage

11:25 cemerick: 'course, I didn't put the years of work into it :-)

11:25 _fogus_: rhickey: Thanks for the comments on IRC yesterday about the book, I don't know what "doozy" means, but I'll just assume it's positive ;)

11:26 rhickey: _fogus_: I'll try to get you guys some more considered feedback than that :) But overall, yes, positive - I like the focus on the ideas in Clojure

11:26 fliebel: _fogus_: doozy: something outstanding or unique of its kind. (according to my dictionary)

11:27 _fogus_: rhickey: Any feedback that you have time for would be welcome indeed. Good or bad.

11:29 Well, all feedback is good.

11:30 fliebel: _fogus_: is this about the clojure book you and… can't remember... are writing?

11:32 _fogus_: fliebel: "Some guy" named chouser ;-)

11:32 fliebel: Ah, of course!

11:35 Can a mortal human like me already read some sort of preview of it? I see things about it popping up now and then, but I keep forgetting even the name and the authors…

11:39 stuartsierra: Keyword arguments done right: http://stuartsierra.com/2010/01/15/keyword-arguments-in-clojure

11:40 * stuartsierra toots his own horn

11:41 ecyrb: In the methods list of a gen-class form, how do I specify a parameter of type array of String?

11:41 (Sorry if my terminology is awful)

11:42 cemerick: stuartsierra: nice. Do you always use commas in your code, or is that just for blog readability?

11:46 stuartsierra: cemerick: thanks. I often use commas in maps.

11:49 cemerick: Interesting. I always separate pairs with linebreaks.

11:50 stuartsierra: I do one or the other. If the map is small enough to fit on 1 line, I use commas to separate pairs.

11:59 _fogus_: fliebel: http://www.manning.com/fogus/Fogus_MEAP_Ch1.pdf

12:00 fliebel: _fogus_ whoa! thanks :)

12:00 _fogus_: no tigers :(

12:01 _fogus_: ?

12:01 dysinger: stuartsierra: I managed to hose the box my fat fingering my authorized keys :( - will take me an hour or so to rebuild it.

12:01 fliebel: _fogus_: headfirst books contain a lot of jokes and images to keep your attention. I kind of like that...

12:02 dysinger: hose the box *by* fat fingering

12:02 _fogus_: Sorry, I can barely draw stick figures. :(

12:02 fliebel: _fogus_: that would be fun… :)

12:04 _fogus_; I instantly imagine stick figure fights between languages and different ways of coding, etc.

12:05 jasapp: _fogus_: in fact, maybe you could make it into a flip book ;)

12:06 _fogus_: jasapp: oooooooo, good idea. Mutable-Bill vs. Immutable Bob.

12:06 jasapp: good for showing the difference between expansion time, and compile time too

12:07 fliebel: _fogus_: haha, maybe as an easter egg in the bottom right corner of every page :P

12:07 _fogus_: That is actually a really good idea!

12:09 fliebel: _fogus_: maybe you should skim a few pages of head first java for ideas… They also have a good introduction to the concept at the start.

12:10 _fogus_: I read it many moons ago, but maybe I will skim it like you say

12:10 AlexS_: I am starting out with slime/swank-clojure installed from ELPA. It seems no keybinding for slime commands are set up by default. Is that expected?

12:10 fliebel: _fogus_: Roses are red violets are blue, mutating collections you should not do :)

12:12 http://www.headfirstlabs.com/about.php

12:13 jkdufair: ooh. shakespeare, spinal tap, and clojure, FTW

12:41 lypanov: are there any paredit screencasts?

12:57 jkdufair: very excited to read about datatypes and protocols. was just thinking this morning, trying to map my smalltalk-y brain into clojure via classes like sorted lists and the like

12:58 clojure kicks ass. i haven't been this excited about a PL since i learned smalltalk a decade ago

12:58 enjoying playing with coin flipper apps and such. thx stuartsierra

12:59 stuartsierra: jkdufair: you're welcome

13:06 ohpauleez: hey guys

13:17 jlb: lypanov: not a screencast, but this helped me bunches - http://www.slideshare.net/mudphone/paredit-preso

13:19 most things in paredit are straightforward, but getting out of the ((foo bar)) situation required digging up some help :)

13:31 taotree: I'm new to clojure. I have a set of lisp files trying to run them from Java. I'm running RT.loadResourceScript, var, invoke and I get an error "Unable to resolve symbol: in-package in this context"

13:33 arohner: taotree: that sounds like a "normal" error in your clojure file

13:34 taotree: "normal" error? the lisp file works when run from lisp. Do I need to include a library that defines "in-package"?

13:34 stuartsierra: taotree: Are you trying to run Common Lisp sources in Clojure?

13:34 taotree: yes

13:34 stuartsierra: Clojure is not Common Lisp.

13:34 the-kenny: taotree: Clojure isn't common Lisp

13:35 fanatico: taotree: http://common-lisp.net/project/armedbear/

13:35 taotree: yes, I understand... is there a straightforward porting process?

13:37 arohner: the same as porting from one programming language to any other

13:37 taotree: ok, thanks

13:41 the-kenny: Maybe it's a bit easier with a similar syntax, but the immutability could be a bit annoying while portin

13:41 *porting

13:54 maacl: Does compojure support gzip?

13:55 arohner: maacl: Jetty does

13:56 maacl: arohner: Is there an easy way to switch it on from Clojure?

13:56 tolstoy: So, if I want to throw a custom exception (with a payload) deep in my Clojure app so it's caught at the top layer and an error is reported, am I doing it wrong?

13:56 Can't create custom exceptions (except in Java).

13:56 hiredman: you can

13:57 tolstoy: Can you?

13:57 hiredman: using gen-class

13:57 tolstoy: Does that work in the repl, too?

13:57 hiredman: only for AOT

13:57 tolstoy: I'm thinking a better pattern is some sort of macro at the top layer.

13:58 hiredman: but I don't think using exceptions "deeply" is a good idea

13:58 if you must use exceptions deal with them as close to the source of the exception as possible

13:58 cemerick: hrm, I wonder how many here use compojure but aren't in #compojure :-)

13:58 arohner: maacl: you'd have to check your server docs

13:58 chouser_: tolstoy: you could bind a var at the top level and call it instead of throwing an error

13:58 arohner: it might be possible

13:58 chouser_: it wouldn't unwind the stack, but could report any details you want without having to AOT compile

13:59 tolstoy: The idea here is that it's a web request. Any number of things might go wrong, and so "handling" it is just offering a response with the error in it.

13:59 chouser_: That sounds interesting. Hm.

14:00 Luyt: From Hacker News, http://joyofclojure.com/

14:00 mebaran151: how do I reset the slime repl?

14:00 hiredman: tolstoy: why would a webrequest end up that "deep"?

14:00 chouser: contrib has error-kit which does a hybrid of that and exception-throwing, plus a little object model all thrown together in one big happy mess.

14:00 the-kenny: Luyt: chouser etc. are in here :)

14:00 mebaran151: ,q

14:00 Ew.. ,r or so

14:01 ,q closes the repl

14:01 clojurebot: java.lang.Exception: Unable to resolve symbol: q in this context

14:01 hiredman: fnparse seems to have been leinized, but not pushed to clojars :(

14:01 tolstoy: chouser: I'll check that out. Thanks!

14:01 mebaran151: hmmm?

14:01 ,q

14:01 clojurebot: java.lang.Exception: Unable to resolve symbol: q in this context

14:01 chouser: tolstoy: I

14:01 tolstoy: I'm not really recommending it, just mentioning its existence

14:01 the mess may not be so happy

14:01 the-kenny: mebaran151: clojurebot can eval clojure-code, starting with a ,

14:02 ,(+ 1 2)

14:02 clojurebot: 3

14:02 jder: can anyone suggest how I might use print from non-main threads in the slime repl?

14:02 mebaran151: oh no I know

14:02 tolstoy: chouser: It might jog my creativity, though. So it's all good.

14:02 chouser: tolstoy: if calling a thread-bound var would be sufficient, by all means just do that.

14:02 mebaran151: jder: you could send all the results to an atom and print that

14:02 the-kenny: jder: There's a variable somewhere which is called something like "print-inferior-text-in-main"

14:02 jder: thanks, guys, I'll investigate

14:04 hiredman: and fnparse's project.clj has an unmatched delimiter

14:05 technomancy: jder: also contrib's logging lib can do it

14:05 konr: Can I use the cross-reference slime functions with clojure?

14:06 technomancy: konr: no. =(

14:06 it's somewhere on my backlog of things to implement though

14:07 cemerick: wow, I've forgotten how painfully complicated J2EE security is.

14:11 hiredman: technomancy: can you tell lein to use a custom groupId when generating a pom?

14:13 mtm: any handy set of clojure functions for dealing with date/time? or do I just need to fall back on joda or java.util.Date?

14:13 technomancy: hiredman: defproject mygroup/project-id should do the trick.

14:14 hiredman: ah

14:14 technomancy: mtm: joda if you need to be able to compare times between different timezones or jump across DST boundaries

14:14 hiredman: makes sense

14:14 technomancy: hiredman: yeah, I was pleased to be able to use the symbol's ns as the groupId

14:15 mtm: technomancy: thanks, I'm looking at writing some code to play with iCal format (.ics files)

14:17 technomancy: I wrote a dumb wrapper around java.util.Date, but it has serious bugs wrt DST

14:17 to be fair, DST itself is fundamentally incompatible with the idea of a linear timeline, so it's no surprise that it's nearly impossible to get right.

14:18 mtm: date/time has always been a thorny rats-nest to deal with as far back as I can remember; so many edge cases

14:19 technomancy: yeah, if I get a time machine, going back to kill/kidnap william willet is in my top 5

14:19 probably right after convincing Brendan Eich not to make Javascript look like Java

14:20 http://twitter.com/coda/status/4928323914

14:21 mtm: :D

14:21 we just need... Metric Time!

14:22 metric: time

14:22 mtm: ha!

14:23 the-kenny: We should just use the Swatch Internet Time :)

14:23 technomancy: I'd be happy with a time system that always progresses forwards and doesn't pretend that the same hour happens more than once

14:23 mtm: there are roughly Pi seconds in a nano-century

14:23 technomancy: it's called GMT (or zulu time)

14:24 the-kenny: and the beat goes on...

14:24 jkdufair: junior, your birthday is coming up soon! it's only 5.1 megaseconds away!

14:25 the-kenny: mtm: Yes :)

14:25 It's @853.beats now

14:46 bpsm: I've (1) sent in my CA and (2) Applied to join clojure-dev, but thus far no joy.

14:46 Have I overlooked something?

14:51 ericthorsen: Is there a "blessed" place for clojure.lib builds? (1.0, 1.1)

14:52 technomancy: ericthorsen: http://build.clojure.org

14:52 tolstoy: ericthorsen: If you're talking contrib, there's a google code project where they drop jar files

14:52 technomancy: contrib is still being figured out

14:53 hiredman: is there a way to pass java options through lein?

14:53 ericthorsen: technomancy: that appears to be just the latest...no 1.0 and 1.1

14:54 technomancy: hiredman: if it's not respecting $JAVA_OPTS that's a bug

14:54 ericthorsen: tolstoy: that's a start...thanks

14:54 hiredman: technomancy: excellent

14:54 tolstoy: http://code.google.com/p/clojure-contrib/

14:55 stuartsierra: I am working with dysinger on getting numbered contrib releases in a maven repo at build.clojure.org

14:56 pre-built ZIPs are already available on Google Code

14:57 bpsm: tolstoy: http://github.com/richhickey/clojure-contrib/downloads also. Which is "more official"? Are download sites kept up-to-date?

14:57 ericthorsen: stuartsierra: that's great. The google code zips will hold me over for now. It would be nice if the same were available for Clojure proper

14:58 tolstoy: bpsm: I have no idea. I wish there were links on Clojure.org or what have you.

14:59 stuartsierra: ericthorsen: there are ZIPS of Clojure proper on http://code.google.com/p/clojure/

14:59 ericthorsen: stuartsierra: perfect. Thanks!

15:00 kotarak: How does clojars handle scp?

15:01 stuartsierra: The "downloads" on http://github.com/richhickey/clojure-contrib/downloads are auto-generated by Github. They are source-code-only, not pre-built binaries.

15:02 bpsm: stuartsierra: ah! now more enlightened.

15:02 hiredman: kotarak: jsch I believe

15:03 kotarak: hiredman: I have trouble using the ant scp task. It works for my server but not for clojars. It's waiting for some ACK it seems.

15:03 hiredman: hmmm

15:04 direct scp to clojars works

15:04 kotarak: yes. jsch (which is used by the ant scp task) to ssh works also. But jsch to clojars does not work. :(

15:04 technomancy: jsch is quirky. I could only get it to work with RSA SSH keys

15:04 kotarak: bleh

15:05 tolstoy: sometimes you have to implement the UIKeyboardInteractive interface, or something like that.

15:05 technomancy: which is why "lein push" is no longer supported

15:05 kotarak: Well. No. My key works for a normal ssh server. So it's not the key, I guess.

15:06 technomancy: :( I wanted to provide something similar with clojuresque.

15:06 hiredman: anyway, clojurebot is leinized

15:06 huzzah

15:06 kotarak: Invoking external commands is so clunky.

15:06 tolstoy: http://www.jcraft.com/jsch/examples/ScpTo.java

15:06 hiredman: out of all the lein command I've used, lein repl is the only one that didn't work with /bin/sh

15:08 technomancy: lein repl needs to get replaced anyway

15:08 it's the only one that doesn't use a subclassloader

15:08 due to funkiness with IO and clojure.main

15:08 hiredman: but thanks for checking that

15:09 hiredman: sure, "checking that" was what I was doing...

15:28 cburroughs: mta you may be interested in http://liebke.github.com/incanter/chrono-api.html

15:33 lypanov: omdog. incanter has mongodb stuff.

15:35 technomancy: that's ... weird.

15:37 the-kenny: Agreed

15:38 * lypanov wonders if he's the only one insane enough to use vi mode emacs for clojure

15:38 chouser: vectors, lists, and java lists can be = to each other, but can never be = to a set or a map.

15:39 "set" and "map" nicely describe those two groups, so what's the word for the group that includes vectors, lists, and java lists?

15:39 stuartsierra: java.util.List?

15:40 cburroughs: lypanov, More formally incanter has a incanter-mongodb submodule.

15:40 qbg: ordered?

15:40 hiredman: ,(ancestors (class ()))

15:40 ,(ancestors (class ()))

15:40 clojurebot: #{clojure.lang.Sequential clojure.lang.IPersistentCollection java.lang.Iterable clojure.lang.IPersistentList clojure.lang.IObj clojure.lang.ISeq clojure.lang.Seqable java.util.List clojure.lang.Obj clojure.lang.IMeta java.lang.Object clojure.lang.Counted clojure.lang.IPersistentStack java.util.Collection :clojure.contrib.generic/any}

15:40 lypanov: cburroughs: its like clojure was designed precisely for the project i was originally planning to do with ruby this week.

15:41 (and a good first project)

15:42 somnium: clojure is good at becoming precisely designed for whatever it is youre doing =)

15:43 lypanov: somnium: especially when neat guys write mongodb wrappers.

15:43 the day after there is a 37% MEAP discount on joy of.

15:44 chouser: lypanov: did that code stop working?

15:45 lypanov: no idea. should it work for more than 24 hours?

15:45 i was going to retweet it but didn't want to bum someone out if its already ended.

15:45 chouser: oh, I thought you tried it ... I wasn't sure what "day after" was relative to

15:46 I think the code is good all week. not sure when that ends precisely.

15:46 lypanov: chouser: i used it this morning. my wife entered the house just as i was about to buy it last night - had not seen the offer..

15:46 * lypanov has spent all day playing with getting slime + aquamacs + random other stuff going though

15:49 lypanov: um. leiningen is just great. pragmatic but idealist.

15:53 technomancy: to a newbie. would be nice if lein repl loaded the newly added deps. i can't easily see what i'm meant to run to get them.

15:55 the-kenny: lypanov: close the repl, run "lein deps" and restart the repl

15:55 lypanov: aye. got it already.

15:55 maybe the docs should be less "explicit" about what lein deps does.

15:56 its not obvious that "installing into lib" is the same as "downloading deps"

15:59 stuartsierra: ~def merge-with

16:07 lypanov: is there a shortcut for (ns blah (:use foo)) in the repl?

16:07 so i can just type the :use somehow?

16:07 qbg: ,(doc refer)

16:07 clojurebot: "([ns-sym & filters]); refers to all public vars of ns, subject to filters. filters can include at most one each of: :exclude list-of-symbols :only list-of-symbols :rename map-of-fromsymbol-tosymbol For each public interned var in the namespace named by the symbol, adds a mapping from the name of the var to the var to the current namespace. Throws an exception if name is already mapped to something else in the current nam

16:08 hiredman: lypanov: use

16:09 ,(doc use)

16:09 clojurebot: "([& args]); Like 'require, but also refers to each lib's namespace using clojure.core/refer. Use :use in the ns macro in preference to calling this directly. 'use accepts additional options in libspecs: :exclude, :only, :rename. The arguments and semantics for :exclude, :only, and :rename are the same as those documented for clojure.core/refer."

16:09 lypanov: "in pref to calling ..." is for neatness in real code?

16:09 or it might be deprecated?

16:10 stuartsierra: not deprecated

16:10 But recommended for interactive use only.

16:12 lypanov: (ns boo (:use somnium.congomongo)) -> nil

16:12 (use somnium.congomongo) -> classnotfound

16:13 directly calling :use gives the same

16:13 the-kenny: lypanov: Try to quote somnium.congomongo.

16:13 (use 'comnium.congomongo)

16:13 lypanov: ah. that works. awesome. thx the-kenny!

16:19 ordnungswidrig: hi. When defining a dsl by using macros, what is the recommented way to signal an error at macro runtime?

16:20 hiredman: you can throw exceptions if you want

16:20 or just have the macro expand into something that would signal an error

16:20 ordnungswidrig: hiredman: I want it to fail early. So a custom exception would be fine?

16:21 hiredman: *shrug*

16:22 ordnungswidrig: hiredman: I want to fail it at "compile time"

16:23 kotarak: ordnungswidrig: you can throw excpetions from a macro.

16:23 somnium: ,(throw (Exception. "the world ended"))

16:23 clojurebot: java.lang.Exception: the world ended

16:25 ordnungswidrig: I know, thanks. But is this considered good style? Or is it better to have the macro to always expand and as hiredman said, signal at runtime?

16:26 qbg: If you want it to fail early, throwing an exception is probably better

16:34 stuartsierra: Throwing exceptions at compile-time is acceptable. The core libraries do.

16:54 lypanov: um

16:54 anyone any clue why my slime might start up and then instantly die?

16:54 qbg: Does it say anything?

16:54 lypanov: it was working, (doc blah) worked. then the logo faded in and boom, it won't react anymore.

16:55 maybe i just got a bad version? is there a good way to get a stable one?

16:55 qbg: Is emacs still responsive?

16:55 SLIME is a crazy project

16:55 lypanov: yes

16:56 qbg: Which version do you have?

16:56 lypanov: todays snapshot.

16:57 qbg: Snapshots aren't always stable

16:57 You could try an older version

16:58 technomancy: lypanov: slime trunk has known issues with clojure

16:58 lypanov: ah, :D that would explain

16:58 technomancy: see the swank-clojure readme for stable install instructions

17:00 lypanov: technomancy: i used the magical mac pkg that comes with aquamacs thinking that would Just Work.

17:01 technomancy: lypanov: aquamacs is ... "lightly supported"

17:01 * lypanov wonders how on earth to delete it

17:01 lypanov: technomancy: ah.. bummer.

17:01 whats best to run on mac?

17:01 technomancy: aquamacs is often broken in strange and unpredictable ways, and it's not portable, so I can't test it myself

17:02 * technomancy recommends Cocoa Emacs: http://emacsformacosx.com/

17:02 lypanov: k. grabbing. thank you!

17:03 * the-kenny uses Emacs23 in terminal.app

17:06 stuartsierra: What's the deai with overlapping interfaces that implement the same method signature?

17:06 lypanov: apparently my mac has once again gone insane. newly installed apps lack icons in the dock now.

17:11 alexyk: somnium: pingy-wingy

17:11 somnium: alexyk: heyy

17:12 alexyk: somnium: is there a faster mass-fetch, similar to mass-insert?

17:12 for oodles of data

17:12 somnium: alexyk: not sure I follow, fetch always returns one cursor

17:13 which gets seqed

17:13 alexyk: somnium: I mean, is there a way to tell fetch to work in blocks of say 10000?

17:13 is it chunkable inside mongo-java?

17:15 somnium: hmm, you can get the cursor with .find and do imperative stuff to it

17:16 alexyk: somnium: I didn't look if java's fetch is chunkable... but I want clojure's to be fast! :)

17:16 and it's damn slow now :(

17:18 lypanov: alexyk: /me == an alex k playing with mongo.

17:18 somnium: alexyk: your datasets are a few orders of magnitude beyond the 'normal' use case :)

17:19 lypanov: "File error: Cannot open load file, swank-clojure-autoload"

17:19 eep :(

17:19 somnium: alexyk: dropping into an imperative-style loop-recur on the cursor is probably going to give a performance boosn

17:20 alexyk: somnium: ok, will look

17:21 lypanov: technomancy: on trying the instructions in the module. i get File error: Cannot open load file, swank-clojure-autoload

17:21 technomancy: running M-x slime i get "Symbol's value as variable is void: package-activated-list"

17:23 somnium: alexyk: are you still using old-new?

17:24 alexyk: somnium: nope, old old :)

17:24 plain 1.1.0-snapshot

17:24 should I recompile stuff? I was wary of changing everything right away

17:24 as am in the middle of a deadline

17:26 Raynes: lypanov: Did you get Swank from ELPA?

17:26 lypanov: w.t.f.

17:26 [java] Compiling clojure.contrib.pprint.PrettyWriter to /Users/lypanov/src/clojure-contrib/classes

17:26 [java] java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V

17:26 i'm assuming i timed all of this realllly badly.

17:26 Raynes: lypanov: That means you need to build Clojure contrib master against your clojure.

17:26 qbg: Do `ant clean`

17:26 Raynes: You're using a verion of c.c that was built against an older version of Clojure.

17:27 lypanov: man. in the deep end today :D

17:27 gotta install vi mode first else can't use emacs.

17:27 lisppaste8: stuartsierra pasted "2-element Tuple deftype" at http://paste.lisp.org/display/93468

17:28 stuartsierra: rhickey: that was harder than I expected

17:29 hiredman: Raynes: he is compiling contrib

17:29 Raynes: hiredman: The only thing I know to cause that is not having c.c compiled against whatever Clojure you're using.

17:30 lypanov: er, thats majorly broken.

17:30 Raynes: Maybe his jars are screwed up.

17:30 technomancy: lypanov: you probably have some manual slime config left over from your old installation

17:30 on the elisp side

17:30 hiredman: lypanov: where did you get your clojure.jar?

17:30 lypanov: technomancy: nope.

17:31 rhickey: stuartsierra: how so?

17:31 lypanov: technomancy: but,after install. i did a clojure-update.

17:31 technomancy: and got java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V

17:31 stuartsierra: rhickey: just finding all the methods to implement

17:31 rhickey: rhickey: or, welcome to my world :)

17:31 hiredman: lypanov: where did you get your clojure.jar?

17:31 lypanov: technomancy: but: BUILD SUCCESSFUL

17:31 Total time: 5 seconds

17:31 hiredman: checking sorry.

17:32 stuartsierra: rhickey: I was confused by the fact that the same methods appear in multiple interfaces.

17:32 Does it matter which one I implement?

17:32 lypanov: hiredman: afaiu, that came via clojure mode el

17:34 it seems to grab 1.0

17:34 hiredman: lypanov: I am pretty sure contrib came with clojure-mode

17:35 lisppaste8: stuartsierra annotated #93468 "Microbenchmark Tuple vs Vector" at http://paste.lisp.org/display/93468#1

17:35 rhickey: stuartsierra: yeah, that interface inheritance will go away with protocols. No, it doesn't make a difference, as long as same sig

17:35 hiredman: technomancy: ?

17:35 stuartsierra: It's faster than 2-element vectors, though:

17:35 lypanov: i'll scrap everything and start from scratch

17:36 stuartsierra: Tuple2 speed comparison with Vector: http://paste.lisp.org/+204C/1

17:36 rhickey: stuartsierra: those conds look like candidates for case

17:37 stuartsierra: rhickey: you're right, didn't know case was in core yet

17:37 lypanov: oh... crap...

17:37 i git cloned the first hit on google...

17:37 *shame*

17:37 k... gonna come back to this.

17:37 hiredman / technomancy: exactly which version of this do i want? technomancy or jochu?

17:37 (github)

17:37 or the contrib version?

17:38 ninjudd: what is the most efficient way nowadays to serialize clojure structs?

17:39 stuartsierra: ninjudd: structs are largely obseleted by deftype

17:42 ninjudd: stuartsierra: oh, are types more efficient to serialize?

17:43 stuartsierra: is deftype in the stable branch, or is it still is development?

17:43 stuartsierra: They're easier to serialize and recover the type information when reading back

17:43 efficiency is probably about the same

17:43 It's on the master branch now, not yet in a numbered release.

17:44 ninjudd: ok, so what is the most efficient way nowadays to serialze types?

17:44 stuartsierra: rhickey: Tuple2 with case is slower than with cond!

17:44 ninjudd: define efficiency. Time to serialize? Space occupied by serialized form?

17:48 pr/read and Java serialization are built-in. Anything else you'll have to implement yourself.

17:48 ninjudd: time

17:48 str-pr/read-string are not fast enough

17:48 would Java Serialization be faster?

17:48 hiredman: are they serializable at all?

17:49 clojurebot: ping?

17:52 hmmm

17:56 ninjudd: so Java Serializable support is available in clojure now? is that is master?

17:59 hiredman: clojurebot: ping

17:59 clojurebot: PONG!

19:12 eivindu: anyone running tests from vimclojure? with \rt it just gives me {:type :summary, :test 1, :pass 5, :fail 1, :error 0} and not the detailed descriptions as I get with `lein test` (which is too slow to spin up)

19:15 hiredman: clojurebot: ping

19:15 clojurebot: PONG!

19:19 the-kenny: clojurebot: pong

19:28 * defn reads the joy of clojure ch 3

19:34 defn: clojurebot: pong is <reply>PONG YANG!

19:34 clojurebot: In Ordnung

19:38 the-kenny: clojurebot: pong

19:38 clojurebot: PONG YANG!

19:38 defn: I think it's actually Pyongyang

19:38 clojurebot: forget pong

19:38 clojurebot: I forgot pong

19:39 defn: clojurebot: pong is <reply> Qinfengxiang!

19:39 clojurebot: 'Sea, mhuise.

19:42 alexyk: I have a largish map painfully built from disk. Now if I mess up and cojure repl starts printing large piece of data into rlwrap, it all gets effed up and I have to Ctrl-C, wasting the previous hours loading the darn map. I've heard there're things like Terracotta allowing to share memory between JVMs. Ca I shove the map into it and then get it back really quickly?

19:45 the-kenny: alexyk: The first thing you could do is set a print-limit

19:45 So the repl won't start printin large pieces of data :)

19:45 alexyk: the-kenny: how?

19:45 the-kenny: *print-limit* etc.

19:46 Some global vars

19:46 alexyk: ok, still I wonder about persisting things into RAM

20:31 redalastor: I'm having a mysterious clojure related JNI problem, can someone help with that?

20:45 I'm having a C++/clojure app with a single Java Class (everything is static in it) to bridge everything via JNI. If I call a particular method, it crashes the JVM, unless I comment out a single clojure function call. Calling that method from java works fine. I own nothing more than the class and method id on the C++ side. I can call other clojure functions in that method with no problem. I don't know where to look to solve the

20:45 problem.

20:54 the-kenny: redalastor: You should tell a bit more about this particular function

20:54 redalastor: the-kenny: There's nothing very strange about it... where's the pastebin?

20:54 the-kenny: lisppaste8: url

20:54 lisppaste8: To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.

20:55 redalastor pasted "JNI trouble" at http://paste.lisp.org/display/93473

20:56 redalastor: Both remove-column and remove-row when called from java called by C++ fail.

20:56 But they work as expected when called from clojure or java.

20:57 Well... They don't fail, the JVM crash.

20:59 the-kenny: hmmm strange

21:11 redalastor: I also tried having another method call that method and it still crashes the JVM.

21:29 rikthevik: hey, can someone link me to a example of well set up clojure project? i'm having trouble laying things out and setting up my build

21:31 ltyphair: rikthevik: have you tried lein? http://zef.me/2470/building-clojure-projects-with-leiningen

21:32 rikthevik: i have. the first time i started using it it downloaded a metric shitload of stuff. is lein turning out to be the clojure standard?

21:33 the-kenny: rikthevik: I think so. It's a great tool

21:33 ltyphair: rikthevik: it takes the best parts of maven and clojure-fies them

21:33 rikthevik: cool. this article is really good. thanks for the advice

21:39 defn: hmmmmm weird

21:39 apparently using slime's fuzzy completion screws up the way i used to be able to do clojure.contrib.str-utils/[TAB]

21:39 and get a list of possible forms

21:41 the-kenny: defn: Yeah, that's broken for me too

21:41 Maybe I'll try to fix this.. but not today

21:41 defn: is there any way to get the standard completion to work?

21:41 what's the name of the basic completion fn

21:42 the-kenny: slime-complete-symbol*?

21:42 Ah, no

21:42 defn: doesnt work

21:42 :(

21:42 the-kenny: defn: slime-simple-complete-symbol

21:43 setq slime-complete-symbol-function to 'slime-simple-complete-symbol

21:43 defn: if only i had that function

21:43 the-kenny: huh

21:43 defn: M-x slime-simple-complete-symbol

21:43 doesnt exist

21:43 the-kenny: It isn't an interactive function

21:43 You can't call it with M-x

21:43 defn: oh i see

21:43 my bad

21:43 the-kenny: Try C-h f slime-simple...

21:44 C-h v slime-complete-symbol-function RET is interesting too

21:44 defn: hmmmm, i should try to fix this

21:45 the-kenny: defn: I'm almost sure the c.c.str-utils/TAB stuff is a problem in fuzzy-completion in the contrib of swank-clojure. You should start there

21:45 I'll take a look at this tomorrow too

21:49 defn: the-kenny: hmmm

21:49 apparently there's a swank-fuzzy and a slime-fuzzy

21:49 i didnt know that...

21:49 the-kenny: the fuzzy completion need a backend too

21:52 Whoa, slime_fuzzy.clj is really... let's say funny to work on

21:54 defn: the-kenny: lol yes

21:54 the-kenny: it should be redone

21:55 the-kenny: i have no idea what im doing in there so im going to leave it alone

21:55 if you figure out a fix please let me know

21:56 the-kenny: defn: Of course, I will contact you

21:56 I'm pretty sure a fix like this would be merged into swank-clojure too

21:56 defn: i dont understand how the heck all of the plumbing works i guess

21:57 what does swank do that slime doesnt?

21:57 the-kenny: swank is the backend for slime

21:57 slime runs in emacs, swank in the lisp process

21:58 Looks like slime-fuzzy needs some special work on the backend side

22:04 qbg: I'm writing a macro that is installing an :arglists entry in the meta data for a var by setting the meta data for symbol when I def it. But the compiler seems to be doing magic here

22:05 defn: The Joy of Clojure is going to be a massive book

22:05 qbg: If I put a symbol that hasn't been def'ed yet in :arglists, I get an exception saying that the symbol can't be resolved

22:05 ltyphair: defn: reading it now. liking it so far.

22:06 qbg: If the symbol has been def'ed, I get a wrong number of args passed to PersistentVector error

22:06 What is going on?!?

22:06 defn: ltyphair: a lot of spelling errors :X

22:08 ltyphair: 100+ pages for 1-4, image how many there will be when they add another 250

22:08 imagine

22:09 ltyphair: defn: right. the editor will clean it.

22:09 the-kenny: I don't have the money to buy it right now :(

22:09 ltyphair: the-kenny: i had a code and only got the pdf so it was affordable.

22:10 the-kenny: uh the code is good

22:10 defn: the-kenny: does it have to do with the / after the 'ns

22:10 maybe?

22:11 qbg: This is strange: If I def without the meta data, then alter the meta data of the var later, it works

22:11 Very strange

22:11 the-kenny: defn: I think it just completes the namespace-declaration and - when it's completed - it treads it as a complete declaration and doesn't recognize it as a namespace with functions in it

22:11 qbg: I wonder if it is intended behaviour...

22:12 defn: the-kenny: hmmm

22:12 so it's not recognizing it as a namespace

22:12 the-kenny: defn: That's just an idea

22:20 No :( Can't buy the book without a credit card

23:03 qbg: ,(do (defmacro foo [] (let [new-meta {:doc '(throw (Exception. "D'oh!"))} name (with-meta 'bar new-meta)] `(def ~name nil))) (foo))

23:03 clojurebot: DENIED

23:04 qbg: :(

23:07 I can set the metadata using the read syntax, but if I do it from a macro, the exception is thrown

23:13 Ah, it needs to be double quoted (that's strange...)

23:14 * qbg thinks defn is black magic

23:57 Apage43: man

23:57 clojure makes me feel like a god sometimes, you know

Logging service provided by n01se.net