#clojure logs

2011-11-15

00:03amalloyalexbaranosky: man, every time he spends two seconds waiting for compilation my teeth grind together
00:22scottjsritchie_: the url in project.clj of wonderdog is not very useful
01:03alexbaranoskyanyone know how to get lazybot to send me my messages?
01:41noob3234Is this an appropriate place to ask a swank question?
02:02R4p70rIs there a naming guide for Clojure somewhere? I often see the same variable names such as "coll" for collections, "n" for number of things, "idx" for indices. Most of it is obvious but I'd like to see it all written in one place to help me write idiomatic code.
02:10seancorfield_http://dev.clojure.org/display/design/Library+Coding+Standards
02:14R4p70rseancorfield, thx
02:41tsdhIs it possible to attach metadata to a namespace after its definition?
02:42amalloy&(doc alter-meta!)
02:42lazybot⇒ "([iref f & args]); Atomically sets the metadata for a namespace/var/ref/agent/atom to be: (apply f its-current-meta args) f must be free of side-effects"
02:42tsdhSomething equivalent to (ns ^{:bla "blubb"} foo)? The problem with that is that clojure-mode doesn't like it. For example, `C-c t' breaks.
02:42tsdhamalloy: Ah, great.
02:42tsdhThanks.
02:43tomojhmm
02:43tomojthat should be fixed
02:43amalloythe elisp for understanding ns forms is fragile
02:44tomojtsdh: what's your clojure-mode version?
02:45tsdhtomoj: 1.11.4
02:45tomojhuh, I'm on 1.11.2 and it seems fixed
02:48tomojmaybe your ns form is just different
02:55tsdhtomoj: Oh, indeed it works fine when invoking `C-c t' from anywhere in the file except when point is in the metadata map itself.
02:56tsdhBTW: `C-c t' is a binding that is reserved for the user and must not be bound by emacs modes.
02:57tsdhIn fact, I've bound it globally to some other command which clojure-mode forcefully overrides.
03:13amalloyyeah, i'm a little surprised technomancy bound C-c t. midje mode binds a zillion C-c <letter> combos, so even if i ever figure out midje i'm just not going to use the emacs support
03:46Blktgood morning everyone
04:02R4p70rBlkt, More like middle of the night here.
04:13licenserR4p70r: he is using the UGT ;)
04:13licensergood morning everyone by the way
05:06naeumorning
05:07naeuanyone else in here still feeling completely drained by the conj?
05:07clgvnaeu: how did you like it?
05:08naeuclgv: it was incredible - such an amazing aggregation of insanely cool people
05:08clgvnaeu: that what other source say as well ;)
05:09naeuclgv: great minds think alike ;-)
05:09clgvIt's a pity there are no videos up yet. Some slides aren't made to transfer knowledge without the speaker ;)
05:10naeuclgv: yeah, totally. In fact I'd go so far as to say the best presentations have slide decks that by necessity don't work independently
05:11clgvthere are only few slides on the github repo yet, compared to the schedule
05:11naeuclgv: do you plan on watching them all?
05:12clgvnaeu: nope, I'll select by topic and abstract
05:13clgvoh fogus' slides are in there now
05:13clgvand the bioinformatics talk sounds interesting as well
05:15lucianaren't these the videos? http://clojure.com/blog/2011/03/23/conj-talks-all-up.html
05:15lucianoh, they're from march
05:15clgvlucian: watch the date ;)
05:16clgvhmm the "hacking the genome" slides archive is empty :/
05:17clgvhow do I open .key files?
05:17clgvit seems to be html
05:17clgvbut my browser doest display it
05:19clgvoh well thats not the slides it seems :(
05:40naeuclgv: the bioinformatics talk was interesting - a real Clojure success story
05:40naeuand fogus's macronomicon talk was also great
05:41naeualso, to watch out is Byrd and Friedman's outstanding double act (which wasn't scheduled)
05:41naeuthey were writing programs backwards!
05:47mindbender1In Midje, if I want to declare that a number of operations called in succession throws an Exception, how should I write it?
05:59naeucemerick: hey there
06:00naeucemerick: recovered yet? I'm sitting at my desk wondering how I'm going to survive the day - the conj has sapped me dry!
06:04cemericknaeu: hi :-D
06:04cemerickYeah, it always takes a couple of days to come down from the high.
06:05cemerickI guess I've seen your handle before, but never made the connection that you were who you are. ;-)
06:19frank,(+ 1 1)
06:19clojurebot2
06:19frankaha, it works :-)
06:24cemerickclgv: don't think about that for too long ;-)
06:26clgvcemerick: I think it might be the reason for a bug in my serialization
06:37ejacksonmorning, I think, all
06:51naeucemerick: yep - I am who I am :-)
06:51naeuejackson: how are you doing? How's your brain? Mine is still completely fried
06:52Arafangionnaeu: Blasthemy!
06:52ejacksonnaeu: Mine is currently beaten down by my circadian rhythms.
06:53ejacksoni'm such a lisp-weenie when it comes to jetlag ;)
06:53cemericknaeu: what was your cumulative impression of the U.S.?
06:54cemerick(it's too bad you weren't able to take in some other locales — Raleigh is OK, but hardly NYC or D.C. or Boston)
06:55naeucemerick: I liked it although it's hard to say after spending most of my time in the hotel
06:55cemerickyeah
06:55naeuI did get the impression that there were a lot of rules
06:55cemericksuch is the nature of conferences, I guess
06:55naeuand I wasn't so fussed about the number of flags
06:56naeubut everyone I met was super friendly
06:56naeubut I've no idea if that was a superficial friendliness or not
06:56naeuI definitely felt welcomed
06:57naeuejackson: you should codify your circadian rhythms into overtone
06:58ejacksonI'm not sure the world is ready for Grunge Goop
06:58cemericknaeu: We're generally a friendly bunch, though it's hard to generalize over 300m people. :-)
06:58naeucemerick: haha, exactly
06:59cemericknaeu: My question was, did the conference organizers know what you were capable of, and that's why they booked you last? ;-)
07:00naeucemerick: I really don't think so. I didn't know either!
07:01naeucemerick: I stopped making overtone screencasts to increase the element of suprise
07:02cemerickheh
07:02cemericknaeu: Yeah, the delta between those vimeo clips and what you produced on stage was enormous.
07:02naeucemerick: I also think that speaking to such an amazing audience full of people that I repsect to the highest levels also brought out some passion in me - in addition to being terrified
07:03cemerickAbject terror can sometimes bring out hidden strengths. ;-)
07:03naeucemerick: indeed!
07:04naeucemerick: the relief that I felt when I perceived that people were appreciative of Overtone midway through the presentation really did bring tears to my eyes
07:05cemerickAppreciation and wonderment, really.
07:06ejacksoni too had tears in my eyes, but it was from the pain of my jaw hitting the table
07:06cemerickseriously
07:06cemerickejackson: you mean naeu hadn't been giving local demos and such?!
07:06ejacksonyeah, I'd heard some of it before, but he was holding back on me :)
07:07naeuI guess I've been too steeped in what I do to realise how others might perceive it
07:07naeuAlso, from a music academic perspective, there's not that much that's new in Overtone
07:08ejacksonwell, we're a pragmatic bunch
07:08naeuI guess it's crazy new to a typical programmer though - and with Clojure I believe we can really travel fast into cool new musical terratory together as a community
07:09ArafangionPfft.
07:09cemericknaeu: it seems that that's not the case, insofar as language involved gives you a lot more than e.g. ruby
07:09cemerick(re: not much new in Overtone)
07:09naeucemerick: yes, true - but that's a hard argument to make in an academic setting
07:09naeucemerick: but it's precisely why Overtone exists :-)
07:09clgvnaeu: ah, you are the overtone guy ;)
07:10naeuclgv: one of them, yes :-)
07:10clgvwhen is that talk video up? ;)
07:11naeusoon, I'm sure :-)
07:11clgvdid you ever try fractal music?
07:12BahmanHi all!
07:13naeuclgv: no, but that's a cool idea - I'm happy to help you hack out some ideas if you want
07:13cemericknaeu: so am I to understand that you have a day job that pulls you away from Overtone?! :-O
07:14naeucemerick: sadly - yes :-(
07:14clgvnaeu: oh no, I dont have the time to do it. I just read about it a while ago and was curious if you already might have something like that ;)
07:14cemerickgoodness — that seems like something that needs to be remedied.
07:16naeucemerick: It's hard. First you have to find some person/organisation that's interested in paying a guy to hack on an open source music programming language, and secondly in a way that has some form of job safety as I have a baby coming along in April
07:16cemerickTotally understood.
07:16naeuI'm working on a few funding proposals to continue doing it in an academic context - but they're long shots - especially considering the current financial climate
07:16BorkdudeJust a quick question: what do you guys think it the most student (non-Lispers) friendly introductory book to Clojure?
07:17naeuBorkdude: I always recommend the Joy of Clojure - although it's a book to digest slowly and savour rather than one that blasts through the language. However, I think Clojure is best learned by careful consideration anyway.
07:18cemericknaeu: Maybe you could go on tour :-P
07:18naeucemerick: haha, that would rock :-)
07:18clgvBorkdude: I started with Programming Clojure
07:19BorkdudeI'm looking at Clojure in Action, which is soon to be published right?
07:19cemerickSell Overtone-branded equipment? i.e. buy the cheaper monome devices white-label and sell them on the site.
07:19BorkdudeIn chapter 2 it tells readers to clone from git
07:19cemerickBorkdude: it only covers 1.2 AFAIK
07:19BorkdudeIn chapter 8 there's a mocking macro that doesn't work anymore
07:20cemerickBorkdude: FWIW: http://www.clojurebook.com/ We aimed to be very accessible for those who don't know a lisp already.
07:20naeucemerick: my main issue is that I have a complete lack of business acumen - I just focus all my energy hacking
07:21Borkdudecemerick: is that book available end of January in Europe?
07:21Borkdudecemerick: I would maybe recommend it, if I could have a preview copy
07:21Borkdudecemerick: recommend as in: oblige them to buy it ;)
07:23cemericknaeu: The salvation and bane of the open source hacker is his enthusiasm. ;-)
07:24cemerickI think you may have a number of options. I'd be happy to help in whatever way I can.
07:24cemerickBorkdude: That sounds plausible, though I have very little visibility into the publishing side of things. Are you looking for a particular translation?
07:25naeucemerick: that would be great. To be honest, I'm pretty happy about the new job as I'm able to hack Clojure and make academia more aware of its awesomeness. However, I'd like to return to Overtone full-time next year if that would be at all possible
07:25cemerickBorkdude: FWIW, amazon.co.uk lists it as available on 12/30 as well: http://www.amazon.co.uk/Clojure-Programming-Chas-Emerick/dp/1449394701/
07:25cemericknaeu: new job?
07:26naeuyeah, I started as a research associate at Cambridge University computer labs a couple of weeks ago
07:26naeuI'm going to rebuild a GUI-heavy web app with Clojure and ClojureScript
07:27cemerickheh, hardly a bad gig :-)
07:27naeucemerick: exactly ;-)
07:27Borkdudecemerick: tnx, I'll maybe order it but I hope it won't be too late for the course
07:27Borkdudecemerick: does your book "run" on 1.3? ;)
07:27cemerickBorkdude: 1.3-only
07:27naeucemerick: but it was funny - people were shocked that I wasn't so stoked about it. I really am, but I'm also super sad to stop hacking Overtone full time.
07:28cemericknaeu: no, I can understand that — compared to a web app among other web apps, overtone is your passion. I know I wouldn't find "web programming" with clojure particularly compelling.
07:29cemerickThough I can't say what I'm doing otherwise is my "passion", to the degree that it's clear that Overtone is yours. :-|
07:30naeucemerick: but I do have a fantastic Overtone-based project idea in the works which will fill up my evenings :-)
07:31cemericknaeu: just one?! ;-)
07:31naeucemerick: yep - it's a big and bold idea
07:31cemerickbold is good
07:32naeuit'll also force me to focus on *using* Overtone instead of just hacking on the internals
07:32cemerickFWIW, you should definitely submit a talk proposal to clojure west — I think you have carte blanche at Clojure conferences from here on out.
07:33naeucemerick: I'd like to but I'm not sure I can afford the travel etc. My savings have been totally wiped out.
07:33cemericknaeu: Did your stipend not cover the trip to Raleigh?
07:33naeucemerick: yeah, it totally did :-)
07:33cemerickI suspect you'll find the same holds for clojure west.
07:33naeucemerick: but the stipend Clojure/West are offering wouldn't
07:34cemerickoh, have they published their rates?
07:34naeucemerick: yeah - $400 for international speakers
07:35cemericknaeu: Submit your proposal. We'll make sure you get there without nicking your savings. I have my ways. :-)
07:35naeucemerick: hahaha
07:35naeucemerick: that would be awesome...
07:36cemerickSeriously. The whole point of prior fundraisers has been to make sure that people that deserve to be at the conj can get there, despite stupid stuff like money.
07:36cemerickNo reason it needs to be limited to students AFAIC.
07:36naeucemerick: btw, I was thinking about the podcast interview we did and feel quite bad that I didn't thank my wife, Susanna, for letting me work on a crazy esoteric music system whilst not earning any money for a year. Do you think you could add that in as a comment?
07:37cemerickheh
07:37cemerickI'll see how it flows, maybe we can splice something in there without it sounding obvious. ;-)
07:38naeucemerick: or just mention it at the end?
07:38cemerickI haven't listened to any of the audio I recorded yet. Sometime next week.
07:38naeucemerick: splicing it in there would sound awful ;-)
07:38cemericknaeu: yeah, we can put a "special mention" at the end.
07:39cemerickI'll ping you later this week so we can set something up via skype
07:39naeucemerick: haha, a special "shout out" "mad crazy props" "big up the Overtone massive"
07:40cemericknaeu: yeah, something will go on the end just fine
07:40cemerickSo you worked on overtone full-time for the last year?
07:42naeucemerick: well, monome stuff initially, then around early 2011 my knowledge of Overtone internals reached a level that allowed me to make significant contributions (I have been involved with Overtone at a conceptual level since a couple of months in)
07:43naeuthat, coupled with Jeff having to focus on his PhD thesis, meant I turned into the maintainer and put in a huge amount of effort
07:43naeuOvertone is a lot more stable, documented, organised and structured as a result
07:44cemerickYeah, I was able to get going in < 5 minutes.
07:44cemerickI fleshed out the maven sections BTW.
07:44naeucemerick: awesome - thanks
07:44cemerickNot that I'd recommend it :-P
07:45naeucemerick: have you played around with TouchOSC yet?
07:45cemericknot yet; I wanted to twiddle with things in code for a bit first
07:46cemerickDo you know if they're coming out with a tablet-sized version for android eventually?
07:48naeucemerick: I'm not sure. However, it's definitely something you should slap down on your todo list. TouchOSC totally complements code twiddling
07:48cemerickI'll check it out :-)
07:49naeuRight, I'm off for a meeting regarding funding for music projects...
07:49cemerickgood luck with that :-P
07:52BahmanIs it alright to use Clojure with OpenJDK? Or should I get myself an Oracle one?
07:53Borkdudecemerick: translation?
07:53cemerickBahman: Yeah, OpenJDK will work. Just make sure you're using OpenJDK, and not something like IceaTea, etc.
07:55Bahmancemerick: So is this "OpenJDK Runtime Environment (IcedTea6 1.10.4) (ArchLinux-6.b22_1.10.4-1-x86_64)" Alright?
07:56cemerickBahman: if you've not yet installed a JDK, why not just grab the oracle one from the start?
07:57Bahmancemerick: Right...thanks.
07:57cemerickBorkdude: yeah, I didn't know if you needed a translation to German or French or…
07:57BorkdudeDutch ;)
07:57Borkdudecemerick: but I'm not hoping for that
07:58cemerickSeems like a longshot, no? :-)
07:59Borkdudecemerick: maybe I can start writing one, but I prefer to use existing books in my courses
08:34michael_campbellMorning, #clojurians.
08:34juhu_chapahi!
08:51clgvcemerick: a translation for German is probably not needed - as german computer science student you have to be capable of writing and reading english anyway ;)
08:53cemerickclgv: The empire is serving its purpose, then. ;-)
08:54clgvlol
09:01michael_campbellcemerick: Do you have an ETA for Mostly Lazy #2?
09:02cemerickmichael_campbell: probably late this week
09:03gunnarahlbergcemerick, excellent! I was just about to ask. Heard #1 yesterday, very good conversation
09:03michael_campbellgreat, thanks
09:05gunnarahlbergis there a way to get more informational error messages from the repl?
09:05michael_campbellNot without losing a finger. (Sorry, that'll only make sense to people at the conj)
09:06gunnarahlbergmichael_campbell, I wish I was there!
09:06michael_campbellnot to make you feel worse, but it was spectacular.
09:06gunnarahlberggood to hear, I heard it on the grapvine (twitter) lots of comments
09:06michael_campbellI was as inspired as I was terrified.
09:07gunnarahlbergwow!
09:08gunnarahlbergso, if I were to implement informational err messages, were would I start?
09:08gunnarahlbergand I'm not sure what my fingers will say, or what the joke was
09:08michael_campbellWhen fogus' talk gets posted, watch it. It will explain the joke.
09:09michael_campbell(his was on macros)
09:09cemerickgunnarahlberg: best to start with what problem you're looking to solve
09:09clgvgunnarahlberg: filtering clj-files from the stacktraceelements helps a lot
09:10clgvI built my self a clj-filtered view that can be expanded to a detailed view
09:13gunnar_sorry, i got disconnected
09:16gunnarahlberghmm, maybe I should watch my language
09:23cemerickgunnarahlberg: language?
09:24gunnarahlbergcemerick, I was disconnected shortly after my last msg
09:24clgvthere is no censor here afaik ;)
09:25cemerickgunnarahlberg: not by anyone here; we don't even have an op in the room
09:25gunnarahlbergoh, that's a relief. Just a coincidence then :)
09:25cemericker, chouser has op I think, though he might have picked it up all of once in three years. :-P
09:25cemerickgunnarahlberg: we're a bunch of teddy bears around here
09:26gunnarahlbergcemerick, that's comforting :)
09:26gunnarahlbergwell back to my question.
09:26gunnarahlbergspecific example: as a n00b i try vainly to concatenate a string and a function
09:27Borkdudecemerick: tnx http://stackoverflow.com/questions/2758783/podcasts-for-clojurians ;-)
09:28cemerickgunnarahlberg: why would you try to concatenate a string and a function? o.0
09:28gunnarahlbergcemerick, lack of foo :)
09:29Borkdude,(concat "a" identity)
09:29clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core$identity>
09:29cemerickgunnarahlberg: fu's got nothing to do with it. :-) Would you ever try to concatenate a string and a number?
09:29cemerickor, a string, and a socket?
09:31gunnarahlberg(def greeting "Greetings")
09:31gunnarahlberg(defn greet[who] (apply str (who "greeting")))
09:31gunnarahlbergcalling greet is not too good in this case
09:31clgvcemerick: string and number works just fine ;) ##(str "Hello Nr. " 5)
09:31lazybot⇒ "Hello Nr. 5"
09:33Borkdude,(concat "dude" 5) ;; doesnt
09:33clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
09:33gunnarahlbergin my greet sample, "java.lang.String cannot be cast to clojure.lang.IFn>" isn't trivial to comprehend
09:34Borkdudegunnarahlberg: who is a string?
09:34clgvBorkdude: lol. there is a high probability that any random function from clojure.core wont work with random select types and values of paramters
09:35Borkdudeclgv: of course, that's why theres doc ;)
09:35clgvgunnarahlberg: you want to do (defn greet[who] (str "Greetings " who))
09:35gunnarahlbergclgv exacty
09:36gunnarahlbergwhat is interesting is that the error message doesn't tell me that
09:36Borkdudegunnarahlberg: if who is a string, then (who "greeting") applies "greeting" to a string, which is not a function, hence the error
09:36clgvwith your "variable" its just: (defn greet[who] (str greetings who))
09:37Borkdudewhy don't these error messages tell us what the value of the thing that isn't a function is, that would be helpful
09:37gunnarahlbergBorkdude, thank you. How do we tell that to someone new to clojure?
09:37clgvgunnarahlberg: you have to know that when evaling a list the first argument always is interpreted as a function and string is no function. thats what the error tells you in short
09:37gunnarahlbergclgv ok
09:38Borkdudegunnarahlberg: I agree, the error messages could be more informative
09:38clgvmaybe it's time for one of those introdutory books to get you setup quickly. ;)
09:39Borkdudegunnarahlberg: you could have passed a function in the who parameter though
09:39Borkdudegunnarahlberg: then it would work ;)
09:39Borkdudegunnarahlberg: could, I must say
09:39gunnarahlbergI still think the error message could have said which of the parameter that the interpreter stumbled on
09:40gunnarahlbergclgv, i've read a few intro book. My goal is to setup othres to grok clj
09:40clgvgunnarahlberg: I think in this case the error message is pretty clear if you have basic knowlegde. there are other cases where the error messages could be better or exist at all ;)
09:41Borkdudegunnarahlberg: I agree. I would like "The string {value of string} cannot be cast to IFn" better.
09:42gunnarahlbergBorkdude, yeah that looks about right
09:42gunnarahlbergI'm talking about getting people on board clojure. as long as its non trivial to do trivial things, there is some work to be done. In my humble opinion
09:43Borkdudegunnarahlberg: I agree once more
09:43gunnarahlbergwhat about a repl that told you long descriptive tales of what went wrong. just give it an option, like, verbose
09:43clgvBut I think you need at least one basic lesson in almost every programming language there is
09:44Borkdude,("dude" "arg")
09:44clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn>
09:44clgvand in a Clojure one the semantics of a function call certainly has to be part of this first lesson
09:44gunnarahlbergclgv, thats true
09:44BorkdudeI wonder how much trying and catching it would take in what places to make it more user friendly
09:46clgvthere are worse things: (at least in 1.2.1) the signatures of prtocols deftypes/defrecords dont signal an error when you use '& as param name intending to use the next name as multiple args
09:47gunnarahlbergclgv, that would solve problems for experts. I'm talking beginners
09:47Borkdudeis it possible to inject a global replacement for the standard ClassCastException that is more informative
09:47Borkdudewithout changing too much code
09:47gunnarahlbergBorkdude, where?
09:48Borkdudegunnarahlberg: in the clojure compiler for example
09:48cemerickBeginners are expected to at least read some basic materials. e.g. if someone only knows BASIC, it wouldn't be reasonable to expect a Java environment to infer error messages would help them understand the object.methodName(argument) calling convention.
09:48clgv$(inc cemerick)
09:49cemericks/would help/that would help
09:49clgv&(inc cemerick)
09:49lazybotjava.lang.RuntimeException: Unable to resolve symbol: cemerick in this context
09:49Borkdudecemerick: of course. but more informative error message would be a benefit to beginner and expert ;)
09:49clgv$inc cemerick
09:49lazybot⇒ 7
09:49cemerickBorkdude: agreed — I was responding mostly to gunnarahlberg's "long descriptive tales of what went wrong" :-)
09:50cemerickEven in such cases, we have to assume that people know about e.g. function position
09:50gunnarahlbergcemerick, that was maybe pushing it too far.
09:51gunnarahlbergmaybe I should write a tutorial repl for beginners, wonder how much work it would be
09:54Borkdudewhat was that site again where you could try different prog. languages?
09:54kzarRing seems to give me a org.mortbay.jetty.HttpParser for the body of a request, how do I turn that into a string?
09:54Borkdudegunnarahlberg: sounds like a nice project
09:55leo2007how do people get documentation on a third party library?
09:55clgvgunnarahlberg: writing an own repl is pretty easy using clojure.main/repl
09:55clgvyou could catch the exceptions and translate them in what you like them to be
09:55gunnarahlbergclgv cool, thx for the input
09:55gunnarahlbergBorkdude, thx
09:57clgvgunnarahlberg: as an example you can look at the debug-repl macro over there https://github.com/GeorgeJahad/debug-repl/blob/master/src/alex_and_georges/debug_repl.clj
09:57clgvit's using clojure.main/repl in its implementation
09:59gunnarahlberga goal would be like ward says about clean code - " should do pretty much what you expected"
10:04gunnarahlbergclgv, looks like a starting point, thx
10:07jcromartie,(print \u2583)
10:07clojurebot
10:07jcromartiehm
10:07jcromartieworks here but not in lein repl
10:07frankman, I really hate jet-lag, but at least I got my order for "the reasoned schemer" out
10:07frankI think there is going to be a real spike for that book after the conference
10:09jcromartiewhy does my Clojure REPL print "?"
10:10frankworks on my emacs slime repl
10:11joegalloare you running it via emacs, jcromartie?
10:11joegalloor just in a shell, straight up?
10:11frankperhaps your shell, etc does not support the characterset
10:11jcromartiejoegallo: no, OS X Terminal.app
10:12jcromartieother programs can print the character
10:12jcromartiei.e. Ruby or bash
10:13joegallojcromartie: prints ? for me to, in terminal.app
10:13joegallos/to/too/
10:13jcromartiejoegallo: from lein repl, to be specific
10:14jcromartieand in java -jar clojure-1.3.0.jar
10:14jcromartiehm
10:14joegallodoes the same thing from iterm2 on osx
10:14jcromartieI wonder if it's Clojure or Java.
10:14joegallobut, but! it works just fine if i'm sshed into a linux host and run it there
10:14joegallosame jars
10:14jcromartiehttp://hints.macworld.com/article.php?story=20050208053951714
10:14jcromartieinteresting
10:15joegalloanyway, that's all i've got ;)
10:17cemerickjcromartie: what does (java.nio.charset.Charset/defaultCharset) return?
10:17jcromartieMacRoman
10:17jcromartie:P
10:17jcromartiewho wants that!?
10:17cemerickthat'll do it
10:17cemerickyou can thank Cupertino for that one
10:18cemerickI think setting LANG is what fixes that. I've had `setenv LANG en_US.UTF-8` in my .tcshrc ~forever.
10:18jcromartieLANG in the shell?
10:18jcromartieenvironment?
10:18cemerickright
10:18jcromartiehm
10:19michael_campbelltcsh... wow.
10:19cemerickThere's a java system property that sets it as well.
10:19jcromartieyes I just found it
10:19jcromartie-Dfile.encoding=UTF8
10:19cemericksure
10:19cemerickeasier to set everything everywhere to utf8 IMO
10:20cemerickmichael_campbell: I try to burn as few cycles as possible on command-line rabbit holes. ;-)
10:20michael_campbell. /bin/sh, man! ;-)
10:20frankmmm, did not fix it for me: export LANG=n_US.UTF-8 still gets me ?
10:20michael_campbellhonestly, I'm a zsh guy.
10:20cemerickfrank: did you restart your repl?
10:21frankyup, got out, did the export and started again
10:21frankstill getting ? here, same as jcromartie
10:22jcromartieah JAVA_TOOL_OPTIONS
10:23jcromartieexport JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
10:23jcromartiethat does the trick
10:24frankyup, the -Dfile.encoding works as well
10:25cemerickodd, I've never set that
10:25jcromartieJAVA_TOOL_OPTIONS just makes the actual "java" command-line tool pick up the specified options whenever it is run
10:25jcromartieyou can see lein running two JVMs when you set that variable :)
10:25frankhope mac will switch to UTF8 one of these days, I have run in these kind of problems before
10:25jcromartiebecause it says "picked up ..." for the options
10:25cemerickyeah, it should grab your system default though…
10:25jcromartieyeah really
10:25jcromartieit's silly
10:27franklucky I never run my repl from the terminal, and Emacs seems to do the right thing by defau;t
10:27frankthat is a first :-)
10:27raekit's really weird that java in OS X thinks the default encoding is MacRoman when OS X actually uses UTF-8...
10:28frankWhen working with Intellij java, default encoding is MacRoman as well
10:28frankYou need to change some setting somewhere to change to UTF-8
10:28raekI saw that this was actually documented somewhere
10:29frankwas there a reason for this or some legacy stuff?
10:29cemerickah-ha — LANG doesn't actually do anything: setting "Character Encoding" to UTF8 in Terminal.app does, though.
10:30raekbasically it acknowledged that OS X really uses UTF-8 but the default encoding is MacRoman anyway.
10:30raekit is really a bug in the OS X configuration of Java
10:31raekanyway, noone should use the "default encoding" anyway
10:31raekthe whole idea of a platform default encoding assumes that all files, pipes and sockets the OS touches uses the same encoding
10:32raekwhich is simply not true
10:32luciansadly, MacRoman is in fact the default encoding on OS X
10:32lucianpython defaults to it as well, and several system tools
10:32raekreally? I thought only Java had this problem. that's bad.
10:34Fossiis there an easy way to map over a vector until a specific condition occurs at which point i want to stop the mapping and do something completely different?
10:35raekwhat values does the condition need?
10:35lucianraek: it is an apple recommendation as well
10:35Fossiso far i only came up with using lazyness and a special marker, but that feels dirty
10:35raekthe value before given to the map function or the value the map function returns?
10:35ejacksonFossi: while might be what you want
10:35lucianraek: it's the "right" thing to do, sort of
10:35ejackson,(doc while)
10:35clojurebot"([test & body]); Repeatedly executes body while test expression is true. Presumes some side-effect will cause test to become false/nil. Returns nil"
10:35ejacksonno, that's not it at all
10:36raek,(doc take-while)
10:36clojurebot"([pred coll]); Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects."
10:36ejacksonyeah thats it, or (for .... :while)
10:36raekFossi: if your condition only depends on the function input, you can do it like this: (map f (take-while p coll))
10:37raekyeah, for is a lot more flexible here (you can apply the :while before or after the function)
10:38raek,(for [x (range), :let [y (* x x)], :while (< y 5)] y)
10:38clojurebot(0 1 4)
10:38raek,(for [x (range), :while (< x 5)] (* x x))
10:38clojurebot(0 1 4 9 16)
10:39Fossihmm, i need both, either the return value or the value that failed. normally i'd return the result, but in the other case i want to "break" with returning an error-handling-cod
10:41Fossilike http://pastebin.com/iUm1mZmK only with more params
10:41Fossiie a vector
10:41Fossium, ignore the stray reduce :>
10:44Fossiit would work with recursion, but i dislike making macros recursive
10:46clgvFossi: why not? they cant blow the stack afaik ;)
10:47Fossiin this case it would be okay because params is always really small, but it would generate a real monster if it would be really big
10:47raekFossi: recursive macros can be very simple. just let a macro (foo ...) expand into something that contains another (foo ...)
10:47bhenryi need some help on converting this to clojurescript or being pointed to something that already does it http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript/901144#901144
10:48raekbhenry: I assume that the Google Closure library has such a function
10:50raekbhenry: http://closure-library.googlecode.com/svn/docs/class_goog_Uri.html
10:50raekgetParameterValue
10:50lucianbhenry: don't you want document.querySelector[All] ?
10:50bhenryi don't know. i'm certainly no js expert
11:32kzarHow do you make a reader from a string again?
11:33kzaroops got it (java.io.StringReader. "hello")
11:35licenserdun dun dun :)
11:40Fossiafter lots of fichting them quotes: http://pastebin.com/PKF5SkLa
11:40Fossiany way to get rid of the into [] ?
11:41gfredericks(into [] ...) ~ (vec ...)
11:42Fossiyeah, the question was more if there is a rest/more for vectors
11:42gfredericks,(subvec [7 8 3 4 5] 1)
11:42clojurebot[8 3 4 5]
11:42Fossiokay
11:44gfredericksFossi: I'm trying to figure out why you need params to be a vector there...
11:44Fossiif it's a list you get something like ("bar")
11:44Fossiwhich gets evaluated
11:45gfrederickshmmm
11:45Fossiby (first ~params)
11:45gfredericks[~@(rest params)] could work
11:45Fossihmmm, clever :>
11:45gfrederickswai
11:46gfrederickst
11:46gfredericksit _does_ get evaluated?
11:46gfredericksisn't it only the arg to the macro?
11:46gfredericksI don't see you emitting it anywhere, except recursively
11:46Fossiah wait
11:46clgvwhen using (keyword "my-keyword") why does it always call java.lang.String.intern() even if the keyword already exists?
11:47Fossii can change (first ~params) to ~(first params)
11:47Fossithen it works with lists as well
11:47gfredericksclgv: what would you expect it to do?
11:47joegallohttp://download.oracle.com/javase/6/docs/api/java/lang/String.html#intern%28%29
11:48clgvthe problem is that call is using pretty much time
11:48gfredericksFossi: ah ha; that makes sense.
11:48joegalloif you intern a string and it isn't in the pool, you'll add it to the pool and get back the version that was just added
11:48gfredericksFossi: didn't notice that detail
11:48joegalloif you intern a string and it is in the pool, you get the string from the pool instead
11:49clgvhumm somehow java serialization can avoid this behavior but kryo serialization cannot
11:49Fossianyway, i (still) don't believe this recursive version is much clearer/nicer than a plain old imperative one
11:49kzararohner: I saw in the logs your Heroku app was timing out, you ever figure out how to fix it?
11:49Fossiguess i'll try that now
11:50arohnerkzar: not really
11:50gfredericksFossi: I'd think you could do it pretty simply without recursion
11:50arohnerkzar: clj 1.3 might help
11:50kzararohner: I get it sometimes and other times I don't, it's really annoying. I'm using 1.3
11:51Fossigfredericks: that's what i told my collegue about 2 hours ago ;)
11:51gfredericks(if-let [first-bad-param (first (filter (complement payload) (keys params)))]
11:51TimMchaha
11:51gfredericksFossi: something like that ^ I'm not sure I'd describe that as imperative
11:52Fossiwell, not recursive then
11:52Fossiis there a word for that? ;D
11:52Bronsaiterative?
11:52TimMcfilter-complement -> remove
11:52gfrederickssimplected :)
11:52TimMc$dec gfredericks
11:52gfredericksTimMc: you betcha!
11:52lazybot⇒ 3
11:52babilenHi all. How do you restart swank from within Emacs? Or rather: How do I convince it to honour changes to the classpath? I am using clojure-mode, lein-swank and start it with clojure-jack-in
11:53pjstadigbabilen: i usually just re "clojure-jack-in" and it kills and restarts swank
11:53TimMcgfredericks: You've done enough damage this morning!
11:54babilenpjstadig: Ah, that works. I wonder why I didn't try it :) Thanks!
11:55TimMcgfredericks: (the $dec was for that horrible word, not filter + complement :-P)
12:07Fossiif i change to the iterative way i just have to make sure i don't use our magic binding stuff
12:20devnhello everybody
12:22devnnote to self: don't set :checksum-deps true in project.clj right before a flight
12:23pjstadigdevn: bummer
12:24ejacksonoooh
12:24bhenryraek: i don't know how to use that getQueryData method in clojurescript
12:30babilenHmm, I just upgraded clojure-mode to .4 (from .2) and "C-c M-p" to switch the repl namespace does not work anymore. Does it use a different keybinding now, is it broken or did *I* break it with local modifications?
12:33babilenAh, I had to remove the old .2 installation...
12:45technomancybabilen: C-c M-p is part of slime rather than clojure-mode
12:47timvisheris it possible to make difftest work with clojure-test-mode and/or slime?
12:48babilentechnomancy: Thanks. Not sure what the problem was, but removing 1.11.2 solved it. Btw, I packaged 1.6.2 and it is waiting to be sponsored. Should be faster in the future as I will be a Debian Maintainer soon. (and don't need a sponsor then)
12:48technomancybabilen: thanks! glad to hear you're getting the access you need.
12:49iokwhat's the equivalent to cons for appending?
12:49michael_campbellconj?
12:49clojurebot(conj {:a 1} (when true {:b 2}))
12:50iokconj sticks it in at the first position :(
12:51cemerickiok: where a value is added to a collection is polymorphic w/ respect to the collection's type
12:51Bronsaconcat?
12:51cemerickconj adds to the front for lists, rear for vectors, etc.
12:51michael_campbellcemerick: yeah, that's what I was going to say ;-)
12:53iokconcat was it.. thanks!
12:54michael_campbellperhaps an unanswerable question, but for general REPL spelunking, do you download and run a clojure jar, or start/enter a lein project and "lein repl" with the clojure jar that lein downloaded for you?
12:57babilenmichael_campbell: I just use "lein repl" within or outside a project.
12:57michael_campbellgotcha.
12:59TimMcYeah, it runs from lein's own JVM.
12:59michael_campbellif you "lein repl" inside a lein project, does it do anything different/special with respect to the project?
12:59zerokarmaleftmichael_campbell: i keep a lein project around that sort of acts as a staging area for half-baked ideas, and use swank from there
12:59TimMcmichael_campbell: From inside a project, it launches a separate JVM.
12:59TimMcso you can choose a clojure version, etc.
12:59babilenmichael_campbell: I should note that I mainly use "lein repl" within a project as I want 1.3 ...
13:00michael_campbell<nod>
13:02babilenmichael_campbell: At least the Debian/Ubuntu packages for clojure{1.2,1.3} install rlwrapped clojure1.2/clojure1.3 scripts that get you a nice REPL .. I use that if I want to run something like "(+ 1 2)" (no fancy dependencies or anything). Not sure about your setup though.
13:04michael_campbellI've JUST started clojure, really, so I've d/l lein and did a self-install. I've also, on occasion, download the clojure jar directly and just run java -jar on that for a repl. But it's all been trying out things that I read about in Stu H's book. So just plinking around right now.
13:04michael_campbellI'm and old guy emacs user so will start playing with swank and all that soon enough.
13:05michael_campbelldidn't realize there was an Ubuntu package, even.
13:11gfredericksTimMc: oh, simplected. I see. Okay good. Simplifected then?
13:11michael_campbellawesome. Fogus' slides from the conj are up.
13:11michael_campbellhttp://blog.fogus.me/2011/11/15/the-macronomicon-slides/ Slides 34 and 43 are the keepers.
13:14TimMcgfredericks: *cries*
13:32technomancydo the jark developers hang out on IRC?
13:36shtutgarthm, I have some weird behaviour, (class x) returns some clazz, but (instance? clazz x) returns false. Is there known reasons for that?
13:36shtutgartit's clojure 1.2 and I can't reproduce it
13:38shtutgartok, i've recompiled the whole file and it's gone
13:39technomancyshtutgart: was it a defrecord or deftype?
13:40shtutgartdefrecord
13:40shtutgartwith one additional filed assoc'ed, if it matters
13:40technomancyyeah, you get really weird semantics with existing record instances when you reload the defrecord forms.
13:43shtutgarthm, but I can't remember recompiling the (defrecord ...) itself
13:43shtutgartonly ns with import for that record
13:44drguildowhich is the best data structure for checking whether it contains a value?
13:45gtrakset?
13:46drguildohow do i check whether it contains the value?
13:47technomancydrguildo: just call it
13:47drguildo(set-name value) seems to return the value rather than a boolean. maybe that'd work in a boolean context, though (i'm new to clojure)
13:47gtrakdrguildo, http://clojure.org/data_structures#Data%20Structures-Sets
13:47drguildodunno if that's idiomatic
13:47shtutgartanyway, lesson learned: recompile the whole program first when things getting strange :)
13:47shtutgartdrguildo: use contains? if you want bool
13:47brehautdrguildo: its extremely idiomatic to use a set as a function
13:48drguildoshtutgart: i thought that was for maps only?
13:48gtrakshtutgart, just don't hang on to the old instances?
13:48technomancyshtutgart: bonus lesson: use more predictable language constructs if you can.
13:48drguildook thanks
13:48drguildoi assume hash-set is better than a standard set for my purposes?
13:49gtrakwhat's a standard set?
13:49brehaut,(class #{})
13:49clojurebotclojure.lang.PersistentHashSet
13:49technomancydrguildo: hash-set is an implementation detail; you shouldn't think about them at that level.
13:49drguildogtrak: dunno, whatever gets created using the #() syntax
13:49shtutgartdrguildo: no, it works even for vectors and java arrays!
13:49shtutgarttechnomancy: what exactly do you mean?
13:50edwIs there a trick with calling variable argument Java methods? I'm getting a no-such-method exception when calling redis.clients.jedis/Jedis's watch method.
13:50technomancyshtutgart: don't use records where a map will do; don't use protocols where a multimethod will do.
13:50gtrakedw, try passing in an array
13:51edwgtrak: Will do. Thanks.
13:51gtrak,(doc into-array)
13:51clojurebot"([aseq] [type aseq]); Returns an array with components set to the values in aseq. The array's component type is type if provided, or the type of the first value in aseq if present, or Object. All values in aseq must be compatible with the component type. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE."
13:51brehautbonus bonus lesson: dont use regexps when a parser would do
13:51drguildotechnomancy: i'm not sure what you mean. i should just use #() and forget about the type of set?
13:52technomancydrguildo: use #{}, and yes, the type is immaterial
13:52technomancythe point is that it's a set
13:52drguildook, thanks
13:53technomancynp
13:54shtutgarttechnomancy: honestly, it doesn't feel right for me when I have some 'entity' with fixed set of keys (well, most of time) and it isn't defined somewhere
13:57technomancygive it a try; it's not as bad as you think it is.
14:06shtutgartI've tried; but creating new instances without positional constructor isn't very convenient, often the type predicate is required, etc... After all, the code becomes less self-descriptional (imo)
14:18amalloyman, it looks like i missed a lot of bonus^n lessons
14:25R4p70rIs there a core function that retunrs a lazy seq of (coll, (rest coll) (rest (rest coll))) and so on?
14:26BorkdudeR4p70r: isn't that reductions?
14:26jcromartieR4p70r: try (reductions rest coll)
14:26jcromartieI think
14:26gtrakneat
14:26jcromartie,(reductions rest [1 2 3 4])
14:26clojurebot#<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: core$rest>
14:27Borkdude,(doc reductions)
14:27clojurebot"([f coll] [f init coll]); Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init."
14:27jcromartieerr
14:27jcromartieyeah
14:27gtrak,(source reductions)
14:27clojurebotSource not found
14:28shtutgartrepeatedly?
14:28Borkdude,(doc rest)
14:28clojurebot"([coll]); Returns a possibly empty seq of the items after the first. Calls seq on its argument."
14:29raek,(take 10 (iterate inc 0))
14:29clojurebot(0 1 2 3 4 ...)
14:29R4p70rright. I don't think that's reductions... like (f [1 2 3 4 5]) would give ([1 2 3 4 5] [2 3 4 5] [3 4 5] [4 5] [5]) I have already writen one but don't want to reinvent the wheel if I don't have to.
14:30Borkdude,(reductions rest [[1 2 3 4]])
14:30clojurebot([1 2 3 4])
14:30raek,(take 10 (iterate rest (range 10))
14:30clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
14:30raek,(take 10 (iterate rest (range 10)))
14:30clojurebot((0 1 2 3 4 ...) (1 2 3 4 5 ...) (2 3 4 5 6 ...) (3 4 5 6 7 ...) (4 5 6 7 8 ...) ...)
14:30shtutgartah, iterate, right
14:30Borkdude,(reductions + [1 2 3 4])
14:30clojurebot(1 3 6 10)
14:31raek,(take-while seq (iterate rest (range 3)))
14:31clojurebot((0 1 2) (1 2) (2))
14:31R4p70r,(take 10 (iterate rest [1 2 3 4 5]))
14:31clojurebot([1 2 3 4 5] (2 3 4 5) (3 4 5) (4 5) (5) ...)
14:31raekthere!
14:31R4p70rraek, Thanks!
14:31Raynes&(reductions conj [] [1 2 3 4])
14:31lazybot⇒ ([] [1] [1 2] [1 2 3] [1 2 3 4])
14:31RaynesBackwards, but close enough.
14:31Raynes;)
14:32R4p70rright
14:32raekR4p70r: that won't include (), though (don't know if you wanted that too)
14:32Raynesraek, of course, wins this battle, because this is precisely what iterate is for.
14:34shtutgartpretty often i'm writing someting like #(if (pred? %) (f %) %). How can I get rid of this % signs?
14:37Raynes(fn [x] (if (pred? x) (f x) x))
14:37gfredericksshtutgart: write a helper HOF?
14:37amalloyshtutgart: well! if you want to use the "useful" library, it has that already built-in
14:37Raynesinb4 but how di I get rid of the xes!?
14:37gfredericksor use amalloy's
14:37amalloy(to-fix pred? f) => (fn [x] (if (pred? x) (f x) x)))
14:37shtutgartRaynes: no, I mean what haskellers calling point-free style
14:39RaynesBut yeah, this is called 'fix' in useful, right amalloy?
14:39amalloyshtutgart: point-free style is made possible by having a few functions down at the bottom that deal with points. if you define (say) to-fix once, you can avoid introducing points later by using it
14:39RaynesOr given.
14:39amalloyRaynes: depends if he actually wants the function (use to-fix), or wants to apply it to an x immediately (use fix/given)
14:39RaynesI hate those names.
14:40raeksince clojure does not use currying for functions with more than one argument, it's not as easy to write point-free function, I think
14:40shtutgartamalloy: "useful" is a name of library, right?
14:40RaynesWell, sure it is.
14:40amalloyhttp://github.com/flatland/useful
14:40Raynes&((partial + 2) 3)
14:40lazybot⇒ 5
14:40RaynesJust more long-winded.
14:40amalloyRaynes: that sounds like "not as easy" to me
14:41shtutgartamalloy: ok, i'll check it out, thanks!
14:41RaynesIt sounded like "Clojure doesn't curry, so this would be hard."
14:42RaynesBut yes, it doesn't, and if typing out 'partial' for partial application is difficult for you, this is definitely harder. ;)
14:42amalloyshtutgart: specifically the function you wanted is somewhere in the neighborhood of https://github.com/flatland/useful/blob/develop/src/useful/fn.clj#L25
14:43gfrederickswhat do we mean by "clojure doesn't curry"?
14:44pjstadig,(+ 1)
14:44clojurebot1
14:44Rayneshttp://www.haskell.org/haskellwiki/Currying
14:44pjstadiger
14:44kurtharrigercould use the threading operator
14:44michael_campbellfor anon funcs which take > 1 parameter, is it idiomatic to use "% %2 %3..." instead of "%1 %2 %3..."?
14:44pjstadig,(map +)
14:44clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$map>
14:44kurtharriger(-> 2 (+ 3) (+ 5))
14:44gtrak,(partial + 1)
14:44clojurebot#<core$partial$fn__3794 clojure.core$partial$fn__3794@38c6be>
14:44amalloymichael_campbell: either is fine
14:44Raynesmichael_campbell: It is idiomatic to use whatever you feel like using at any given time.
14:45pjstadiggfredericks: if clojure curried then (map +) would return a function that takes a seq
14:45amalloykurtharriger: that's not really the same thing
14:45michael_campbellRaynes: right now I feel like reading the "useful" source, which is where I saw it, so... you guys are making my decisions! =D
14:45gfrederickspjstadig: is it kind of just a syntactic distinction then?
14:45pjstadigwhich you can obviously get with partial
14:45gtrak,((apply partial '(+ 1)) 2)
14:45clojurebot2
14:45shtutgartamalloy: but, you know, since this fns isn't in core it's easier to write some more % than add lib to deps, require, etc...
14:45brehautgfredericks: easy partial application is feature of curried functions, but curried functions are not partial application
14:46RaynesAnd here is where the fog begins to thicken.
14:46gfredericksbrehaut: man there's like three different parts of that where I don't know what you're talking about
14:46devnthe plot thickens!
14:46pjstadiggfredericks: i don't think it is just a syntactic distinction
14:47brehautgfredericks: time for haskell type signatures!
14:47gfredericksdoes "curried function" mean a function which has had some of its arguments filled in?
14:47gfredericksI think I decently understand how currying works in haskell :/ maybe.
14:47brehautgfredericks: normal_function :: (a,b,c) -> r
14:47brehautgfredericks: curried_function :: a -> b -> c -> r
14:47gtrakhmm, why doesn't ((apply partial '(+ 1)) 2) return 3?
14:47gfrederickshrm.
14:47amalloygfredericks: i don't think you do. currying means that any function, when called with "not enough" arguments, will return a partially-applied version of itself
14:47gtrakwhen ((partial + 1) 2) returns 3
14:48amalloygtrak: i was wondering if you'd picked that example by accident or what
14:48gfredericksamalloy: I understand how that works in haskell, I'm just having trouble applying it to this clojure discussion
14:48amalloy(not= + '+)
14:48gfredericksI think I get it now though.
14:48gtrakamalloy, ah, it's just a straight symbol and not the function?
14:49gfredericksis currying incompatible with multiple-arities?
14:49amalloygtrak: '(+ 1) is a list containing a symbol
14:49scottjstrangeloopers: was it clear how sussman's propagator idea was different from cl-cells/dataflow?
14:49pjstadiggfredericks: i believe in a curried language, multiple arities are just syntactic sugar
14:50gtrakscottj, sussman's propagator is probably much more involved since it doesn't exist :-)
14:50brehautgfredericks: its by itself no; its incompatible with multiple arities (or varargs) in combination with a lack of static generic types
14:50shtutgartby the way, why does ~some-seq return (...), not [...]? I've always have to do [~@some-seq] or stuff like that so clojure won't try to call first elem as a fn
14:50gfrederickspjstadig: so is this possible in haskell? (fn ([a b] (* a b)) ([a b c] (+ a b c)))?
14:50brehautgfredericks: via deep magic ;)
14:50scottjgtrak: oh his code was psuedocode?
14:51amalloyshtutgart: it just returns whatever some-seq is. if it's a seq, then pretending to be a vector would be a lie
14:51brehautgfredericks: you have to use return type polymorphism and some typeclass voodoo but yes, completely achievable
14:51gtrakscottj, i think the mathy stuff worked, but he was proposing something much grander
14:51gfredericksbrehaut: it sounds ambiguous :/
14:52brehautgfredericks: pervasive finickity types make it not the case
14:52gfredericksso if I want to call (f 2 4), then if I say I want an integer return type it calls the 2-arity version, and if I say I want a function-that-returns-integer type then it partially applies the 3-arity version?
14:53brehautgfredericks: f :: int -> int -> int is different to f :: int -> int -> (int -> int)
14:53gfrederickswhat's the difference?
14:53gfredericksoh wait
14:53gfrederickssorry
14:53gfredericksmiscounted some ints
14:53BorkdudeIf pred? would only return its arg and nil otherwise, you can just do (comp f pred?), but maybe that's not idiomatic?
14:54brehautgfredericks: remeber that ML family languages dont need parens on a function call
14:54gfredericksbrehaut: so did I summarize it poorly...?
14:54gfrederickswas I wrong?
14:54shtutgartamalloy: indeed; so it's a &'s fault
14:54brehautgfredericks: ah i imissed yur summary
14:55brehautgfredericks: you are correct; my bad
14:55Borkdudeno wait, sorry
14:55Borkdudebullshit
14:55Borkdude;)
14:57gfredericksso in haskell you can have two functions with the same name and argument types but different return types?
14:57amalloyshtutgart: no offense but it's kinda your fault for wanting something that would be nice in the limited scope you're working with but doesn't make sense in general. ~foo *must* return the value of foo without any sort of transformation on it, even though that transformation would be useful in the specific case where you're writing a macro and intend to use the result as a value rather than a function call
14:58brehautgfredericks: yes, but only if you define them with a typeclass
14:58brehautgfredericks: the canonical example is read
14:58brehaut&heval 1 + 1
14:58lazybotjava.lang.RuntimeException: Unable to resolve symbol: heval in this context
14:59amalloyfor example, consider (defmacro add-and-print [& args] (let [func (cons `+ args)] `(print ~func)))
14:59amalloy$heval 1 + 1
14:59lazybot⇒ 2
14:59brehautamalloy: thanks
14:59brehaut$heval (read "1") :: String
14:59lazybot⇒ "*Exception: Prelude.read: no parse
15:00brehaut$heval (read "1") ::Int
15:00lazybot⇒ 1
15:00brehaut$heval (read "1") :: Float
15:01lazybot⇒ 1.0
15:01brehautgfredericks: ^
15:01devn$heval (read "1")
15:01lazybot⇒ *Exception: Prelude.read: no parse
15:01gfredericksbrehaut: that example sure was canonical!
15:01brehautgfredericks: :P
15:02brehaut$heval read "\"1\""
15:02lazybot⇒ *Exception: Prelude.read: no parse
15:02gfrederickswell. Thanks for the haskell lesson everybody.
15:02gfredericksamalloy: does ##(inc lazybot) do inline karma?
15:02lazybotjava.lang.RuntimeException: Unable to resolve symbol: lazybot in this context
15:03devnthere's your answer :)
15:03gtrakis haskell eval sandboxed too?
15:03gfredericksdevn: that just means that's not the syntax for it :P
15:03BahmanIs it possible to recur from a lambda function?
15:03brehautgtrak: trivially so ;)
15:03gtrakBahman, trampoline
15:03gfredericksBahman: you can name it with (fn foobar [a] a) also
15:04brehaut$heval performUnsafeIO
15:04gfredericksif you have limited recurring to do
15:04lazybot⇒ Not in scope: `performUnsafeIO'
15:04gtrakbrehaut, ah, right, you need some sort of monad
15:04BahmanThanks.
15:04brehautgtrak: specifically you need the IO monad
15:05shtutgartamalloy: yeah I agree, that's the truth, but... that [~@coll]s just make me sad :)
15:07amalloytrampoline sounds like a terrible answer to this question, fwiw
15:08gtrakwhy?
15:08clojurebothttp://clojure.org/rationale
15:10mrnex2010Hi, how can i convert a lazy seq back into a persistentList? i have (def a '(1 2 3)) and i can succesfully do (str a) and if i do (def b (map identity a)) and then try: (str b) it returns shite
15:10gfredericksmrnex2010: use (apply str b)
15:10amalloyunlikely to be what he wants
15:10mrnex2010it concatenates them
15:11gfredericksmrnex2010: or (pr-str b), sorry
15:11mrnex2010yep, i want it to respect the structure
15:11amalloy&(pr-str (range 4))
15:11lazybot⇒ "(0 1 2 3)"
15:11mrnex2010fucking a!
15:11mrnex2010thanks
15:11mrnex2010im building a proof of concept for non dev builds, from rhickey's keynote
15:11gfredericksIRC: one guy answers real fast, then the other guy sits back and figures out why he's wrong.
15:12mrnex2010thx a lot gfredericks & amalloy
15:12greghgfredericks: also, stack overflow
15:12gfredericksno doubt
15:13gtrakgfredericks, sometimes i just say things
15:13gfredericksgtrak: I find that's a good way to learn
15:14gfredericksvectors are like eager functors, but more simplected.
15:14gtraklol
15:14brehautgfredericks: ouch
15:14gtrakvectors are hashsets with integer indicies
15:14gtrakand an easy iteration capability
15:15gfredericksindex-sets of the form (range N)
15:15gfrederickskey-sets rather
15:15gtrakyes, non-negative integers
15:16brehautaka natural numbers
15:16gfredericks"The Nats"
15:16gtrak"There is no universal agreement about whether to include zero in the set of natural numbers"
15:17gtrakfool
15:17gtrak:-)
15:17brehautgoddamn mathematicians going and messing with me again
15:17gfrederickseh it's just about names
15:17gtrakhttp://en.wikipedia.org/wiki/Natural_number#History_of_natural_numbers_and_the_status_of_zero
15:18brehauti thought the whole point of the term natural numbers was because whole numbers was ambigious :P
15:18gfredericksthere should be a name for "the other set". Maybe "The Unnatural Numbers". It means whichever set the natural numbers doesn't.
15:18gfredericksI prefer to include 0, as otherwise "positive integers" is readily available
15:19gtraki think 'non-negative' implies 0 more than 'positive'
15:19gfredericksyes
15:19gfredericksI mean positive integers is a name for Z+
15:19gfredericksi.e. (1,2,...)
15:19gfredericksI'm just going to stop talking.
15:19gtrakrather 'positive ints' doesn't imply 0 as much as non-negative ints
15:19BahmanDoes anyone know to what address can I send my suggestions If I have for "Joy of Clojure"?
15:20Bahman...have some for...
15:21Raynes /dev/null
15:21Raynes;)
15:21TimMctechnomancy: Oh god what is this thing where there should be "fn"...
15:22TimMcwhat have you done
15:22BahmanRaynes: I have received some letters from hell that asked me to stop pumping everything (mostly garbage) to /dev/null :-)
15:22gtrakBahman, http://joyofclojure.com/errata/
15:22RaynesHeh
15:22michael_campbellTimMc: the function symbol in emacs?
15:22TimMcYes.
15:22Bahmangtrak: Thanks.
15:22TimMcI started using emacs-starter-kit at work.
15:22michael_campbellTimMc: yeah, that's special, isn't it. There's a lambda in there somewhere too
15:23TimMcIt messes up my column counts.
15:24TimMctechnomancy: You don't know what powers you're playing with!
15:24michael_campbellI've installed it too; after 23+ years of emacs, I'm not sure I can make the jump to ido-mode. I'm trying, honestly, but old habits are fierce.
15:25amalloy<3 ido
15:25TimMcido is the wonderful thing that makes buffer and FS navigation easy?
15:25amalloyyes
15:25TimMc<3
15:25michael_campbell"easy" in RIch Hickey's terms, sure. "Simple"... no.
15:26TimMcright
15:26michael_campbelland I'm just used to the old-school way of doing it. so my finger memory is all confused now
15:26TimMcIt took me a while to figure out how to create a file with a space in the name. :-)
15:26michael_campbellI haven't tried; how do you?
15:26TimMcSomething to do with C-q
15:27michael_campbellah, right. standard emacs quoting
15:27tyconnellSomeone says emacs, and I have a chicken lady moment.
15:27amalloyTimMc: you can also press C-f again to switch out of ido
15:27michael_campbellI had to figure out how to open "the current directory in which the file you're looking at is sitting".
15:27michael_campbellC-x C-f . C-j.
15:28TimMcC-j is enter?
15:28TimMcish
15:28amalloytyconnell: i would goodle for "chicken lady moment", but for fear of what i might find
15:28pauldoowhen clojurescripting, is it sensible to have an almost empty html file, and emit the dom content through a "main()" function triggered onload?
15:30TimMcmichael_campbell: Aha, I found the little bastard: .emacs.d/starter-kit-lisp.el:61
15:30dnolenpauldoo: emitting dom content from JS is going to be slower than having the markup already there on the page to manipulate via JS.
15:31pauldoodnolen: slower in what sense? runtime performance, loading time, development time..
15:31TimMcpauldoo: http://ejohn.org/blog/dom-documentfragments/
15:32dnolenpauldoo: runtime performance, loading time - maybe even development time - generating DOM via code is error-prone.
15:32pauldooahh ok - I'm really not fussed about runtime performace. still "hello worlding" my way around google closure + clojurescript.
15:33pauldooI was just interested if emitting from clojurescript is seen as more flexible or idiomatic in some way
15:33michael_campbellTimMc: Thanks!
15:33amalloypauldoo: your app also won't work at all without js enabled. if you emit actual html, you can at least have nice fallbacks
15:34dnolenpauldoo: emitting is just not idiomatic based on how browsers work. The fastest thing is - the markup is already there, innerHTML, create elements - in that order IMO.
15:34pauldoodnolen: right-o. I understand
15:35dnolencreating DOM trees in code is just crazy tedious.
15:35pauldooeven with the power of macros?! surely not… :p
15:35TimMcmichael_campbell: I'm imagining that scene in the Matrix where they extract the "bug" from Neo's abdomen.
15:35michael_campbellhahahah
15:35dnolenpauldoo: I was going to say that :) but I consider it bad practice.
15:36dnolennot macros - DOM generation via code.
15:36pauldoodnolen: hehe.. thanks for your advice.. :) I'm still experimenting for now. I have no experience of JS or HTML. trying to ignore them and go entirely clojurescript. (maybe it's not a sensible thing to try)
15:37michael_campbellTimMc: how did you remove it; just comment out the add-hook?
15:37dnolenpauldoo: sure, I think there are some opportunities for ClojureScript to make dealing w/ the DOM sensible - but I haven't had any time to pursue any directions along those lines.
15:38gtrakpauldoo, take a look at pinot
15:38gtrakthere's a dom.cljs
15:38gtrakhttps://github.com/ibdknox/pinot/blob/master/src/pinot/dom.cljs
15:41michael_campbellOther than 4clojure, are there other sorts of "solve these puzzles in clojure" type sites to get one more familiar with the language?
15:41gtraklabrepl
15:41klauernI've yet to try it, but clojure koans sounds fun: https://github.com/functional-koans/clojure-koans
15:42jjidorosettacode
15:42TimMcmichael_campbell: I nuked the whole top level add-hook thing, yeah.
15:42TimMcpauldoo: The DocumentFragment thing I linked is one thing to consider, but also check out enlive if you want to generate some markup on the server.
15:43pauldooTimMc: thanks
15:43scottjmichael_campbell: there's also a site w/ euler project solutions
15:44michael_campbellThanks scottj, jjido, klauern, gtrak - all bookmarked!
15:45R4p70rIs clojure sort a stable sort?
15:45TimMcI bet it uses the Java Collections sort, so look there.
15:45gtrakR4p70r, java sort is timsort in java7 i think
15:45jjidomichael: what is your prog background ?
15:46Raynes$cd sort
15:46lazybotclojure.core/sorted-map: http://clojuredocs.org/v/1494
15:46lazybotclojure.core/sorted?: http://clojuredocs.org/v/1558
15:46lazybotclojure.core/sorted-map-by: http://clojuredocs.org/v/1783
15:46TimMcR4p70r: j.u.Collections/sort is stable
15:46michael_campbelljjido: 20 years, of c, c++, perl, and java. But it's not been deep; one reason I'm coming to clojure is I've realized my "X" years of experience are really "X/5" years, repeated 5 times over. I want to do something new.
15:46TimMc,(doc sort)
15:46clojurebot"([coll] [comp coll]); Returns a sorted sequence of the items in coll. If no comparator is supplied, uses compare. comparator must implement java.util.Comparator."
15:47TimMcYup, that's probably it.
15:47gtrakmichael_campbell, lisp is a good thing to learn then
15:47michael_campbelljjido: That said, i'm a language whore, and have played around the edges of a lot of different langs; at least enough to get the ideas... somewhat.
15:47RaynesKind of strange that searching clojuredocs for sort or clojure.core/sort gives you everything *but* sort itself on top.
15:47klauernI find myself struggling with clojure, but I think of it as a good thing. :)
15:47klauernReally stretches you to think about things differently
15:47TimMcRaynes: ClojureDocs uses different orderings for the dropdown autosuggest and the actual search page.
15:48gtrakclojure/lisp/scheme shows you the essence of things
15:48michael_campbellgtrak: <nod> I specifically am into clojure (as opposed to Scala, right now), so I don't fall back into doing "language x" in a style with which I am comfortable.
15:48R4p70rThanks
15:49scottjRaynes: clojure.core/sort is the first result for me in the autocomplete search box and in the search results for sort
15:49michael_campbelland as I have said, I've been into emacs for longer than Raynes has been on this earth (plus a few years), so the lispy syntax doesn't bother me like it does some.
15:49Raynesscottj: I was referring to the API search endpoint.
15:49RaynesI can already see that becoming a meme.
15:50gtrakmichael_campbell, i think what happens if you do enough lisp is you lose heart for specific styles of coding, since you can abstract absolutely anything
15:50amalloyRaynes: it's been a meme for longer than you've been alive
15:50RaynesIndeed.
15:50michael_campbell*chuckle*
15:51jcromartiesigned bytes are insane
15:51jcromartiewhy does Java have signed bytes
15:51gfrederickssigned bytes and rvm.
15:51amalloyi sign all my bytes. don't want anyone impersonating me
15:52jcromartiervm?
15:52michael_campbellgpg signed bytes. only 2K overhead for each one.
15:52jcromartieheh :)
15:52R4p70rI love having these "source" links right in the documentation but loading core.clj from github makes Firefox really slow.
15:52gfredericksjcromartie: ruby version manager. My current source of pain.
15:52jcromartieah yes
15:53jcromartiervm is insane
15:53jcromartieIs there a good bit/byte packing/unpacking lib for Clojure?
15:53amalloymichael_campbell: that'll be a language primitive in the next compiler i write
15:53jcromartiea la Ruby's String#unpack :)
15:53amalloyultra-secure
15:53michael_campbellamalloy: Nice. I've always wanted to write a compiler and to save space, the error message table would just be, "No."
15:54brehautmichael_campbell: have you looked at prolog?
15:54amalloyhah
15:54michael_campbell"looked at" in the strictest sense of the word, yes. Not even begun to delve into its idioms or usage.
15:54TimMcmichael_campbell: "Ugh, why would you think that would work?" "Haha, as if!" "That is not valid syntax." "You're missing a thing."
15:55RaynesThat last one is golden.
15:55gtrakprolog says that stuff?
15:55brehautgtrak: No.
15:55michael_campbellTimMc: I'm reminded of my early college days; Pascal on a mainframe. The errors would be like ".... at line 6. Did you miss a semicolon?" Why, yes, yes I did. Now put it in there if you guessed I needed it and keep on going FFS.
15:55amalloyTimMc: elected for president of the Clojure Error Messages committee???
15:55lazybotamalloy: Oh, absolutely.
15:56R4p70rmichael_campbell, Pascal has semicolons?
15:56TimMcmichael_campbell: That might be a brilliant ues-case for a condition system.
15:56michael_campbellR4p70r: absolutely. But when I write it, evidently too few ;_)
15:56brehautgtrak, michael_campbell: prolog answers any query it cant satisfy (or when it has exausted its results) with "No."
15:57gtrakmichael_campbell, better than python, >>> exit replies 'Use exit() or Ctrl-Z plus Return to exit'
15:57michael_campbellbrehaut: Hah, awesome. And I didn't patent the idea - blast it!
15:57michael_campbellgtrak: yes, that's a class misfeature of a UI.
15:57gtrakit knows unambiguously i want to exit, and insists on being pedantic :-)
15:58michael_campbellthus, "pythonista".
15:58TimMcgtrak: Luckily it knows about C-d
15:58amalloy(def exit (lazy-seq (System/exit 0)))
15:58RaynesI like Python's approach -- yo, do it right or don't do it at all.
15:58brehautgtrak: there should be only one, obvious, (for a dutchman) way to do anything
15:58gtrakeven at the repl?
15:58RaynesYes.
15:59brehautgtrak: it satisfies all the criteria for the pythonism :P
15:59gtraklamesauce
15:59michael_campbellThe problem is there are various ideas of "right", so really, "You do it the way we say, or you don't do it at all" is more like it. Even when "the way we say" is pathological.
15:59TimMcamalloy: Haha, nice!
16:00TimMcI demand that Leiningen use that.
16:00gtrakbrehaut, the thing is, it's only persuasive if you agree with them, i find a lot of their decisions arbitrary wrt to their effects
16:00R4p70rmichael_campbell, Guess you're right I've done some Turbo Pascal but it seems I have forgoten a lot of it.
16:00brehautgtrak: you wont find me defending python very much ;)
16:00amalloyor (def exit (delay (System/exit 0))). this lets you issue a macho-sounding (force exit)
16:05amalloyhuh. i seem to have gotten emacs into a state where clojure-jack-in displays "error in process filter: Cyclic keymap inheritance"
16:06BahmanI get "Unable to resolve symbol: find-doc in this context" when trying to use 'find-doc'. Anything special I should do before accessing the fucntion?
16:06Raynesamalloy: When that happens, the solution is usually to keep doing it until it works.
16:06Bahmanfunction
16:06amalloyRaynes: amusingly, that's how i got into this state
16:07RaynesHeh
16:07gtrakhow big of a prog is emacs?
16:07amalloyi think that question has a countably-infinite number of correct answers. clarify intent?
16:08gtraksource LOC
16:08gtrakjust curious
16:08amalloyiirc it's a couple million lines if you add together the C and elisp?
16:08gtrakoh jesus :-)
16:09technomancyhttps://www.ohloh.net/p/emacs/analyses/latest
16:09gtrakso we can't rewrite it in clojure?
16:09technomancythat insane leap last year was the merge of cedet
16:09amalloydang, who is this Other guy. he gets a lot done
16:09Bahmangtrak: With Swing? phew
16:10Raynesgtrak: Everybody tries it, everybody fails.
16:10gtrakha, well the rendering could be anything
16:10amalloywhoa this chart *is* interactive
16:10gtrakRaynes, people actually try to write emacs?
16:10Raynes$google Haskell yi
16:10lazybot[Yi - HaskellWiki] http://www.haskell.org/haskellwiki/Yi
16:10michael_campbellgtrak: a "wc -l" of all files in the pre-build *windows* binary distribution give 2,464,300. That's just files (which includes .exe's, so ... not 100% correct there)
16:11gtrakdamn, that's a lot of lips
16:11michael_campbelland includes both *.el and *.elc (the compiled versions of the .el)
16:11Bahmangtrak: Though it would be nice to have a web-based Clojure IDE which stores the source files on the server/cloud.
16:11gtraklisp
16:11technomancywow, the amount of C in emacs has actually gone down since '08; that's encouraging
16:11gtrakBahman, yea, you don't really need a full emacs for that though
16:12amalloyemacs has 195 lines of java code in it? i wonder what it does and where it is
16:12technomancyamalloy: tests, I'm sure
16:12amalloyah. yes
16:12amalloycedet-java autocomplete tests
16:12Bahmanamalloy: That's when they tried to reduce the speed of Emacs key-reader to make programmers feel they type fast :-D
16:13brehautLispReader.java is the reader implementation for clojure right?
16:13michael_campbellamalloy: and 776 lines of C# (!?)
16:13amalloymichael_campbell: if you want to do this sort of analysis you should check out cloc
16:13BahmanSo folks, any idea about my problem?
16:14Raynes&(require 'clojure.repl)
16:14lazybot⇒ nil
16:14Raynes&(clojure.repl/find-doc "print")
16:14lazybot⇒ ------------------------- clojure.tools.logging/debug ([message & more] [throwable message & more]) Macro Debug level logging using print-style args. ------------------------- clojure.tools.logging/error ([message & more] [throwable message & more]) Macro Erro... failed to gist: Connection reset
16:14RaynesHeh, I really, really need to update clj-github to Github's v3 API. Surely it doesn't suck as bad as the old unofficial gist API.
16:15amalloymichael_campbell: the C# is a miscount by cloc, afaict
16:15BahmanThanks Raynes.
16:15michael_campbellAh.
16:15amalloyit's a .cs file meaning something other than C#
16:16michael_campbell<nod> RMS allowing C# code in the source base did seem suspect.
16:16amalloyah. a tutorial in czech
16:17brehautphwoar, theres a lot of stuff happing in the reader
16:17gtrakyea
16:19brehautthe java formatting for the clj imp still surprises me
16:20gtraki think it shows how little respect rich has for classes
16:20brehautlol
16:21gtrakthe try-catch is really odd though
16:21licenserneat neat :) I start to like clojurescript
16:22BahmanIn which namespace can I find 'javadoc'?
16:22gtrakhe puts { } on the same indentation as the insides
16:23RaynesBahman: Pretty sure there is no 'javadoc' function.
16:23TimMcThere was...
16:23brehautclojure.java.javadoc/javadoc ?
16:23TimMcI think it was a contrib
16:23RaynesReally?
16:23brehaut,(apropos 'javadoc)
16:23RaynesHoly crap.
16:24clojurebot()
16:24Rayneshttp://clojure.github.com/clojure/clojure.java.javadoc-api.html
16:24licenserRaynes mate :)
16:24licensernow are you?
16:24RaynesFantastic.
16:25licensergreat great :) I read your slides, I am seriously impressed with what you did there :)
16:25TimMcgtrak: He also eschews Javadocs, it seems.
16:25Rayneslicenser: <3
16:25gtrakyea, it's quite hard to read
16:25gtrakmaybe deliberately
16:26TimMcTrying to interop from the Java side is pretty rough.
16:26gtraki wonder if he uses emacs for java
16:28brehautgtrak: perhaps its to shock you into realise you are reading ordinary java code and to read it careful
16:29gtraki think it's probably because he works alone most of the time
16:29michael_campbellThe brace style is "Whitesmith", looks like.
16:30brehautwhatever the brace style is, ive got my work cut out making a valid tokenizer
16:30klauern_I'm having some trouble with the korma library and WHERE clauses
16:30michael_campbellhttp://en.wikipedia.org/wiki/Indent_style#Whitesmiths_style
16:30klauernFor instance, if I type this:
16:31klauern(sql-only (select bobs (where (:ROWNUM [< 50]))))
16:31klauernI get back
16:31klauern"SELECT * FROM bobs WHERE "
16:31klauernNow, could it be that since ROWNUM is a pseudocolumn, it doesn't work?
16:32michael_campbellwhat do you get when you use something other than :ROWNUM?
16:32klauernThe same
16:32klauern(sql-only (select bobs (where (:id [< 50]))))
16:32klauern"SELECT * FROM bobs WHERE "
16:32michael_campbell>:-\
16:33klauernIt seems odd
16:33brehautklauern: does (where (< :id 50)) do anything different?
16:33hiredmanklauern: I think that is supposed to be a map
16:33klauernchanges it a bit
16:33klauern"SELECT * FROM bobs WHERE 10"
16:33hiredman{:id [> 50]}
16:34hiredman(but I've never used korma, dunno)
16:34klauern_Yeah, i'm just starting to play around with it
16:34TimMcI've always been uncomfortable with the select/from/where syntax.
16:35hiredmanhttp://sqlkorma.com/ the examples have it as a map
16:35TimMcIt should be FROM/WHERE/GROUP-BY/HAVING/SELECT/LIMIT or something
16:36jcromartieI wish I could better convey my feelings about the interface for ClojureQL and Korma... for instance the (sql-only ...) vs just printing the non-deref'ed RTable object in ClojureQL.
16:37jcromartielike, in Korma, a dry-run or getting the SQL is the extra step, whereas in ClojureQL actually executing it is the extra step
16:37jcromartieright?
16:37kephalewhat is the best way to reduce a boolean sequence with or? i'm guessing #(or %1 %2) isn't
16:37clojurebotto be fair I dunno that I've ever had code out right rejected, it just sits in jira or assembla or where ever, or if I ask if there is any interest (before writing any code) I get told to go write alioth benchmarks
16:37technomancydakrone: did I catch your intention correctly that you're planning on taking a look at the lein 1.6.2 JVM_OPT issue you found?
16:37dakronetechnomancy: I am planning to if I ever have any time, but by all means feel free to get to it before I do :)
16:38technomancydakrone: got my hands full with designing 2.0; thanks. =)
16:40TimMckephale: some
16:40licensertechnomancy: kudos for joining forces with cake
16:40TimMc&(some [false nil 2 true])
16:40lazybotclojure.lang.ArityException: Wrong number of args (1) passed to: core$some
16:40TimMc&(some identity [false nil 2 true])
16:40lazybot⇒ 2
16:40technomancylicenser: thanks, but it wasn't my idea. =)
16:40kephalemmm with identity
16:40kephaleTimMc: cool, ty
16:41TimMcYeah, it's a little silly, but whatever.
16:41RaynesBecause I want Leiningen stickers.
16:41licensertechnomancy: no matter all involved showed really personal greatness I think :) so rare to see people join forces and not devide
16:42technomancyhm; I should see if my new employer could finance the second run of stickers.
16:44cemericktechnomancy: it'd likely be essentially free if they were printed on the same sheets as the other heroku stickers
16:45TimMctechnomancy: leiningen.core/exit accepts an optional exit code... do you think anyone actually uses that?
16:46scottjhave your cake and lein it too
16:46technomancyTimMc: sure; it's mostly for CI contexts to communicate to jenkins/travis whether to consider the build successful
16:47TimMctechnomancy: Ah... so it's not just for the REPL, right. But what about REPL users?
16:47technomancyI'd be surprised if repl users care about the exit code
16:47devnRaynes: you joining heroku?
16:48technomancytheoretically you could do "lein repl, deploy" and have the deploy task only go through if you had a zero exit code
16:48Raynesdevn: He means the Leiningen + Cake teams.
16:48devnoh, sorry, just stumbled in
16:48technomancyI'd be surprised if anyone actually did that, but it should work.
16:53jcromartieso
16:53tyconnell@mac users: is there a preferred EMACS application?
16:53jcromartiethis whole "spark" script thing on HN today
16:54jcromartieI think I wasted my day playing with UTF and weird terminal stuff
16:54jcromartiea
16:54jcromartieand doing it in Ruby, and then Clojure, and the Java *just to remind me how annoying it would be*
16:55jcromartiesomeone take a look at this and let me know if it's reasonable... because honestly I'm not sure https://gist.github.com/5cd0f0f31cdd9db84199
16:55jcromartielike, I want to believe programming in Java is not that bad
16:55BahmanIs there a macro equivalent to Common Lips's WITH-OPEN-FILE ?
16:55brehautwith-open
16:55clojurebotGabh mo leithscéal?
16:55Bahmanbrehaut: Thanks.
16:56TimMcjcromartie: Link to the HN sparklines post?
16:56technomancytyconnell: http://emacsformacosx.com is the way to go
16:56jcromartieTimMc: http://news.ycombinator.com/item?id=3237478
16:56jcromartieand now compare Java and clojure :) https://gist.github.com/3517ed2c343bbbc3adae
16:57jcromartiebut I don't know... is there a better way to do it in Java?
16:58tyconnelltechnomancy: thanks
16:59bhenryis there an implicit do on when?
16:59Raynesbhenry: Yes.
17:00bhenrythanks
17:00Raynes&(macroexpand '(when foo bar))
17:00lazybot⇒ (if foo (do bar))
17:08aaelonyhey all, I'm specifying clojure 1.3.0 in my project.clj but getting strange lein deps errors that reference 1.2.0. Details here http://pastie.org/2869248. Suggestions appreciated on what I'm missing...
17:09TimMcaaelony: Transitive dependency?
17:09aaelonyTimMc: not sure what I would eliminate...
17:09technomancythat's weird; top-level dependency declarations should always take precedence
17:10technomancyaaelony: if you have maven installed, "mvn dependency:tree" is really helpful for these kind of situations
17:10aaelonytechnomancy: let try that mvn command
17:10TimMc`lein pom` first
17:11technomancyoh yeah, good point
17:11aaelonyhere's the pom: http://pastie.org/2869273
17:12technomancythat's a lot of snapshots. =(
17:12aaelonyok, I'll see about removing snapshots
17:13technomancyaaelony: well, it's unrelated to the problem you're having
17:13technomancyjust a good idea to avoid them in real production apps
17:13aaelonymakes sense
17:13jcromartieI wonder if this Zach Holman guy is trolling.
17:15jcromartieanyway
17:17devnwhere?
17:17clojurebotwhere is your source code
17:18devnjcromartie: what are you referring to?
17:19jcromartiedevn: the spark thing. I seriously don't understand how a bad shell script that doesn't work correctly and takes 30 seconds to run one of its examples got 400 points on HN
17:19devnoh, heh, yeah I saw that
17:19hiredmanI've been thinking about having clojurebot do inference, e.g. if 'A is X' and 'X is B' asking about A will get you 'A is X' or 'A is B'
17:19jcromartiejcromartie: when it could be 5% of the LoC in another language, and work right, and actually handle the data that they use for their example!
17:20jcromartieseriously, the earthquake data doesn't even render correctly
17:20devnjcromartie: it's portable
17:20jcromartiebarely
17:20hiredmana long with some kind of inference budget per lookup
17:20Raynesjcromartie: Talking to yourself is a sign of mental illness.
17:20jcromartiethe first version didn't work on OS X
17:20jcromartieRaynes: hah oops
17:21michael_campbellRaynes: I think NOT talking to yourself is a sign of that too. Perhaps more so!
17:21RaynesI'm terrible company.
17:21brehauthiredman: that would be very cool
17:22devnmichael_campbell: I like that point. If you aren't constantly thinking "stuff" that you keep to yourself, you might be even crazier. That being said, limiting the lengths to which you chat with yourself seems healthy.
17:22jolyTalking to yourself is ok, and answering yourself isn't too bad. But if you start going "What?!", then you're in trouble.
17:22BorkdudeYou can always hit M-x doctor
17:22michael_campbellI find myself asking me, Dude, seriously, WTF? more often than I'd like.
17:23michael_campbellI work out of my house right now, so talking to myself (or rather, scolding myself for that crap I wrote "some time ago") is pretty common
17:23devnget a rubber duck :)
17:24R4p70rAnyone know if the doctor source code actually worth reading? I remember reading something about it in "Coders at work"...
17:24BorkdudeJust wondering, is there any standard on how to annotate Java in a code review?
17:25michael_campbellBorkdude: that's often some company standard.
17:25michael_campbellhave never seen a canonical way, other than "the Sun java coding standard" or somesuch
17:30hiredmananyone know if there is a way to get cl-format to human format numbers like -h on du?
17:31Borkdudemichael_campbell: any suggestions on how to annotate it, just use comments, can I use javadoc to get an overview of them, etc?
17:38devnhiredman: oh man, it's been awhile since I looked at that. I remember there being a ton of cl printing options in clojure
17:43tcjI just wrote my first utility using clojure. It connects to a DB and does some stuff. What is the best way to configure this utility (e.g. DB creds). Currently, these are hard-coded in the source. I have a Java properties file with all the values that I need. It'd be cool to use that. But I'm more concerned with doing things in a "Clojure way". I have a hunch the Clojure way is to do config...
17:43tcj...using Clojure. Is this right? Any advice? Would it make sense to store my config as a global map?
17:44technomancytcj: just a static map read off the classpath is pretty common
17:46tcjtechnomancy: Just so I'm clear... this would be something like config.clj available in my CP. Correct?
17:46technomancytcj: sure
17:46tcjcool. Thanks!
17:51kurtharrigertcj: Take a look at https://github.com/4clojure/4clojure.git, it uses a config.clj file which it reads with *read-eval* false. It seemed like a pretty good approach to me
17:52kurtharrigertcj: sorry copied the git url not the http url https://github.com/4clojure/4clojure
18:04Borkdudekurtharriger: cool! I think I'm going to use it as well
18:05technomancyBorkdude: mind if I privmsg?
18:05Borkdudetechnomancy: go ahead
18:06tcjBorkdude: thanks. I'll have a look
18:13mjwhittok, I have a stupid question, how do I println to stderr?
18:13technomancyclojurebot: what is the most horrible thing?
18:13clojurebotmost horrible thing is http://tinyurl.com/b65o8e
18:13ibdknoxlol
18:13technomancy~botsnack
18:13clojurebotThanks! Can I have chocolate next time
18:14Raynesmjwhitt: (binding [*out* *err*] (println "I'm out of errs"))
18:14ibdknoxmjwhitt: (binding [*out* *err*] (println "hey"))
18:15ibdknoxhm
18:15ibdknox:p
18:15mjwhittlol jynx
18:15RaynesI win.
18:15ibdknoxyeah yeah. ;)
18:15mjwhittthanks guys
18:17hiredmanso the idea is, clojurebot would have some budget for infering, determining how many inferences and how deep they can go per lookup, and it would keep some kind of log of the inferences that it used, and if some "favorable response" heuristic was triggered (botsnacks or something?) all inferences made in the past minute or so would get reified as actual factoids
18:18Arafangionclojurebot: Do you like hiredman's idea?
18:18clojurebotHuh?
18:18ibdknoxlazybot: what about you???
18:18lazybotibdknox: Yes, 100% for sure.
18:18lazybotIt's AWWWW RIGHT!
18:19ibdknoxRaynes: wtf is that? ^
18:19RaynesIt's a command.
18:19RaynesAnd a hook.
18:19brehautquestionmarks???
18:19ibdknoxthe it's awww right part?
18:19lazybotbrehaut: How could that be wrong?
18:19RaynesYou just triggered two things at once.
18:19ibdknoxlol
18:19ibdknoxcuz I'm awesome
18:19RaynesThe 'it's awwww right" part is the 'what' command.
18:20ibdknoxah
18:20Raynes$what do you think of Noir?
18:20lazybotIt's AWWWW RIGHT!
18:22ArafangionPersonally, I think clojurebot's already the most realistic.
18:22ibdknoxlol
18:22ArafangionI mean, most of the time i ask a girl a question, they respond much the same.
18:28R4p70rSites like 4clojure.com and online REPLs use Java sandboxing I guess?
18:28ibdknoxR4p70r: Clojail
18:29R4p70ribdknox, I'll have to read about that.
18:32RaynesR4p70r: I gave a talk about it at the Conj, but the video isn't out yet. Keep and eye out for it if you're interested.
18:35BorkdudeRaynes: I liked your slides, especially the one about being a Stuart Sierra groupie
18:35Borkdudehttps://github.com/relevance/clojure-conj/blob/master/2011-slides/anthony-grimes-clojail.pdf <-- slides
18:38amalloytechnomancy: i don't remember the huge mess of php errors last time i saw that link. it kinda makes it even more horrible
18:38ibdknoxeverybody loves PHP errors
18:39ibdknoxit's the hallmark of a great site ;)
18:39amalloyand they're so severe! severity 8192 is serious business!
18:41ibdknoxthat's damn near nuclear holocaust severity
19:01ibdknoxhm
19:02ibdknoxclojurebot appears to be showing the same thing from clojars over and over
19:03alexbaranoskyibdknox: I'm thinking of doing a 5-minute lightning talk on Noir at work this week
19:03ibdknoxalexbaranosky: cool :D
19:03alexbaranoskyibdknox: going to see if I can somehow cram Mongo into there as well, but 5 minutes is pretty tight
19:04ibdknoxmongo's pretty simple, so I could possibly see it working
19:04alexbaranoskyexactly
19:06amalloyibdknox: twice in a row is "over and over"? we are harsh masters to our slavebots
19:06ibdknox:p
19:06alexbaranoskyrofl
19:06ibdknoxamalloy: listen. They are here for our satisfaction
19:06technomancyclojurebot: eventual consistency is for losers
19:06clojurebotYou don't have to tell me twice.
19:07ibdknoxif they start to get out of line, we have to keep them in check... otherwise you get skynet
19:07amalloytechnomancy: you might in fact have to tell him twice, if you want to make sure you get the same answer back before tomorrow...
19:07ibdknoxlol
19:07technomancynice
19:08ibdknox~eventual consistency
19:08clojureboteventual consistency is for losers
19:14ninjuddibdknox: we talked a bit about a unified backend for clojureql and korma at the conj. curious if you've had any more thoughts on it
19:15ninjuddbendlas is working on a blog post about the future of clojureql, so he'll be interested in your thoughts too
19:19ibdknoxninjudd: I definitely think it would make sense
19:19ibdknoxI suspect there are a couple things that will need to happen to enable it, namely the subselect stuff I mentioned
19:26alexbaranoskyibdknox: does the noir+mongo tutorial still work? I got the first half working easily with Noir, but the mongo code I added is giving me an Application Error
19:26ibdknoxhm I think so? though I didn't write that tutorial
19:27alexbaranoskyibdknox: you've got a link to it on Noir, so I thought maybe you're aware of it
19:27alexbaranoskyon the Noir site)
19:27ibdknoxalexbaranosky: yep yep, I know what you're talking about. I know it *did* work
19:27ibdknoxbut congomongo has been changing some
19:28ibdknox(for the better)
19:28alexbaranoskywait, let me try something, dont' spend any moe time on it
19:28alexbaranoskyI used a newer version of congomongo, silly me
19:29ibdknoxthe latest versions of congomongo make it really easy to use
19:29ibdknoxmuch easier than that older version
19:30ibdknoxwe use it for our logging code
19:30ibdknoxand what we have isn't much more complicated than what's in the congomongo readme :)
19:31alexbaranoskymongo thinks about data much the way Clojure thinks of data, which makes them feel like a good match
19:31ninjuddibdknox: think it makes sense to split the backend sql compiler out into a separate project we can all contribute to?
19:32brehautfrom http://clojure.org/reader: "Symbols begin with a non-numeric character and can contain alphanumeric characters" is alphanumeric here [a-zA-Z0-9] or does it include non-english characters as well?
19:33ibdknoxninjudd: I'll have to think about that. It would probably make sense, but I hadn't originally built it with that level of separation in mind.
19:34amalloybrehaut: i mean, the current impl allows pretty much anything. it's hard to know what's "guaranteed" given that the wiki is not really canonical
19:35brehautamalloy: thats a bit difficult. i guess i'll just be extremely permissive about what looks like symbols then
19:36ninjuddibdknox: yeah. no hurry. FWIW, we could steal the name sqleton (pronounced sqeleton) from our incomplete schema migration library
19:36buduhi
19:36ibdknoxninjudd: haha that's a good name :)
19:36budui've got a small question about ClojureScript
19:36ninjuddor name it after some other indian food ;) vindaloo?
19:36ibdknoxlol
19:37BahmanHow do I swap two characters in a string?
19:37ninjuddNaan or Basmati? since that's what you put your Korma on
19:37buduit currently doesn't support Refs nor STM
19:37ibdknoxNaan *is* delicious
19:37amalloyninjudd: sqeleton is not a very thorough pronunciation guide :P. neets to start more like squell
19:38ninjuddsqleton, rhymes with skeleton
19:38ibdknoxI mean really you know it's got to be a good library if it's named after food
19:38ibdknoxlol
19:38ibdknoxnow I need a library named Brisket :D
19:38jcromartiesqleton... nice
19:38bududoes someone knows if it will get implemented one day?
19:38ninjuddthe most important part of deciding if something should be a separate library *is* figuring out a name for it
19:38ibdknoxbudu: why do you need them?
19:38amalloybudu: javascript doesn't have multiple threads so there's not much point
19:39ibdknoxninjudd: true...
19:39buduok
19:39jcromartiemasala has a nice ring
19:39buduforgot about that!
19:39ibdknoxbudu: atom's exist though
19:39ibdknoxbudu: so you can pretend :D
19:39amalloyRaynes: you should write a lazybot plugin that registers every word ibdknox says as a library on clojars
19:39RaynesSure.
19:39amalloythen sell em
19:39ibdknoxnoooooo those are *mine*
19:40ibdknoxI was surprised I got watchtower
19:40amalloyibdknox: i'll be using my new "noooooo" library to generate xml
19:40amalloysoap, maybe
19:40ibdknoxamalloy: haha
19:40technomancyclojurebot: via soap?
19:41clojurebot"They enable us to send XML messages through SOAP. Through SOAP!!!" (http://www.youtube.com/watch
19:41technomancy=(
19:41ibdknoxlol
19:41buduibdknox: btw, congratulation on Korma
19:41ibdknoxbudu: haha thanks :)
19:41buduibdknox: i haven't used it yet but it looks great
19:41ibdknoxwe'll see if you say the same thing once you use it ;)
19:42budui'm thinking about adding support for delimited identifiers
19:42ibdknoxdelimited identifiers?
19:42buduquoted tables, columns name
19:42ibdknoxah
19:42ibdknoxeverything is quoted now
19:42ibdknoxthough spaces are problematic for that...
19:43budualready! cool
19:43ibdknoxpeople actually put spaces in their table names?
19:43ibdknoxthat's terribel
19:43ibdknoxterrible*
19:43ibdknoxbudu: yeah, check out 0.3.0-alpha
19:43ibdknoxI was productive on the plane ride back :)
19:43buduyeah the SQL standard is quite permissive with delimited identifier
19:43alexbaranoskyibdknow: I think I've seen space-serpated reporting db table names
19:47mabesis there something like proxy but that takes an already existing object? I basically, want to create a delegate/proxy object that has meta data for an underlying java object
19:48cgrayhere's a strange thing... I'm putting in type hinting and at some places, ^int works, but at others I have to use ^Integer... any ideas why that would be?
19:48technomancyibdknox: I love committing on a plane.
19:49ibdknoxtechnomancy: gotta use that time for something :)
19:49mabescgray: maybe you have an Integer instead of an int.. what version of clojure are you on? You can try doing (int foo) instead of typehinting
19:49gfredericksThat was a movie with Samuel L Jackson, right?
19:49technomancyibdknox: I also watched one of the videos from last year's conj
19:49cgraymabes: i'm on 1.3
19:50mabescgray: okay, I'm not as familiar with 1.3 but try replacing ^Integer with (int x).. also, have you verified that the method you are trying to call accepts the primitive form?
19:52cgraymabes: I think the problem is trying to call subs
20:02nickmbaileywhats the best way to get the 3rd, 6th, 9th, etc items out of a collection
20:02nickmbaileytake-nth is almost what i want but it gives the first element than skips n
20:02ibdknoxdrop 3
20:02ibdknoxand then take nth
20:02cgray(map last (partition 3 coll))
20:02ibdknox,(doc take-nth)
20:02clojurebot"([n coll]); Returns a lazy seq of every nth item in coll."
20:03brehautM isnt the only suffix for numbers now is it?
20:03ibdknox,1.0N
20:03hiredman,1N
20:03clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 1.0N>
20:03clojurebot1N
20:03hiredmanbleh
20:03brehautthanks
20:03ibdknoxhm
20:03brehautand it always has to be capitalized?
20:03nickmbaileydrop and take-nth should work, thanks
20:04ibdknox,(take-nth 3 (range 1 11))
20:04clojurebot(1 4 7 10)
20:04ibdknox,(take-nth 2 (range 1 11))
20:04clojurebot(1 3 5 7 9)
20:04nickmbailey,(take-nth 3 (drop 2 (range 1 9)))
20:04clojurebot(3 6)
20:05nickmbailey^thats what i wanted
20:05ibdknoxyep yep, I was just playing around with it :)
20:05brehautfantastic. i have working number tokenizer and its only 62 lines long :S
20:05nickmbaileythe doc for take-nth seems confusing
20:05nickmbaileyat least to me
20:06cgray,(map last (partition 3 (range 10)))
20:06clojurebot(2 5 8)
20:06budui've got another question...
20:06ibdknox,(take-nth 3 (range 10))
20:06clojurebot(0 3 6 9)
20:06ibdknox,(rest (take-nth 3 (range 10)))
20:06clojurebot(3 6 9)
20:06gfredericks,(->> 10 range (take-nth 3) rest)
20:06clojurebot(3 6 9)
20:06bududoes somebody knows what happened with the contrib.datalog library
20:07technomancybudu: its author seemed to indicate it should be rewritten
20:07technomancyseems doubtful it'll be promoted to 1.3
20:07budui was thinking it could be rewritten using core.logic
20:08budubut that job seem over my current capabilities
20:08technomancywhat better way to extend your capabilities
20:08buduhehehe
20:09budui'll have a look at the code but i don't promise anything
20:09budui'm just getting into core.logic, it's fun
20:09cgrayhow do you translate 'var foo = { bar: 4, baz: 5 }' into cljs?
20:09ibdknoxmy capabilities were directly tied to my ability to come up with names... now that amalloy is stealing all of them I fear I am a mere shell of a man
20:09buduand give me headashes at the same time! ;-)
20:10technomancysqleton is pretty great
20:10ibdknoxcgray: as in you need that line exactly?
20:10cgrayibdknox: well, that idea
20:11ibdknoxcgray: (let [foo {:bar 4 :baz 5}] ...) ?
20:11gfrederickshrm..clutch still depends on contrib
20:11cgrayibdknox: i think i need the names not to be munged though...
20:11ibdknoxcemerick: shame! ^
20:12ibdknoxcgray: there's a magical js-object function I think
20:12cgrayibdknox: I'm looking at http://code.google.com/apis/maps/documentation/javascript/overlays.html#Markers
20:12ibdknoxcgray: ah
20:12BahmanSuppose I need to swap character 0 and 2 of string 's'. Is there any way other than (str (nth s 2) (nth s 1) (nth s 0) (subs s 3)) ?
20:12ibdknoxcgray: just provide strings as keys and you'll be fine
20:12cgrayibdknox: ok, thanks
20:16ibdknoxbudu: as far as you know double-quotes work for all dbs right?
20:16ibdknoxbudu: in terms of delimited identifiers
20:29ninjuddtechnomancy: thanks! =)
20:37buduibdknox: no
20:38buduibdknox: better answer.. nearly
20:39ibdknoxbudu: what are the corner cases?
20:40ibdknoxthe lists I found seemed to indicate "some-ident" would work everywhere
20:40buduibdknox: in fact (after revision) in term of input all RDBMS accept quoted identifiers
20:41buduibdknox: it's just that when querying the schema for SQL Server for example it will return bracketed identifiers by default
20:42ibdknoxbudu: ah, I see. I should be ok then, since I never interpret the results myself/ask for the schema
20:42buduibdknox: also for MySQL the ANSI_QUOTES mode must be enabled, but i think it is by default now
20:43ibdknoxbudu: yeah it used to be back-tick right?
20:43buduibdknox: exactly
20:43ibdknoxbudu: k, thanks :)
20:43budufunny example from MySQL doc: CREATE TABLE `a``b` (`c"d` INT);
20:44budupreceded by "The following statement creates a table named a`b that contains a column named c"d: "
20:44buducrazy stuff!!!
20:44ibdknoxwow
20:44ibdknoxthis is an example of flexibility gone wrong
20:45alexbaranoskyyikes!
20:45ibdknoxI hate SQL. :p
20:45hiredman~A is X
20:45clojurebot'Sea, mhuise.
20:45buduthere's so much hilarious stuff inside the SQL standard and implementations doc, forgot about most of them to maintain my sanity
20:45hiredman~X is B
20:46clojurebotYou don't have to tell me twice.
20:46hiredmanA?
20:46clojurebotA is X
20:46hiredmanhmm
20:46hiredmanA?
20:46clojurebotA is X
20:46hiredmanI guess
20:46ibdknoxhiredman: you're trying to turn clojurebot into an inference engine?
20:46hiredmanA?
20:46clojurebotA is B
20:46hiredmantrying?
20:47ibdknoxhaha :)
20:47buduthis is weird
21:07aperiodic~succ 0 is 1
21:07clojurebotOk.
21:07bhenryworking with clojurescript atom. i'm swap!ing it and then calling something that derefs it to make changes to the dom. however it appears to be asynchronous, because the second command doesn't work within the function. if i wait a few seconds and run it in the repl, it works fine. any ideas on how to get around this?
21:09aperiodic~succ (n + 1) is succ (succ n)
21:09clojurebotOk.
21:09aperiodic~0 + 1 is 1
21:09clojurebotRoger.
21:09brehautsimple profiling of my syntaxhighligher brush has it at about 7 times faster than the regexp based solution im hoping to replace
21:10ibdknoxbrehaut: nice :)
21:11brehautibdknox: yeah im stoked :) brutally imperative code sometimes pays off
21:12cemerickibdknox: ?
21:13ibdknoxcemerick: oh, somebody said something about clutch uses contrib and I was being funny :p
21:13cemerickah :-)
21:13cemerickall of its usage is 1.3-safe
21:13cemerickmodulo irritating warnings about earmuffed vars
21:13ibdknoxstupid earmuffs
21:14cemerickibdknox: settled in again after the conj?
21:14ibdknoxcemerick: I got back at like 9:30 last night
21:15cemerickoh, right
21:15cemerickmy sense of time was totally destroyed between saturday night and monday morning
21:16amalloyibdknox: almost 24 hours! why no new libraries yet?
21:16cemerickI got one hour of sleep before my flight on Sunday :-P
21:18ibdknoxcemerick: lol :p
21:19ibdknoxamalloy: I needed a dash of sleep ;)
21:20ibdknoxI did however sketch out some stuff on the plane for some nice time helpers ;)
21:23gfredericks`lein search` is not kidding about taking a while to download indexes
21:25chousermy sense of time was destroyed from pretty much the start of the conj until yesterday
21:26cemerickMan, I feel bad about messing with nREPL's protocol now. :-(
21:26chouserI was going to follow that up with a funny anicdote, but it turns out not to be funny.
21:27chousercemerick: why's that?
21:27brehautsyntax highlighting question: should meta stuff be highlighted a) all the same (regardless of the literal types) ie all grey, b) exactly as they normally would be, c) some halfway point ie, desaturated versions of b) ?
21:27cemerickchouser: https://twitter.com/#!/kotarak/statuses/136567617304543232
21:27cemerickHe knew it was coming, but still…
21:27cemerickbrehaut: opacity:.75?
21:27brehautpersonally im leaning towards c) as it falls back to b) with the appropo CSS anyway
21:27brehautcemerick: yeah exactly
21:27cemerick+1
21:28brehautsold!
21:29chouserinteresting.
21:30cemerickThat's client #4.
21:42TimMctechnomancy: Is the most horrible thing that that page is made almost entirely of PHP errors?
21:42bhenryalmost ready to push our new ui into production, written entirely in clojurescript. unfortunately it's an intranet app so we can't show it off.
21:47alexbaranoskybhenry: sweet. Too bad you can't show it off
21:50amalloyshow off the compiled js. nobody will be able to find the NDA-protected stuff in all that, eh?
21:51alexbaranoskyamalloy you're always thinking these great ideas
21:51alexbaranosky;)
22:02alexbaranoskyamalloy: do you know of a 1.3 ordered map implementation?
22:03amalloyalexbaranosky: you're referring to my Ordered library? it looks like it doesn't actually need contrib anymore; the dependency is just there because it was there earlier
22:04alexbaranoskywe're using yours in Midje
22:04amalloyactually that might not be true. i have like a zillion branches of this thing and i'm not sure which one is released; hang on while i poke around
22:05alexbaranoskyamalloy: looks like we have an entire copy of your library pasted into Midje :\
22:06alexbaranoskyamalloy: guess Brian was rushed, and just tweaked yours
22:06amalloyalexbaranosky: i can't say i blame him. i released a version that contains silly benchmarking crap
22:16amalloyalexbaranosky: it looks like his fork fixes a number of silly issues with my released version, and works with 1.3, so i'm not sure what you mean by a "1.3 ordered map implementation"
22:18alexbaranoskyamalloy: was looking at the code spew in the Midje source. didn't realize he had forked your project
22:19amalloyall the same, i'll pull in his changes and push a new version to clojars
22:19alexbaranoskyyeah that'd be great
22:19alexbaranoskylooks like all he really had to do was change the deps ?????
22:19amalloyyes
22:23amalloyalexbaranosky: deployed his changes to clojars. happy testing
22:24alexbaranoskythanks
22:35alexbaranoskyamalloy: update Midje to use the new jar.
22:36alexbaranoskyamalloy: correction, *updated*
22:49alexbaranoskydoes anyone know where I can find an immigrate function?
22:53amalloyalexbaranosky: in the blackest pits of hell
22:53alexbaranoskyamalloy: or in Midje
22:54amalloyseriously immigrate is vile and evil
22:54alexbaranoskyI was looking for somewhere public to grab one from, but it may in fact be a function relegated to the depths of hell, apparently
22:54alexbaranoskyI wonder what we're using it for
22:54amalloyi added something like it to useful recently, though, so i can't really take a moral high ground
22:55amalloyalexbaranosky: probably for re-exporting stuff from semi-sweet into sweet or something like that
22:55alexbaranoskyyep
22:55aperiodicdoes immigrate move things between namespaces?
22:56alexbaranoskydoc: "Create a public var in this namespace for each public var in the
22:56alexbaranosky namespaces named by ns-names. The created vars have the same name, root
22:56alexbaranosky binding, and metadata as the original except that their :ns metadata
22:56alexbaranosky value is this namespace."
22:56ibdknoxevil.
22:57aperiodicwhy would you do that rather than requiring the namespace?
22:57alexbaranoskyrequiring it wouldn't make it public to consumers of the namespace???
22:57lazybotalexbaranosky: Oh, absolutely.
22:59alexbaranoskylooks like this way you don't have to use both midje.sweet AND midje.checkers
23:00amalloyi really hate using it for that purpose (folding a dependency into a "parent" ns), but i have only a strong distaste for using it to combine two non-dependent namespaces
23:00amalloyeg, specifically we wanted useful.core to be a conglomeration of useful.*
23:00alexbaranoskyamalloy: I'd be open to hearing other ways of achieving the same effect
23:01aperiodicyeah, i can see how it could be handy for that reason, but i'd hope that you wouldn't put much else in the conglomerated ns
23:01amalloyaperiodic: nothing else, so far
23:01ibdknoxordered?
23:02amalloyibdknox: maps and sets that retain insertion order
23:02alexbaranoskywe use ordered-map for the binding map created from the tabular macro
23:03ibdknoxI see
23:03amalloyalexbaranosky: fold checkers into sweet (probably not viable), or create another namespace that does nothing but re-export sweet&checkers
23:03amalloyeven call it sweet if you want, and rename the existing sweet to sweet-impl
23:04alexbaranoskyhonestly... it is causing any harm
23:04wtfcoderwhen including clojure-contrib in dependenices of package.clj do i need to specify a repository, lein deps results in not found in repos
23:04alexbaranoskyI'd rather spend time fixing a bug
23:04alexbaranoskyor doing a new feature
23:04amalloyalexbaranosky: i kinda agree. i'm overly aggressive about this issue, like a number of others. you have to learn to ignore me
23:04alexbaranoskyof course, I appreciate the convo about it
23:05ibdknoxalexbaranosky: I never listen to amalloy
23:05amalloyibdknox: surprisingly apropos, unless...surely you didn't listen to me in order to decide to agree!?
23:06amalloywtfcoder: you probably asked for a version that doesn't exist, and also you meant project.clj
23:07brehautamalloy: i have local lookup working for the brush :)
23:07wtfcoderyes, and yes..do I have be explicit with version number or can I just put 1.*.* and let it grab the latest
23:08PPaul(inc wtfcoder)
23:08lazybot⇒ 1
23:09PPaul(inc)
23:09PPaul(inc 1)
23:09lazybot⇒ 2
23:09PPaul(inc (inc 1))
23:09lazybot⇒ 1
23:09PPaulno
23:09amalloywtfcoder: 1.*.* is [1.0.0,2.0.0)
23:10amalloythough there are a lot of people who think version ranges are bad for the soul
23:10wtfcoderokay, confused, im coming from nodejs here if I believe can specify in my project.json to get "thirdpartylib": "1.2.x" and anything from 1.2.x will be pulled in with npm install . (akin lein deps)
23:13technomancyversion ranges are incompatible with repeatable builds
23:13ibdknoxyeah, I don't like ranges
23:14technomancywhich is OK for libraries (assuming you've tested it with everything in the range) but terrible for applications
23:14technomancyversion ranges that include versions that don't yet exist are an anathema
23:14wtfcoderfollowing out the box lein conventions, if i have a jar that isnt sourced from clojars/mvn, such as ms sql jdbc driver, do i just drop in the lib directory
23:14ibdknoxyou can't know if your stuff will work for a future version
23:14wtfcodertechnomancy, idbknox, on reflective that makes sense, absolutely.
23:15technomancywtfcoder: you can install it locally with the lein-localrepo plugin if it really doesn't exist in any repository, but be sure to file a bug with the library maintainers to get them to publish it
23:15amalloyibdknox: in theory it would be fine if everyone followed semver strictly
23:16wtfcoderokay, one other question coming from node.js package manager if I want see info for a package i just type 'npm info clojure-contrib' and it tells me author, current version string, repo, license etc.., does lein/maven have such a thing or do you just bounce around from clojure to mvn etc.. to find the jar
23:16ibdknoxamalloy: that's a big if :p
23:16wtfcoders/clojure/clojar
23:16amalloyindeed
23:17technomancywtfcoder: "lein search" will show you all the version numbers
23:17technomancybut you have to download the indices first, (one time) which is pretty slow
23:17technomancyit'll tell you which repo it comes from
23:18technomancymost jars have a pom inside that includes license and URL if the author has specified it
23:19technomancythat's an interesting idea for a feature though
23:21technomancyin case anyone's, you know, looking for a project idea, hint hint
23:22wtfcoderworking on getting hello world going before given consideration ;)
23:23klauernI'd like to test out Aether support whenever it gets to be alpha. I'm not a Clojurian per se, but I have a really horrible enterprisey setup that would at least suss out stupid edge cases
23:24klauernhttp proxy settings, Maven settings, private Maven server, Windows...
23:24technomancyklauern: would love to get more folks kicking the tires, reporting bugs, etc.
23:24technomancyklauern: are you on the leiningen mailing list?
23:24klauernI don't think so
23:25klauernIs that the google group?
23:25technomancyyeah
23:25technomancyI'll announce it there once that's transitioned
23:25klauernI'll have to update some settings if I am, because I don't get emails from that group (yet)
23:26technomancythe main thing we still have to do before aether gets merged is to figure out what parts of leiningen make sense as a library vs what should stay in the application
23:36choffsteinCan anyone point me to the docs for -?>
23:36choffsteinI can't seem to find it anywhere online
23:36amalloyi don't think -?> made it into new-contrib
23:37amalloyit's really just -> with a short-circuit on any nil
23:37brehaut(clojure.algo.monads/domonad clojure.algo.monads/maybe-m […] …) ;)
23:37amalloyouch
23:37brehautno?
23:37brehautfine
23:37amalloybrehaut the dream-crusher
23:38brehautlol
23:40rsenior-?> is a little masked by the defnilsafe macro
23:40rseniorbut it's here: https://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/incubator.clj
23:41choffsteinawesome. thanks
23:42choffsteinbrehaut: I was trying to avoid monads ;) Try as I may, monads wreak me conceptually. Still haven't quite gotten the full handle on them yet
23:42brehautchoffstein: it was mostly a joke ;)
23:43amalloy$dict wreak
23:43lazybotamalloy: verb-transitive: To inflict (vengeance or punishment) upon a person.
23:44choffsteinMan lazybot is helpful
23:55amalloychoffstein: we'll stop adding features as soon as it's possible to do everything you could possibly want without leaving #clojure