#clojure logs

2010-11-11

00:00coldheadwait why?
00:00hiredmanwell, 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
00:01technomancyjust need to convince cyanogen to move to the EU and the future of Android is safe.
00:01seancorfieldi bet the vast majority of java programmers haven't even heard the news
00:01hiredmantechnomancy: not true, companies will stop making android phones
00:02technomancyHTC is taiwanese
00:02hiredmanthe software alone is not enough, and you are deluding yourself if you believe manufactures will make the hardware for it without google
00:02lambdalionover the patent issues?
00:02seancorfieldi 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)
00:02seancorfieldscale that up ten fold and you've got the same thing in the java world
00:03coldheadben nadel is one of the 1000, right?
00:03technomancyhiredman: well development would slow, but I don't see HTC switching to windows 7 or anything
00:03lambdalionfacebook is still PHP
00:03seancorfieldi mean, how many java devs actually attend conferences or write blogs or even _read_ blogs? :)
00:03seancorfieldyeah, coldhead, ben nadel is one of the 1,000
00:03coldheadoh good
00:03lambdalionA friend of mine, who is very sharp just went to esty.
00:04dnolenseancorfield: not allowed, they are held hostage in rhickey's Pods.
00:04lambdalionI asked him "why is your site still PHP?"
00:04lambdalionhe responded "You ant to rewrite it>?"
00:04lambdalionerr- "You want to rewrite it?
00:05hiredmantechnomancy: they switched to android fast enough, they can switch to something else
00:05technomancyeast asia was ahead of the US for years in mobile technology; the worst oracle could do is bring back that situation
00:05seancorfieldlambdalion: if you want a blog or a CMS, PHP is (unfortunately) the default choice
00:06lambdalionunfortunately facebook and etsy started like that...
00:06seancorfieldtechnomancy: yeah, when i moved to the US from the UK i was shocked at how primitive the phones were over here ('99)
00:06lambdalionand it is so hard to rewrite that they still are like that.
00:06hiredmantechnomancy: people say that, but I find they phones to be "different" not actually better
00:06hiredmane.g. just as much walled gardens
00:07hiredmanin many cases even worse about that kind of thing
00:07technomancyhiredman: right; what I mean is the US has caught up now, but 10 years ago we were way behind.
00:07lambdalionThat PHP is the dominant web language is prioof that programming is still not a profession.
00:07lambdalion*proof
00:07jk_are phones in europe locked down by the carrier though?
00:07jk_i thought that wasn't the case
00:07jk_just swap the sim
00:08danlarkinlambdalion: that is a stupid inflammatory statement that is impossible to back up with actual reasoned thought
00:08lambdalionreally?
00:08lambdalionwhy?
00:08clojurebothttp://clojure.org/rationale
00:09sthuebne_jk_: not in all cases, but we have sim-locks. yes
00:09lambdalionare there no objective standards that languages can be measured by?
00:09sthuebne_don't ask me for the ratio, though
00:09danlarkinlambdalion: PHP being a dominant web language and programming being a profession are independent of one another
00:10ppppaulphp is like pcbs?
00:10danlarkinit is a logical fallacy to infer a relationship between them
00:10lambdalionbut doesn;t the fact that PHP is the dominant language make you ask a few things about the profession?
00:11danlarkinone has nothing, or at least very little, to do with the other
00:11jk_danlarkin: i think he's just using inductive logic to say that the art is not dominated by professionals
00:11lambdalionI disagree...
00:11danlarkinI regret involving myself in this
00:11jk_lol
00:12ppppaulyou can not undo this
00:12ppppaulnot even with vim
00:12lambdalionwell, if you would rather not hear why i disagree I donlt have to tell you.
00:12hiredmandanlarkin: this is why you need to let go and /ignore
00:13danlarkinin other news, it's raining out, so that must be what's keeping the earthquakes away
00:14ppppaulearthquakes and volcanos!
00:16jk_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
00:17lambdalionhmm...
00:18jk_but i have to admit that a big earthquake could ruin the whoe game. i hope it rains
00:18hiredmanjk_: if you read the rationale one of the whole reasons for clojure's existence is wanting a lisp that embraces the host system
00:18jk_hiredman: but rich himself has a .NET version too right?
00:18ppppaulhad
00:18hiredmanno
00:18lambdalionI think the question might be "how well does calling java compose"
00:18hiredmanhe does not
00:18jk_ok, it's dead?
00:19hiredmanhe had an earlier lisp on .net
00:19hiredmanand super early versions of clojure ran on both
00:19hiredmanand someone else has done a port of clojure to .net
00:19jk_ok, i see. i thought there were plans to revive that
00:19lambdalionand how well can that be abstracted so that clojure code can move from VM to VM, though that is a ways off...
00:19jk_maybe it's that someone else that i was reading about
00:19hiredmanbut Rich himself said that ClojureCLR is not Clojure
00:20RaynesSince 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.
00:20ppppaul&(#(% %
00:20ppppaulawwww
00:20danlarkinraynes: take your time
00:20danlarkinohhhh burn!!!!
00:20hiredmanClojureCLR should be as seamless to use on the clr as clojure is on the jvm
00:20Raynesdanlarkin: I love you too, man.
00:20lambdalionBut it is annoying when destructive functions fail to retiurn values.
00:21hiredmanlambdalion: all is suffering
00:21lambdalionindeed
00:21jk_lambdalion: what about exceptions? don't they cause a pain?
00:22lambdalionthe world is not perfect. Exception sare.
00:22jk_are perfect?
00:22lambdalionno, just are.
00:23ppppaulcomputers aren't supposed to make mistakes
00:23jk_what is the sound of one exception throwing?
00:23jk_probably *crash*
00:23lambdalioncomputers rarely make mistakes. But you often make mistakes.
00:23technomancyhas anyone used leiningen test selectors on a nontrivial project?
00:24hiredmanso I was taking out the trash and thinking about monads and had an idea https://gist.github.com/672059
00:24lambdalionThis is the Tao.
00:24ppppaulwoah
00:24ppppaultrashy monads?
00:25hiredmanso by extending the protocol Bindable to different objects you can give them type specific binding behaviour in blet
00:25Raynesdanlarkin: 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.
00:26hiredmanthe default is just identity, but you can see it extended there to deref derefable things when bound
00:27danlarkinRaynes: yeah, we met
00:28Raynesdanlarkin: You were down there talking to ninjudd and lancepantz, weren't you?
00:29danlarkinyep
00:29RaynesThat was pleasant night.
00:30lambdalionI suppose it would be better to say "The world is not perfect. Exceptions will not be handled. {lease call our help desk.'
00:32dnolenhiredman: interesting, did you see antonio garrote clj-control? https://github.com/antoniogarrote/clj-control, monads, functors, monoids via protocols.
00:32hiredmanI've not
00:38lambdalionit is very hard to abstract over unexpected conditions-
00:38lambdalionperhaps that should be called Tolstoy's dictum.
00:40lambdalionAll succesful programs are essentially the same, but failing programs can fail for any number of reasons.
00:40hiredman~#32
00:40clojurebot32. Programmers are not to be measured by their ingenuity and their logic but by the completeness of their case analysis.
00:40lambdalionyes- but #33 should be.. you missed one.
00:41hiredmancould be, you should check
00:41lambdalionah, but #34 is also...
00:44lambdalionanywy, my point was that a lot of thought has gone into abstracting computationj- perhaps it is time to think about failures now.
00:45lambdalionCause 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.
00:58ppppaulanyone here a fan of prolog?
00:59lambdalionI keep thinking I should do more prolog.. no sure if that counts.
00:59ppppaul(int lambdalion)
00:59ppppaul(inc lambdalion)
00:59sexpbot⟹ 1
00:59sthuebne_to go along with lambdalion: I'm playing with Drools ATM
01:00ppppauldrooooooools?
01:00lambdalionI have a very naive view of prolog though
01:00sthuebne_ppppaul: yepp
01:01lambdalionFor instance- all algorithms wind up being O(n^2) in prolog
01:01ppppaulum
01:02sthuebne_ppppaul: but not more than that yet: playing
01:02ppppaulso what if they are all O(n^2)???
01:03ppppaulbeing fast isn't always the most important thing
01:03lambdalionHmm- well for some things that might be a problem, I guess ;).
01:05lambdalionAlso 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.
01:05ppppaulthat sounds pretty badass
01:06lambdalionHow badass that is depends a lot on what you expect the system to produce.
01:06dnolenppppaul: I've been working through the Reasoned Schemer, interesting stuff, I wasn't really familiar w/ the concepts behind Prolog.
01:07lambdalionAs I recall it was not very badass.
01:10dnolenI'm looking forward to Clojure getting a fast embedded mini-Prolog-ish thing. a lot of cool things could fall out of that.
01:10seancorfieldppppaul: i used to do quite a bit of prolog - nearly ended up running a team of prolog devs back in the UK :)
01:11lambdalionI 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.
01:11ppppaulthere is work on a clojure-prolog
01:11seancorfieldmini-kanren?
01:11ppppaulbut, that'll be pretty slow
01:12sthuebnerppppaul: do have a pointer to that?
01:12ppppaulgoogle 'clojure prolog' first hit
01:12lambdalionThe quaestion is what would you do with it? Other than parsing?
01:12seancorfieldbrb... gotta change batteries...
01:12ppppaulhttp://blog.fogus.me/2009/01/15/on-lisp-clojure-prolog-pt-1/
01:13ppppauli don't think it would be so hard to implement, seeing as though it's done in the famous SICP book
01:13dnolenlambdalion: type inference, predicate dispatch, datalog
01:13ppppaulyou get a relations
01:14lambdalionhmm- I have never had a client come to me asking for a system with type inference...
01:14lambdalionperhaps I am sheltered
01:14dnolenlambdalion: type inference for Clojure
01:14seancorfieldback on new batteries :)
01:14dnolenlambdalion: http://kanren.cvs.sourceforge.net/kanren/kanren/mini/type-inference.scm
01:14sthuebnerppppaul: I've seen fogus' post a while ago, yes
01:15dnolenlambdalion: predicate dispatch would make multimethods more open
01:15sthuebnerthere's a mini-kanren for clojure as well
01:15seancorfieldhttps://github.com/jduey/mini-kanren
01:15sthuebneryepp
01:16lambdalionyou shouldn't just spring scheme on neophytes like that
01:17ppppaulis mini kanren clojure done?
01:17ppppaulscheme is really nice, at least compared to CL
01:17sthuebnerppppaul: I didn't had the chance to play with it yet
01:18dnolenppppaul: mini-kanren is only 300 LOC of scheme code, it's tiny. so it's yeah it's done in Clojure and it works.
01:18ppppaulcoooooool
01:18lambdalionwell i got a dialogue asking ("is scheme a lisp?")
01:18ppppauli'll play around with it soon
01:18ppppaulscheme is
01:19ppppaulscheme is like lisp that washes it's hand after playing in the mud
01:19ppppaulhands*
01:19ppppaulit's also like a naked lisp
01:19ppppaulbut, why wouldn't it be a lisp?
01:20lambdalionwell, first, don't ask me...
01:20lambdalionand secondly because it is an alogol
01:20lambdalionerr- algol
01:21lambdalionbut trust me this is a serious schism in the lisp world...
01:21ppppaulmaybe it's the SICP dude who calls programming magic and wears a robe and funny hat that make people question scheme
01:21lambdalionnah
01:21lambdalionall lisp programmers are at least that fruity
01:22lambdalionit is mostly about scope.
01:22lambdalionanyway, I happen to consider scheme a lisp...
01:23ppppaullisp is not an algol?
01:23lambdalionno, lisp predates algol
01:24ppppauloh
01:24lambdalionthis is where the religios wars come from ;)
01:24ppppaulalgol is based on lambda calc, so is scheme... i thought that lisp was in that pool too
01:25lambdalionerr- how is algol based on lanmbda calculus in any meaningful way?
01:25lambdalionAnyway Lisp is the first language based on the lambda calculus...
01:25ppppaulmaybe i miss-read the wikipedia article i'm reading on it now
01:25ppppaul^_^
01:25lambdalionmaybe so...
01:26ppppaul"As Peter Landin noted, the language Algol was the first language to seamlessly combine imperative effects with the (call-by-name) lambda calculus."
01:26lambdalionhmm...
01:26lambdalionthat is a novel interpretation of Algol
01:27ppppauloh well
01:27lambdalionI suppose that it must mean that Algol functions were first-class
01:27lambdalionin some sense
01:27ppppaulis algol limited in any ways that scheme is not?
01:28lambdalionit would be easier to list the ways that Algol is not limited, actually.
01:29ppppauloh
01:31lambdalionhowever, 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...
01:32lambdalionIf 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.
01:32ppppaullol
01:32lambdalionnot a joke there ;)
01:32ppppaulmaybe i'll come by somethings from there while going through c2.com
01:33lambdalionmeh- c2 is not a good lisp resource.
01:33ppppaulit's indeed not
01:33lambdalionsmalltalk is what it is, but...
01:33lambdalionit is not lisp
01:34ppppaulthere are a lot of lispy things and people on c2
01:34lambdalionthere are
01:34ppppaulc2 is what got me into lisp
01:34lambdalionbut it is a very smalltalky site nonetheless.
01:35ppppaulafter reading about xml
01:35ppppauli don't see any smalltalk stuff on the site
01:35ppppaulbut, i haven't looked too hard
01:35lambdalionthen you are not seeing well.
01:35ppppaulsmallsight for smalltalk
01:35lambdalionThe site is one big altar to Smalltalk.
01:35ppppaulwow
01:37ppppaulwell, i tend to be attracted to the articles that aren't language specific... so all i see are object/rational people fighting
01:37lambdalionnot that there's anythiong wrong with that...
01:37ppppaulno rational, relational
01:38lambdalionOK, well you have to learn to filter out the people who have purely commercial interests, there...
01:38lambdalionlike "Rational"
01:39ppppaulboth groups are idealists, thought the relational people more-so
01:39lambdalionsure... but Kent Beck really is a genius in some ways....
01:40lambdalionall the unit-testing stuff and the TDD stiff you see these days is from him, originally.
01:40ppppaulnot 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
01:40lambdalionAnd it was all on c2 many years before every faddist in the world took it over...
01:41lambdalionyeah, well I gave up on "Ward's Wiki" a few years ago...
01:41ppppaulevery 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
01:41lambdaliontoo many people.
01:42lambdalionRight- but that''s like saying that /b is obscure even though lolcats come from there ;)
01:43ppppaulyeah... 4chan is pretty unkown...
01:43lambdalionUnit testing basically comes from Ward's Wiki.
01:43ppppauleven though moot was on TED...
01:43lambdalionFor that matter, the mouse and the GUI come from Lisp.
01:44ppppaulreally?
01:44lambdalionYes.
01:44lambdalionSee the demo of all demos.
01:44ppppauli thought GUI came from xerox parc, via smalltalk.... or was that just the browser?
01:44ppppaulall the demos!
01:44ppppaulwhere are these demos?
01:44lambdalionBut they got the idea from Doug Engelbert.
01:45lambdalionOn youtube, I think.
01:45ppppauli think i saw some black and white video of someone showing off a workstation of the future, with a mouse
01:45lambdalionAnyway Doug Englebert invented the GUI and the mouse in the late 60s
01:45ppppaul2 mice
01:46ppppaulyeah
01:46lambdalion"the mother of all demos"
01:46lambdalionI guess is what you should search for
01:46ppppauli saw that vid.... saw doug
01:46ppppaulthat computer was so slow!
01:46lambdalioner- yeah ;)
01:47ppppaulcould have done things faster with a pencil
01:47lambdalionhmm- some things at least
01:47ppppaulthe double mouse was pretty cool
01:48lambdalionthe point is that even Alan Kay had some inspiration.
01:48lambdalionFrom Lisp ;)
01:49lambdalionyou people with access to Python, and Ruby, and perl...
01:49ppppaulyeah, alan kay was hugely inspired by lisp
01:49lambdalionhave no idea what Lisp meant.
01:49lambdalionback then.
01:49ppppaulruby seems nice... perl too... i'm not so happy with python, the code is long and skinny
01:49ppppauli want fat code
01:50lambdalionOK, here's the thing- imagine that you have to allocate all storage at compile time.
01:50ppppauli know a bit... just don't know what it was really like to be there...
01:51lambdalionSimon and Newell might predate McCarthy, but...
01:51ppppaulyeah, gotta build a mini OS to do anything special
01:51lambdalionimagine C without pointers.
01:51ppppaulwow
01:51ppppaulthat's really weird
01:51lambdalionThat's how shit was before Lisp.
01:52ppppaullol
01:52ppppaulpoor folk
01:52ppppauljust a step up from punch-cards
01:52lambdalionUnless you just said fck it and did assembler.
01:52lambdalionwhoich is still the most flexible language around...
01:53ppppaulflexible, but at the cost of sanity
01:53lambdalionBut yeah, when you make a linked list in C... thank lisp.
01:53ppppauli know some dude who made his own OS in asm, with 3d GUI
01:53ppppaulhe had let his sanity go far far away
01:53lambdalionhmm...
01:54lambdalionso when you program in python or ruby or whatever...
01:55lambdalionthank McCarthy that you get to program in something that benefited from Lisp.
01:55ppppauli thank lisp by using it ;)
01:56lambdalionCause you would be crying if you had to do what I am doing now for performance.. fpr everything.
01:56ppppaulwow
01:56lambdalionpppaul: hihg-five
01:57ppppauli did performance openGL C++ stuff a while back.... don't want to go there
01:57ppppaul:D *high-five*
01:57lambdalionHmm- I am doing stff right now where C++ is too much overhead
01:58lambdalionSo I am writing splines and deformers in straight C.
01:58ppppauli think i would prefer C to C++
01:59ppppauli really lose productivity when i'm doing stuff in either
01:59lambdalionBut it sucks because Ihave to have things like point_plus_point(p1, p2);
02:00lambdalionbut.. it is fast
02:00ppppaulpoint_plus_point() seems simple compared to classes and templates in C__
02:00ppppaulC++
02:00ppppaulthe complexity of C++ syntax is draining
02:01lambdalionright, but complex math involving points and vectors is hard to follow in that form.
02:02ppppaulhmmm... i think the math i used was pretty simple
02:03lambdalioni get (point_plus_vector(vectpr_times_star_wars_hero_(Chewbacca(1.0, 2.0, 3.0))
02:03ppppaullol
02:03lambdalionHan(4.0, 5.9, 5.0)))
02:03lambdaliona;; the time..
02:03lambdalionand then I am like.. is that right?
02:04ppppaulwell, that looks easy enough to read... in C++ i would be asking the 'am i right?' question while looking at the class skel code
02:05lambdalionok, but in lisp I would ignire the parens entirely ;)
02:05ppppaulshould this be public? should this be a subclass?
02:06seancorfieldi spent eight years on the C++ committee... should i be ashamed?
02:06ppppaullol
02:06lambdalionyes
02:06ppppaulC++ made a joke of functional programming
02:07ppppaulit turned OOP into a hell too
02:07seancorfieldhuh? C++ had nothing to do with functional programming
02:07lambdalionLook- I programmed C++ wjen there was no choice.
02:07ppppaultemplates are functional
02:07seancorfieldok, the oop-hell, i'll buy
02:07lambdalionI had an SGI ONYX machine and I had to hit its hardware just right.
02:08ppppaullol
02:08lambdalionFcuk me.
02:08lambdalionOther than that though, why c++?
02:09ppppaulyou needed to work for the smalltalk startups
02:09lambdalionNAH...
02:09ppppaullol
02:09lambdalionwhat smalltalk startups?
02:10ppppaulthe ones that made lots of money before 2000
02:10ppppaulthe year smalltalk died
02:10lambdalionhmm- and turned into...
02:10lambdalionwjat?
02:10ppppaulturned into java startups
02:10lambdalioncome on..
02:10dnolenspeaking of C++
02:10dnolenhttp://www.tutok.sk/fastgl/callback.html
02:10lambdalionEclispse...
02:10dnolenby none other than Rich Hickey circa 1994
02:10lambdalionFcuk me
02:11lambdalionYou do ralize that Eclipse is the evoplution of a Smalltalk envotonment, right?
02:12lambdalionThe whole thing turns out to be complicated.
02:13ppppaulthat's one mighty button class/template
02:13lambdalionoh, it's worse than that.
02:13ppppauleclipse and smalltalk feel like 2 completely different things
02:14ppppauldebugging in smalltalk is so much sweeter
02:14lambdalionwell- things mutate.
02:14ppppaulgremlins?
02:15lambdalionbut that's just because you are used to everythin looking like lisp or smalltalk now,
02:15RaynesLauJensen: Morning.
02:15LauJensenMorning Raynes
02:16ppppaulgetting used to lispy code
02:16ppppaulwish i knew how to debug it
02:16lambdalionImgine a worls in which no on invented the things that the inventors of lisp andsmalltalk invented..
02:17lambdaliongood lord...
02:17lambdalionhard to imagine ;)
02:17ppppaulcan't dismiss forth
02:18lambdalionForth is interesting, but not necessary unless you care a lot about about a certain generataion of Apple machines.
02:18ppppauli thought forth could run on anything
02:19lambdalionAnything can run on anything, given enough memory
02:19lambdalioncomputation is not chip specofic, really
02:19ppppauli read somewhere that forth was the most ported language
02:20lambdalionmaybe so- it is certainly easy to port
02:20LauJensenforth is THE low level language if you ask me
02:20lambdalionI would agree
02:20ppppaulcool
02:20lambdalionIt is as simple as it can be
02:20seancorfieldi implemented forth in prime assembler back in the early 80's
02:21seancorfieldcertainly one of the easier languages to implement
02:21lambdalionalso, Forth has no syntax
02:21lambdalionLisp has no syntax, at first...
02:22seancorfieldwell, it has _minimal_ syntax
02:22lambdalionLisp, in its primeval form, is a lot like forth
02:22ppppaulsimple languages are similar
02:23lambdalionright
02:23ppppaulso, lisp is at one extreme, regex at the other... what do you get when they mix?
02:24ppppaulactually, regex isn't a language
02:24lambdalionI think you have started from a false premise.
02:24ppppauli dono what would be at the other extreme
02:25ppppauli'm all about false premises
02:25lambdalionI thought so ;)
02:25lambdalionYou son of a bitch...
02:26lambdalionI might hav3eto put your head in a vise one one of these days...
02:26lambdalionthank god i have a vise
02:27ppppaulnever know when a vise will come in handy
02:27lambdalionwell, it;s pretty certain to....
02:27lambdalionafter all efventually someone will disagree with you.
02:28ppppauli agree
02:28lambdalionwwwwwww
02:28ppppaulbut just to avoid the vice
02:29ppppaulanyway, time for me to watch SICP sorcerers do prolog in scheme
02:30lambdalionHmm- maybe they should figure out what happens if everyone who claimed somhiong..
02:31lambdalionerr- nefvermind
02:31lambdalionI guuessthe government does this anyway.
02:36lambdalionSo it turns out you aren't safe? Fuck me.
02:37lambdalionwwww
02:37lambdalionI swear to god.
02:37zkimhey all
02:38lambdalionhey
02:41lambdalionanything to say?
02:43lambdalionyou ever rotate one vector onto another?
02:45lambdalionand then try to rotate aroung one of those vectors?
02:55ppppaulanyone want to improve on my compression code (reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))
03:00LauJensenppppaul: use apply insead of reduce
03:00ppppaulreduce works, though
03:00ppppaul&(reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))
03:00sexpbot⟹ "11A5Z6A1Z8A1Z"
03:01ppppaul&(apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))
03:01sexpbot⟹ "11A5Z6A1Z8A1Z"
03:02LauJensen&(time (dotimes [_ 1e6] (apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*"
03:02LauJensen "AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))
03:02sexpbotjava.lang.Exception: EOF while reading
03:02LauJensen&(time (dotimes [_ 1e6] (apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" AAAAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))
03:02sexpbotjava.lang.Exception: EOF while reading string
03:02LauJensen&(reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))
03:02sexpbot⟹ "9A5Z6A1Z8A1Z"
03:03LauJensen&(time (dotimes [_ 1e6] (reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))
03:03sexpbotExecution Timed Out!
03:03LauJensen&(time (dotimes [_ 1e6] (apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))
03:03sexpbotExecution Timed Out!
03:03jarturStupid StackOverflow... I can't post more than one link before getting reputation. I can't be helpful. I can't gain reputation. Idiotic.
03:03LauJensen&(time (dotimes [_ 1e3] (apply str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))
03:03sexpbot⟹ "Elapsed time: 13.896 msecs" nil
03:03LauJensen&(time (dotimes [_ 1e3] (reduce str (map #(str (count (first %))(second %)) (re-seq #"([A-Z])\1*" "AAAAAAAAAZZZZZAAAAAAZAAAAAAAAZ")))))
03:03sexpbot⟹ "Elapsed time: 14.765 msecs" nil
03:04LauJensenNice. I think thanks for Internal Reduce they're now a lot closer than they used to be
03:04ppppaulcool
03:06LauJensenThe 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
03:12ppppaulyup
03:12ppppaulanyone know if i can do pattern replacing via a function for the replace string
03:13ppppaul&(clojure.string/replace "The color is red" #"red" "blue")
03:13sexpbot⟹ "The color is blue"
03:13ppppaul&(clojure.string/replace "The color is red" #"red" #(repeat 4 %))
03:13sexpbotjava.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.String
03:14ppppauli want to get the match as an arg to the function, and build a string based on that
03:19ppppauli sorta got it working
03:20zkim&(clojure-version)
03:20sexpbot⟹ "1.2.0"
03:35ppppaul(defn extract [string] (replace string #"\d+[A-Z]"
03:35ppppaul #(let [c-data (re-seq #"\d+|[A-Z]" %)]
03:35ppppaul (join (repeat (Integer/parseInt (first c-data)) (second c-data))))))
03:35ppppaulthat is the fancy extraction function with a replace function
04:08eevar_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?
04:14AWizzArdeevar_: did you hear of https://the-deadline.appspot.com/ ? This is running on AE, and it is written in Clojure.
04:15esjhowdy y'all
04:15eevar_looks snappy enough. and i see they have a blog
04:17eevar_bit concerned about startup overhead, guess I'll read the blog and see what issues they bring up
04:38jjidoclojurebot: oracle
04:38clojurebotThe sky is falling!
04:38jjidoclojurebot: barnacle
04:38clojurebotGabh mo leithscéal?
04:38ppppaulrules
04:38ppppaul#3
04:39ppppaulclojurebot: help
04:39clojurebothttp://www.khanacademy.org/
04:39ppppaullol
04:39ppppaulclojurebot: rule #34
04:39clojurebotPardon?
04:39ppppaulrule #34
04:40ppppaul~#31
04:40clojurebot31. Simplicity does not precede complexity, but follows it.
04:40ppppaul~#34
04:40clojurebot34. 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.
04:41ppppaulwhore string
04:41ppppaul~#39
04:41clojurebot39. 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.
04:41ppppaulhow many LOC is a picture worth?
04:43ppppaul~199
04:43clojurebotTitim gan éirí ort.
04:43ppppaul~#12342
04:43clojurebotIt's greek to me.
04:43ppppaul~#123
04:43clojurebotI don't understand.
04:43ppppaul~#99
04:43clojurebot99. In man-machine symbiosis, it is man who must adjust: The machines can't.
04:43ppppaul~#98
04:43clojurebot98. In computing, the mean time to failure keeps getting shorter.
04:43ppppaul~#97
04:43clojurebot97. When a professor insists computer science is X but not Y, have compassion for his graduate students.
04:44ppppaulis that a gender joke?
04:44ppppaul~#96
04:44clojurebot96. Computers don't introduce order anywhere as much as they expose opportunities.
04:44ppppaul~#95
04:44clojurebot95. Don't have good ideas if you aren't willing to be responsible for them.
04:44ppppaul~#94
04:44clojurebot94. Interfaces keep things tidy, but don't accelerate growth: Functions do.
04:44ppppaul~#93
04:44clojurebot93. When someone says "I want a programming language in which I need only say what I wish done," give him a lollipop.
04:45ppppaul~#92
04:45clojurebot92. The computer is the ultimate polluter: its feces are indistinguish- able from the food it produces.
04:45ppppaulum
04:45ppppaulwoah
04:47LauJensenppppaul: and the best thing is, clojurebot will also reply in private conversations
04:48RaynesSo will sexpbot, for the record.
04:59sandGorgonI 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
05:55hsuhwhen 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)
06:00raekno. it is what the .toString method of Timestamp returns
06:09hsuhraek: thanks
06:32hsuhdoes this function already exists on core/contrib ? http://pastie.org/1289540
06:35Chousukenope
06:35RaynesAnd if it did, it certainly wouldn't look like that. :p
06:37Raynesfliebel: Top of the morning.
06:37fliebelRaynes: hi
06:37raekRaynes: why?
06:37Raynesraek: It was a snide remark about formatting. I was going to elaborate if asked, but I wasn't asked.
06:38hsuhyeah i posted an untabified version which ended on another pastie
06:38Raynes:p
06:38hsuhbut if there is a more idiomatic way to write this please tell me
06:38hsuh:)
06:39RaynesI'll point out that using get there is no different than just using funsmap and map as a function.
06:39Raynes(get funsmap key) -> (funsmap key)
06:39fliebelRaynes: sexpbot has mail for me, but how do I get it?
06:39Raynesfliebel: It tells you how. You just type $mail. Here or in PM.
06:39Raynes:p
06:39hsuhRaynes: cool, just like (:key map)
06:40RaynesYup!
06:40fliebelRaynes: It didn;t tell me the prefix
06:40Raynesfliebel: Oh. The prefix is always $ with the live sexpbot. Except for special things like evaluation.
06:41fliebelRaynes: Okay, thanks. I'll finish the ping in a moment :)
06:41Raynesamalloy was telling me about your progress with it.
06:41RaynesFun stuff.
06:41Chousukehsuh: I would do it something like this http://pastie.org/1289560
06:41Chousuke(didn't check parens)
06:42fliebelRaynes: Yea, fun stuff, he told me to put the 5 lines I have online, and he told me to rewrite those 5 lines.
06:42RaynesI concur, but I'd probably put it all on two lines, 'cause I'm a rebel.
06:42hsuhChousuke: will study it, tks
06:42Raynesamalloy loves fixing code. Even code that isn't broken.
06:42RaynesHe's awesome that way.
06:44fliebelRaynes: Awesome, I want to see you put this in 2 lines :) But I'll finish my 5 lines first.
06:44Raynes:p
06:45AWizzArdfliebel: 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.
06:46fliebelharhar
06:47hsuhactually what i needed was a function that returned a function, but clojure has got partial :D oh the joy
06:48fliebelRaynes: What keywords does sexpbot put into :on-message? I guessed [irc bot channel nick message]
06:49RaynesUm, lots. What do you need? I can't think of everything right off hand.
06:50fliebelRaynes: just those would be fine, if message is not named msg or something.
06:50RaynesAll of those should be right.
06:58krlfliebel: is there an overtone irc channel somewhere?
06:59fliebelkrl: I don't know. There is a mailing lis though. And you could try my limited knowledge.
07:00krli'm just getting started, but would be nice to have one, dpro asked here before as well
07:08hsuhi'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 ?
07:10Chousukehsuh: nope
07:10hsuh(of course in this example because its a number I could just do (or b 0), but that doesnt apply to my original problem
07:10ChousukeBut I don't think the definition of bar is very good style :/
07:11hsuhwhy not? better than foo that "is repetitive" no ?
07:11Chousukeno
07:11Chousukefoo is better; it's clearer and faster
07:12hsuhok, then i'll remove foo's body (which is kinda big) to another function foo*, and do the matching on foo
07:12Chousukehsuh: the other bodies can call foo too
07:13Chousukea common idiom is to do (defn foo ([a] (foo a somedef)) ([a b] (lots-of-code)))
07:13hsuhoh, thats right, thats nice idiom
07:17fliebelRaynes: I think I'm done. It's running in #tempchan now.
07:25fliebelRaynes: https://github.com/pepijndevos/sexpbot
07:28hsuhChousuke: 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
07:30Chousukehsuh: what harm is there in passing identity?
07:30Chousuke~def sql-query
07:30hsuh(hyp) sql-query executes much faster with only one argument
07:30AWizzArdIs there a sane mime-type for clojure objects? For JSON for example: application/json So, is there anything such as application/cljon ?
07:31Chousukehsuh: then you're out of options.
07:31Chousukehsuh: but you know, building queries from strings is a bad thing to od :P
07:31Chousukedo*
07:31hsuhhehe
07:32hsuhwhat would you do ?
07:33Raynes&(System/currentTimeMillis)
07:33sexpbot⟹ 1289478956351
07:33Chousukeuse something that builds queries for you, taking care of quoting etc.
07:34Chousukewhatever you do, don't concatenate strings :P
07:34hsuhnot even mine ?
07:34Chousukeunless you're 100% sure no user ever can affect those strings.
07:35Chousukebut even then it's a bit dirty.
07:36hsuhwell i'm not sure there are any well tested layers on top of sql right now...there is briancarper oyako, but its in development
07:57lenwnoob question - how do i add 2 maps together ?
07:57Raynes&(into {:a :b} {:c :d})
07:57sexpbot⟹ {:a :b, :c :d}
07:57lenwcheers !
07:58Raynes:D!
08:04lenwanother one : how to i transform {:one 1, :two [{:three 3, :four 4}]} into {:one 1, :three 3, :four 4}
08:05lenwgetting myself horribly confused :)
08:07gfrlog,(doc memoize)
08:07clojurebot"([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...
08:09chouserlenw: might be easier to build it differently in the first place
08:10lenwchouser: its the return from a webservice ... trying to clean it up
08:14Tordmor,(let [m {:one 1, :two [{:three 3, :four 4}]}] (apply into m (filter seq? (values m))))
08:14clojurebotjava.lang.Exception: Unable to resolve symbol: values in this context
08:14gfrlogis there anything in contrib or elsewhere that will memoize a function and let you set the size of the cache?
08:15Tordmor,(let [m {:one 1, :two [{:three 3, :four 4}]}] (apply into m (filter seq? (vals m))))
08:15clojurebotjava.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$into
08:15Tordmor,(doc seq?)
08:15clojurebot"([x]); Return true if x implements ISeq"
08:16Tordmor*sigh* so much to learn
08:16hsuhanyone 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"] ?
08:17hsuhs/you//
08:17gfrloghsuh: I don't think you can do table names and column names; just values
08:17chouserlenw: hm. well, do you need it to be recursive?
08:17jolythat's my impression as well
08:18LauJensenhsuh: Just use CQL @(where users (= {:log_id 1})) simple :)
08:18lenwchouser: thats where i am at yes
08:18hsuhwhat is that ?
08:18LauJensenclojurebot: clojureql?
08:18clojurebotclojureql is http://gitorious.org/clojureql and tracked @ http://clojureql.lighthouseapp.com/
08:18LauJensenargh
08:18LauJensenclojurebot: forget clojureql
08:18clojurebotclojureql is http://github.com/LauJensen/clojureql
08:18LauJensenhttps://github.com/LauJensen/clojureql
08:18fliebelgfrlog: I think you could copy memoize and add a watcher to the atom.
08:18LauJensenhsuh: almost 1.0
08:19fliebelgfrlog: And if Clojure had dynamic scope you could use memoize itself, but that wont work.
08:19hsuhLauJensen: cool. i'll try the change but i should write some tests before otherwise i'll face a world of pain
08:20LauJensenYea, and like I said, its not quite 1.0, but the pace is pretty high these days
08:20Tordmorso, a vector does not a seq?
08:20Tordmors/does/is/
08:20chouserTordmor: right
08:21hsuhLauJensen: it should be pretty robust comparing to the rest of my code :P
08:21LauJensenhehe
08:22AWizzArd&(time (Thread/sleep 10000))
08:22TordmorOk, it's just that seq functions will call seq on their arguments so you can pass a vector.
08:22gfrlogfliebel: thanks
08:23TordmorIs there a predicate to test whether some arg is seq-able?
08:23LauJensenAWizzArd: When the big release date?
08:23fliebelTordmor: coll?
08:24chouserTordmor: that's right. I don't think there's any such predicate, at least partially because it's basically never what you want.
08:24chouserstring is seq-able
08:24gfrlog(seq? [])
08:24gfrlog,(seq? [])
08:24clojurebotfalse
08:25gfrlog,(seq? "oh well")
08:25clojurebotfalse
08:25fliebel&(coll [1 2 3])
08:25Tordmor,(coll? [])
08:25fliebel&(coll? [1 2 3])
08:25clojurebottrue
08:26Tordmorso for lenw's case I'd use coll?
08:28chouserTordmor: yeah, probably. or vector?
08:28lenwi was at the vector? point
08:29hsuhLauJensen: have you seen cascalog syntax?
08:29LauJensenhsuh: yes
08:30hsuhLauJensen: its similar to cql, no?
08:30TordmorI 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))))
08:30LauJensenhsuh: Its..totally different
08:30hsuhLauJensen: i mean, in the sense that its a thin layer for accessing databases (not the synax)
08:31hsuhor cql or not that thin? :)
08:31chouserI don't think cascalog is particularly thin
08:31LauJensenhsuh: 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
08:32LauJensenhttps://github.com/LauJensen/clojureql/commit/0eef6b41936cc8422a4909f1e8b3c89fa559594c
08:32hsuhchouser: err, i mean like comparing to things that hide sql...
08:32chouserlenw: I have a solution, but it's pretty horrible.
08:32LauJensenIn 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
08:32LauJensens/by hard/by hand/
08:32sexpbot<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
08:33lenwchouser: what do you have - mine is horrible too
08:33hsuhLauJensen: :)
08:34chouser& (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}]}))
08:34sexpbot⟹ {:one 1, :three 3, :four 4}
08:34hsuhLauJensen: what is "table {}" participation there? 
08:35hsuhoh, nm
08:35cemerickLauJensen: "derrived"?
08:36lenwchouser: 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
08:37LauJensencemerick: 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 ...
08:37cemerickLauJensen: no, I was just pointing out the misspelling. Should be "derived".
08:37LauJensencemerick: okay, please be more clear the next time
08:40hsuhChousuke: that "transform-map" of yours is great
08:40hsuhtks
08:41hsuhtotally feels like that joke on programmer evolution
08:44chouserAWizzArd: I've used application/x-clojure
08:57chouser& ((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}]})
08:57sexpbot⟹ {:one 1, :three 3, :four 4}
08:57chouserlenw: is that less horrible?
08:57lenwchouser: looks neater somehow - wrapping my head around it
09:03AWizzArdchouser: ok
09:03AWizzArdI will probably do this then too.
09:09belunhi. i'm studying functions returning closures and got an example
09:10belun(defn times-n [n] (let [x n] (fn [y] (* y x)))))
09:10belunthe questions is
09:10belunwhy use a let there ?
09:10opqdonutno reason
09:11ChousukeYeah, it's redundant
09:11beluncouln't just have used n _
09:11opqdonutalso: (def times-n [n] (partial * n))
09:11opqdonutbut maybe that doesn't interest you
09:11belunpartial is way nicer
09:11beluneven without it
09:12beluncould have used just n
09:12belunright ?
09:12Chousukeyeah
09:12Chousukefunction parameters are locals that can be closed over, just like let-bound ones.
09:16cemerickfogus_: these are Clojure tests, I presume?
09:16fogus_cemerick: WRT? My tweet?
09:16cemerickyes
09:18fogus_Yes, that is correct. I was able to fix it by removing the testSourceDirectory element
09:18cemerickfogus_: It's almost certainly a clojure-maven-plugin bug. This wasn't happening a month ago, IIRC.
09:18cemerickIn any case, a fix should be in the offing shortly.
09:19fogus_Sadly I do not recall if it happened before.
09:19cemerickWell, it shall not stand, regardless. :-)
09:30djpowellanybody had a go of my alternate diff implementation: https://gist.github.com/666114
09:32djpowelli guess it behaves more like the set diff implementation, but preserving the order of the elements
09:33chouserdjpowell: I saw you'd written it. Sound neat, though I haven't found a use yet for stuart's diff code either.
09:34tonylmorning
09:35djpowellchouser: 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
09:36chousercould be
09:36djpowellprint-table is aweso... good btw.
09:37djpowellchouser: btw - did you seem my fingertrees link yesterday?
09:37chouserI 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.)
09:38chouserdjpowell: I can't take any credit for print-table, beyond creating something else hated sufficiently to drive Stu to write it. :-)
09:38djpowellhttp://blog.sigfpe.com/2010/11/statistical-fingertrees.html
09:38djpowellI tried it with clojure's finger-trees and it seems pretty cool
09:39djpowellIt lets you calculate running averages and statistics of sliding windows
09:39chouserthat's great. I haven't had a real use for finger-trees yet either.
09:39chouser(reading now)
09:40chouserdjpowell: if you've got code using clojure finger-trees for that, it might be worth posting somewhere.
09:40djpowellyeah - i'll dig it out later
09:41chouserpeople would be interested
09:41djpowellactually 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
09:42djpowellcould be something where the .net rx style sequence/observable duality could be useful
09:42chouserhm, I see what you mean.
09:43chouser(parition 10 1 data) ?
09:46djpowellhmm, 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
09:52djpowellfinger-tree stats demo: https://gist.github.com/672592
09:54fogus_cemerick: So I'm using the parent pom and all looks good, except for deploy.
09:55cemerickfogus_: You're doing this in your local environment?
09:55fogus_What does that mean?
09:55chouserso what do you think of the finger-tree api?
09:56fogus_I am on my own computer. (?)
09:56chouserdjpowell: perhaps having finger-tree take items instead of just meter args is a bit useless. Maybe everyone will end up using 'into' anyway?
09:56cemerickfogus_: Right. So, `mvn deploy` will only ever work on build.clojure.org. That's where the credentials to the OSS repo live.
09:56djpowellI like into
09:56djpowellI always use (into [] ...) etc
09:56fogus_cemerick: Oh.
09:57djpowellI can never remember whether vec or vector is the one that takes varargs
09:57chouser:-)
09:57cemerickfogus_: For local testing, `mvn verify` will run everything that will be run prior to the actual deployment.
09:58cemerickfogus_: FYI, if you're interested: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
09:58djpowellI guess into is nice cause you exit the realm of weird finger-tree stuff quite quickly
09:58chouserthe short ones take collections (vec, set). long ones take varargs (vector, hash-set, sorted-set, hash-map, sorted-map, array-map, finger-tree)
09:59fogus_cemerick: Definitely interested.
09:59djpowellhow does consl work on a double-list - what metric does the new item get?
09:59chouserdjpowell: hm, yes, and finger-tree is just doing into anyway.
10:00cemerickfogus_: 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:00djpowelldo they go into negatives?
10:00fogus_cemerick: I did not disable (I don't think)
10:00chouserdjpowell: double-counted-list? nth 0 would get you the newly consl'ed item, indexes for everything else scoot up one step.
10:01cemerickfogus_: OK; I can re-enable it if you want.
10:01fogus_cemerick: If you please.
10:01cemerickfogus_, chouser: are you guys admin on build.clojure.org as well?
10:01fogus_fogus_: I am not
10:01fogus_GRRR
10:02cemerickfogus_: done; FYI, anyone can start builds at any time there
10:02chousercemerick: I don't think so. I don't think I've ever even logged in there.
10:02cemerickso, if you're anxious to see things deployed, have at it :-)
10:03fogus_cemerick: I see it building now. Thank you!
10:04cemerickdeployed already, even :-) https://oss.sonatype.org/content/repositories/snapshots//org/clojure/
10:05fogus_Beautiful.
10:23fliebelRaynes: ping
10:23Raynesfliebel: Your plugin is live and it's working excellently.
10:24fliebelyay!
10:24RaynesAs you should now know.
10:24Raynes:P
10:24fliebelIt does :)
10:24Raynes:)
10:24RaynesExcellent work. A welcome contribution.
10:24fliebelty :)
10:24RaynesI'm off to sleep.
10:24fliebelnight
10:28eshiraanybody 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:34eshiraah nevermind, I was using :dependencies instead of :dev-dependencies
10:36esjNoble 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:36esjbe much obliged :)
10:39eshiraesj, looks nice
10:39tonyli'll check it it
10:39esjthanks guys.
10:42eshiraSo 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:42eshiraBecause 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:53cemerickesj: 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:53esjcemerick: you got it !
10:53dnolenesj: very cool.
10:53cemerickboss-level.com is a helluva domain name, and the theme is great. Immediate goofy grin. :-D
10:53esjmerci !
10:54esjyeah, i feel like i've inadvertantly wandered into some boss level.... now gotta figure out how to survive it :)
10:54dnolenesj: the logic programming frame of mind is tough, but I'm finding it rewarding. it is dramatically different then imperative style thinking.
10:56esjdnolen: yeah, it turns my head inside out. I've literally just discovered it, so need to learn more about the underlying magics
10:56esjwill be hitting contrib.unify soon :)
10:56dnolenesj: 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:56cemerickesj: "independent (as of this very day)" -- where had you been working?
10:57dnolengetting into it.
10:57esjcemerick: I was a quant in a hedge fund.
10:57esjbut that got tired.
10:57cemerickSo I've heard.
10:59esjcemerick: it was ridiculous: the fund was physically in the channel islands, so I was commuting from Cambridge to there every other week
10:59esjun groovy.
10:59esjdecided to quit that gig, and try find my own way
11:00arohnerany of the relevance dudes here? mycroft.clojure.org is down
11:00esjdnolen: we should talk - I'd really value your feedback on the site
11:00esjright now I've gotta shoot - giving maths lessons :)
11:00cemerickesj: Yikes! Were they sited there for legal reasons? i.e. the islands are semi-autonomous IIRC?
11:01dnolenesj: oh wow, you're whole blog so far is on logic programming in Clojure nice!
11:07dnolenesj: good blog, this going to be a great resource for the Clojurian Logic Programming enthusiasts
11:13cemerickarohner: Looks like wooby is here, but he's often idle.
11:47sivajagHi all
11:49replacaQ: does anyone know where in the java "def" is implemented to save me rooting around?
11:49kumarshantanusivajag: hi
11:50sivajagHi kumarshantanu
11:51tonylreplaca: i've tried once to find it, but no dice. it overwhelmed me, but gotta try it again
11:52sivajagkumarshantanu: Did u get a chance to use "are" in testing
11:52replacaahh, here we go Compiler.clj around line 325 in the checkout of master I have
11:52chouserreplaca: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L325
11:52chouseroh, right. :-)
11:52replaca:)
11:52kumarshantanusivajag: I deliberately avoid using 'are' because the line numbers are mangled
11:52replacachouser: just a little too late...
11:53kumarshantanusivajag: I use 'is' with helpers
11:53sivajagWhen u get a chance could u send me an example
11:53replacachouser: 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:54replaca(sometimes absolute sometime relative to something)
11:54kumarshantanusivajag: it is even documented -- http://richhickey.github.com/clojure/clojure.test-api.html#clojure.test/are
11:54replacakumarshantanu: please use clojure.github.com/clojure....
11:55replacathe richhickey version is no longer kept up to date
11:55kumarshantanus/richhickey/clojure/
11:55sexpbot<kumarshantanu> sivajag: it is even documented -- http://clojure.github.com/clojure/clojure.test-api.html#clojure.test/are
11:56kumarshantanureplace: thanks for pointing
11:56kumarshantanus/replace/replaca/
11:56sexpbot<kumarshantanu> replaca: thanks for pointing
11:57replacakumarshantanu: np!
12:03replacachouser: 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:04replacachouser: hmmm, that would seem to imply that we don't set source file consistent when we load a file from :require, etc.
12:04replacaoff to confirm!
12:07esjdnolen: yeah, i'm studying it right now, so the blog is basically by notes :)
12:08esjcemerick: the bosses liked the Channel for tax reasons, so moved us all there. Cripes !
12:09kumarshantanuDoes anybody know of a repo where experimental work for clojure.xml is happening? (just in case)
12:10cemerickesj: that sounds pretty brutal. They look like nice places to visit, not necessarily an ideal work locale. :-)
12:10replacakumarshantanu: I haven't heard of any such work
12:10esjcemerick: yeah, I refused to move, so had to commute, but that didn't work out long term.
12:11esjcemerick: which is good, because now I'm full time on clojure... and motivated to find a way to use it feed myself :)
12:17kumarshantanureplaca: okay
13:02cemerickfogus_: FYI, you don't need the <repositories> tag in your pom at all.
13:03cemerickand I think we can safely set <licenses> in our parent pom too
13:11pppaulyo crew
13:13fliebelesj: ping
13:13esjfliebel: yo
13:14pppaulshould i use multi-methods to implement a FSM?
13:14fliebelesj: 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:15esjfliebel: I'd be surprised if that's all I mixed :)
13:15TakeVHow do I filter a collection by comparing it to a collection of items that I want filtered out?
13:15pppaullink?
13:15clojurebotyour link is dead
13:15pppaulyou mean a set?
13:15fliebelesj: It's the one thing I noticed so far :)
13:15esjfliebel: thank for reading it btw - hoping that I'll get feedback to help me come to understand this dark magic :)
13:16TakeVYes, the collection to compare it to would be a set, but not necessarily the initial collections which I am filtering.
13:16amalloy&(remove #{4 5 7} (range 10))
13:16sexpbot⟹ (0 1 2 3 6 8 9)
13:16pppaul(filter #( some #{1 2 3}))
13:16pppaulamalloy's is better
13:17fliebelesj: The dark magic being logic programming? Have you ever looked at datalog?
13:17pppaulyeah i was in here talking about logic just a few hours ago
13:17esjfliebel: that's right. Not yet... but thanks for the pointer, I'll be checking it out ;)
13:18pppaulso, FSM via multi-methods. good idea or bad idea?
13:19fliebelFSM? Missed the first part :(
13:19amalloypppaul: seems as reasonable approach as any
13:19TakeVAh, that works. Thank you.
13:19amalloyfliebel: state machine
13:19fliebelamalloy: The kind of stuff regexes use?
13:20amalloyyeah, that's one well-known FSM
13:20fliebelah, the f is for finite :)
13:20amalloyindeed
13:21amalloythough technically regexes are more powerful than real FSMs, because they include some stack-like features
13:21pppaulmore powerful leading to them not being real FSM?
13:22chouserI think most real regex engines are not FSMs. Once you include backtracking, it can't be an FSM, can it?
13:23pppaulmaybe it could
13:23pppaulit could be some hugely complicated FSM
13:23fliebelMaybe you could make a finite state machine by using logic programming? hrm… just a random thought.
13:27pppauli wonder how that would look
13:27AdamantRegexs are not regular expressions
13:28Adamantregular expressions can be done as FSM's
13:30TakeVAnd, 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:30defnDo 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:31defnI miss being able to pull up M-x slime by itself
13:31chouser& (re-seq #"\S+" "This (will be) broken up! Into Words!")
13:31sexpbot⟹ ("This" "(will" "be)" "broken" "up!" "Into" "Words!")
13:32tonyl&(vec (.split "This (will be) broken up! Into Words!" " "))
13:32sexpbot⟹ ["This" "(will" "be)" "broken" "up!" "Into" "Words!"]
13:33drewrdefn: no, you can still frob slime-lisp-implementations
13:33jimdueyfliebel: Here's one way to do an FSM using the continuation monad.
13:33jimdueyhttp://intensivesystems.net/tutorials/cont_m.html
13:33TakeVThank you again.
13:33pppaulyou can use clojure.string/split too
13:33technomancydefn: M-x durendal-jack-in: http://github.com/technomancy/durendal nice M-x slime replacement
13:34pppauloh, too late
13:34drewrdefn: eg, http://p.draines.com/1289500575036bea209de.txt
13:34pppauli am a monad newb
13:34drewrbut durendal is better if you use lein
13:36pppauljimuey, *reading* ...
13:41jimdueyoops. The reference to FSM is at the bottom of
13:41jimdueyhttp://intensivesystems.net/tutorials/cont_m_web.html
13:42jimdueyThe downside of doing FSM's like this is they can't be minimized using Hopcroft's algorithm.
13:42jimdueyI did some work in that direction a long time ago and haven't written it up yet.
13:44pppaulminimized how? jimduey
13:58jimdueyFor a deterministic FSM, minimize the number states that will have the same behavior
13:58jimdueyhttp://en.wikipedia.org/wiki/State_machine
14:28Phantom_HooverWhat do the [] in Clojure actually signify?
14:29LaPingvinoPhantom_Hoover: [] is a vector
14:29Phantom_HooverLaPingvino, not a list?
14:30LaPingvino() is lists, you use them for functions, [] is a vector, working like a list for data and way faster and {} is a hashmap
14:30LaPingvinoPhantom_Hoover: you can use it for everything you use lists for in CL, but it is not implemented as a linked list
14:30LaPingvinoit's faster
14:30Phantom_HooverAh, like CL's vectors.
14:31cemerickweren't CL vectors essentially managed arrays?
14:31cemericke.g. ArrayList-esque?
14:31Phantom_HooverNot sure.
14:32Phantom_HooverYou can make them appendable etc. with keywords to make-array.
14:32LaPingvinoPhantom_Hoover: no, CL vectors are restricted to one type of content
14:32Phantom_HooverLaPingvino, really?
14:32LaPingvinoPhantom_Hoover: Clojure vectors are essentially free-form
14:32LaPingvinoLaPingvino: yes
14:32LaPingvinolike #(1 2 3 4 5)
14:33Phantom_HooverFWIW, element-type is t by default, which IIRC is the global type.
14:33Phantom_Hoover#(3 'a #\a) works perfectly.
14:33LaPingvinoI thought the defaults were different
14:34LaPingvinobut not sure :)
14:34Phantom_HooverIt's certainly not for me.
14:35scottjare lein checkouts a 1.4 feature or in 1.3.1?
14:35scottjthe checkouts dir that is
14:36Phantom_HooverPUSH doesn't work, but that's because it's just (setf list (cons thing list))
14:36amalloyPhantom_Hoover: clojure vectors have different performance characteristics than in CL though
14:36cemerickamalloy: …which is what I was getting at re: managed arrays
14:37Chousukearen't the vector literals read-time only too?
14:37amalloycemerick: heh, sorry. guess i didn't scroll up far enough
14:37technomancyscottj: they've been around a while
14:37Chousukeso if you do #(a b c) you'll get a vector of three symbols.
14:38Phantom_HooverNot necessarily.
14:38Phantom_Hoover#( is a read macro, so it's not that certain.
14:40Phantom_HooverBut you're right.
14:47LauJensenHas anyone written something that supports connections pools yet ?
14:47amalloyPhantom_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:49amalloyLauJensen: 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:49LauJensenamalloy: 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:50LauJensen(though patches are welcome)
14:50LauJensen(beautiful patches)
14:50amalloyheh, yes, i did plug CQL for you
14:50amalloyah, it was jartur. search for him if you check the logs
14:50cemerickamalloy: it's O(log32 n) on vector get, nth, and assoc IIRC
14:51LauJensenamalloy: You plugged it?
14:51amalloyLauJensen: as in advertise? does that idiom not translate well?
14:51LauJensenah right. Yes Im sure it does, I just misunderstood in the context of patches
14:52amalloycemerick: 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:53amalloyer, O(1)
14:53cemerickamalloy: Sure; people get picky though ;-)
14:53amalloyyeah. sometimes i'm one of them
14:54amalloycemerick: precise but not accurate is a common disease
14:55cemerickamalloy: I usually suffer from the opposite affliction.
14:55fliebelhrm, cake is doing the ssl thing again :(
14:57mtyakaLauJensen: 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:57LauJensenmtyaka: Thanks! I'll check it out
15:00Phantom_Hooveramalloy, wait, O(1) random access and O(1) appends?
15:00Phantom_HooverI can't see how that would possibly work without black OS magic.
15:00Chousukethey're O(log32 n)
15:01Chousukeif you're talking about clojure vectors
15:01ChousukeI wonder where I put the data structure chart
15:01LauJensenChousuke: I was just looking for it myself
15:01cemerickPhantom_Hoover: This is a good writeup of the internals of PersistentVector http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/
15:01Chousuke[D[Dhttp://www.innoq.com/blog/st/2010/04/clojure_performance_guarantees.html
15:02amalloyPhantom_Hoover: see cemerick's nitpicks
15:02Chousuke(the headers are off by one :P)
15:02Chousukeat least in my browser
15:02cemerickdamn, I'm a nitpicker :-P
15:03cemerickI much prefer being the nitpickee.
15:04fliebelChousuke: What's the log32 thing?
15:05Chousukefliebel: it's the "maximum number of hops" you need for the operation.
15:05Phantom_HooverNitpick: O(kn) is equivalent to O(n), so it's just O(ln n).
15:06ChousukePhantom_Hoover: but O(ln n) is misleading since it's much faster :P
15:06Phantom_Hoover...No it's not.
15:06fliebelChousuke: I know that I think… So O(n) takes 1 time for every item, and O(1) is constant, but what is log32?
15:06Phantom_HooverIt's the exact same.
15:06ChousukeO(log32 n) that is.
15:07Phantom_HooverThat's like saying O(5) is slower than O(1).
15:07ChousukePhantom_Hoover: in this case the big-O notation kind of fails
15:07Phantom_HooverIf you want to indicate the actual time taken, big O notation isn't helpful.
15:07Chousukeneeding at most ln n hops is not as good a guarantee as needing at most log32 n hops
15:07Phantom_HooverThat's not even what it means.
15:07Chousukewhich is ultimately why I had the table use english instead of O notation
15:08Phantom_HooverIt means it takes at most k ln n hops.
15:08Chousukeyes I know
15:08cemerickfliebel: (log32 n) gives you the number of levels in the vector's tree given a vector of n items
15:08cemerickso a get or assoc requires that many discrete operations to reach any location in the tree
15:08ChousukeShouldn't have mentioned big O notation in the first place
15:08Chousukeit's just confusing
15:09Phantom_HooverIt's a measure of algorithmic complexity, not time taken, which is the source of the confusion.
15:09amalloyPhantom_Hoover: in a mathematical perfect world, O(log32 n) would be "the same" as O(log2 n)
15:09Phantom_Hooveramalloy, yes, I just said that.
15:10Phantom_HooverIn fact, it *is*.
15:10Chousukeit is the same, but not when you execute the algorithm on a machine ;P
15:10Chousukewhich is kind of the thing here.
15:11Phantom_HooverIt is *in terms of big O notation*.
15:11Chousukeyes
15:11Phantom_HooverThe two are *exactly equivalent*.
15:11fliebelcemerick: Thanks. I need to remember some more math...
15:11Phantom_Hoover*Even in the real world.*
15:11amalloyPhantom_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:11Chousukewhich makes the O notation not so useful in this case.
15:11fliebelhrm: [cake] connection to bake jvm is taking a long time...
15:12Phantom_Hooveramalloy, what?
15:12cemerickfliebel: heh, or you can just say to yourself "it's damn fast", and leave the math-lawyering to amalloy, Phantom_Hoover, and Chousuke ;-)
15:12Chousuke:P
15:12Phantom_HooverO(log_32 n) is not equivalent to O(1) ever, so I assume you mean something else.
15:13ChousukePhantom_Hoover: he means the execution time of the algorithms are almost equivalent
15:13Chousukeforget the big-O notation for now, it's not useful here
15:13fliebelcemerick: But I ought to know what log does at the very least.
15:13Phantom_Hooverfliebel, a^b=c, ln_a c = b.
15:13amalloyf(x) = O(g(x)) iff there exist constants M,N such that f(x) < M*g(x) for all x > N
15:13Phantom_Hoovers/ln/log/
15:13sexpbot<Phantom_Hoover> fliebel, a^b=c, log_a c = b.
15:14amalloyPhantom_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:14Phantom_Hooveramalloy, oh, that's what you meant.
15:15amalloyPhantom_Hoover: sorry if i wasn't clear enough
15:15Phantom_HooverWe were talking about O(log32 n) and O(ln n), so I'm not really sure why you mentioned it, but anyway...
15:16fliebelPhantom_Hoover: So log is like the square root of an exponent?
15:17Phantom_Hooverfliebel, logs, roots and exponents are all just rearrangements of one another, yes.
15:18Phantom_HooverRelated by a^b=c, root(b, c) = a and log_a c = b.
15:18fliebelgreat
15:22alexykif 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:24cemerickalexyk: yet, but it's not really "calling itself" there -- it's a completely separate send-off
15:24alexykcemerick: right, is it an idiom?
15:25cemerickfor a continuously-running cycle on an agent, sure
15:25alexykkk
15:25cemerickit doesn't look like there's a way to cancel the next send though, which is probably a future bug source
15:26alexykcemerick: it's supposed to index one's mail; I guess it's just killed with the process
15:26cemerick*shrug* sure
15:27alexykcemerick: dunno, github brought it :)
15:27alexykhttps://github.com/marktriggs/mailindex
15:28cemerickhuh, lookit that
15:30alexykcemerick: I'm curioius how you'd terminate gracefully... you'd need to query something, e.g. existence of a file...
15:30cemerickalexyk: well, it looks like there's a telnet command interface. *shrug*
15:31cemerickreally, I didn't know that people had local mail indexing pains anymore
15:32cemerickalexyk: I guess I start doing that when I fall outside the target user profile for something :-)
15:32talioshey cemerick
15:32cemericktalios: Hey, my favorite kiwi. :-)
15:32alexykcemerick: I think it's a guy's clojure learning project using Lucene, not much more than that. Sonian can sleep restfully :)
15:33cemerickheh, well, Sonian isn't exactly local mail indexing AFAIK
15:33talioscemerick: I see I broke testing :)
15:33taliosnot at all
15:33talioshobbit maybe tho :)
15:34cemericktalios: The natives are restless. http://twitter.com/#!/fogus/status/2717209939943424 ;-)
15:34cemericktalios: I don't think I have big enough stones to call anyone a "hobbit" ;-)
15:35dnmfogus_: Ping.
15:36manojping
15:38xkbhi! 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:38xkbthe jar I added is as http://os.xebia.com/maven2/ and is a Last.fm binding
15:39xkbany idea what might be wrong? I cant access server logfiles :(
15:39cemerickxkb: you've added the local repo in your project.clj?
15:40xkbcemerick: yep as a :repository
15:40manojI am a newbie to clojure and have a question on lexical scoping especially when "let" is used in a recursive function call
15:40xkbcemerick: yep as a :repositories even
15:40manojThe 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:41xkbcemerick: and I added the dep like so: [net.roarsoftware/last.fm-bindings "1.0"]
15:42Chousukemanoj: hmmh
15:42raekmanoj: the function 'memoize' is only called once
15:42Chousukemanoj: memoize doesn't work well with recursive functions
15:42raekmanoj: you use it like this: (defn foo ...) (def foo (memoize foo))
15:42cemerickxkb: seems reasonable to me, but I'm not the one to ask for lein help :-) Try technomancy if he's around?
15:42Chousukemanoj: at least if you use recur
15:43xkbcemerick: will check thx :)
15:45raekmanoj: 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:47alexykwhere does it say in clojure docs that *agent* is set to the running agent in a function executing on it?
15:47manojThanks 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:47chouser(doc *agent*)
15:47clojurebot"; The agent currently running an action on this thread, else nil"
15:48alexykok
15:49alexykwhy "; ..."?
15:49hiredman(doc +)
15:49clojurebot"([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0."
15:49chouserthat's a clojurebot question
15:49alexykah
15:51amalloy&(doc *agent*)
15:51sexpbot⟹ "; The agent currently running an action on this thread, else nil"
15:52amalloythe ; must be in the actual docstring
15:52amalloy&(meta #'*agent*)
15:52sexpbot⟹ {: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:52xkbduh, fixed my lein problem.. Should mind typo's more :P
15:53xkbforgot to postfix the jar with the version..
16:16slyrustechnomancy: that's some serious blogspam!
16:30nickikWhy does form-dot-clj not work on appengine?
16:49LauJensenClojureQL 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:52ohpauleezLauJensen: Awesome! I'm definitely interested to see how the redesign is coming
16:52LauJensenohpauleez: So much is done already, check out demo.clj :)
16:54technomancyslyrus: where?
16:55dnolenLauJensen: interesting deref triggers the query to execute?
16:56LauJensendnolen: yea
16:56LauJensendnolen: deref, and all functions ending with !
16:57dnolenLauJensen: any particular benefit from the deref syntax? is just to denote side-effects?
16:57LauJensendnolen: It gives cleaner looking code with clear semantics, thats all
16:58dnolenLauJensen: interesting, so it's easy to get the SQL statement from the CQL exprs?
16:58LauJensendnolen: everything is a RTable record, just call compile on it
16:58LauJensen(compile (table db :users [:*])) => "SELECT * FROM users"
16:59dnolenLauJensen: very cool.
17:00LauJensendnolen: 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:05ninjuddderef also lets you construct and query and pass it around without fetching the results.
17:16dnolenninjudd: so how do you run the query? so deref is about compiling the query representation to a string?
17:17LauJensendnolen: compile compiles, its called by deref. deref executes.
17:21ninjudddnolen: right
17:21ninjuddcompile is mainly useful for seeing what sql is going to be executed
17:22ninjuddand testing
18:07slyrustechnomancy: well, it was here: http://technomancy.us/142 but I guess you found it
19:12Deranderif 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:13amalloydoseq
19:14amalloyDerander: ## (doseq [x (range 5)] (println x))
19:14sexpbot⟹ 0 1 2 3 4 nil
19:15Deranderamalloy: thank you sir
19:23quizmewhat does * mean? as in (list * or fn* ?
19:23technomancyquizme: means it's an internal support function
19:24quizmetechnomancy oh ok, so it's just a naming convention?
19:24RaynesIt 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:25Raynestechnomancy worded that better.
19:30Raynesquizme: Yes.
19:33technomancybasically if you didn't write foo, you probably shouldn't call foo*
19:33technomancybut sometimes foo* can't be private because macroexpansions use it
19:54sivajagIs there any good resource
19:54amalloysivajag: no. resources are all evil
19:54sivajagon how to move from imperative paradigm to functional paradigm
19:54sivajagI am planning on writing a blog about it
19:54sivajagwas looking for some resources
19:55sivajagamalloy: i will use term reference instead of resources :)
19:55amalloysivajag: http://blip.tv/file/982823 maybe?
19:55amalloyi 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:56sivajagI have seen some of it
19:56sivajagit is mostly about techniques
19:56sivajagI am looking for something more generic
19:56sivajagI am sure it is there :) I need to collect it one place
19:56amalloysivajag: sicp?
19:57amalloyit's not really "for iterative people", but it's a really powerful intro to functional programming
19:57sivajagsure I will check it out amalloy
19:57sivajaghttp://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html
20:12pppaulsicp!
20:13amalloypppaul: i like to pronounce it as sick-pea
20:13pppaulsivajag SICP is what you want (there are videos you can download of a lecture 25 years ago)
20:14pppauli'm sick of peas
20:15pppaulsivajag: http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
20:15pppauli really like how that in the course they rarely use a computer
20:19sivajagpppaul: ThanksI will check it
20:25pppaulmonad sounds like a dirty word
20:34dnoleninteresting report on an STM for a Prolog-like language, http://www.mercury.csse.unimelb.edu.au/information/papers/bmellor_hons.pdf
20:37dnolencrazy goldmine of papers on that site.
20:49pppaulare continuations like streams?
20:49amalloypppaul: not in any way i can think of
20:50pppauli'm reading about them now, and they look a bit weird
20:50amalloythey're basically callbacks, right?
20:50tomoja continuation is like a first-class execution context
20:50tomojwell, could be
20:50Raynes$8ball Are continuations like streams?
20:50sexpbotRaynes: Very doubtful.
20:50RaynesHe has spoken.
20:50tomojsome are like 1/2-class I guess
20:51pppaul$8ball True?
20:51sexpbotpppaul: It is certain.
21:17pppaulwhat's so special about monads?
21:18pppaul^_^
21:18quizmetechnomancy, raynes: thanks.
21:20pppaulmonads just a way to hide complexity with nested functions?
21:20pppaulis there something more to them? can they help me with my sex life?
21:21samxif you'll get to know monads, you won't have any chance of a sex life
21:22pppaulwill monads provide me with enough money to delegate my sex-life to professionals?
21:23samxsure, just watch out you won't get any monoids back
21:25samxbut monads give you protection, so you won't have to worry about continuations
21:25pppauli haven't worried about continuations in the past by not using them
21:27Adamantpppaul: I think remotely possessing the body of Charlie Sheen, a la "Being John Malkovich", is a swifter and surer route to said situation.
21:27Adamantyou just have to make movie premises work in the real life
21:27pppaulthat has been my dreams since i burst from the womb
21:28pppaul$8ball 8balls?
21:28sexpbotpppaul: Without a doubt.
21:34pppaulwooooooooooooooooooooooah monads are pretty cool!
21:34tonylpppaul what are you reading?
21:34pppaulthey are injected with monad enlightenment
21:34pppaulhttp://intensivesystems.net/tutorials/cont_m.html
21:35tonylcool, thanks for the link
21:36pppaulcan you make an infinite loop with a monad?
22:48amalloyhow does dosync work with lazy seqs? eg, ##(let [var (ref [2 3 4])] (doseq [x (dosync (map inc @var))] (println x)))
22:48sexpbot⟹ 3 4 5 nil
22:49amalloydoes dosync return a lazy seq that actually gets forced in the doseq, *outside* the dosync?
22:56chouseryep
22:56amalloychouser: thanks. it turns out that's not a problem for me, but it was a little head-bending to realize
23:07technomancyhttp://p.hagelb.org/garbagemen.gif
23:07technomancyoops, wrong window
23:46KirinDaveAre there any incentives for using defstruct anymore?
23:46quizmekirindave, what's the replacement for it ?
23:46amalloydefrecord?
23:46quizmeamalloy oh yeah duh
23:46KirinDavequizme: Defrecord seems like it does most of what defstruct was meant to do, and then much more.
23:47quizmei was thinking there was another iteration of that