#clojure log - Nov 11 2010

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

0:00 coldhead: wait why?

0:00 hiredman: well, geez, if five people on the internet are worried about a company doing something that have not said they will do based on the fact that they did something to this other thing that they said they would do

0:01 technomancy: just need to convince cyanogen to move to the EU and the future of Android is safe.

0:01 seancorfield: i bet the vast majority of java programmers haven't even heard the news

0:01 hiredman: technomancy: not true, companies will stop making android phones

0:02 technomancy: HTC is taiwanese

0:02 hiredman: the software alone is not enough, and you are deluding yourself if you believe manufactures will make the hardware for it without google

0:02 lambdalion: over the patent issues?

0:02 seancorfield: i see the same thing in the cfml community - there are about 800,000 cfml devs but only about 1,000 are 'active' in the community and maybe at most 10,000 actually _read_ anything about what's going on (most likely less)

0:02 scale that up ten fold and you've got the same thing in the java world

0:03 coldhead: ben nadel is one of the 1000, right?

0:03 technomancy: hiredman: well development would slow, but I don't see HTC switching to windows 7 or anything

0:03 lambdalion: facebook is still PHP

0:03 seancorfield: i mean, how many java devs actually attend conferences or write blogs or even _read_ blogs? :)

0:03 yeah, coldhead, ben nadel is one of the 1,000

0:03 coldhead: oh good

0:03 lambdalion: A friend of mine, who is very sharp just went to esty.

0:04 dnolen: seancorfield: not allowed, they are held hostage in rhickey's Pods.

0:04 lambdalion: I asked him "why is your site still PHP?"

0:04 he responded "You ant to rewrite it>?"

0:04 err- "You want to rewrite it?

0:05 hiredman: technomancy: they switched to android fast enough, they can switch to something else

0:05 technomancy: east asia was ahead of the US for years in mobile technology; the worst oracle could do is bring back that situation

0:05 seancorfield: lambdalion: if you want a blog or a CMS, PHP is (unfortunately) the default choice

0:06 lambdalion: unfortunately facebook and etsy started like that...

0:06 seancorfield: technomancy: yeah, when i moved to the US from the UK i was shocked at how primitive the phones were over here ('99)

0:06 lambdalion: and it is so hard to rewrite that they still are like that.

0:06 hiredman: technomancy: people say that, but I find they phones to be "different" not actually better

0:06 e.g. just as much walled gardens

0:07 in many cases even worse about that kind of thing

0:07 technomancy: hiredman: right; what I mean is the US has caught up now, but 10 years ago we were way behind.

0:07 lambdalion: That PHP is the dominant web language is prioof that programming is still not a profession.

0:07 *proof

0:07 jk_: are phones in europe locked down by the carrier though?

0:07 i thought that wasn't the case

0:07 just swap the sim

0:08 danlarkin: lambdalion: that is a stupid inflammatory statement that is impossible to back up with actual reasoned thought

0:08 lambdalion: really?

0:08 why?

0:08 clojurebot: http://clojure.org/rationale

0:09 sthuebne_: jk_: not in all cases, but we have sim-locks. yes

0:09 lambdalion: are there no objective standards that languages can be measured by?

0:09 sthuebne_: don't ask me for the ratio, though

0:09 danlarkin: lambdalion: PHP being a dominant web language and programming being a profession are independent of one another

0:10 ppppaul: php is like pcbs?

0:10 danlarkin: it is a logical fallacy to infer a relationship between them

0:10 lambdalion: but doesn;t the fact that PHP is the dominant language make you ask a few things about the profession?

0:11 danlarkin: one has nothing, or at least very little, to do with the other

0:11 jk_: danlarkin: i think he's just using inductive logic to say that the art is not dominated by professionals

0:11 lambdalion: I disagree...

0:11 danlarkin: I regret involving myself in this

0:11 jk_: lol

0:12 ppppaul: you can not undo this

0:12 not even with vim

0:12 lambdalion: well, if you would rather not hear why i disagree I donlt have to tell you.

0:12 hiredman: danlarkin: this is why you need to let go and /ignore

0:13 danlarkin: in other news, it's raining out, so that must be what's keeping the earthquakes away

0:14 ppppaul: earthquakes and volcanos!

0:16 jk_: i just hope that clojure has a long life and i want to see a lot of clojure libraries get developed to replace relying on java libs for some stuff. it's just too easy to fall into calling java, which complicates things like going to .NET or basically running your clojure code anywhere else

0:17 lambdalion: hmm...

0:18 jk_: but i have to admit that a big earthquake could ruin the whoe game. i hope it rains

0:18 hiredman: jk_: if you read the rationale one of the whole reasons for clojure's existence is wanting a lisp that embraces the host system

0:18 jk_: hiredman: but rich himself has a .NET version too right?

0:18 ppppaul: had

0:18 hiredman: no

0:18 lambdalion: I think the question might be "how well does calling java compose"

0:18 hiredman: he does not

0:18 jk_: ok, it's dead?

0:19 hiredman: he had an earlier lisp on .net

0:19 and super early versions of clojure ran on both

0:19 and someone else has done a port of clojure to .net

0:19 jk_: ok, i see. i thought there were plans to revive that

0:19 lambdalion: and how well can that be abstracted so that clojure code can move from VM to VM, though that is a ways off...

0:19 jk_: maybe it's that someone else that i was reading about

0:19 hiredman: but Rich himself said that ClojureCLR is not Clojure

0:20 Raynes: Since it doesn't appear anybody will be needing sexpbot for anything any time soon, I'm going to take this opportunity to move it to a new server. Shall be back shortly.

0:20 ppppaul: &(#(% %

0:20 awwww

0:20 danlarkin: raynes: take your time

0:20 ohhhh burn!!!!

0:20 hiredman: ClojureCLR should be as seamless to use on the clr as clojure is on the jvm

0:20 Raynes: danlarkin: I love you too, man.

0:20 lambdalion: But it is annoying when destructive functions fail to retiurn values.

0:21 hiredman: lambdalion: all is suffering

0:21 lambdalion: indeed

0:21 jk_: lambdalion: what about exceptions? don't they cause a pain?

0:22 lambdalion: the world is not perfect. Exception sare.

0:22 jk_: are perfect?

0:22 lambdalion: no, just are.

0:23 ppppaul: computers aren't supposed to make mistakes

0:23 jk_: what is the sound of one exception throwing?

0:23 probably *crash*

0:23 lambdalion: computers rarely make mistakes. But you often make mistakes.

0:23 technomancy: has anyone used leiningen test selectors on a nontrivial project?

0:24 hiredman: so I was taking out the trash and thinking about monads and had an idea https://gist.github.com/672059

0:24 lambdalion: This is the Tao.

0:24 ppppaul: woah

0:24 trashy monads?

0:25 hiredman: so by extending the protocol Bindable to different objects you can give them type specific binding behaviour in blet

0:25 Raynes: danlarkin: Did I meet you at the conj? I forget. I think I did when I came down stairs on that first night, but I was pretty tired.

0:26 hiredman: the default is just identity, but you can see it extended there to deref derefable things when bound

0:27 danlarkin: Raynes: yeah, we met

0:28 Raynes: danlarkin: You were down there talking to ninjudd and lancepantz, weren't you?

0:29 danlarkin: yep

0:29 Raynes: That was pleasant night.

0:30 lambdalion: I suppose it would be better to say "The world is not perfect. Exceptions will not be handled. {lease call our help desk.'

0:30 * lambdalion has been thinking a lot about exceptions lately...

0:32 dnolen: hiredman: interesting, did you see antonio garrote clj-control? https://github.com/antoniogarrote/clj-control, monads, functors, monoids via protocols.

0:32 hiredman: I've not

0:38 lambdalion: it is very hard to abstract over unexpected conditions-

0:38 perhaps that should be called Tolstoy's dictum.

0:40 All succesful programs are essentially the same, but failing programs can fail for any number of reasons.

0:40 hiredman: ~#32

0:40 clojurebot: 32. Programmers are not to be measured by their ingenuity and their logic but by the completeness of their case analysis.

0:40 lambdalion: yes- but #33 should be.. you missed one.

0:41 hiredman: could be, you should check

0:41 lambdalion: ah, but #34 is also...

0:44 anywy, my point was that a lot of thought has gone into abstracting computationj- perhaps it is time to think about failures now.

0:45 Cause honestly I spend most of my time thinking about how my code could fail... it would be nice if I had some coherent way of thinking about that.

0:58 ppppaul: anyone here a fan of prolog?

0:59 lambdalion: I keep thinking I should do more prolog.. no sure if that counts.

0:59 ppppaul: (int lambdalion)

0:59 (inc lambdalion)

0:59 sexpbot: ⟹ 1

0:59 sthuebne_: to go along with lambdalion: I'm playing with Drools ATM

1:00 ppppaul: drooooooools?

1:00 lambdalion: I have a very naive view of prolog though

1:00 sthuebne_: ppppaul: yepp

1:01 lambdalion: For instance- all algorithms wind up being O(n^2) in prolog

1:01 ppppaul: um

1:02 sthuebne_: ppppaul: but not more than that yet: playing

1:02 ppppaul: so what if they are all O(n^2)???

1:03 being fast isn't always the most important thing

1:03 lambdalion: Hmm- well for some things that might be a problem, I guess ;).

1:05 Also I seem to recall that as an honors project I wrote a Prolog interpreter in Prolog that accepted "Maybe"- but my undergrad days are long ago now.

1:05 ppppaul: that sounds pretty badass

1:06 lambdalion: How badass that is depends a lot on what you expect the system to produce.

1:06 dnolen: ppppaul: I've been working through the Reasoned Schemer, interesting stuff, I wasn't really familiar w/ the concepts behind Prolog.

1:07 lambdalion: As I recall it was not very badass.

1:10 dnolen: I'm looking forward to Clojure getting a fast embedded mini-Prolog-ish thing. a lot of cool things could fall out of that.

1:10 seancorfield: ppppaul: i used to do quite a bit of prolog - nearly ended up running a team of prolog devs back in the UK :)

1:11 lambdalion: I do think that if I had to write a parser from scratch (assuming it fell into a normal language category) I would think about Prolog for it. That's unlikely though. You don;t have to write parsers from scratch much anymore.

1:11 ppppaul: there is work on a clojure-prolog

1:11 seancorfield: mini-kanren?

1:11 ppppaul: but, that'll be pretty slow

1:12 sthuebner: ppppaul: do have a pointer to that?

1:12 ppppaul: google 'clojure prolog' first hit

1:12 lambdalion: The quaestion is what would you do with it? Other than parsing?

1:12 seancorfield: brb... gotta change batteries...

1:12 ppppaul: http://blog.fogus.me/2009/01/15/on-lisp-clojure-prolog-pt-1/

1:13 i don't think it would be so hard to implement, seeing as though it's done in the famous SICP book

1:13 dnolen: lambdalion: type inference, predicate dispatch, datalog

1:13 ppppaul: you get a relations

1:14 lambdalion: hmm- I have never had a client come to me asking for a system with type inference...

1:14 perhaps I am sheltered

1:14 dnolen: lambdalion: type inference for Clojure

1:14 seancorfield: back on new batteries :)

1:14 dnolen: lambdalion: http://kanren.cvs.sourceforge.net/kanren/kanren/mini/type-inference.scm

1:14 sthuebner: ppppaul: I've seen fogus' post a while ago, yes

1:15 dnolen: lambdalion: predicate dispatch would make multimethods more open

1:15 sthuebner: there's a mini-kanren for clojure as well

1:15 seancorfield: https://github.com/jduey/mini-kanren

1:15 sthuebner: yepp

1:16 lambdalion: you shouldn't just spring scheme on neophytes like that

1:17 ppppaul: is mini kanren clojure done?

1:17 scheme is really nice, at least compared to CL

1:17 sthuebner: ppppaul: I didn't had the chance to play with it yet

1:18 dnolen: ppppaul: mini-kanren is only 300 LOC of scheme code, it's tiny. so it's yeah it's done in Clojure and it works.

1:18 ppppaul: coooooool

1:18 lambdalion: well i got a dialogue asking ("is scheme a lisp?")

1:18 ppppaul: i'll play around with it soon

1:18 scheme is

1:19 scheme is like lisp that washes it's hand after playing in the mud

1:19 hands*

1:19 it's also like a naked lisp

1:19 but, why wouldn't it be a lisp?

1:20 lambdalion: well, first, don't ask me...

1:20 and secondly because it is an alogol

1:20 err- algol

1:21 but trust me this is a serious schism in the lisp world...

1:21 ppppaul: maybe it's the SICP dude who calls programming magic and wears a robe and funny hat that make people question scheme

1:21 lambdalion: nah

1:21 all lisp programmers are at least that fruity

1:22 it is mostly about scope.

1:22 anyway, I happen to consider scheme a lisp...

1:23 ppppaul: lisp is not an algol?

1:23 lambdalion: no, lisp predates algol

1:24 ppppaul: oh

1:24 lambdalion: this is where the religios wars come from ;)

1:24 ppppaul: algol is based on lambda calc, so is scheme... i thought that lisp was in that pool too

1:25 lambdalion: err- how is algol based on lanmbda calculus in any meaningful way?

1:25 Anyway Lisp is the first language based on the lambda calculus...

1:25 ppppaul: maybe i miss-read the wikipedia article i'm reading on it now

1:25 ^_^

1:25 lambdalion: maybe so...

1:26 ppppaul: "As Peter Landin noted, the language Algol was the first language to seamlessly combine imperative effects with the (call-by-name) lambda calculus."

1:26 lambdalion: hmm...

1:26 that is a novel interpretation of Algol

1:27 ppppaul: oh well

1:27 lambdalion: I suppose that it must mean that Algol functions were first-class

1:27 in some sense

1:27 ppppaul: is algol limited in any ways that scheme is not?

1:28 lambdalion: it would be easier to list the ways that Algol is not limited, actually.

1:29 ppppaul: oh

1:31 lambdalion: however, scheme is seen as an Algol descendent because of the lack of dynamic scope, in some circles- well, it is more complicated than thatm but...

1:32 If you want to know why some people think scheme is not a lisp you should just search comp.lang.lisp, and ignore the bits that encourage you to commit suicide.

1:32 ppppaul: lol

1:32 lambdalion: not a joke there ;)

1:32 ppppaul: maybe i'll come by somethings from there while going through c2.com

1:33 lambdalion: meh- c2 is not a good lisp resource.

1:33 ppppaul: it's indeed not

1:33 lambdalion: smalltalk is what it is, but...

1:33 it is not lisp

1:34 ppppaul: there are a lot of lispy things and people on c2

1:34 lambdalion: there are

1:34 ppppaul: c2 is what got me into lisp

1:34 lambdalion: but it is a very smalltalky site nonetheless.

1:35 ppppaul: after reading about xml

1:35 i don't see any smalltalk stuff on the site

1:35 but, i haven't looked too hard

1:35 lambdalion: then you are not seeing well.

1:35 ppppaul: smallsight for smalltalk

1:35 lambdalion: The site is one big altar to Smalltalk.

1:35 ppppaul: wow

1:37 well, i tend to be attracted to the articles that aren't language specific... so all i see are object/rational people fighting

1:37 lambdalion: not that there's anythiong wrong with that...

1:37 ppppaul: no rational, relational

1:38 lambdalion: OK, well you have to learn to filter out the people who have purely commercial interests, there...

1:38 like "Rational"

1:39 ppppaul: both groups are idealists, thought the relational people more-so

1:39 lambdalion: sure... but Kent Beck really is a genius in some ways....

1:40 all the unit-testing stuff and the TDD stiff you see these days is from him, originally.

1:40 ppppaul: not saying he isn't... the articles that aren't down-t-earth are the ones i enjoy reading most, cus when people start talking about real things, the articles just turn to mud

1:40 lambdalion: And it was all on c2 many years before every faddist in the world took it over...

1:41 yeah, well I gave up on "Ward's Wiki" a few years ago...

1:41 ppppaul: every faddists? i think the site is pretty unknown, even in the comp-sci world... i don't know anyone in person who knows about it

1:41 lambdalion: too many people.

1:42 Right- but that''s like saying that /b is obscure even though lolcats come from there ;)

1:43 ppppaul: yeah... 4chan is pretty unkown...

1:43 lambdalion: Unit testing basically comes from Ward's Wiki.

1:43 ppppaul: even though moot was on TED...

1:43 lambdalion: For that matter, the mouse and the GUI come from Lisp.

1:44 ppppaul: really?

1:44 lambdalion: Yes.

1:44 See the demo of all demos.

1:44 ppppaul: i thought GUI came from xerox parc, via smalltalk.... or was that just the browser?

1:44 all the demos!

1:44 where are these demos?

1:44 lambdalion: But they got the idea from Doug Engelbert.

1:45 On youtube, I think.

1:45 ppppaul: i think i saw some black and white video of someone showing off a workstation of the future, with a mouse

1:45 lambdalion: Anyway Doug Englebert invented the GUI and the mouse in the late 60s

1:45 ppppaul: 2 mice

1:46 yeah

1:46 lambdalion: "the mother of all demos"

1:46 I guess is what you should search for

1:46 ppppaul: i saw that vid.... saw doug

1:46 that computer was so slow!

1:46 lambdalion: er- yeah ;)

1:47 ppppaul: could have done things faster with a pencil

1:47 lambdalion: hmm- some things at least

1:47 ppppaul: the double mouse was pretty cool

1:48 lambdalion: the point is that even Alan Kay had some inspiration.

1:48 From Lisp ;)

1:49 you people with access to Python, and Ruby, and perl...

1:49 ppppaul: yeah, alan kay was hugely inspired by lisp

1:49 lambdalion: have no idea what Lisp meant.

1:49 back then.

1:49 ppppaul: ruby seems nice... perl too... i'm not so happy with python, the code is long and skinny

1:49 i want fat code

1:50 lambdalion: OK, here's the thing- imagine that you have to allocate all storage at compile time.

1:50 ppppaul: i know a bit... just don't know what it was really like to be there...

1:51 lambdalion: Simon and Newell might predate McCarthy, but...

1:51 ppppaul: yeah, gotta build a mini OS to do anything special

1:51 lambdalion: imagine C without pointers.

1:51 ppppaul: wow

1:51 that's really weird

1:51 lambdalion: That's how shit was before Lisp.

1:52 ppppaul: lol

1:52 poor folk

1:52 just a step up from punch-cards

1:52 lambdalion: Unless you just said fck it and did assembler.

1:52 whoich is still the most flexible language around...

1:53 ppppaul: flexible, but at the cost of sanity

1:53 lambdalion: But yeah, when you make a linked list in C... thank lisp.

1:53 ppppaul: i know some dude who made his own OS in asm, with 3d GUI

1:53 he had let his sanity go far far away

1:53 lambdalion: hmm...

1:54 so when you program in python or ruby or whatever...

1:55 thank McCarthy that you get to program in something that benefited from Lisp.

1:55 ppppaul: i thank lisp by using it ;)

1:56 lambdalion: Cause you would be crying if you had to do what I am doing now for performance.. fpr everything.

1:56 ppppaul: wow

1:56 lambdalion: pppaul: hihg-five

1:57 ppppaul: i did performance openGL C++ stuff a while back.... don't want to go there

1:57 :D *high-five*

1:57 lambdalion: Hmm- I am doing stff right now where C++ is too much overhead

1:58 So I am writing splines and deformers in straight C.

1:58 ppppaul: i think i would prefer C to C++

1:59 i really lose productivity when i'm doing stuff in either

1:59 lambdalion: But it sucks because Ihave to have things like point_plus_point(p1, p2);

2:00 but.. it is fast

2:00 ppppaul: point_plus_point() seems simple compared to classes and templates in C__

2:00 C++

2:00 the complexity of C++ syntax is draining

2:01 lambdalion: right, but complex math involving points and vectors is hard to follow in that form.

2:02 ppppaul: hmmm... i think the math i used was pretty simple

2:03 lambdalion: i get (point_plus_vector(vectpr_times_star_wars_hero_(Chewbacca(1.0, 2.0, 3.0))

2:03 ppppaul: lol

2:03 lambdalion: Han(4.0, 5.9, 5.0)))

2:03 a;; the time..

2:03 and then I am like.. is that right?

2:04 ppppaul: well, that looks easy enough to read... in C++ i would be asking the 'am i right?' question while looking at the class skel code

2:05 lambdalion: ok, but in lisp I would ignire the parens entirely ;)

2:05 ppppaul: should this be public? should this be a subclass?

2:06 seancorfield: i spent eight years on the C++ committee... should i be ashamed?

2:06 ppppaul: lol

2:06 lambdalion: yes

2:06 ppppaul: C++ made a joke of functional programming

2:07 it turned OOP into a hell too

2:07 seancorfield: huh? C++ had nothing to do with functional programming

2:07 lambdalion: Look- I programmed C++ wjen there was no choice.

2:07 ppppaul: templates are functional

2:07 seancorfield: ok, the oop-hell, i'll buy

2:07 lambdalion: I had an SGI ONYX machine and I had to hit its hardware just right.

2:08 ppppaul: lol

2:08 lambdalion: Fcuk me.

2:08 Other than that though, why c++?

2:09 ppppaul: you needed to work for the smalltalk startups

2:09 lambdalion: NAH...

2:09 ppppaul: lol

2:09 lambdalion: what smalltalk startups?

2:10 ppppaul: the ones that made lots of money before 2000

2:10 the year smalltalk died

2:10 lambdalion: hmm- and turned into...

2:10 wjat?

2:10 ppppaul: turned into java startups

2:10 lambdalion: come on..

2:10 dnolen: speaking of C++

2:10 http://www.tutok.sk/fastgl/callback.html

2:10 lambdalion: Eclispse...

2:10 dnolen: by none other than Rich Hickey circa 1994

2:10 lambdalion: Fcuk me

2:11 You do ralize that Eclipse is the evoplution of a Smalltalk envotonment, right?

2:12 The whole thing turns out to be complicated.

2:13 ppppaul: that's one mighty button class/template

2:13 lambdalion: oh, it's worse than that.

2:13 ppppaul: eclipse and smalltalk feel like 2 completely different things

2:14 debugging in smalltalk is so much sweeter

2:14 lambdalion: well- things mutate.

2:14 ppppaul: gremlins?

2:15 lambdalion: but that's just because you are used to everythin looking like lisp or smalltalk now,

2:15 Raynes: LauJensen: Morning.

2:15 LauJensen: Morning Raynes

2:16 ppppaul: getting used to lispy code

2:16 wish i knew how to debug it

2:16 lambdalion: Imgine a worls in which no on invented the things that the inventors of lisp andsmalltalk invented..

2:17 good lord...

2:17 hard to imagine ;)

2:17 ppppaul: can't dismiss forth

2:18 lambdalion: Forth is interesting, but not necessary unless you care a lot about about a certain generataion of Apple machines.

2:18 ppppaul: i thought forth could run on anything

2:19 lambdalion: Anything can run on anything, given enough memory

2:19 computation is not chip specofic, really

2:19 ppppaul: i read somewhere that forth was the most ported language

2:20 lambdalion: maybe so- it is certainly easy to port

2:20 LauJensen: forth is THE low level language if you ask me

2:20 lambdalion: I would agree

2:20 ppppaul: cool

2:20 lambdalion: It is as simple as it can be

2:20 seancorfield: i implemented forth in prime assembler back in the early 80's

2:21 certainly one of the easier languages to implement

2:21 lambdalion: also, Forth has no syntax

2:21 Lisp has no syntax, at first...

2:22 seancorfield: well, it has _minimal_ syntax

2:22 lambdalion: Lisp, in its primeval form, is a lot like forth

2:22 ppppaul: simple languages are similar

2:23 lambdalion: right

2:23 ppppaul: so, lisp is at one extreme, regex at the other... what do you get when they mix?

2:24 actually, regex isn't a language

2:24 lambdalion: I think you have started from a false premise.

2:24 ppppaul: i dono what would be at the other extreme

2:25 i'm all about false premises

2:25 lambdalion: I thought so ;)

2:25 You son of a bitch...

2:26 I might hav3eto put your head in a vise one one of these days...

2:26 thank god i have a vise

2:27 ppppaul: never know when a vise will come in handy

2:27 lambdalion: well, it;s pretty certain to....

2:27 after all efventually someone will disagree with you.

2:28 ppppaul: i agree

2:28 lambdalion: wwwwwww

2:28 ppppaul: but just to avoid the vice

2:29 anyway, time for me to watch SICP sorcerers do prolog in scheme

2:30 lambdalion: Hmm- maybe they should figure out what happens if everyone who claimed somhiong..

2:31 err- nefvermind

2:31 I guuessthe government does this anyway.

2:36 So it turns out you aren't safe? Fuck me.

2:37 wwww

2:37 I swear to god.

2:37 zkim: hey all

2:38 lambdalion: hey

2:41 anything to say?

2:43 you ever rotate one vector onto another?

2:45 and then try to rotate aroung one of those vectors?

2:55 ppppaul: anyone want to improve on my compression code (reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))

3:00 LauJensen: ppppaul: use apply insead of reduce

3:00 ppppaul: reduce works, though

3:00 &(reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))

3:00 sexpbot: ⟹ "11A5Z6A1Z8A1Z"

3:01 ppppaul: &(apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))

3:01 sexpbot: ⟹ "11A5Z6A1Z8A1Z"

3:02 LauJensen: &(time (dotimes [_ 1e6] (apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*"

3:02 "AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))

3:02 sexpbot: java.lang.Exception: EOF while reading

3:02 LauJensen: &(time (dotimes [_ 1e6] (apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))

3:02 sexpbot: java.lang.Exception: EOF while reading string

3:02 LauJensen: &(reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))

3:02 sexpbot: ⟹ "9A5Z6A1Z8A1Z"

3:03 LauJensen: &(time (dotimes [_ 1e6] (reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))

3:03 sexpbot: Execution Timed Out!

3:03 LauJensen: &(time (dotimes [_ 1e6] (apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))

3:03 sexpbot: Execution Timed Out!

3:03 jartur: Stupid StackOverflow... I can't post more than one link before getting reputation. I can't be helpful. I can't gain reputation. Idiotic.

3:03 LauJensen: &(time (dotimes [_ 1e3] (apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))

3:03 sexpbot: ⟹ "Elapsed time: 13.896 msecs" nil

3:03 LauJensen: &(time (dotimes [_ 1e3] (reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))

3:03 sexpbot: ⟹ "Elapsed time: 14.765 msecs" nil

3:04 LauJensen: Nice. I think thanks for Internal Reduce they're now a lot closer than they used to be

3:04 ppppaul: cool

3:06 LauJensen: The thing is, reduce actually does linear accumulation, adding to the string on each pass. apply turns it into a huge (str x y z 1 2 3) type of statement

3:12 ppppaul: yup

3:12 anyone know if i can do pattern replacing via a function for the replace string

3:13 &(clojure.string/replace "The color is red" #"red" "blue")

3:13 sexpbot: ⟹ "The color is blue"

3:13 ppppaul: &(clojure.string/replace "The color is red" #"red" #(repeat 4 %))

3:13 sexpbot: java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.String

3:14 ppppaul: i want to get the match as an arg to the function, and build a string based on that

3:19 i sorta got it working

3:20 zkim: &(clojure-version)

3:20 sexpbot: ⟹ "1.2.0"

3:35 ppppaul: (defn extract [string] (replace string #"\d+[A-Z]"

3:35 #(let [c-data (re-seq #"\d+|[A-Z]" %)]

3:35 (join (repeat (Integer/parseInt (first c-data)) (second c-data))))))

3:35 that is the fancy extraction function with a replace function

4:08 eevar_: what's the story for clojure on google app engine these days? worth giving a shot, or should I just go with plain Java/Python?

4:14 AWizzArd: eevar_: did you hear of https://the-deadline.appspot.com/ ? This is running on AE, and it is written in Clojure.

4:15 esj: howdy y'all

4:15 eevar_: looks snappy enough. and i see they have a blog

4:17 bit concerned about startup overhead, guess I'll read the blog and see what issues they bring up

4:38 jjido: clojurebot: oracle

4:38 clojurebot: The sky is falling!

4:38 jjido: clojurebot: barnacle

4:38 clojurebot: Gabh mo leithscéal?

4:38 ppppaul: rules

4:38 #3

4:39 clojurebot: help

4:39 clojurebot: http://www.khanacademy.org/

4:39 ppppaul: lol

4:39 clojurebot: rule #34

4:39 clojurebot: Pardon?

4:39 ppppaul: rule #34

4:40 ~#31

4:40 clojurebot: 31. Simplicity does not precede complexity, but follows it.

4:40 ppppaul: ~#34

4:40 clojurebot: 34. The string is a stark data structure and everywhere it is passed there is much duplication of process. It is a perfect vehicle for hiding information.

4:41 ppppaul: whore string

4:41 ~#39

4:41 clojurebot: 39. Re graphics: A picture is worth 10K words - but only those to describe the picture. Hardly any sets of 10K words can be adequately described with pictures.

4:41 ppppaul: how many LOC is a picture worth?

4:43 ~199

4:43 clojurebot: Titim gan éirí ort.

4:43 ppppaul: ~#12342

4:43 clojurebot: It's greek to me.

4:43 ppppaul: ~#123

4:43 clojurebot: I don't understand.

4:43 ppppaul: ~#99

4:43 clojurebot: 99. In man-machine symbiosis, it is man who must adjust: The machines can't.

4:43 ppppaul: ~#98

4:43 clojurebot: 98. In computing, the mean time to failure keeps getting shorter.

4:43 ppppaul: ~#97

4:43 clojurebot: 97. When a professor insists computer science is X but not Y, have compassion for his graduate students.

4:44 ppppaul: is that a gender joke?

4:44 ~#96

4:44 clojurebot: 96. Computers don't introduce order anywhere as much as they expose opportunities.

4:44 ppppaul: ~#95

4:44 clojurebot: 95. Don't have good ideas if you aren't willing to be responsible for them.

4:44 ppppaul: ~#94

4:44 clojurebot: 94. Interfaces keep things tidy, but don't accelerate growth: Functions do.

4:44 ppppaul: ~#93

4:44 clojurebot: 93. When someone says "I want a programming language in which I need only say what I wish done," give him a lollipop.

4:45 ppppaul: ~#92

4:45 clojurebot: 92. The computer is the ultimate polluter: its feces are indistinguish- able from the food it produces.

4:45 ppppaul: um

4:45 woah

4:47 LauJensen: ppppaul: and the best thing is, clojurebot will also reply in private conversations

4:48 Raynes: So will sexpbot, for the record.

4:59 sandGorgon: I have a "defn -main " in my leiningen project. I have leiningen-run available ? How do I run it - do I still need to declare a :main

5:55 hsuh: when i pull a timestamp from sql, I get something looking like #<Timestamp 2010-11-11 08:39:54.180284>. is this a syntax for constructing java objects? (evaluating gives an error)

6:00 raek: no. it is what the .toString method of Timestamp returns

6:09 hsuh: raek: thanks

6:32 does this function already exists on core/contrib ? http://pastie.org/1289540

6:35 Chousuke: nope

6:35 Raynes: And if it did, it certainly wouldn't look like that. :p

6:37 fliebel: Top of the morning.

6:37 fliebel: Raynes: hi

6:37 raek: Raynes: why?

6:37 Raynes: raek: It was a snide remark about formatting. I was going to elaborate if asked, but I wasn't asked.

6:38 hsuh: yeah i posted an untabified version which ended on another pastie

6:38 Raynes: :p

6:38 hsuh: but if there is a more idiomatic way to write this please tell me

6:38 :)

6:39 Raynes: I'll point out that using get there is no different than just using funsmap and map as a function.

6:39 (get funsmap key) -> (funsmap key)

6:39 fliebel: Raynes: sexpbot has mail for me, but how do I get it?

6:39 Raynes: fliebel: It tells you how. You just type $mail. Here or in PM.

6:39 :p

6:39 hsuh: Raynes: cool, just like (:key map)

6:40 Raynes: Yup!

6:40 fliebel: Raynes: It didn;t tell me the prefix

6:40 Raynes: fliebel: Oh. The prefix is always $ with the live sexpbot. Except for special things like evaluation.

6:41 fliebel: Raynes: Okay, thanks. I'll finish the ping in a moment :)

6:41 Raynes: amalloy was telling me about your progress with it.

6:41 Fun stuff.

6:41 Chousuke: hsuh: I would do it something like this http://pastie.org/1289560

6:41 (didn't check parens)

6:42 fliebel: Raynes: Yea, fun stuff, he told me to put the 5 lines I have online, and he told me to rewrite those 5 lines.

6:42 Raynes: I concur, but I'd probably put it all on two lines, 'cause I'm a rebel.

6:42 hsuh: Chousuke: will study it, tks

6:42 Raynes: amalloy loves fixing code. Even code that isn't broken.

6:42 He's awesome that way.

6:44 fliebel: Raynes: Awesome, I want to see you put this in 2 lines :) But I'll finish my 5 lines first.

6:44 Raynes: :p

6:45 AWizzArd: fliebel: if you are after lines: just wrap your whole file into one (do ..) and you have a whole program written in just one line of code.

6:46 fliebel: harhar

6:47 hsuh: actually what i needed was a function that returned a function, but clojure has got partial :D oh the joy

6:48 fliebel: Raynes: What keywords does sexpbot put into :on-message? I guessed [irc bot channel nick message]

6:49 Raynes: Um, lots. What do you need? I can't think of everything right off hand.

6:50 fliebel: Raynes: just those would be fine, if message is not named msg or something.

6:50 Raynes: All of those should be right.

6:58 krl: fliebel: is there an overtone irc channel somewhere?

6:59 fliebel: krl: I don't know. There is a mailing lis though. And you could try my limited knowledge.

7:00 krl: i'm just getting started, but would be nice to have one, dpro asked here before as well

7:08 hsuh: i'm having a problem combining optional arguments with matching on number of functions args, for example, http://pastie.org/1289600 (because nil gets passed). is there a better solution than testing if the optional argument is nil ?

7:10 Chousuke: hsuh: nope

7:10 hsuh: (of course in this example because its a number I could just do (or b 0), but that doesnt apply to my original problem

7:10 Chousuke: But I don't think the definition of bar is very good style :/

7:11 hsuh: why not? better than foo that "is repetitive" no ?

7:11 Chousuke: no

7:11 foo is better; it's clearer and faster

7:12 hsuh: ok, then i'll remove foo's body (which is kinda big) to another function foo*, and do the matching on foo

7:12 Chousuke: hsuh: the other bodies can call foo too

7:13 a common idiom is to do (defn foo ([a] (foo a somedef)) ([a b] (lots-of-code)))

7:13 hsuh: oh, thats right, thats nice idiom

7:17 fliebel: Raynes: I think I'm done. It's running in #tempchan now.

7:25 Raynes: https://github.com/pepijndevos/sexpbot

7:28 hsuh: Chousuke: i cant make this simpler, unless i did something like (sql-query query identity), but i really want to pass only one argument to sql-query http://pastie.org/1289644

7:30 Chousuke: hsuh: what harm is there in passing identity?

7:30 ~def sql-query

7:30 hsuh: (hyp) sql-query executes much faster with only one argument

7:30 AWizzArd: Is there a sane mime-type for clojure objects? For JSON for example: application/json So, is there anything such as application/cljon ?

7:31 Chousuke: hsuh: then you're out of options.

7:31 hsuh: but you know, building queries from strings is a bad thing to od :P

7:31 do*

7:31 hsuh: hehe

7:32 what would you do ?

7:33 Raynes: &(System/currentTimeMillis)

7:33 sexpbot: ⟹ 1289478956351

7:33 Chousuke: use something that builds queries for you, taking care of quoting etc.

7:34 whatever you do, don't concatenate strings :P

7:34 hsuh: not even mine ?

7:34 Chousuke: unless you're 100% sure no user ever can affect those strings.

7:35 but even then it's a bit dirty.

7:36 hsuh: well i'm not sure there are any well tested layers on top of sql right now...there is briancarper oyako, but its in development

7:57 lenw: noob question - how do i add 2 maps together ?

7:57 Raynes: &(into {:a :b} {:c :d})

7:57 sexpbot: ⟹ {:a :b, :c :d}

7:57 lenw: cheers !

7:58 Raynes: :D!

8:04 lenw: another one : how to i transform {:one 1, :two [{:three 3, :four 4}]} into {:one 1, :three 3, :four 4}

8:05 getting myself horribly confused :)

8:07 gfrlog: ,(doc memoize)

8:07 clojurebot: "([f]); Returns a memoized version of a referentially transparent function. The memoized version of the function keeps a cache of the mapping from arguments to results and, when calls with the same a...

8:09 chouser: lenw: might be easier to build it differently in the first place

8:10 lenw: chouser: its the return from a webservice ... trying to clean it up

8:14 Tordmor: ,(let [m {:one 1, :two [{:three 3, :four 4}]}] (apply into m (filter seq? (values m))))

8:14 clojurebot: java.lang.Exception: Unable to resolve symbol: values in this context

8:14 gfrlog: is there anything in contrib or elsewhere that will memoize a function and let you set the size of the cache?

8:15 Tordmor: ,(let [m {:one 1, :two [{:three 3, :four 4}]}] (apply into m (filter seq? (vals m))))

8:15 clojurebot: java.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$into

8:15 Tordmor: ,(doc seq?)

8:15 clojurebot: "([x]); Return true if x implements ISeq"

8:16 Tordmor: *sigh* so much to learn

8:16 hsuh: anyone knows why you this sql prepared works ["select * from logs_internal where (log_id=?)" 1] but this one doesnt ["select * from ? where (log_id=1)" "logs_internal"] ?

8:17 s/you//

8:17 gfrlog: hsuh: I don't think you can do table names and column names; just values

8:17 chouser: lenw: hm. well, do you need it to be recursive?

8:17 joly: that's my impression as well

8:18 LauJensen: hsuh: Just use CQL @(where users (= {:log_id 1})) simple :)

8:18 lenw: chouser: thats where i am at yes

8:18 hsuh: what is that ?

8:18 LauJensen: clojurebot: clojureql?

8:18 clojurebot: clojureql is http://gitorious.org/clojureql and tracked @ http://clojureql.lighthouseapp.com/

8:18 LauJensen: argh

8:18 clojurebot: forget clojureql

8:18 clojurebot: clojureql is http://github.com/LauJensen/clojureql

8:18 LauJensen: https://github.com/LauJensen/clojureql

8:18 fliebel: gfrlog: I think you could copy memoize and add a watcher to the atom.

8:18 LauJensen: hsuh: almost 1.0

8:19 fliebel: gfrlog: And if Clojure had dynamic scope you could use memoize itself, but that wont work.

8:19 hsuh: LauJensen: cool. i'll try the change but i should write some tests before otherwise i'll face a world of pain

8:20 LauJensen: Yea, and like I said, its not quite 1.0, but the pace is pretty high these days

8:20 Tordmor: so, a vector does not a seq?

8:20 s/does/is/

8:20 chouser: Tordmor: right

8:21 hsuh: LauJensen: it should be pretty robust comparing to the rest of my code :P

8:21 LauJensen: hehe

8:22 AWizzArd: &(time (Thread/sleep 10000))

8:22 Tordmor: Ok, it's just that seq functions will call seq on their arguments so you can pass a vector.

8:22 gfrlog: fliebel: thanks

8:23 Tordmor: Is there a predicate to test whether some arg is seq-able?

8:23 LauJensen: AWizzArd: When the big release date?

8:23 fliebel: Tordmor: coll?

8:24 chouser: Tordmor: that's right. I don't think there's any such predicate, at least partially because it's basically never what you want.

8:24 string is seq-able

8:24 gfrlog: (seq? [])

8:24 ,(seq? [])

8:24 clojurebot: false

8:25 gfrlog: ,(seq? "oh well")

8:25 clojurebot: false

8:25 fliebel: &(coll [1 2 3])

8:25 Tordmor: ,(coll? [])

8:25 fliebel: &(coll? [1 2 3])

8:25 clojurebot: true

8:26 Tordmor: so for lenw's case I'd use coll?

8:28 chouser: Tordmor: yeah, probably. or vector?

8:28 lenw: i was at the vector? point

8:29 hsuh: LauJensen: have you seen cascalog syntax?

8:29 LauJensen: hsuh: yes

8:30 hsuh: LauJensen: its similar to cql, no?

8:30 Tordmor: I got this one: But how would I remove :two? ,(let [m {:one 1, :two [{:three 3, :four 4}]}] (apply into m (filter coll? (vals m))))

8:30 LauJensen: hsuh: Its..totally different

8:30 hsuh: LauJensen: i mean, in the sense that its a thin layer for accessing databases (not the synax)

8:31 or cql or not that thin? :)

8:31 chouser: I don't think cascalog is particularly thin

8:31 LauJensen: hsuh: CQL is the primitives from relational algebra, implemented to let you compose queries in weird and insane ways, acting on them pretty much like they were regular Clojure sets

8:32 https://github.com/LauJensen/clojureql/commit/0eef6b41936cc8422a4909f1e8b3c89fa559594c

8:32 hsuh: chouser: err, i mean like comparing to things that hide sql...

8:32 chouser: lenw: I have a solution, but it's pretty horrible.

8:32 LauJensen: In the commit message, look at the complexity of the generated statement, realize you couldnt do it better by hard, recognize that this is abstraction art work

8:32 s/by hard/by hand/

8:32 sexpbot: <LauJensen> In the commit message, look at the complexity of the generated statement, realize you couldnt do it better by hand, recognize that this is abstraction art work

8:33 lenw: chouser: what do you have - mine is horrible too

8:33 hsuh: LauJensen: :)

8:34 chouser: & (apply hash-map ((fn mapflat [m] (mapcat (fn [[k v]] (if (coll? v) (mapcat mapflat v) [k v])) m)) {:one 1, :two [{:three 3, :four 4}]}))

8:34 sexpbot: ⟹ {:one 1, :three 3, :four 4}

8:34 hsuh: LauJensen: what is "table {}" participation there? 

8:35 oh, nm

8:35 cemerick: LauJensen: "derrived"?

8:36 lenw: chouser: hey it works - thanks - will keep at it and myabe something will emerge - although i agree that if i could change the way the data is arriving it would be better

8:37 LauJensen: cemerick: Might not be the right word, it just fixes the name in the SELECT ... list, because once CQL sees an aggregate, it makes a subselect with an alias. So when the user thought it was called sales.col1, I need to make that sales-aggregate.col1 ...

8:37 cemerick: LauJensen: no, I was just pointing out the misspelling. Should be "derived".

8:37 LauJensen: cemerick: okay, please be more clear the next time

8:40 hsuh: Chousuke: that "transform-map" of yours is great

8:40 tks

8:41 totally feels like that joke on programmer evolution

8:44 chouser: AWizzArd: I've used application/x-clojure

8:57 & ((fn [m] (let [c? (comp coll? second)] (into {} (remove c? (tree-seq c? #(mapcat seq (second %)) [:x [m]]))))) {:one 1, :two [{:three 3, :four 4}]})

8:57 sexpbot: ⟹ {:one 1, :three 3, :four 4}

8:57 chouser: lenw: is that less horrible?

8:57 lenw: chouser: looks neater somehow - wrapping my head around it

9:03 AWizzArd: chouser: ok

9:03 I will probably do this then too.

9:09 belun: hi. i'm studying functions returning closures and got an example

9:10 (defn times-n [n] (let [x n] (fn [y] (* y x)))))

9:10 the questions is

9:10 why use a let there ?

9:10 opqdonut: no reason

9:11 Chousuke: Yeah, it's redundant

9:11 belun: couln't just have used n _

9:11 opqdonut: also: (def times-n [n] (partial * n))

9:11 but maybe that doesn't interest you

9:11 belun: partial is way nicer

9:11 even without it

9:12 could have used just n

9:12 right ?

9:12 Chousuke: yeah

9:12 function parameters are locals that can be closed over, just like let-bound ones.

9:16 cemerick: fogus_: these are Clojure tests, I presume?

9:16 fogus_: cemerick: WRT? My tweet?

9:16 cemerick: yes

9:18 fogus_: Yes, that is correct. I was able to fix it by removing the testSourceDirectory element

9:18 cemerick: fogus_: It's almost certainly a clojure-maven-plugin bug. This wasn't happening a month ago, IIRC.

9:18 In any case, a fix should be in the offing shortly.

9:19 fogus_: Sadly I do not recall if it happened before.

9:19 cemerick: Well, it shall not stand, regardless. :-)

9:28 * fogus_ Maven makes me feel dumb

9:30 djpowell: anybody had a go of my alternate diff implementation: https://gist.github.com/666114

9:32 i guess it behaves more like the set diff implementation, but preserving the order of the elements

9:33 chouser: djpowell: I saw you'd written it. Sound neat, though I haven't found a use yet for stuart's diff code either.

9:34 tonyl: morning

9:35 djpowell: chouser: yeah, it is a fun algorithm. would be interesting to know what stuart uses diff for. I'm assuming that it is mostly for interactive use

9:36 chouser: could be

9:36 djpowell: print-table is aweso... good btw.

9:37 chouser: btw - did you seem my fingertrees link yesterday?

9:37 * cemerick will proudly still use "awesome" within earshot of rhickey ;-)

9:37 chouser: I think a highly efficient diff (exploiting common subtrees in historically-related collections) could open fascinating opportunities for keeping different states in sync (across a network, on disk, etc.)

9:38 djpowell: I can't take any credit for print-table, beyond creating something else hated sufficiently to drive Stu to write it. :-)

9:38 djpowell: http://blog.sigfpe.com/2010/11/statistical-fingertrees.html

9:38 I tried it with clojure's finger-trees and it seems pretty cool

9:39 It lets you calculate running averages and statistics of sliding windows

9:39 chouser: that's great. I haven't had a real use for finger-trees yet either.

9:39 (reading now)

9:40 djpowell: if you've got code using clojure finger-trees for that, it might be worth posting somewhere.

9:40 djpowell: yeah - i'll dig it out later

9:41 chouser: people would be interested

9:41 djpowell: actually computing statistics of a sliding window is an interesting problem in clojure. lazy sequences don't really give you access to the most-recent 10 elements very easily

9:42 could be something where the .net rx style sequence/observable duality could be useful

9:42 chouser: hm, I see what you mean.

9:43 (parition 10 1 data) ?

9:46 djpowell: hmm, not really thought about it - I was thinking that with a lazy sequence you don't know that you are within 10 items of the end of what the sequence has currently generated - if the sequence hasn't actually finished being produced

9:52 finger-tree stats demo: https://gist.github.com/672592

9:54 fogus_: cemerick: So I'm using the parent pom and all looks good, except for deploy.

9:55 cemerick: fogus_: You're doing this in your local environment?

9:55 fogus_: What does that mean?

9:55 chouser: so what do you think of the finger-tree api?

9:56 fogus_: I am on my own computer. (?)

9:56 chouser: djpowell: perhaps having finger-tree take items instead of just meter args is a bit useless. Maybe everyone will end up using 'into' anyway?

9:56 cemerick: fogus_: Right. So, `mvn deploy` will only ever work on build.clojure.org. That's where the credentials to the OSS repo live.

9:56 djpowell: I like into

9:56 I always use (into [] ...) etc

9:56 fogus_: cemerick: Oh.

9:57 djpowell: I can never remember whether vec or vector is the one that takes varargs

9:57 chouser: :-)

9:57 cemerick: fogus_: For local testing, `mvn verify` will run everything that will be run prior to the actual deployment.

9:58 fogus_: FYI, if you're interested: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

9:58 djpowell: I guess into is nice cause you exit the realm of weird finger-tree stuff quite quickly

9:58 chouser: the short ones take collections (vec, set). long ones take varargs (vector, hash-set, sorted-set, hash-map, sorted-map, array-map, finger-tree)

9:59 fogus_: cemerick: Definitely interested.

9:59 djpowell: how does consl work on a double-list - what metric does the new item get?

9:59 chouser: djpowell: hm, yes, and finger-tree is just doing into anyway.

10:00 cemerick: fogus_: I just twiddled the unify job in hudson to have the right goals (clean deploy). Once the build is re-enabled (I assume you disabled it?), your artifacts will start flowing into OSS.

10:00 djpowell: do they go into negatives?

10:00 fogus_: cemerick: I did not disable (I don't think)

10:00 chouser: djpowell: double-counted-list? nth 0 would get you the newly consl'ed item, indexes for everything else scoot up one step.

10:01 cemerick: fogus_: OK; I can re-enable it if you want.

10:01 fogus_: cemerick: If you please.

10:01 cemerick: fogus_, chouser: are you guys admin on build.clojure.org as well?

10:01 fogus_: fogus_: I am not

10:01 GRRR

10:02 cemerick: fogus_: done; FYI, anyone can start builds at any time there

10:02 chouser: cemerick: I don't think so. I don't think I've ever even logged in there.

10:02 cemerick: so, if you're anxious to see things deployed, have at it :-)

10:03 fogus_: cemerick: I see it building now. Thank you!

10:04 cemerick: deployed already, even :-) https://oss.sonatype.org/content/repositories/snapshots//org/clojure/

10:05 fogus_: Beautiful.

10:23 fliebel: Raynes: ping

10:23 Raynes: fliebel: Your plugin is live and it's working excellently.

10:24 fliebel: yay!

10:24 Raynes: As you should now know.

10:24 :P

10:24 fliebel: It does :)

10:24 Raynes: :)

10:24 Excellent work. A welcome contribution.

10:24 fliebel: ty :)

10:24 Raynes: I'm off to sleep.

10:24 fliebel: night

10:28 eshira: anybody got lein-vimclojure (https://github.com/autre/lein-vimclojure) working? When I enter "$ lein vimclojure" I get a "That's not a task" error from lein

10:34 ah nevermind, I was using :dependencies instead of :dev-dependencies

10:36 esj: Noble Ones. In order to help me study Clojure I've started a little blog to subject myself to the glare of public humiliation. Its something like my notes to myself, but it might be interesting to others. I've kicked off with a couple of posts on logic programming in mini-Kanren (via Jim Duey's library) and an example of using that to solve a sudoku like puzzle. If anybody would like to mozey on over to www.boss-level.com I

10:36 be much obliged :)

10:39 eshira: esj, looks nice

10:39 tonyl: i'll check it it

10:39 esj: thanks guys.

10:42 eshira: So i'm new to Clojure and I'm trying to get a user's input from a prompt. I'm using read-line. Is this right?

10:42 Because in a lein repl, I don't know how to stop reading new lines from the user. In a vimclojure repl, it doesn't prompt me for anything.

10:53 cemerick: esj: FWIW, some explicit links to prior material would be good. e.g. if I had only landed on http://boss-level.com/?p=66 I would have no idea where & came from.

10:53 esj: cemerick: you got it !

10:53 dnolen: esj: very cool.

10:53 cemerick: boss-level.com is a helluva domain name, and the theme is great. Immediate goofy grin. :-D

10:53 esj: merci !

10:54 yeah, i feel like i've inadvertantly wandered into some boss level.... now gotta figure out how to survive it :)

10:54 dnolen: esj: the logic programming frame of mind is tough, but I'm finding it rewarding. it is dramatically different then imperative style thinking.

10:56 esj: dnolen: yeah, it turns my head inside out. I've literally just discovered it, so need to learn more about the underlying magics

10:56 will be hitting contrib.unify soon :)

10:56 dnolen: esj: yeah I just starting getting it right before the conj. I can't say enough good things about the Reasoned Schemer. It's the Little Schemer for miniKanren.

10:56 cemerick: esj: "independent (as of this very day)" -- where had you been working?

10:57 dnolen: getting into it.

10:57 esj: cemerick: I was a quant in a hedge fund.

10:57 but that got tired.

10:57 cemerick: So I've heard.

10:59 esj: cemerick: it was ridiculous: the fund was physically in the channel islands, so I was commuting from Cambridge to there every other week

10:59 un groovy.

10:59 decided to quit that gig, and try find my own way

11:00 arohner: any of the relevance dudes here? mycroft.clojure.org is down

11:00 esj: dnolen: we should talk - I'd really value your feedback on the site

11:00 right now I've gotta shoot - giving maths lessons :)

11:00 cemerick: esj: Yikes! Were they sited there for legal reasons? i.e. the islands are semi-autonomous IIRC?

11:01 dnolen: esj: oh wow, you're whole blog so far is on logic programming in Clojure nice!

11:07 esj: good blog, this going to be a great resource for the Clojurian Logic Programming enthusiasts

11:13 cemerick: arohner: Looks like wooby is here, but he's often idle.

11:47 sivajag: Hi all

11:49 replaca: Q: does anyone know where in the java "def" is implemented to save me rooting around?

11:49 kumarshantanu: sivajag: hi

11:50 sivajag: Hi kumarshantanu

11:51 tonyl: replaca: i've tried once to find it, but no dice. it overwhelmed me, but gotta try it again

11:52 sivajag: kumarshantanu: Did u get a chance to use "are" in testing

11:52 replaca: ahh, here we go Compiler.clj around line 325 in the checkout of master I have

11:52 chouser: replaca: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L325

11:52 oh, right. :-)

11:52 replaca: :)

11:52 kumarshantanu: sivajag: I deliberately avoid using 'are' because the line numbers are mangled

11:52 replaca: chouser: just a little too late...

11:53 kumarshantanu: sivajag: I use 'is' with helpers

11:53 sivajag: When u get a chance could u send me an example

11:53 replaca: chouser: The thing I'm seeing (in autodoc) is that the :file tag in the metadata is coming out different sometimes for defs in the same files

11:54 (sometimes absolute sometime relative to something)

11:54 kumarshantanu: sivajag: it is even documented -- http://richhickey.github.com/clojure/clojure.test-api.html#clojure.test/are

11:54 replaca: kumarshantanu: please use clojure.github.com/clojure....

11:55 the richhickey version is no longer kept up to date

11:55 kumarshantanu: s/richhickey/clojure/

11:55 sexpbot: <kumarshantanu> sivajag: it is even documented -- http://clojure.github.com/clojure/clojure.test-api.html#clojure.test/are

11:56 kumarshantanu: replace: thanks for pointing

11:56 s/replace/replaca/

11:56 sexpbot: <kumarshantanu> replaca: thanks for pointing

11:57 replaca: kumarshantanu: np!

12:03 chouser: oh, I know. I must be loading the files twice: once indirectly and then directly. The defmultis special case the redefinitions and keep their original metadata but the defns clobber it.

12:04 chouser: hmmm, that would seem to imply that we don't set source file consistent when we load a file from :require, etc.

12:04 off to confirm!

12:07 esj: dnolen: yeah, i'm studying it right now, so the blog is basically by notes :)

12:08 cemerick: the bosses liked the Channel for tax reasons, so moved us all there. Cripes !

12:09 kumarshantanu: Does anybody know of a repo where experimental work for clojure.xml is happening? (just in case)

12:10 cemerick: esj: that sounds pretty brutal. They look like nice places to visit, not necessarily an ideal work locale. :-)

12:10 replaca: kumarshantanu: I haven't heard of any such work

12:10 esj: cemerick: yeah, I refused to move, so had to commute, but that didn't work out long term.

12:11 cemerick: which is good, because now I'm full time on clojure... and motivated to find a way to use it feed myself :)

12:17 kumarshantanu: replaca: okay

13:02 cemerick: fogus_: FYI, you don't need the <repositories> tag in your pom at all.

13:03 and I think we can safely set <licenses> in our parent pom too

13:11 pppaul: yo crew

13:13 fliebel: esj: ping

13:13 esj: fliebel: yo

13:14 pppaul: should i use multi-methods to implement a FSM?

13:14 fliebel: esj: I'm reading your blog, nad besides the fact that it's awesome, you mixed "its" and "it's", I think. (If I'm allowed to say that as a non-native speaker) ;)

13:15 esj: fliebel: I'd be surprised if that's all I mixed :)

13:15 TakeV: How do I filter a collection by comparing it to a collection of items that I want filtered out?

13:15 pppaul: link?

13:15 clojurebot: your link is dead

13:15 pppaul: you mean a set?

13:15 fliebel: esj: It's the one thing I noticed so far :)

13:15 esj: fliebel: thank for reading it btw - hoping that I'll get feedback to help me come to understand this dark magic :)

13:16 TakeV: Yes, the collection to compare it to would be a set, but not necessarily the initial collections which I am filtering.

13:16 amalloy: &(remove #{4 5 7} (range 10))

13:16 sexpbot: ⟹ (0 1 2 3 6 8 9)

13:16 pppaul: (filter #( some #{1 2 3}))

13:16 amalloy's is better

13:17 fliebel: esj: The dark magic being logic programming? Have you ever looked at datalog?

13:17 pppaul: yeah i was in here talking about logic just a few hours ago

13:17 esj: fliebel: that's right. Not yet... but thanks for the pointer, I'll be checking it out ;)

13:18 pppaul: so, FSM via multi-methods. good idea or bad idea?

13:19 fliebel: FSM? Missed the first part :(

13:19 amalloy: pppaul: seems as reasonable approach as any

13:19 TakeV: Ah, that works. Thank you.

13:19 amalloy: fliebel: state machine

13:19 fliebel: amalloy: The kind of stuff regexes use?

13:20 amalloy: yeah, that's one well-known FSM

13:20 fliebel: ah, the f is for finite :)

13:20 amalloy: indeed

13:21 though technically regexes are more powerful than real FSMs, because they include some stack-like features

13:21 pppaul: more powerful leading to them not being real FSM?

13:22 chouser: I think most real regex engines are not FSMs. Once you include backtracking, it can't be an FSM, can it?

13:23 pppaul: maybe it could

13:23 it could be some hugely complicated FSM

13:23 fliebel: Maybe you could make a finite state machine by using logic programming? hrm… just a random thought.

13:27 pppaul: i wonder how that would look

13:27 Adamant: Regexs are not regular expressions

13:28 regular expressions can be done as FSM's

13:30 TakeV: And, if I have a long string, like a sentence, how to I break it up into a vector that is composed of the words in that sentence?

13:30 defn: Do I understand correctly that M-x slime no longer works, you must have a swank-clojure project and connect to it with slime-connect?

13:31 I miss being able to pull up M-x slime by itself

13:31 chouser: & (re-seq #"\S+" "This (will be) broken up! Into Words!")

13:31 sexpbot: ⟹ ("This" "(will" "be)" "broken" "up!" "Into" "Words!")

13:32 tonyl: &(vec (.split "This (will be) broken up! Into Words!" " "))

13:32 sexpbot: ⟹ ["This" "(will" "be)" "broken" "up!" "Into" "Words!"]

13:33 drewr: defn: no, you can still frob slime-lisp-implementations

13:33 jimduey: fliebel: Here's one way to do an FSM using the continuation monad.

13:33 http://intensivesystems.net/tutorials/cont_m.html

13:33 TakeV: Thank you again.

13:33 pppaul: you can use clojure.string/split too

13:33 technomancy: defn: M-x durendal-jack-in: http://github.com/technomancy/durendal nice M-x slime replacement

13:34 pppaul: oh, too late

13:34 drewr: defn: eg, http://p.draines.com/1289500575036bea209de.txt

13:34 pppaul: i am a monad newb

13:34 drewr: but durendal is better if you use lein

13:36 pppaul: jimuey, *reading* ...

13:41 jimduey: oops. The reference to FSM is at the bottom of

13:41 http://intensivesystems.net/tutorials/cont_m_web.html

13:42 The downside of doing FSM's like this is they can't be minimized using Hopcroft's algorithm.

13:42 I did some work in that direction a long time ago and haven't written it up yet.

13:44 pppaul: minimized how? jimduey

13:58 jimduey: For a deterministic FSM, minimize the number states that will have the same behavior

13:58 http://en.wikipedia.org/wiki/State_machine

14:28 Phantom_Hoover: What do the [] in Clojure actually signify?

14:29 LaPingvino: Phantom_Hoover: [] is a vector

14:29 Phantom_Hoover: LaPingvino, not a list?

14:30 LaPingvino: () is lists, you use them for functions, [] is a vector, working like a list for data and way faster and {} is a hashmap

14:30 Phantom_Hoover: you can use it for everything you use lists for in CL, but it is not implemented as a linked list

14:30 it's faster

14:30 Phantom_Hoover: Ah, like CL's vectors.

14:31 cemerick: weren't CL vectors essentially managed arrays?

14:31 e.g. ArrayList-esque?

14:31 Phantom_Hoover: Not sure.

14:32 You can make them appendable etc. with keywords to make-array.

14:32 LaPingvino: Phantom_Hoover: no, CL vectors are restricted to one type of content

14:32 Phantom_Hoover: LaPingvino, really?

14:32 LaPingvino: Phantom_Hoover: Clojure vectors are essentially free-form

14:32 LaPingvino: yes

14:32 like #(1 2 3 4 5)

14:33 Phantom_Hoover: FWIW, element-type is t by default, which IIRC is the global type.

14:33 #(3 'a #\a) works perfectly.

14:33 LaPingvino: I thought the defaults were different

14:34 but not sure :)

14:34 Phantom_Hoover: It's certainly not for me.

14:35 scottj: are lein checkouts a 1.4 feature or in 1.3.1?

14:35 the checkouts dir that is

14:36 Phantom_Hoover: PUSH doesn't work, but that's because it's just (setf list (cons thing list))

14:36 amalloy: Phantom_Hoover: clojure vectors have different performance characteristics than in CL though

14:36 cemerick: amalloy: …which is what I was getting at re: managed arrays

14:37 Chousuke: aren't the vector literals read-time only too?

14:37 amalloy: cemerick: heh, sorry. guess i didn't scroll up far enough

14:37 technomancy: scottj: they've been around a while

14:37 Chousuke: so if you do #(a b c) you'll get a vector of three symbols.

14:38 Phantom_Hoover: Not necessarily.

14:38 #( is a read macro, so it's not that certain.

14:40 But you're right.

14:47 LauJensen: Has anyone written something that supports connections pools yet ?

14:47 amalloy: Phantom_Hoover: basically, clojure vectors have O(1) random access (like in CL), O(1) append at the *end*, and slow (not sure exactly big-O) insert anywhere but the end

14:49 LauJensen: someone was being really sad about connection pools yesterday. i wasn't here for all of it, but you might find something useful in the n01se logs

14:49 LauJensen: amalloy: thanks, but their sadness I will turn to joy with CQL :) Likely in version 2.0, in 1.0 I'll just supports persistent connections

14:50 (though patches are welcome)

14:50 (beautiful patches)

14:50 amalloy: heh, yes, i did plug CQL for you

14:50 ah, it was jartur. search for him if you check the logs

14:50 cemerick: amalloy: it's O(log32 n) on vector get, nth, and assoc IIRC

14:51 LauJensen: amalloy: You plugged it?

14:51 amalloy: LauJensen: as in advertise? does that idiom not translate well?

14:51 LauJensen: ah right. Yes Im sure it does, I just misunderstood in the context of patches

14:52 amalloy: cemerick: which is O(n) with a constant factor as low as like 5, for even extremely large n, simply because the size of an integer is limited

14:53 er, O(1)

14:53 cemerick: amalloy: Sure; people get picky though ;-)

14:53 amalloy: yeah. sometimes i'm one of them

14:53 * cemerick has spent too much time in…um…precise company ;-) ;-)

14:54 amalloy: cemerick: precise but not accurate is a common disease

14:55 cemerick: amalloy: I usually suffer from the opposite affliction.

14:55 fliebel: hrm, cake is doing the ssl thing again :(

14:57 mtyaka: LauJensen: Not sure if it is relevant, but I remember this library being announced on the mailing list: http://bitbucket.org/kumarshantanu/clj-dbcp/src

14:57 LauJensen: mtyaka: Thanks! I'll check it out

15:00 Phantom_Hoover: amalloy, wait, O(1) random access and O(1) appends?

15:00 I can't see how that would possibly work without black OS magic.

15:00 Chousuke: they're O(log32 n)

15:01 if you're talking about clojure vectors

15:01 I wonder where I put the data structure chart

15:01 LauJensen: Chousuke: I was just looking for it myself

15:01 cemerick: Phantom_Hoover: This is a good writeup of the internals of PersistentVector http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/

15:01 Chousuke: [D[Dhttp://www.innoq.com/blog/st/2010/04/clojure_performance_guarantees.html

15:02 amalloy: Phantom_Hoover: see cemerick's nitpicks

15:02 Chousuke: (the headers are off by one :P)

15:02 at least in my browser

15:02 cemerick: damn, I'm a nitpicker :-P

15:03 I much prefer being the nitpickee.

15:04 fliebel: Chousuke: What's the log32 thing?

15:05 Chousuke: fliebel: it's the "maximum number of hops" you need for the operation.

15:05 Phantom_Hoover: Nitpick: O(kn) is equivalent to O(n), so it's just O(ln n).

15:06 Chousuke: Phantom_Hoover: but O(ln n) is misleading since it's much faster :P

15:06 Phantom_Hoover: ...No it's not.

15:06 fliebel: Chousuke: I know that I think… So O(n) takes 1 time for every item, and O(1) is constant, but what is log32?

15:06 Phantom_Hoover: It's the exact same.

15:06 Chousuke: O(log32 n) that is.

15:07 Phantom_Hoover: That's like saying O(5) is slower than O(1).

15:07 Chousuke: Phantom_Hoover: in this case the big-O notation kind of fails

15:07 Phantom_Hoover: If you want to indicate the actual time taken, big O notation isn't helpful.

15:07 Chousuke: needing at most ln n hops is not as good a guarantee as needing at most log32 n hops

15:07 Phantom_Hoover: That's not even what it means.

15:07 Chousuke: which is ultimately why I had the table use english instead of O notation

15:08 Phantom_Hoover: It means it takes at most k ln n hops.

15:08 Chousuke: yes I know

15:08 cemerick: fliebel: (log32 n) gives you the number of levels in the vector's tree given a vector of n items

15:08 so a get or assoc requires that many discrete operations to reach any location in the tree

15:08 Chousuke: Shouldn't have mentioned big O notation in the first place

15:08 it's just confusing

15:09 Phantom_Hoover: It's a measure of algorithmic complexity, not time taken, which is the source of the confusion.

15:09 amalloy: Phantom_Hoover: in a mathematical perfect world, O(log32 n) would be "the same" as O(log2 n)

15:09 Phantom_Hoover: amalloy, yes, I just said that.

15:10 In fact, it *is*.

15:10 Chousuke: it is the same, but not when you execute the algorithm on a machine ;P

15:10 which is kind of the thing here.

15:11 Phantom_Hoover: It is *in terms of big O notation*.

15:11 Chousuke: yes

15:11 Phantom_Hoover: The two are *exactly equivalent*.

15:11 fliebel: cemerick: Thanks. I need to remember some more math...

15:11 Phantom_Hoover: *Even in the real world.*

15:11 amalloy: Phantom_Hoover: but in practice, there's only space for 2 billion elements in an array, so the constant factor necessary to make log32 be as small as 1 is very small

15:11 Chousuke: which makes the O notation not so useful in this case.

15:11 fliebel: hrm: [cake] connection to bake jvm is taking a long time...

15:12 Phantom_Hoover: amalloy, what?

15:12 cemerick: fliebel: heh, or you can just say to yourself "it's damn fast", and leave the math-lawyering to amalloy, Phantom_Hoover, and Chousuke ;-)

15:12 Chousuke: :P

15:12 Phantom_Hoover: O(log_32 n) is not equivalent to O(1) ever, so I assume you mean something else.

15:13 Chousuke: Phantom_Hoover: he means the execution time of the algorithms are almost equivalent

15:13 forget the big-O notation for now, it's not useful here

15:13 fliebel: cemerick: But I ought to know what log does at the very least.

15:13 Phantom_Hoover: fliebel, a^b=c, ln_a c = b.

15:13 amalloy: f(x) = O(g(x)) iff there exist constants M,N such that f(x) < M*g(x) for all x > N

15:13 Phantom_Hoover: s/ln/log/

15:13 sexpbot: <Phantom_Hoover> fliebel, a^b=c, log_a c = b.

15:14 amalloy: Phantom_Hoover: and there is no such M to make log32 slower than constant, because the size of integers in the problem domain (computers) is limited

15:14 Phantom_Hoover: amalloy, oh, that's what you meant.

15:15 amalloy: Phantom_Hoover: sorry if i wasn't clear enough

15:15 Phantom_Hoover: We were talking about O(log32 n) and O(ln n), so I'm not really sure why you mentioned it, but anyway...

15:16 fliebel: Phantom_Hoover: So log is like the square root of an exponent?

15:17 Phantom_Hoover: fliebel, logs, roots and exponents are all just rearrangements of one another, yes.

15:18 Related by a^b=c, root(b, c) = a and log_a c = b.

15:18 fliebel: great

15:22 alexyk: if you send-off a function to an agent, does it refer to the agent as *agent*? Here's a continually running function from mailindex off github: http://paste.pocoo.org/show/290176/ -- does it call itself on the same agent in the end?

15:24 cemerick: alexyk: yet, but it's not really "calling itself" there -- it's a completely separate send-off

15:24 alexyk: cemerick: right, is it an idiom?

15:25 cemerick: for a continuously-running cycle on an agent, sure

15:25 alexyk: kk

15:25 cemerick: it doesn't look like there's a way to cancel the next send though, which is probably a future bug source

15:26 alexyk: cemerick: it's supposed to index one's mail; I guess it's just killed with the process

15:26 cemerick: *shrug* sure

15:26 * cemerick is surprised people are doing local mail indexing with clojure?

15:27 alexyk: cemerick: dunno, github brought it :)

15:27 https://github.com/marktriggs/mailindex

15:28 cemerick: huh, lookit that

15:30 alexyk: cemerick: I'm curioius how you'd terminate gracefully... you'd need to query something, e.g. existence of a file...

15:30 cemerick: alexyk: well, it looks like there's a telnet command interface. *shrug*

15:31 really, I didn't know that people had local mail indexing pains anymore

15:31 * alexyk observes cemerick's bulging shrugging muscles

15:32 cemerick: alexyk: I guess I start doing that when I fall outside the target user profile for something :-)

15:32 talios: hey cemerick

15:32 cemerick: talios: Hey, my favorite kiwi. :-)

15:32 alexyk: cemerick: I think it's a guy's clojure learning project using Lucene, not much more than that. Sonian can sleep restfully :)

15:33 cemerick: heh, well, Sonian isn't exactly local mail indexing AFAIK

15:33 talios: cemerick: I see I broke testing :)

15:33 * cemerick hopes that "kiwi" isn't derogatory to actual NZ'ers ;-)

15:33 talios: not at all

15:33 hobbit maybe tho :)

15:34 cemerick: talios: The natives are restless. http://twitter.com/#!/fogus/status/2717209939943424 ;-)

15:34 talios: I don't think I have big enough stones to call anyone a "hobbit" ;-)

15:35 dnm: fogus_: Ping.

15:36 manoj: ping

15:38 xkb: hi! I'm trying to add a jar to a local corp. repository, and include it as a dependency in Lein.. However, it doesnt find the dep.

15:38 the jar I added is as http://os.xebia.com/maven2/ and is a Last.fm binding

15:39 any idea what might be wrong? I cant access server logfiles :(

15:39 cemerick: xkb: you've added the local repo in your project.clj?

15:40 xkb: cemerick: yep as a :repository

15:40 manoj: I am a newbie to clojure and have a question on lexical scoping especially when "let" is used in a recursive function call

15:40 xkb: cemerick: yep as a :repositories even

15:40 manoj: The example of the memoize function on clojure.org has a let declaration which binds the "mem" variable to atom{}. My question is wouldn't this cause the "mem" variable to be re-bind to a new atom {} in a recursive function call?

15:41 xkb: cemerick: and I added the dep like so: [net.roarsoftware/last.fm-bindings "1.0"]

15:42 Chousuke: manoj: hmmh

15:42 raek: manoj: the function 'memoize' is only called once

15:42 Chousuke: manoj: memoize doesn't work well with recursive functions

15:42 raek: manoj: you use it like this: (defn foo ...) (def foo (memoize foo))

15:42 cemerick: xkb: seems reasonable to me, but I'm not the one to ask for lein help :-) Try technomancy if he's around?

15:42 Chousuke: manoj: at least if you use recur

15:43 xkb: cemerick: will check thx :)

15:45 raek: manoj: the fn returned by memoize will "remember" the mem atom from the memoize call, and use that every time the returned fn is invoked

15:47 alexyk: where does it say in clojure docs that *agent* is set to the running agent in a function executing on it?

15:47 manoj: Thanks raek I think that explains it! I did not realize that it is actually returning a function and not the calculation, thanks for pointing it out!

15:47 chouser: (doc *agent*)

15:47 clojurebot: "; The agent currently running an action on this thread, else nil"

15:48 alexyk: ok

15:49 why "; ..."?

15:49 hiredman: (doc +)

15:49 clojurebot: "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0."

15:49 chouser: that's a clojurebot question

15:49 alexyk: ah

15:51 amalloy: &(doc *agent*)

15:51 sexpbot: ⟹ "; The agent currently running an action on this thread, else nil"

15:52 amalloy: the ; must be in the actual docstring

15:52 &(meta #'*agent*)

15:52 sexpbot: ⟹ {:added "1.0", :tag clojure.lang.Agent, :ns #<Namespace clojure.core>, :name *agent*, :doc "The agent currently running an action on this thread, else nil"}

15:52 xkb: duh, fixed my lein problem.. Should mind typo's more :P

15:53 forgot to postfix the jar with the version..

16:16 slyrus: technomancy: that's some serious blogspam!

16:30 nickik: Why does form-dot-clj not work on appengine?

16:49 LauJensen: ClojureQL roadmap 1.0 is now public, slip me a note if I left something out which is important to you: https://github.com/LauJensen/clojureql/wiki

16:52 ohpauleez: LauJensen: Awesome! I'm definitely interested to see how the redesign is coming

16:52 LauJensen: ohpauleez: So much is done already, check out demo.clj :)

16:54 technomancy: slyrus: where?

16:55 dnolen: LauJensen: interesting deref triggers the query to execute?

16:56 LauJensen: dnolen: yea

16:56 dnolen: deref, and all functions ending with !

16:57 dnolen: LauJensen: any particular benefit from the deref syntax? is just to denote side-effects?

16:57 LauJensen: dnolen: It gives cleaner looking code with clear semantics, thats all

16:58 dnolen: LauJensen: interesting, so it's easy to get the SQL statement from the CQL exprs?

16:58 LauJensen: dnolen: everything is a RTable record, just call compile on it

16:58 (compile (table db :users [:*])) => "SELECT * FROM users"

16:59 dnolen: LauJensen: very cool.

17:00 LauJensen: dnolen: yea its really turning out quite well, though I cant take all the credit, ninjudd has been instrumental in sparing on ideas and designs

17:05 ninjudd: deref also lets you construct and query and pass it around without fetching the results.

17:16 dnolen: ninjudd: so how do you run the query? so deref is about compiling the query representation to a string?

17:17 LauJensen: dnolen: compile compiles, its called by deref. deref executes.

17:21 ninjudd: dnolen: right

17:21 compile is mainly useful for seeing what sql is going to be executed

17:22 and testing

18:07 slyrus: technomancy: well, it was here: http://technomancy.us/142 but I guess you found it

19:12 Derander: if I have a collection and want to run a block of code w/ side effects once for each element, should I use loop/recur?

19:13 amalloy: doseq

19:14 Derander: ## (doseq [x (range 5)] (println x))

19:14 sexpbot: ⟹ 0 1 2 3 4 nil

19:15 Derander: amalloy: thank you sir

19:23 quizme: what does * mean? as in (list * or fn* ?

19:23 technomancy: quizme: means it's an internal support function

19:24 quizme: technomancy oh ok, so it's just a naming convention?

19:24 Raynes: It means that it's related to list, but not exactly list. It's sometimes used to indicate implementation details of the function/macro of the same name without the star.

19:25 technomancy worded that better.

19:30 quizme: Yes.

19:33 technomancy: basically if you didn't write foo, you probably shouldn't call foo*

19:33 but sometimes foo* can't be private because macroexpansions use it

19:54 sivajag: Is there any good resource

19:54 amalloy: sivajag: no. resources are all evil

19:54 sivajag: on how to move from imperative paradigm to functional paradigm

19:54 I am planning on writing a blog about it

19:54 was looking for some resources

19:55 amalloy: i will use term reference instead of resources :)

19:55 amalloy: sivajag: http://blip.tv/file/982823 maybe?

19:55 i haven't watched it, but it's by rich and it's called Clojure for Java Programmers, so it must be what you want

19:56 sivajag: I have seen some of it

19:56 it is mostly about techniques

19:56 I am looking for something more generic

19:56 I am sure it is there :) I need to collect it one place

19:56 amalloy: sivajag: sicp?

19:57 it's not really "for iterative people", but it's a really powerful intro to functional programming

19:57 sivajag: sure I will check it out amalloy

19:57 http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html

20:12 pppaul: sicp!

20:13 amalloy: pppaul: i like to pronounce it as sick-pea

20:13 pppaul: sivajag SICP is what you want (there are videos you can download of a lecture 25 years ago)

20:14 i'm sick of peas

20:15 sivajag: http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/

20:15 i really like how that in the course they rarely use a computer

20:19 sivajag: pppaul: ThanksI will check it

20:25 pppaul: monad sounds like a dirty word

20:34 dnolen: interesting report on an STM for a Prolog-like language, http://www.mercury.csse.unimelb.edu.au/information/papers/bmellor_hons.pdf

20:37 crazy goldmine of papers on that site.

20:49 pppaul: are continuations like streams?

20:49 amalloy: pppaul: not in any way i can think of

20:50 pppaul: i'm reading about them now, and they look a bit weird

20:50 amalloy: they're basically callbacks, right?

20:50 tomoj: a continuation is like a first-class execution context

20:50 well, could be

20:50 Raynes: $8ball Are continuations like streams?

20:50 sexpbot: Raynes: Very doubtful.

20:50 Raynes: He has spoken.

20:50 tomoj: some are like 1/2-class I guess

20:51 pppaul: $8ball True?

20:51 sexpbot: pppaul: It is certain.

21:17 pppaul: what's so special about monads?

21:18 ^_^

21:18 * tonyl ^^^ good question, i need to know too

21:18 quizme: technomancy, raynes: thanks.

21:20 pppaul: monads just a way to hide complexity with nested functions?

21:20 is there something more to them? can they help me with my sex life?

21:21 samx: if you'll get to know monads, you won't have any chance of a sex life

21:22 pppaul: will monads provide me with enough money to delegate my sex-life to professionals?

21:23 samx: sure, just watch out you won't get any monoids back

21:25 but monads give you protection, so you won't have to worry about continuations

21:25 pppaul: i haven't worried about continuations in the past by not using them

21:27 Adamant: pppaul: I think remotely possessing the body of Charlie Sheen, a la "Being John Malkovich", is a swifter and surer route to said situation.

21:27 you just have to make movie premises work in the real life

21:27 pppaul: that has been my dreams since i burst from the womb

21:28 $8ball 8balls?

21:28 sexpbot: pppaul: Without a doubt.

21:34 pppaul: wooooooooooooooooooooooah monads are pretty cool!

21:34 tonyl: pppaul what are you reading?

21:34 pppaul: they are injected with monad enlightenment

21:34 http://intensivesystems.net/tutorials/cont_m.html

21:35 tonyl: cool, thanks for the link

21:36 pppaul: can you make an infinite loop with a monad?

22:48 amalloy: how does dosync work with lazy seqs? eg, ##(let [var (ref [2 3 4])] (doseq [x (dosync (map inc @var))] (println x)))

22:48 sexpbot: ⟹ 3 4 5 nil

22:49 amalloy: does dosync return a lazy seq that actually gets forced in the doseq, *outside* the dosync?

22:56 chouser: yep

22:56 amalloy: chouser: thanks. it turns out that's not a problem for me, but it was a little head-bending to realize

23:07 technomancy: http://p.hagelb.org/garbagemen.gif

23:07 oops, wrong window

23:46 KirinDave: Are there any incentives for using defstruct anymore?

23:46 quizme: kirindave, what's the replacement for it ?

23:46 amalloy: defrecord?

23:46 quizme: amalloy oh yeah duh

23:46 KirinDave: quizme: Defrecord seems like it does most of what defstruct was meant to do, and then much more.

23:47 quizme: i was thinking there was another iteration of that

Logging service provided by n01se.net