#clojure logs

2010-08-19

00:35itistodayis RC3 available from the github master branch?
00:36itistodayi'm pretty sure i'm on it, but i'm not sure whether what i have is rc3 or an older version
00:37itistodayerr... is the master branch >= RC3?
02:00Raynes"Clojure goes in the right direction, but unfortunately, the trend and research is in advanced type systems and some syntax. An intermediate solution is for someone to fork Clojure and give it some nice Python-like syntax"
02:03Scriptorwhere would the "advanced type system" come from then?
02:06RaynesThat was from a comment on this post: http://thecleancoder.blogspot.com/2010/08/why-clojure.html
02:10tomojRaynes: think it's sincere?
02:11Raynestomoj: Think what is sincere?
02:12RaynesThe comment? No, it sounds like trolling to me.
02:13tomojI hope so
02:16Scriptorsomeone apparently agrees with him, though
02:18RaynesI'm sure a lot of people who miss the cosmic point will agree with him.
02:47LauJensenGood morning all
02:53Bjeringmorning.
02:53BjeringToday I'll revisit my chat replacing alot of refs with agents.
02:56BjeringI did the mistake of thinking I could port my C++ solution, just replacing blocks that used to be under locks to be blocks inside dosyncs. That is obviosly an oversimplification. What you said yesterday re refs and mutable objects makes alot of sense. Seems using agent as monitors around mutable java-objects atleast will make it read cleanly. Unsure if it is a perfomance issue, but thats why I am doing a benchmark after all...
03:02LauJensenIt will likely perform better than refs, and agents seem a good fit for a chat server
03:03LauJensenAnd a big win, is that agents dont respin
05:39pdelgallegohi what are good project, problems and "katas" to learn clojure?
05:41bobo_pdelgallego: i did project euler
05:42pdelgallegobobo_, I have done of them, but they are too math-centric.
05:42pdelgallegoI did till number 12 I think
05:43pdelgallegobobo_, Is there something like ruby quiz or "perl challenge of the week" in clojure?
05:46sparievpdelgallego: have you looked into this - http://codingkata.org/katas/ ?
05:46pdelgallegospariev, I didnt know that one. looks good.
06:03LauJensenGuys - I have a little OT topic but Im hoping there's some brains in here that can tackle this: I have a login screen which posts the input fields to a backend using $.ajax(). This works in all browsers except of course IE. If you open the page in IE and submit your details, you get an error on return new A.XMLHttpRequest, saying that it doesn't implement some function. Then refresh the page, try again and it works. Anybody heard of
06:03LauJensenthat before?
06:07old_soundhi
06:11LauJensenOh wow, I found it. Man its subtle. If you import scripts before <meta http-equiv="Conten...> IE8 will bork on it.
06:15bobo_ie always wants to be special
06:18LauJensenI should really get to work on a script which can take over IE and force the user to use Chrome instead
06:18bobo_there is a jquery plugin thats only function is to crash ie
06:18bobo_:-)
06:19bobo_maybe it was just ie6, but still
06:21LauJensenyea its only ie6 Im afraid
06:21BahmanHi all!
06:22LauJensenHi Bahman, old_sound! :)
06:22old_soundhi there, I was wondering if there's a way of generating a class name with clojure, from a string
06:22BahmanHey LauJensen! What's the old_sound BTW?
06:23LauJensenBahman: Its the guy who wants to make classes out of strings
06:23old_soundbasically I want to generate records, so If I have the string "MyClass", I would like to be able to call (defrecord MyClass [a b c])
06:23old_sounddo you get the idea?
06:24BahmanLauJensen: Doh! I didn't see him. Hello old_sound :-)
06:24old_soundHi there Bahman !
06:24LauJensenold_sound: Since defrecord is a macro I think you have to loot its source and modify it
06:25LauJensen~source defrecord
06:25old_soundbut how the get the contents of the string to be used like that?
06:25LauJensenthere, go loot
06:25LauJensenold_sound: I think you just need a symbol
06:25LauJensen,(symbol "MyClass")
06:25clojurebotMyClass
06:27old_soundI'm trying with that
06:27old_soundlike this (defrecord (symbol "ar") [a b])
06:29LauJensenold_sound: You have to make your own defrecord macro, to do the name filtering
06:30old_soundok, I will try to understand what that means :) I'm new to clojure
06:30LauJensenold_sound: the thing is, macros expand to code that is then compiled. Passing in args like you want to do isnt possible with a macro
06:31tomojold_sound: this a toy?
06:31old_soundtomoj: a toy?
06:31tomojI mean, you're just screwing around?
06:31old_soundno
06:31tomojLauJensen: sure it is? maybe I'm confused
06:31LauJensentomoj: How?
06:31old_soundI'm trying to convert erlang records into clojure records
06:32tomoj(defmacro defmyrecord [str fields] `(defrecord ~(symbol str) ~fields)) or something?
06:32old_soundso in erlang a record is just a tuple of this form {record_name, {{key1, val1}, {key2, val2}}}
06:32old_soundsomething like that
06:32old_soundI want to convert that into a clojure record
06:33tomojdefrecording on the fly like that seems.. odd. I don't know why, but if I felt like I wanted to do that, I'd think really hard about it
06:34old_soundWhat I do right now is to just create a map
06:34tomojjust looking for speed?
06:35tomojI wouldn't think you'd get any speedup
06:35old_soundactually to have the kind of accessors functions, an perhaps add some methods later with protocols
06:35LauJensentomoj: oh yea wrapping in another macro, why didnt I think of that ? :)
06:35old_soundI'm not looking for speed
06:35tomojaccessors..
06:36old_soundmaybe that word is invented :P
06:36clojurebotkeyword arguments is http://groups.google.com/group/clojure/msg/51bb53ca077154f8
06:36tomojclojurebot: botsmack
06:36clojurebotclojurebot evades successfully!
06:36LauJensenhaha
06:36tomojshucks
06:37LauJensentomoj: Where are you at in the world?
06:37tomojaustin, texas, usa
06:37old_soundyou LauJensen ?
06:37LauJensenHome of Dell :)
06:37LauJensenold_sound: Im from Denmark (http://conj-labs.eu/instructors.html)
06:37tomojI think my coworkers and I are going to start a clojure meetup here :)
06:38LauJensenCool - You work with Clojure ?
06:38tomojnot as much as I'd like, but yeah
06:38LauJensenWhich company ?
06:40tomojborrowedsugar
06:40old_soundwhich kind of system do you work with?
06:40LauJensenInteresting!
06:41tomojI wonder if any other austinites ever come here
06:41zmilanew micro-interview :)
06:41LauJensenzmila: where?
06:41zmilaright here right now :)
06:42old_soundwell thanks for the help guys, I have to head home now
06:42LauJensentomoj: What does 'tomoj' mean ?
06:44tomoj'tomo' was my nickname (originally from esperanto-izing my given name), 'j' my last initial
06:45LauJensenoh okay
06:45tomojcoincidentally zo .tomoj. cu drani cmevla .ui
06:45LauJensensure
06:46zmilatomoj estas multaj tomo-j :)
06:46zmilatomoj is a lot of tomo-s
06:49tomojhuh, coincidentally plural as well..
06:49LauJensenbtw, here's a nice stunt. I have a preinstalled Windows 7 on my laptop just sitting in /dev/sda2, I never use it, but today I found out how to directly link that using Vbox and boot Windows 7 inside Arch from /dev/sda2 :)
06:50ordnungswidrigLauJensen: makes it a difference performance wise? partition vs. container file?
06:51LauJensenordnungswidrig: Dont know
06:51tomojthat's interesting
06:51LauJensenThe big difference is I dont need an imagine, and if I reboot into it from grub, I get all the changes Ive made while having the vbox running
06:51LauJensens/imagine/image/
06:51sexpbotThe big difference is I dont need an image, and if I reboot into it from grub, I get all the changes Ive made while having the vbox running
06:51ordnungswidrigLauJensen: thats a good point
06:52ordnungswidrigLauJensen: does it manage the differnet devices well? virtualized network adapter vs. the real one?
06:52LauJensenNetwork and USB works fine. I havent made any special configs for anything else. I doubt I could get bluetooth to work easily
06:53LauJensenBut it would make some network testing easier, as you can assign a number of network cards, with handpicked mac-adrs and vendor stringds
06:53soyrochusHi there, I'm currently using Scriptjure to incorportate Javascript in a compojure/Ring project. Works well. But would be nice if ClojureScript would be maintained. Is there any news on that front?
06:54LauJensensoyrochus: Yea, the news is that most of CS becomes redundant once Clojure-in-Clojure is done. So the project is on hold I believe
06:54LauJensensoyrochus: the guy behind it, chouser_, practically lives in here, so you can check with him in a few hours
06:57soyrochusok, thanks. I'm currently using the CLR version as well and it's more fragile nature can sometimes be maddening. Would be nice if CiC would help alleviate that
06:58yonatan_LauJensen: is there en ETA for clojure-in-clojure?
06:58yonatan_s/en/an
06:58bsteuberare there standard library functions for converting clojure-symbols to camelCase?
06:58LauJensenyonatan_: Not officially, but I recommend that you dont hold your breath
06:59LauJensenbsteuber: yes - I forgot where
07:00bsteuberhm, too bad :)
07:00ordnungswidrigbsteuber: a simple regex should do, shoudn't it?
07:00tomojregex?
07:00clojurebotSometimes people have a problem, and decide to solve it with regular expressions. Now they have two problems.
07:01bsteuberwell, I guess I just use split and (map capitalize-first) or so
07:01tomojhmm, munge goes to under_score
07:01ordnungswidrighmm, java regex cannot do uppercase, I fear.
07:02soyrochusLauJensen: pity, I'm working in a multi-platform shop and Clojure has the potential to really make inroads here, it would be HUGE if there would be JVM / CLR /Javascript versions
07:03soyrochusMore or less equivalent, I mean
07:03LauJensensoyrochus: You could contribute it if you like. There's already gone a lot of work into CS. Secondarily, javascript/jquery can actually hold its own.
07:07LauJensen,(->> (re-find #"([a-z]+)([A-Z]+.*)" "camelCase") rest (map #(.toLowerCase %)) (interpose \-) (apply str))
07:07clojurebot"camel-case"
07:07LauJensenordnungswidrig: you can simplify that a bit if you like :)
07:07LauJensenWill only do one dash though
07:08LauJensenHere's a better version
07:08LauJensenhttp://gist.github.com/raw/462593/9a8e3ce957ce5282672a145d0ec20a9393fa009f/enhanced-record.clj
07:09LauJensen@ bsteuber
07:10bsteuberah, thx
08:13LauJensenDoes anybody here know how the authors of Ring make access to servlet-params available?
08:16alienscienceA ring request should have a :servlet-request key (I've not used it though)
08:17alienscienceOh and a :servlet-context
08:17aliensciencehttp://github.com/mmcgrana/ring/blob/master/ring-servlet/src/ring/util/servlet.clj#L51
08:19LauJensenIt used to, before the 0.3+ split up
08:19LauJensenSo I have some legacy ajax-upload-backend code which doesnt work anymore
08:36pdk,(/ 3840 2)
08:36clojurebot1920
08:38cemerickLauJensen: there's a compojure mailing list/gg I think
09:35mefestois the convention of an asterik after a function name to signal that it's use is mainly to support a macro?
09:36chouserI think it's less specific. more just a vague alternate to the non-splat thing.
09:36cemerickThat, or that it's a support fn, not intended to be called directly.
09:36chouserlike a "prime" tick in math
09:37mefestochouser: sorry, 'non-splat' thing?
09:37chouserthe un-asterikated thing
09:39pdki like that name though
09:39pdkthis function ain't got no splat
09:40Rayneschouser: Mind if I PM you?
09:41chouserRaynes: go ahead
10:02LauJensenmefesto: yes
10:21LauJensenfogus_: how so ?
10:22fogus_Just that my following is a fraction of his. Not that I'm complaining, he's great for exposure.
10:22kaiwrenfogus_: Uncle Bob's definitely got the Clojure bee in his bonnet.
10:22fogus_kaiwren: Indeed
10:22LauJensenfogus_: I think its because you never got that shell working on your site :(
10:23fogus_well, it works, but it's flakey. I've neglected it too long
10:24fogus_I'll redo it once CinC is targetting js
10:24LauJensenYea - Would make for a fantastic interactive Clojure tutorial
10:24fogus_I was hoping a flood of contributions would come in when Gruber used it on his site (well, as a basis anyway), but nada
10:24fogus_oh well
10:24LauJensenDont even know who Gruber is...
10:25fogus_The daring fireball guy
10:25Ploujin Listing 6 on http://www.ibm.com/developerworks/java/library/j-jtp05236.html#2.0 what would be different if I threw a new InterruptedException instead of calling Thread.currentThread().interrupt();
10:26kaiwrenI'm planning to build my personal site on compojure. That however helps nobody when it comes to exposure. :)
10:26LauJensenfogus_: Oh, Ive read some of his posts, but I think he's one of those internet phenoms I just dont get
10:27LauJensenkaiwren: Did I scare you away with my baking classes ?
10:27technomancyLauJensen: it's because you don't have a psychological need to justify spending large sums of money on fruit products.
10:27technomancyI think that's his target audience
10:28LauJensentechnomancy: ?!
10:28fogus_technomancy: +1
10:34LauJensenfogus_: Also someone like Bob, how do you rate his following and where does he get his crowds from?
10:34LauJensen(to me he was unknown until he spoke up about Clojure)
10:35tomojhe's a ruby god
10:35tomojand more I guess, from before I heard of him
10:36fogus_LauJensen: I think he's a big Agile/TDD guy. I don't know him from that however -- I think he did some pretty nice OOP essays a while back (I hope I'm not confusing him)
10:36LauJensenOk. Its fun with some of these hackers who get such huge followings. I think Paulgraham.org takes 10 million hits per month
10:36kaiwrenLauJensen: UncleBob is an XP guy, going back to the Agile Manifesto days
10:36LauJensenOk
10:36technomancybut yeah, I did ruby/TDD for years and never heard of him either
10:37kaiwrenHe's big in the same circles as, say Martin Fowler
10:37fogus_Is he a ruby guy? I always thought he was Java/C++
10:37LauJensenI've heard he likes Ruby as well
10:38kaiwrenfogus_: That lot were pretty much language agnostic. A lot of them have a SmallTalk background.
10:38tomojhe was at railsconf making everybody feel guilty about testing
10:38LauJensentechnomancy: btw Phil, did you hear that I was able to boot a physical windows partition from inside Arch earlier today? :)
10:39technomancyLauJensen: I'm sorry to hear that.
10:40bobo_LauJensen: realy? how much work did it take? :-)
10:40fogus_I guess I've read/watched numerous things from him and am still not sure what he stands for. (shrugs)
10:40LauJensenbobo_: About 15 minutes
10:40bobo_i find it realy annoying to have 2 windows installs
10:40LauJensentechnomancy: alright, I'll let you get back to MetaCity :)
10:40bobo_i would prefer 0
10:40LauJensenfogus_: Bob or Paul ? :)
10:40fogus_Bob
10:40LauJensen(take 8 (bob)) ? :)
10:41LauJensen@ fogus_
10:41fogus_LauJensen: I think his official role is gadfly :p
10:41bobo_imho, unclebob has written and done some of the best presentations about clean code ever
10:46LauJensenbobo_: I should check that out. I think my "Beautiful Code - The Manifesto" post was about the 3.rd or 4.th most flamed post I ever did - And thats saying something :)
10:46bobo_:-)
10:47bobo_dont think ive read your post
10:48LauJensenhttp://bestinclass.dk/index.clj/2009/11/beautiful-code-manifesto.html
10:51bobo_have to go to the train, il read it later!
10:51LauJensenalright
10:56cemerickman, how can HN scoop conference organizers on their own conference? ;-)
10:59chouserthat's the week right after I will have been gone for half a week to Strange Loop
10:59chousermy family's not going to like it, but how can I not go? argh!
10:59fogus_chouser: If you're going, I'm going
11:00cemerickI have family down there, so it's an incredibly easy sell for me :-)
11:00arohnertomoj: I'm in austin
11:00chouserfogus_: can't fool me -- I know you're already going. :-)
11:00fogus_chouser: :-o
11:00cemerickMight actually be in NC / DC area sometime soon full time anyway
11:00fogus_cemerick: Let me know when you are. I'm in the DC area
11:01cemerickfogus_: Just a vague possibility at the moment. You'll be the first to know if it comes off though. :-)
11:02RaynesAw. I wish I could afford to go. :(
11:03RaynesI'm in Alabama, so it isn't *that* far, but even not *that* far is too far to afford gas and lodgings.
11:04pdkALABAMA MAN
11:04RaynesPoor Alabama man.
11:08cemerickis there a general term for "equal except for case" re: strings? That's a mouthful.
11:08cemericks/general/better
11:08pdkcase-insensitive
11:08pdkor case sensitive rather
11:09RaynesWell, shoot. Maybe I can work up enough for gas money. I can sleep in the car.
11:09cemerick"case-insensitively equal" isn't any better :-)
11:09cemerickoh well
11:09chouserRaynes: I bet if you ask around you could find someone else who'd want to split a hotel room or something.
11:10Rayneschouser: It'll be October, so the car wouldn't be that bad anyway. I'm young. I can handle it. ;)
11:10chouser:-)
11:11chouserhm. I've done that, come to think of it. I was young and it was still pretty miserable.
11:11RaynesThat's assuming I can get enough gas money in two months to get there. I don't have a job. I'll go ahead and sign up, since I am reasonable serious about it.
11:13tomojarohner: cool! think we have enough others here for a meetup?
11:13arohnertomoj: the last time I saw it, the google map had ~3-4 in austin. That was probably close to a year ago
11:14arohnerthere's also an FP group trying to get off the ground
11:14tomojthis one? http://groups.google.com/group/austin-fp
11:14arohnertomoj: yeah
11:19RaynesIf I went, I'd be the youngest person there.
11:19tomojcool, thanks
11:19RaynesTo my amusement.
11:21RaynesWill registration cost anything?
11:29chouserI suppose next year will be (second clojure-conj). But what after that? (nth clojure-conj 2)?
11:29liebkeexactly :)
11:29Rayneschouser: We'll have to add functions.
11:29chousermaybe it's a vector
11:29chouser(clojure-conj 2)
11:29liebkeRaynes: we are trying to keep the registration fee low, but there will be one
11:29Raynes(twenty-first clojure-conj)
11:30chouserbut still doesn't help the problem of second/2 being different
11:30Raynesliebke: I don't know what "low" is in context of registration fees for this sort of thing, so I guess we'll have to wait and see. Between gas money, food, and now this, it'll definitely be a close call.
11:36Rayneshttp://groups.google.com/group/clojure/browse_thread/thread/b57965fafc722697
11:38RaynesIt kills me inside that this didn't make it in: http://www.assembla.com/spaces/clojure/tickets/315-add-support-for-running--main-namespace-from-clojure-main-without-aot
11:39djpowellgratz everyone on clojure 1.2!
11:39RaynesDitto.
11:55jcromartieThe link to "Clojure Contrib 1.2" on http://clojure.org/download is broken. It should point to http://github.com/downloads/clojure/clojure-contrib/clojure-contrib-1.2.0.zip
11:55jcromartieoops
11:55jcromartiehttp://clojure.org/downloads
11:55jcromartiespeaking of broken links
12:05JorejiHey guys, a Camera and a Ray both have a direction. With protocols, would you guys create two protocols ACamera and ARay which both have a dir method, or would you abstract the "having a direction" into yet another protocol? (e.g. ASomethingWithDirection)
12:05arohnerJoreji: protocols (and their methods) are namespaced
12:06arohnerI would create two different protocols
12:06JorejiAh, right. Explains why I'm getting errors when trying to :use protocols from different namespaces, with same method names.
12:09JorejiSo I'm better off writing a multimethod for dir instead of specifying it inside the protocol? If I use a protocol, then I get method-name clashes when trying to use two protocols in one namespace which share names for their methods.
12:19arohnerJoreji: just use require rather than use
12:19arohner(camera/dir) (ray/dir)
12:22Jorejiarohner: Well, I'd like to use "dir" in any case - no matter whether it is a camera or a ray.
12:22arohnerok, in that case you will need a multimethod
12:24JorejiToo bad. But thanks for clarifying that up!
12:27cemerickWow, big day. :-)
12:30danlarkincemerick: yarly
12:30hiredmanping?
12:30clojurebotPONG!
12:31cemerickdanlarkin: Man, I'm so lame. Had to google that.
12:31cemerickI figured it was close to "yea, verily".
12:32danlarkinI love urban dictionary
12:41hugodclojars is feeling the strain
12:46fogus_http://fogus.me/static/preso/clj1.2+/
12:47psykoticchouser: hey. rayne asked me to email jcowan and ask him for ownership transfer for #clojure. could you privmsg me an email of yours i could cc?
12:47chouserpsykotic: thanks. I wrote him earlier today.
12:47chouserdunno if the email address I have for him is good or not
12:49RaynesIt's a small world.
12:49psykoticchouser: i have one i've used before, so i'll try that one.
12:50chouserpsykotic: thanks!
12:51Rayneschouser: Isn't word of mouth awesome?
12:51RaynesOr word of keyboard.
12:52chousercould be -- we'll see how this turns out. :-)
12:53Rayneschouser: I have ownership of #clojure-casual now, so if you get ownership and do the whole group registration thing, let me know. I'm not sure what the significance of all that is.
12:54chouserI mostly just want someone somewhere to be able to update the /topic as needed.
12:54RaynesYeah, I was thinking about that earlier.
12:54psykoticyeah, the whole situation is kind of ridiculous :)
12:55psykoticthe whole 'race to see who registers the channel for project x' smells a bit like the domain name race
12:55RaynesI always wondered why it wasn't updated to point out that Clojure moved to github.com/clojure/clojure and stuff.
13:00Rayneschouser: An interesting side-effect of being a group is that you can apparently give people group hostmasks. Picture ~raynes@clojure/user/raynes
13:00Raynes;)
13:01chouserregarding "What is the reason Lisp code is not written with closing parenthesis on new lines?" gmail says "conversation could not be loaded"
13:01chouserprobably just as well.
13:02psykotichaha
13:02cemerickThe more we can bury those old battles, the better.
13:02Rayneschouser: Indeed. It's the entire Clojure community giving reasons and Greg Slepac or whatever his name is telling everyone they're wrong.
13:03RaynesIt's like he believes that he has found some secret to Lisp readability that nobody over the past 50 years has noticed.
13:03cemerickTurn on paredit (or similar) in every editor mode and IDE plugin by default, problem solved. :-)
13:04Raynescemerick: M-x show-paren-mode :D!
13:06cemerickRaynes: remember, I don't speak emacs ;-)
13:06cemerickbut, sure
13:07Raynescemerick: It's the mode (I think) that makes an opening paren highlight when your whatchamacallit is on a matching closing paren.
13:07cemerickah
13:07cemerickI was meaning more the behaviour where closing parens are managed -- you simply can't put them on their own lines
13:07cemerickor, not without undue effort
13:08cemerickThat's exactly how VS preserves newline-braces as the standard over there. *shrug*
13:10fogus_The whole problem with the paren-placement discussion is that people keep forgetting to type "for me" and "in my opinion"
13:12Raynesfogus_: But my opinion is the right one. :(
13:12fogus_as is mine
13:12Raynesfogus_: rhickey's, actually. :p
13:13chouserexcept where they diverge from mine.
13:13RaynesHe speaks the truth.
13:15jcromartiemad props to everybody who got 1.2 out... I really wish I could have contributed but ASP.NET took over my life
13:16Raynesjcromartie: Is he watching you now? Does he know you're IRCing? s_s
13:16itistodayRaynes: you're a dick. :-)
13:16Raynesitistoday: You know I love you though. <3
13:18itistodayRaynes: sometimes... i have my doubts. ;-)
13:18pdkwhat's the meat of slepac's argument there
13:18Raynespdk: He's right there, ask him. :p
13:18pdkheh
13:19itistodaypdk: http://gregslepak.posterous.com/on-lisps-readability
13:19Raynes^ Is the famous mister Slepak.
13:19psykoticfamously wrong
13:21itistodayI think Raynes makes a superbly rational argument agains this Slepak character: "My eyes bleed when I see code written like that."
13:22RaynesI think I heard somebody mention that you probably expected Guy Steele to appear in front of you, shake your hand, and say "Congratulations son, you've done it."
13:23slyruswhere does the "WARNING: spit already refers to: #'clojure.core/spit in namespace: clojure.contrib.io, being replaced by: #'clojure.contrib.io/spit" message I see every time I start lein come from?
13:23RaynesIt was funny at the time.
13:25chouserIt doesn't seem like a topic nearly worthy of the time.
13:26chousermy position is simple: write what you want. If you want any help from me, write in a way that's at least reasonably close to how I like it to look.
13:26chouserfortunately if you write it that way, there are lots of people who will be more willing to help.
13:26chouserthe end.
13:26Rayneschouser: That's because it isn't. But people (like me) can't resist the urge to reply to long blog posts.
13:27RaynesThat's my position. Get out of my position.
13:27chouser:-)
13:27BrianForesterslyrus: I was just about to look up :use versus :require since I'm seeing similar warnings with: WARNING: repeat already refers to: #'clojure.core/repeat in namespace: proquest.pubConvert, being replaced by: #'clojure.contrib.string/repeat ...granted that is my code and not lein...
13:28dnolenclojurebot: use
13:28clojurebotuse vs require is (:use [lib :only [a b c]) or (:require [lib :as alias]) -- (:use lib) is only for playing around
13:28chousernice summary!
13:31itistodaychouser: there are good reasons for each style. i'm happy to help anyone out regardless of how they format their code.
13:31chouseritistoday: that's generous of you, thanks!
13:31itistodayseems silly to say to someone, "no, i won't help you because your code doesn't look like mine"
13:32hiredmanI won't help you because you code looks like something a smurf barfed up
13:32RaynesI think the real issue, and the reason that you get lots of crap, is that most of us don't actually see the good reasons for the newline'd-paren style.
13:32chouserit's just a matter of how I choose to spend my time. If I'm already donating my time to help, I'd simply rather not spend it trying to see through some unusual formatting choices.
13:33BrianForesterso :use brings functions into the current namespace? which explains the collisions I am (was) seeing.
13:33chouserRaynes: I don't think I'd put up much fuss if the "normal" way to format clojure was different. I like to integrate with the culture of the language I'm using.
13:33itistodayRaynes: i listed them in the post. and in principle giving someone crap for having a certain code style is a dick thing to do.
13:34itistodayRaynes: especially when they explain their rational for it. :-p
13:34hiredmanBrianForester: it doesn't bring them in they still are in the namespace they were def'd in
13:34hiredmanit just lets you refer to them without namespace qualifying
13:34itistodayRaynes: the other thing is that i've actually tried both styles. have you?
13:34BrianForesterhiredman: K, thanks.
13:35RaynesWhy would I? :\
13:35itistodayRaynes: exactly, you haven't.
13:35RaynesI've seen code written in both styles.
13:35dnolen*sigh* is this zombie paren discussion really going to be revived on IRC ?
13:35cemerickitistoday: don't mind hiredman, he's usually grumpy ;-)
13:35itistodayRaynes: Your *entire* argument is, "i don't like your style because it's different from mine"
13:35RaynesBut seriously, why would I? ._.
13:35hiredmancemerick: how dare you!
13:35itistodayRaynes: and you then *jump* on people for even considering using a different style
13:36cemerickhiredman: pistols at dawn?
13:36cemerickor is it usually at noon?
13:36itistodayRaynes: your so wrapped up in your own world-view, and closed to others, that you continue to ask, "why would I?" as well
13:36Raynesitistoday: No, my entire argument is that "I don't like your style because it's inconsistent with what *everyone else* does and has done for many years, and your arguments don't make sense to me."
13:36RaynesIt's really simple.
13:36hiredmanI have a day job so it will have to be at dusk
13:36cemerickI agree with dnolen, it'd be nice if all parties involved in any kind of code style issue would walk away and agree to disagree. :-|
13:36hiredmanmaybe noon will work if I can squeeze it into my lunch break
13:37cemerickhiredman: screw it, let's just get a beer then. :-P
13:37itistodaycemerick: i would, but Raynes jumps out from nowhere and attacks me.
13:37hiredman:P
13:37Raynesitistoday: Plus, I never jumped on you. I'm willing to totally let bygones be bygones, because I honestly don't care what your code looks like unless I have to read it. We've already agreed to disagree, so let's not fill up this channel with more garbage than necessary.
13:38itistodayRaynes: great! :-)
13:38itistodayRaynes: (P.S. Never forced you to read it)
13:38RaynesYou most certainly did not.
13:43Raynes:p
13:45Raynesraek: I was "there when it happened"
13:45Raynes;D!!
13:46raekcongratulations, everyone!
13:48slyrusit's a little too early on this coast, or I'd suggest a toast to the responsible parties
13:56tomojwoohoo
13:57fliebelCongratulations with Clojure 1.2!
13:59jcromartieone of the most impressive things about Clojure as a project is how solid it has been
13:59jcromartieit's built like a tank
14:00rhudsonbut a lot more maneuverable!
14:02jcromartieRuby has "releases" that are "sort of" supported on anything but certain versions of Ubuntu...
14:02jcromartieand they call them releases
14:02jcromartienot RC
14:08pdkwould certain versions include 10.04
14:08pdkalso itd be nice if we stuck little "clojure x.y is out now" notices in the topic
14:14jcromartiepdk: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/367983
14:14Raynespdk: We can't.
14:15pdkit is FROZEN IN TIMEEEEEEE
14:15Raynespdk: chouser is awaiting the response of the creator of this channel. Requesting a transfer of ownership or ops.
14:15pdkand it's not rhickey
14:16rhudsonOwner is named Godot, I take it
14:16chouserExactly. He'll be here any moment, I'm certain.
14:16RaynesNope.
14:16Raynesjcowens, actually.
14:17rhudsonIt was a joke, Raynes. Here, have some parens
14:17Rayneschouser: You got a response? Goodie.
14:17Raynesrhudson: I didn't get it. :(
14:17chouserI really wonder how many people will come to clojure-conj. I wonder if they'll be outnumbered by the speakers.
14:17cemerickRaynes: http://en.wikipedia.org/wiki/Waiting_for_Godot
14:17cemerickone of my favorites
14:17chouserI guess that'd be ok -- we can all go to each others talks and have a grand old time.
14:18cemerickwe should start a pool
14:18fliebelWhat is clojure-conj?
14:18Raynesfliebel: first.clojure-conj.org
14:19pdkno relation to phoenix wright
14:19rhudsonIt's a very clever name
14:19cemerickFor my part, I promise a set of 100% maven talks. ;-)
14:20Raynesclojure-conf would have been more obvious, but less clever.
14:20fliebelRaynes: That is in the US is suppose?
14:20Raynesfliebel: North Carolina, US of A.
14:20Raynescemerick: I promise to not be there to see them. :p
14:20BjeringUnit-testing agents, I assume this is one of the good places to use the await function?
14:20fliebelRaynes: If it was in Europe, I'd love to come :(
14:21cemerickRaynes: it'll just be me, SS, and about 85 rabid Java devs.
14:21RaynesNaw, I'd love to be there.
14:21RaynesDoubtful I'll be able to fund the trip though.
14:22cemerickRaynes: are you still in school?
14:22raekwhat fliebel and Raynes said
14:22Raynescemerick: If I came, I'd walk up and give you a big hug.
14:22chouserBjering: possibly. the function you send to the agent though is best when its a pure function and then can be tested without anything as clever as await.
14:22Raynescemerick: Yes, but I'm home schooled. Which is why I'm here all the time.
14:22cemerickRaynes: OK, but I'm not joining you and itistoday! :-P
14:22Raynes:p
14:23fliebelRaynes: same for me, well… almost homeshool
14:23RaynesWell, most of the time. More like why I occasionally sleep during the day and am active at night.
14:23RaynesI have no social life.
14:23cemerickRaynes: you should take up a collection or something
14:24RaynesA collection?
14:24BjeringChouser: https://gist.github.com/6590b4fd7423d10781a7 , perhaps too trivial to really prove anything, but its the start of my rewrite of yesterdays failed chat-server.
14:24fliebelRaynes: And social life :) But I know it's harder wehn doing homeschooling
14:24cemerickRaynes: get donations to pay your way, etc
14:24Raynesfliebel: Not really. It's living in the middle of nowhere with nowhere to go. ;)
14:24Raynescemerick: People don't like me that much. :p
14:24BjeringChouser, its more a unit-testing my understanding of agents and await are correct :)
14:25fliebelRaynes: where is your nowhere?
14:25RaynesAlabama.
14:25fliebel*opens google maps*
14:25RaynesIf anywhere was a nowhere, it's there.
14:25RaynesEldridge, Alabama to be specific.
14:25arkhSouth
14:25RaynesAproximately 550 miles from the location of the conference.
14:25arkh*Dakota may give you a run for your money on nowhere
14:25Raynes9 hours and 41 minutes away.
14:27cemerickEldridge, AL: "At the 2000 census the population was 184."
14:27cemerickRaynes: holy crap!
14:27RaynesYessir.
14:28RaynesAnd people have died since then. ;)
14:28fogus_Raynes: At least you're the best Clojure programmer in your town.
14:28metagovIs lazy-cons a real macro? I see it in the cheat sheet and it's listed on the macros section but I can't find any description of it.
14:28cemerickI support home-schooling must be the only option there.
14:28Raynesfogus_: I'm the best Clojure programmer in 100 miles in either direction, at the very least.
14:28fliebelfogus_: That is probably true for me as well
14:29Raynescemerick: Actually no. The Carbon Hill High School sends buses out here, apparently.
14:29RaynesI've just always been home schooled. I saw no reason to go to a public school when I have more time for coding if I'm home schooled.
14:29fliebelRaynes: But they don't teach Clojure in.. yea, that is what I mean
14:29RaynesClojure trumps a social life. I don't really like teenagers. ._>
14:30RaynesI feel I can learn more on my own regardless.
14:30danlarkinnobody does :)
14:30jcromartiehah
14:30edbondwhat is the function for (first (remove nil? <coll>)) ?
14:30chousermetagov: lazy-cons is old
14:30chousermetagov: It's superceded by lazy-seq
14:31cemerickedbond: I think you just wrote it. :-)
14:31Raynesedbond: Eh, (first (remove nil? coll)) ought to do it. ._. I'm not sure there is an actual function for that.
14:31metagovchouser: thanks
14:32edbondcool, thanks
14:32RaynesI tend to do (filter identity coll) when I know that it's safe to get rid of false values, 'cause I'm a maverick.
14:32edbondisn't better to write (drop-while nil? ...) or something?
14:33edbondor its equivalent since laziness?
14:33raekfilter is lazy too
14:33raekit wont continue unless you force it too
14:34cemerickedbond: very roughly, everything seq-related is lazy except for reduce
14:34RaynesRemove is as well, I imagine. I assume it uses filter and complement's the predicate.
14:34rhudsonI just noticed (range) in the release notes, as a replacement for (iterate inc 0). A tiny but very convenient improvement
14:34Raynescomplements*
14:35RaynesDid I mention that complement is an awesome function with a confusing name? It is.
14:36tomojrhudson: whoa, yes.
14:36Raynes->((complement true?) true)
14:36sexpbot=> false
14:36cemericktomoj, rhudson: range has been around nearly forever
14:36RaynesWhoa, I didn't see that.
14:36tomojcemerick: nullary range too?
14:36rhudsonYes, but the nullary is new
14:36raekthe function-generating-functions are easy to overlook
14:36RaynesNullary is new.
14:37cemerickah, I didn't catch that, sorry
14:37fliebelraek: what are they?
14:37tomojI always felt a bit irked when writing (iterate inc 0)
14:37Raynestomoj: Likewise.
14:37raekjuxt, comp, complement, etc
14:37cemerickI never internalized that, so I always used (range Integer/MAX_VALUE) *blush*
14:38Raynescemerick: That's adorable.
14:38chouserhm -- (range) is chunked, (iterate inc 0) is not
14:38fliebelraek: ah, of course. It's realy time for me to write loads of Clojure again.
14:38RaynesThe code, not the blush.
14:38rhudsonI really wish complement and identity had shorter names. 'non and 'stet maybe
14:38raekthe functional programming chapter of Joy of Clojure is very good
14:38cemerickPuppies have nothing on me.
14:40pdkwhat do you mean by chunked, is this some difference in the way its results are cached
14:40jcromartiepdk: yes, chunked seqs calculate the sequence in "chunks" instead of one at at ime
14:40tomojstet?
14:40tomojwhy not 'id?
14:41tomojer, really my question is what the heck is 'stet
14:41jcromartietomoj: it's "tets" backwards
14:41jcromartieof course
14:42rhudsonstet means "let it stand" -- it's an editing thing that means leave it the way it is
14:42tomojlatin?
14:42rhudsonlatin
14:42Raynesrhudson: I'm surprised "identity" isn't 'id'.
14:42rhudson"id" is just such a useful name for identifier
14:43tomojoh, wow, I didn't even see that, haskell has poisoned my brain
14:44fliebelWhat is the use of a function the just returns its argmuent>?
14:44tomoj(take-while identity coll) is one example I remember
14:44rhudsonBut my real point is 'identity has too many convenient uses in filters etc. to have a long name
14:44pdkuse it in iterate, repeat(edly) etc
14:44tomojyes, I also was always a bit irked by its length
14:44pdkcomp
14:44Raynesfliebel: For stuff like (filter identity [false nil true 2 1 "blah"])
14:44Raynes-> (filter identity [false nil true 2 1 "blah"])
14:44sexpbot=> (true 2 1 "blah")
14:45Raynesfliebel: There are times where you need to pass a function to another function, but you really just want that function to return it's argument.
14:46fliebelI see...
14:46tomojpdk: (comp identity f) ?
14:47pdkit could be a last ditch utility :p
14:47pdkthink of it as
14:47pdkyou'd use it that way in a macguyver sort of situation
15:01chouseralso filter
15:02chousersomeone was just asking for that
15:04technomancywell, I guess the feature freeze is over
15:04chouserright! check it in!
15:04technomancyI have a big list
15:05pdkwe'll have clojure 1.3 before sunset
15:05pdkall thanks to techno over here
15:05technomancyhttp://p.hagelb.org/1.3-hopes-and-dreams.html
15:05tomojif I have to pick one, strange loop or clojure-conj? :/
15:07rhudsonwhat's ":like in ns macro", technomancy?
15:07technomancyrhudson: from nstools
15:07technomancyclojurebot: google nstools clojure
15:07pdkwhat would a 1 arg version of filter or remove do
15:07clojurebotFirst, out of 12 results is:
15:07clojurebotManaging namespaces « On Clojure
15:07clojurebothttp://onclojure.com/2010/02/17/managing-namespaces/
15:07chousertomoj: I would have picked clojure-conj, had I only known it was an option.
15:08tomoj.. aren't you a speaker?
15:08technomancyrhudson: basically having a base namespace so you can easily create others with the same use/require clauses
15:09rhudsonah. looking at the link; sounds cool and useful
15:09technomancyone of the few things that can't be done well in an external library, though that's what he's tried
15:16chousertomoj: yeah, but they're only a week apart -- that's a lot of travel for me.
15:19holowaydo any of you vim users have trouble with vimclojure's rainbowparens mode on the mac? I can't seem to actually turn it on.
15:21naeuHappy 1.2 day everyone
15:21tomojchouser: oh, so grudgingly going to both?
15:22fliebelholoway: I had them working ages ago, but it's realy to long ago since I've written Clojure
15:22chousertomoj: grudgingly sounds meaner than I'd like, but yes going to both.
15:22holowayyeah, everything else seems to work, but as far as I can tell 'let g:vimclojure#RainbowParens=1' has no impact at all
15:22holowayI'll dig further
15:23chouserI'm sure both will be fun
15:25naeuI'm struggling with a basic problem - how to generate a lazy sequence of [int square-of-int] pairs for all ints
15:27raek(for [x (iterate inc 0)] [x (* x x)])
15:27chouserraek: range
15:27raek,(take 3 (range))
15:27clojurebot(0 1 2)
15:27hiredman,(take 10 (map (juxt identity #(* % %)) (iterate inc 0))))
15:27clojurebot([0 0] [1 1] [2 4] [3 9] [4 16] [5 25] [6 36] [7 49] [8 64] [9 81])
15:27raekI see...
15:28naeuI was wondering why #([%1 (* %1 %1)]) doesn't work
15:28hiredman,(take 10 (map (juxt identity #(* % %)) (range))))
15:28clojurebot([0 0] [1 1] [2 4] [3 9] [4 16] [5 25] [6 36] [7 49] [8 64] [9 81])
15:28hiredmannaeu: macroexpand it
15:28hiredman,(macroexpand-1 '#([%1 (* %1 %1)]))
15:28clojurebot(fn* [p1__503246#] ([p1__503246# (* p1__503246# p1__503246#)]))
15:28naeuhiredman: can you macroexpand anonymous functions?
15:28raeknaeu: that expands to (fn [%1] ([%1 (* %1 %1)])) and not (fn [%1] [%1 (* %1 %1)])
15:28hiredmanlook at the parens
15:28pdelgallegoHave clojure anykind of interpolation string? Maybe place holders where introduce data into a string.? Ie "my name is %s" % name
15:29raek#(vector ...) works
15:29hiredman,(doc format)
15:29clojurebot"([fmt & args]); Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax"
15:29tomoj-> '#([% (* % %)])
15:29sexpbot=> (fn* [p1__3661#] ([p1__3661# (* p1__3661# p1__3661#)]))
15:29pdelgallegothank hiredman
15:29hiredmandanlarkin: thats two
15:31naeuhiredman: thanks for the help
15:33danlarkinhiredman: you're a crowd favorite
15:33hiredmandanlarkin: thats three
15:34BjeringI find no def- corresponding to defn-, how do I def a private var? And is there a reason that def- isnt provided (ie is private vars a bad idea?)
15:35technomancyBjering: no reason; it's a very strange omission
15:35hiredmanwell, in 1.3 you will just be able to use ^:private
15:35wwmorganclojure.contrib.def has def-, iirc
15:35technomancythat's nine too many chars, hiredman
15:35hiredman(jeeze, 1.2 just landed)
15:36chouserwwmorgan: I think that's called defvar-
15:36hiredmanugh
15:36technomancyhiredman: http://jordi.platinum.linux.pl/piccies/unacceptable.png
15:36hiredmanI am pretty ok with ^{:private true}
15:36hiredmanfor that matter
15:36Rayneschouser: And defvar- isn't the same as what def- would be.
15:37Raynes^{:private true} is what I do.
15:37danlarkintechnomancy: http://www.bay-of-fundie.com/img/2009/donkey-balls2.gif
15:37hiredmanpoint refuted
15:38naeuI was just perusing fogus's 1.2 slides and came across the following snippet. Could anyone enlighten me as to how this actually works? (let [{first-thing 0, last-thing 3} '[a b c d]]
15:38naeu [first-thing last-thing])
15:38chouserthat's not actually new
15:38technomancydanlarkin: tell it to the bot, man.
15:39lenwhi all
15:39Raynes$learn donkey-balls http://www.bay-of-fundie.com/img/2009/donkey-balls2.gif
15:39sexpbotMy memory is more powerful than M-x butterfly. I wont forget it.
15:39Raynes;)
15:39tomojnaeu: do you understand (let [{foo :f, bar :b} {:f 1 :b 2}] [foo bar]) ?
15:40chouser(let [{a 0, b 3} ...]) will use get to look up values for a and b using the keys 0 and 3
15:40chouserand get works fine on vectors.
15:40chouser,(get '[a b c d] 3)
15:40clojurebotd
15:40naeutomoj: I can see how it works, but I don't understand it.
15:40tomojoh
15:40tomojmaybe chouser will explain it to you :)
15:41chouserhmph. thought I just did.
15:41tomojI suppose so
15:41tomojare the bot wars over?
15:42lenwsimple question : whats the best way to poll an email folder every x minutes ?
15:42tcrayforduse loop with Thread/sleep maybe?
15:42lenwyeah thats what i am doing now :)
15:43chouserwhat do you do with the results? could use repeatdly on a fn that polls and sleeps
15:43naeuI guess the thing I have to get out of my head is that the first map in the let statement isn't assigning a value to a map, but is really rather a fancy syntactic sugar description of the destructuring of the elements within it such that the let binds stuff to the symbols inside it based on the right hand side structure
15:43chousernaeu: sounds like you've got it :-)
15:43naeuit's really rather fancy :-)
15:43lenwi process the results chouser
15:44fogus_chouser: I tried to reword that so it's clear that assoc-destr is not new, but instead kwargs are. I guess it's still confusing :(
15:44lenwsend them off to another system after digesting them a bit :)
15:45naeuok, so how does this work then: (defn a-fn [& {fname :first, lname :last}]
15:45naeu [fname lname])
15:46tcrayfordfogus: who should I talk to about speaking at the clojure conj?
15:46BjeringIn the process of trying to write something in clojure am looking for good ways to stucture and encapsulate especially any access to stateful java-objects. Here is my start at my current attempt https://gist.github.com/06a497d95eb946ed5b62 it expose me a create method and a write method, the fact that these are delagated to agents I view as an implementation detail. Is this a reasonable approach to clojure application development?
15:48hiredmanBjering: are the java objects not thread safe?
15:48Bjeringhiredman: Its more that they are not pure.
15:48Bjeringie their methods have side effects
15:49Bjeringlike sending something on a socket...
15:51Bjeringyesterdays attempt was a failure with incorrect use of refs. Agents seems like a conceptually nice fit. Will see when I get further if the implementation looks good. What I am thinking now is just that I should ask so I dont miss any abvois pattern/style-guides I should follow.
15:52naeuin the case of the varags fn does the let binding happen in the reverse formation as it appears in the definition? i.e. does [& {fname :first, lname :last}] gets turned into the equivalent of (let {fname :first, lname :last} {arg1 arg2 arg3 arg4}])
15:52chouserBjering: you really want pods
15:53fogus_tcrayford: Did you see Stuart's post on the Google Group?
15:53BjeringFor example, I can see myself using the idiom with a public function encapsulating the send to an agent with a private pure function over and over again. Is this something common, if so is there an accepted name-conventions I should use, like one used to use foo-iter inside foo in scheme. ?
15:53AWizzArdchouser: I didn’t follow that discussion, but: are Cells now called Pods?
15:53chouserAWizzArd: yes
15:53AWizzArdk
15:56BjeringAre these pods something I can use for production code now? (1.2) Or something that will come later?
15:57naeuBjering: pods are still in the design stage
15:57Bjeringlol... google clojure pods gave me this irc log 3 min ago....
15:57ordnungswidrigchouser: just joined the discussion, do you have a pointer about pods and pods with non-pure java objects?
15:57ordnungswidrigBjering: that happened to me yesterday :)
15:58BjeringSo, until then, is this agent as monitor approach accepted wisdom or is it a bad idea?
15:58edbondwhy clutch :map function returns vector of vector?
16:01chouserordnungswidrig: not really. I don't know if any code is available either.
16:01chouserclojurebot: cells?
16:01clojurebotcells is http://gist.github.com/306174
16:01chouseroh look -- code!
16:02chouseras what?
16:03slyrus#(vector ...)
16:03chouserah
16:03raekBjering: interesting question
16:04slyrusI've made the same mistake of expecting that to work dozens of times...
16:04chouserBjering: it's certainly been done before. agents are idetities, which matches with the mutable java object they hold
16:05chouserthough of course nothing but convention prevents someone for deref'ing the agent and doing any unprotected thing they want.
16:05raekI think that the pure function part should always be defined explicitly
16:06raekthat the function that is sent to the agent should have it's own (maybe private) name
16:06raekat least that makes testing much more simpler, in my experience
16:07tcrayfordfogus: should I just respond there?
16:07Bjeringraek: Only that in my case the "pure" function is distincly un-pure in that it is its side-effect I am after.
16:08raekhrm, I see
16:08Bjeringraek: My do-write: https://gist.github.com/06a497d95eb946ed5b62
16:12edbondis it true clutch view server doesn't run clojure code but translate it to some js?
16:13arohnerdoes anyone else find themselves doing (if foo (f bar) bar) a lot? It feels like there should be an idiom for it
16:14raekbtw, is there a name for the "splitting into a pure and none-pure part" way of doing things I keep thinking about?
16:14slyrusyay. (map #(names [(:top %) (:bottom %)]) (vals (configurations (smiles-test/get-molecule "Z-1,2-difluoroethane")))) works :)
16:16tcrayfordarohner: I've done a tonne of that recently, have been pondering
16:17arohner(maybe foo f bar)?
16:18tcrayfordthat'd confuse me (seeing as I use the maybe monad in places)
16:19tcrayford(only pred f obj)?
16:21arohnertcrayford: what does only signify to you?
16:21rhudson(apply-if foo f bar) ?
16:22tcrayfordrhudson: nice
16:22arohnerrhudson: I like that
16:22edbondwhy :reduce works in futon, but not in code? http://gist.github.com/538819
16:22tcrayfordarohner: I don't like only, was just trying to get the wheels turning
16:23tcrayfordapply-if seems to signify some use of "apply" though
16:24arohnertcrayford: so apply it :-) [test f arg & args] `(if test (apply f arg args) arg)
16:25tcrayfordarohner: that doesn't need to be a macro
16:25arohnerah, right
16:26tcrayfordand its tricky working out if pred is run against arg or args
16:26arohnerIMO, don't run it against anything. pred could be something that isn't a function of arg
16:27tcrayfordso (apply-if (zero? 0) inc 0) ?
16:28tcrayfordinstead of (apply-if zero? inc 0) ?
16:28edbondgot it: futon automatically add group=true
16:29rhudson(apply-if *paranoid* check whatever)
16:30tcrayfordthat's not bad I guess. My use case is usually that the predicate is always run against the same argument (hence wanted to eliminate duplication there)
16:31arohnertcrayford: the code I'm looking at right here isn't a function of arg, so if apply-if doesn't support it, I'll need another function :-)
16:31slyrusnow I have no excuse not to begin writing the 2d molecule layout routine
16:31tcrayfordarohner: fair does then.
17:30wtetzner,(let [x "fred"] (fn [] x))
17:30clojurebot#<sandbox$eval503264$fn__503265 sandbox$eval503264$fn__503265@92495f>
17:30wtetzner,(.x (let [x "fred"] (fn [] x)))
17:30clojurebotjava.lang.IllegalArgumentException: No matching field found: x for class sandbox$eval503268$fn__503269
17:32slyrushmm... nested maps are kind of a pain to work with. I'm probably missing something though.
17:32raekslyrus: get-in, assoc-in, update-in :)
17:32wtetzner,(map #(.getName %) (.getFields (class (let [x "fred" coolness ['x]] (fn [] [x coolness])))))
17:32clojurebot("__methodImplCache")
17:33slyrusoh, thanks raek!
17:33wtetzner(.__methodImplCache (class (let [x "fred" coolness ['x]] (fn [] [x coolness])))
17:33wtetzner,(.__methodImplCache (class (let [x "fred" coolness ['x]] (fn [] [x coolness])))
17:33clojurebotEOF while reading
17:34wtetzner,(.__methodImplCache (let [x "fred" coolness ['x]] (fn [] [x coolness]))
17:34clojurebotEOF while reading
17:38slyrusraek: wow. not sure how I got by without those :)
18:48psykoticchouser: looks like we got the ownership issue resolved.
18:50bmhDoes anyone have strong feelings about the testing frameworks available for clojure? I would prefer to use something similar to QuickCheck
18:52SirNickI am using Leiningen along with a few java-only jars (not written by me). What's the preferred way of handling such a situation since the jars will likely never be provided on Clojars or anything similar?
18:56tcrayfordbmh: look at clojurecheck
18:56tcrayfordSirNick: you can install those jars into your local mvn repo, or add another mvn server for lein to pull from
18:57slyrusd'oh... the other bracket/brace related bug I always make is that I expect (key {3 4}) to be 3
18:57slyrushow do I make a single map entry like that?
18:57tcrayfordsingle map entries can be made by vectors
18:57tcrayford,(key [3 4])
18:57clojurebotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry
18:57SirNicktcrayford: I can't say I really know anything about using mvn... How can I add to my local repo?
18:58slyrustcrayford: oh?
18:58slyrus,(key (first {3 4}))
18:58clojurebot3
18:58slyrusthat seems ... silly
18:58tcrayford,(vector? (first {3 4}))
18:58clojurebottrue
18:59wwmorgan,(key (find {3 4} 3))
18:59clojurebot3
18:59slyrus,(class (first {3 4}))
18:59clojurebotclojure.lang.MapEntry
18:59slyrus,(class [3 4])
18:59clojurebotclojure.lang.PersistentVector
18:59slyruswjat
18:59slyruswhat's the handy literal syntax for a MapEntry?
18:59tcrayfordslyrus: vectors implement clojure.lang.mapentry, but not java.lang.mapentry (for the looks of it)
19:00slyrusgrumble
19:00hiredmanhuh?
19:00wwmorgan,(key (clojure.lang.MapEntry. 3 4))
19:00clojurebot3
19:00tcrayford(I'm guessing here, hiredman probably actually knows)
19:00hiredman,(ancestors (class [1 2]))
19:00clojurebot#{java.io.Serializable clojure.lang.IPersistentVector java.lang.Comparable clojure.lang.AFn clojure.lang.Counted clojure.lang.Sequential java.util.RandomAccess clojure.lang.Seqable clojure.lang.IFn java.util.Collection clojure.lang.Reversible clojure.lang.IObj clojure.lang.Associative java.lang.Object clojure.lang.IPersistentStack java.util.List java.util.concurrent.Callable clojure.lang.Indexed clojure.lang.IEditableColle
19:01hiredman,((ancestors (class [1 2])) java.util.MapEntry)
19:01clojurebotjava.lang.ClassNotFoundException: java.util.MapEntry
19:01hiredman,((ancestors (class [1 2])) java.util.Map$MapEntry)
19:01clojurebotjava.lang.ClassNotFoundException: java.util.Map$MapEntry
19:01tcrayfordits Map$Entry
19:01hiredman,((ancestors (class [1 2])) java.util.Map$Entry)
19:01clojurebotnil
19:02hiredmanno kidding
19:02tcrayfordhence:
19:02tcrayford,(key [1 2])
19:02clojurebotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry
19:03wwmorganhowever, in many situations you can use a vector like a map entry: (reduce conj {} [[1 2] [3 4]]) => {3 4, 1 2}
19:04tcrayfordyeah, just kinda funny that it doesn't work for key
19:09__debaserHi
19:09__debaserwhat is the best way to start a clojure 1.2 repl with clojure contrib?
19:09__debasermvn clojure:repl does not start jline
19:10areteIIRC you have to add jline as a dependency and then it will
19:10__debaseris java -cp /Users/philipp/Clojure/jline-0.9.5/jline-0_9_5.jar:/Users/philipp/Clojure/clojure-1.2.0/clojure.jar:/Users/philipp/Clojure/clojure-contrib-1.2.0/target/clojure-contrib.jar jline.ConsoleRunner clojure.main
19:10__debaser deprecated?
19:11__debaserthis no longer loads contrib
19:12__debaseror what is the best way for starting a repl?
19:13wwmorgan__debaser: if you use leiningen then "lein repl" will give you a repl with jline
19:20slyrusyay. _now_ we have all of the relative positioning info for complex branched molecules with double bonds.
19:22bobbytekso clojure
19:22bobbytekwhy use it over scheme?
19:25hiredmanbobbytek: can you please go bother everyone in the irc channels of the 64 thousand other langauges you have mentioned and ask them why you should use their language over clojure
19:25wwmorganbobbytek: someone asked that same question yesterday http://clojure-log.n01se.net/date/2010-08-18.html#21:07
19:27bobbytekhiredman: no
19:27bobbytekBut seriously
19:27bobbytekI'm floundering around trying to understand where FP fits in
19:27bobbytekAny what differentiates all these lisps
19:28bobbytekand non-lisps (OCaml, ML, F#)
19:28bobbytekIt's all very confusing. Some basic context might help
19:28wwmorganhttp://clojure.org/lisps comparison of CL, Scheme, and Clojure
19:28bobbytekthanks my good man
19:32__debaserwhat does my project.clj have to look like?
19:32__debaser(defproject interactive "0.1"
19:32__debaser :dependencies [[org.clojure/clojure
19:32__debaser "1.1.0-master-SNAPSHOT"]
19:32__debaser [org.clojure/clojure-contrib
19:32__debaser "1.0-SNAPSHOT"]]
19:32__debaser :main interactive)
19:40aliensciencedebaser: http://github.com/technomancy/leiningen/blob/master/sample.project.clj
19:48defnbobbytek: id be interested to know what you think after reading that
19:50slyrus,(filter (comp #{:low} :bogosity) [{:name "moose" :bogosity :low} {:name "ape" :bogosity :high}])
19:50clojurebot({:name "moose", :bogosity :low})
19:52slyrusor for a more useful example: (map (comp names atoms) (filter (comp #{2} :order) (bonds (smiles-test/get-molecule "tamoxifen"))))
20:21technomancyclojurebot: comments is http://www.cc.gatech.edu/computing/classes/cs2360/ghall/style/commenting.html
20:21clojurebotAlles klar
20:25birdspiderhi, I'm new to clojure and wondering if anyone can tell me how to pass a seq of values to a function as arguments
20:26technomancy,(apply + [1 23 4])
20:26clojurebot28
20:26technomancybirdspider: try apply ^
20:27birdspidertechnomancy: i.e (apply ^ ["1st" "2nd"]) ??
20:27technomancybirdspider: sorry; I mean ^ as in "look at the line above this one" =) just (apply myfunction mysequence)
20:33birdspidertechnomancy: oh my, I thought of everything but applying thisway round :)
20:34technomancybirdspider: you can pull them apart in the function as well using destructuring, but that's harder to demonstrate since clojurebot doesn't allow defn
20:35birdspidertechnomancy: thx, I would have another question, if you like, I do see something like this often lately '`(list ~@(seq "a" "b"))' whats up with this
20:35technomancy,((fn [[a b c]] (println "a" a "b" b "c" c)) [1 2 3])
20:35clojurebota 1 b 2 c 3
20:35birdspidertechnomancy: well yes thats like pattern matching in haskel :)
20:35birdspidertechnomancy, but in my case I have varable args length
20:36birdspidertechnomancy, that was my problem
20:36technomancy,((fn [a b & c] (println "a" a "b" b "c" c)) 1 2 3 4 5 6)
20:36clojurebota 1 b 2 c (3 4 5 6)
20:36birdspidertechnomancy, so I still would have a seq to pass as args in the end :)
20:38birdspidertechnomancy, anyway apply solved it prefectly, any idea or good source where I could read up this ` ~@ stuff ?
20:39technomancybirdspider: it's called unquote-splice; it's generally used in macros
20:44birdspidertechnomancy: thx for the help, much appreciated, bye
21:27chouserpsykotic: transfer's done. thanks for your help.
23:26spewnIs it possible to add a docstring with defrecord?
23:40cemerickchouser: I'm only 15 minutes into looking at this, but it's damn promising so far: http://djproject.sourceforge.net/ns/index.html
23:41cemericknative components involved, but that's almost a good thing
23:43woobythat does look awesome
23:47patrickdloganspewn: does not appear so
23:47patrickdlogan,(doc defrecord)
23:47clojurebot"([name [& fields] & opts+specs]); Alpha - subject to change (defrecord name [fields*] options* specs*) Currently there are no options. Each spec consists of a protocol or interface name followed by zero or more method bodies: protocol-or-interface-or-Object (methodName [args*] body)* Dynamically generates compiled bytecode for class with the given name, in a package with the same name as the current namespace, the given f
23:50spewnpatrickdlogan: I suppose my question was poorly worded. I know it's possible to add a docstring with ^{:doc "foo"}, but is it possible to view it?
23:56pdkcall doc with the record you defined as the argument spewn?
23:58spewnpdk: "Expecting var, but Foo is mapped to class user.Foo"