#clojure log - Nov 15 2011

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

0:03 amalloy: alexbaranosky: man, every time he spends two seconds waiting for compilation my teeth grind together

0:22 scottj: sritchie_: the url in project.clj of wonderdog is not very useful

1:03 alexbaranosky: anyone know how to get lazybot to send me my messages?

1:41 noob3234: Is this an appropriate place to ask a swank question?

2:02 R4p70r: Is 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.

2:10 seancorfield_: http://dev.clojure.org/display/design/Library+Coding+Standards

2:14 R4p70r: seancorfield, thx

2:41 tsdh: Is it possible to attach metadata to a namespace after its definition?

2:42 amalloy: &(doc alter-meta!)

2:42 lazybot: ⇒ "([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"

2:42 tsdh: Something equivalent to (ns ^{:bla "blubb"} foo)? The problem with that is that clojure-mode doesn't like it. For example, `C-c t' breaks.

2:42 amalloy: Ah, great.

2:42 Thanks.

2:43 tomoj: hmm

2:43 that should be fixed

2:43 amalloy: the elisp for understanding ns forms is fragile

2:44 tomoj: tsdh: what's your clojure-mode version?

2:45 tsdh: tomoj: 1.11.4

2:45 tomoj: huh, I'm on 1.11.2 and it seems fixed

2:48 maybe your ns form is just different

2:55 tsdh: tomoj: Oh, indeed it works fine when invoking `C-c t' from anywhere in the file except when point is in the metadata map itself.

2:56 BTW: `C-c t' is a binding that is reserved for the user and must not be bound by emacs modes.

2:57 In fact, I've bound it globally to some other command which clojure-mode forcefully overrides.

3:13 amalloy: yeah, 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

3:46 Blkt: good morning everyone

4:02 R4p70r: Blkt, More like middle of the night here.

4:13 licenser: R4p70r: he is using the UGT ;)

4:13 good morning everyone by the way

5:06 naeu: morning

5:07 anyone else in here still feeling completely drained by the conj?

5:07 clgv: naeu: how did you like it?

5:08 naeu: clgv: it was incredible - such an amazing aggregation of insanely cool people

5:08 clgv: naeu: that what other source say as well ;)

5:09 naeu: clgv: great minds think alike ;-)

5:09 clgv: It's a pity there are no videos up yet. Some slides aren't made to transfer knowledge without the speaker ;)

5:10 naeu: clgv: 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

5:11 clgv: there are only few slides on the github repo yet, compared to the schedule

5:11 naeu: clgv: do you plan on watching them all?

5:12 clgv: naeu: nope, I'll select by topic and abstract

5:13 oh fogus' slides are in there now

5:13 and the bioinformatics talk sounds interesting as well

5:15 lucian: aren't these the videos? http://clojure.com/blog/2011/03/23/conj-talks-all-up.html

5:15 oh, they're from march

5:15 clgv: lucian: watch the date ;)

5:16 hmm the "hacking the genome" slides archive is empty :/

5:17 how do I open .key files?

5:17 it seems to be html

5:17 but my browser doest display it

5:19 oh well thats not the slides it seems :(

5:40 naeu: clgv: the bioinformatics talk was interesting - a real Clojure success story

5:40 and fogus's macronomicon talk was also great

5:41 also, to watch out is Byrd and Friedman's outstanding double act (which wasn't scheduled)

5:41 they were writing programs backwards!

5:47 mindbender1: In Midje, if I want to declare that a number of operations called in succession throws an Exception, how should I write it?

5:59 naeu: cemerick: hey there

6:00 cemerick: recovered yet? I'm sitting at my desk wondering how I'm going to survive the day - the conj has sapped me dry!

6:04 cemerick: naeu: hi :-D

6:04 Yeah, it always takes a couple of days to come down from the high.

6:05 I guess I've seen your handle before, but never made the connection that you were who you are. ;-)

6:15 * clgv is waiting for the vieos of the talks ;)

6:19 frank: ,(+ 1 1)

6:19 clojurebot: 2

6:19 frank: aha, it works :-)

6:23 * clgv discovered that a meta data map can have meta data :O

6:24 cemerick: clgv: don't think about that for too long ;-)

6:26 clgv: cemerick: I think it might be the reason for a bug in my serialization

6:37 * ejackson stumbles in.

6:37 ejackson: morning, I think, all

6:51 naeu: cemerick: yep - I am who I am :-)

6:51 ejackson: how are you doing? How's your brain? Mine is still completely fried

6:52 Arafangion: naeu: Blasthemy!

6:52 ejackson: naeu: Mine is currently beaten down by my circadian rhythms.

6:53 i'm such a lisp-weenie when it comes to jetlag ;)

6:53 cemerick: naeu: what was your cumulative impression of the U.S.?

6:54 (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)

6:55 naeu: cemerick: I liked it although it's hard to say after spending most of my time in the hotel

6:55 cemerick: yeah

6:55 naeu: I did get the impression that there were a lot of rules

6:55 cemerick: such is the nature of conferences, I guess

6:55 naeu: and I wasn't so fussed about the number of flags

6:56 but everyone I met was super friendly

6:56 but I've no idea if that was a superficial friendliness or not

6:56 I definitely felt welcomed

6:57 ejackson: you should codify your circadian rhythms into overtone

6:58 ejackson: I'm not sure the world is ready for Grunge Goop

6:58 cemerick: naeu: We're generally a friendly bunch, though it's hard to generalize over 300m people. :-)

6:58 naeu: cemerick: haha, exactly

6:59 cemerick: naeu: My question was, did the conference organizers know what you were capable of, and that's why they booked you last? ;-)

7:00 naeu: cemerick: I really don't think so. I didn't know either!

7:01 cemerick: I stopped making overtone screencasts to increase the element of suprise

7:02 cemerick: heh

7:02 naeu: Yeah, the delta between those vimeo clips and what you produced on stage was enormous.

7:02 naeu: cemerick: 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

7:03 cemerick: Abject terror can sometimes bring out hidden strengths. ;-)

7:03 naeu: cemerick: indeed!

7:04 cemerick: 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

7:05 cemerick: Appreciation and wonderment, really.

7:06 ejackson: i too had tears in my eyes, but it was from the pain of my jaw hitting the table

7:06 cemerick: seriously

7:06 ejackson: you mean naeu hadn't been giving local demos and such?!

7:06 ejackson: yeah, I'd heard some of it before, but he was holding back on me :)

7:07 naeu: I guess I've been too steeped in what I do to realise how others might perceive it

7:07 Also, from a music academic perspective, there's not that much that's new in Overtone

7:08 ejackson: well, we're a pragmatic bunch

7:08 naeu: I 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

7:09 Arafangion: Pfft.

7:09 cemerick: naeu: it seems that that's not the case, insofar as language involved gives you a lot more than e.g. ruby

7:09 (re: not much new in Overtone)

7:09 naeu: cemerick: yes, true - but that's a hard argument to make in an academic setting

7:09 cemerick: but it's precisely why Overtone exists :-)

7:09 clgv: naeu: ah, you are the overtone guy ;)

7:10 naeu: clgv: one of them, yes :-)

7:10 clgv: when is that talk video up? ;)

7:11 naeu: soon, I'm sure :-)

7:11 clgv: did you ever try fractal music?

7:12 Bahman: Hi all!

7:13 naeu: clgv: no, but that's a cool idea - I'm happy to help you hack out some ideas if you want

7:13 cemerick: naeu: so am I to understand that you have a day job that pulls you away from Overtone?! :-O

7:14 naeu: cemerick: sadly - yes :-(

7:14 clgv: naeu: 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 ;)

7:14 cemerick: goodness — that seems like something that needs to be remedied.

7:16 naeu: cemerick: 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

7:16 cemerick: Totally understood.

7:16 naeu: I'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

7:16 Borkdude: Just a quick question: what do you guys think it the most student (non-Lispers) friendly introductory book to Clojure?

7:17 naeu: Borkdude: 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.

7:18 cemerick: naeu: Maybe you could go on tour :-P

7:18 naeu: cemerick: haha, that would rock :-)

7:18 clgv: Borkdude: I started with Programming Clojure

7:19 Borkdude: I'm looking at Clojure in Action, which is soon to be published right?

7:19 cemerick: Sell Overtone-branded equipment? i.e. buy the cheaper monome devices white-label and sell them on the site.

7:19 Borkdude: In chapter 2 it tells readers to clone from git

7:19 cemerick: Borkdude: it only covers 1.2 AFAIK

7:19 Borkdude: In chapter 8 there's a mocking macro that doesn't work anymore

7:20 cemerick: Borkdude: FWIW: http://www.clojurebook.com/ We aimed to be very accessible for those who don't know a lisp already.

7:20 naeu: cemerick: my main issue is that I have a complete lack of business acumen - I just focus all my energy hacking

7:21 Borkdude: cemerick: is that book available end of January in Europe?

7:21 cemerick: I would maybe recommend it, if I could have a preview copy

7:21 cemerick: recommend as in: oblige them to buy it ;)

7:23 cemerick: naeu: The salvation and bane of the open source hacker is his enthusiasm. ;-)

7:24 I think you may have a number of options. I'd be happy to help in whatever way I can.

7:24 Borkdude: That sounds plausible, though I have very little visibility into the publishing side of things. Are you looking for a particular translation?

7:25 naeu: cemerick: 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

7:25 cemerick: Borkdude: FWIW, amazon.co.uk lists it as available on 12/30 as well: http://www.amazon.co.uk/Clojure-Programming-Chas-Emerick/dp/1449394701/

7:25 naeu: new job?

7:26 naeu: yeah, I started as a research associate at Cambridge University computer labs a couple of weeks ago

7:26 I'm going to rebuild a GUI-heavy web app with Clojure and ClojureScript

7:27 cemerick: heh, hardly a bad gig :-)

7:27 naeu: cemerick: exactly ;-)

7:27 Borkdude: cemerick: tnx, I'll maybe order it but I hope it won't be too late for the course

7:27 cemerick: does your book "run" on 1.3? ;)

7:27 cemerick: Borkdude: 1.3-only

7:27 naeu: cemerick: 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.

7:28 cemerick: naeu: 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.

7:29 Though I can't say what I'm doing otherwise is my "passion", to the degree that it's clear that Overtone is yours. :-|

7:30 naeu: cemerick: but I do have a fantastic Overtone-based project idea in the works which will fill up my evenings :-)

7:31 cemerick: naeu: just one?! ;-)

7:31 naeu: cemerick: yep - it's a big and bold idea

7:31 cemerick: bold is good

7:32 naeu: it'll also force me to focus on *using* Overtone instead of just hacking on the internals

7:32 cemerick: FWIW, you should definitely submit a talk proposal to clojure west — I think you have carte blanche at Clojure conferences from here on out.

7:33 naeu: cemerick: I'd like to but I'm not sure I can afford the travel etc. My savings have been totally wiped out.

7:33 cemerick: naeu: Did your stipend not cover the trip to Raleigh?

7:33 naeu: cemerick: yeah, it totally did :-)

7:33 cemerick: I suspect you'll find the same holds for clojure west.

7:33 naeu: cemerick: but the stipend Clojure/West are offering wouldn't

7:34 cemerick: oh, have they published their rates?

7:34 naeu: cemerick: yeah - $400 for international speakers

7:35 cemerick: naeu: Submit your proposal. We'll make sure you get there without nicking your savings. I have my ways. :-)

7:35 naeu: cemerick: hahaha

7:35 cemerick: that would be awesome...

7:36 cemerick: Seriously. 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.

7:36 No reason it needs to be limited to students AFAIC.

7:36 naeu: cemerick: 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?

7:37 cemerick: heh

7:37 I'll see how it flows, maybe we can splice something in there without it sounding obvious. ;-)

7:38 naeu: cemerick: or just mention it at the end?

7:38 cemerick: I haven't listened to any of the audio I recorded yet. Sometime next week.

7:38 naeu: cemerick: splicing it in there would sound awful ;-)

7:38 cemerick: naeu: yeah, we can put a "special mention" at the end.

7:39 I'll ping you later this week so we can set something up via skype

7:39 naeu: cemerick: haha, a special "shout out" "mad crazy props" "big up the Overtone massive"

7:40 cemerick: naeu: yeah, something will go on the end just fine

7:40 So you worked on overtone full-time for the last year?

7:42 naeu: cemerick: 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)

7:43 that, coupled with Jeff having to focus on his PhD thesis, meant I turned into the maintainer and put in a huge amount of effort

7:43 Overtone is a lot more stable, documented, organised and structured as a result

7:44 cemerick: Yeah, I was able to get going in < 5 minutes.

7:44 I fleshed out the maven sections BTW.

7:44 naeu: cemerick: awesome - thanks

7:44 cemerick: Not that I'd recommend it :-P

7:45 naeu: cemerick: have you played around with TouchOSC yet?

7:45 cemerick: not yet; I wanted to twiddle with things in code for a bit first

7:46 Do you know if they're coming out with a tablet-sized version for android eventually?

7:48 naeu: cemerick: I'm not sure. However, it's definitely something you should slap down on your todo list. TouchOSC totally complements code twiddling

7:48 cemerick: I'll check it out :-)

7:49 naeu: Right, I'm off for a meeting regarding funding for music projects...

7:49 cemerick: good luck with that :-P

7:52 Bahman: Is it alright to use Clojure with OpenJDK? Or should I get myself an Oracle one?

7:53 Borkdude: cemerick: translation?

7:53 cemerick: Bahman: Yeah, OpenJDK will work. Just make sure you're using OpenJDK, and not something like IceaTea, etc.

7:55 Bahman: cemerick: So is this "OpenJDK Runtime Environment (IcedTea6 1.10.4) (ArchLinux-6.b22_1.10.4-1-x86_64)" Alright?

7:56 cemerick: Bahman: if you've not yet installed a JDK, why not just grab the oracle one from the start?

7:57 Bahman: cemerick: Right...thanks.

7:57 cemerick: Borkdude: yeah, I didn't know if you needed a translation to German or French or…

7:57 Borkdude: Dutch ;)

7:57 cemerick: but I'm not hoping for that

7:58 cemerick: Seems like a longshot, no? :-)

7:59 Borkdude: cemerick: maybe I can start writing one, but I prefer to use existing books in my courses

8:34 michael_campbell: Morning, #clojurians.

8:34 juhu_chapa: hi!

8:51 clgv: cemerick: a translation for German is probably not needed - as german computer science student you have to be capable of writing and reading english anyway ;)

8:53 cemerick: clgv: The empire is serving its purpose, then. ;-)

8:54 clgv: lol

9:01 michael_campbell: cemerick: Do you have an ETA for Mostly Lazy #2?

9:02 cemerick: michael_campbell: probably late this week

9:03 gunnarahlberg: cemerick, excellent! I was just about to ask. Heard #1 yesterday, very good conversation

9:03 michael_campbell: great, thanks

9:03 * michael_campbell is not sure he likes emacs ido-mode yet.

9:05 gunnarahlberg: is there a way to get more informational error messages from the repl?

9:05 michael_campbell: Not without losing a finger. (Sorry, that'll only make sense to people at the conj)

9:06 gunnarahlberg: michael_campbell, I wish I was there!

9:06 michael_campbell: not to make you feel worse, but it was spectacular.

9:06 gunnarahlberg: good to hear, I heard it on the grapvine (twitter) lots of comments

9:06 michael_campbell: I was as inspired as I was terrified.

9:07 gunnarahlberg: wow!

9:08 so, if I were to implement informational err messages, were would I start?

9:08 and I'm not sure what my fingers will say, or what the joke was

9:08 michael_campbell: When fogus' talk gets posted, watch it. It will explain the joke.

9:09 (his was on macros)

9:09 cemerick: gunnarahlberg: best to start with what problem you're looking to solve

9:09 clgv: gunnarahlberg: filtering clj-files from the stacktraceelements helps a lot

9:10 I built my self a clj-filtered view that can be expanded to a detailed view

9:13 gunnar_: sorry, i got disconnected

9:16 gunnarahlberg: hmm, maybe I should watch my language

9:23 cemerick: gunnarahlberg: language?

9:24 gunnarahlberg: cemerick, I was disconnected shortly after my last msg

9:24 clgv: there is no censor here afaik ;)

9:25 cemerick: gunnarahlberg: not by anyone here; we don't even have an op in the room

9:25 gunnarahlberg: oh, that's a relief. Just a coincidence then :)

9:25 cemerick: er, chouser has op I think, though he might have picked it up all of once in three years. :-P

9:25 gunnarahlberg: we're a bunch of teddy bears around here

9:26 gunnarahlberg: cemerick, that's comforting :)

9:26 well back to my question.

9:26 specific example: as a n00b i try vainly to concatenate a string and a function

9:27 Borkdude: cemerick: tnx http://stackoverflow.com/questions/2758783/podcasts-for-clojurians ;-)

9:28 cemerick: gunnarahlberg: why would you try to concatenate a string and a function? o.0

9:28 gunnarahlberg: cemerick, lack of foo :)

9:29 Borkdude: ,(concat "a" identity)

9:29 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core$identity>

9:29 cemerick: gunnarahlberg: fu's got nothing to do with it. :-) Would you ever try to concatenate a string and a number?

9:29 or, a string, and a socket?

9:31 gunnarahlberg: (def greeting "Greetings")

9:31 (defn greet[who] (apply str (who "greeting")))

9:31 calling greet is not too good in this case

9:31 clgv: cemerick: string and number works just fine ;) ##(str "Hello Nr. " 5)

9:31 lazybot: ⇒ "Hello Nr. 5"

9:33 Borkdude: ,(concat "dude" 5) ;; doesnt

9:33 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

9:33 gunnarahlberg: in my greet sample, "java.lang.String cannot be cast to clojure.lang.IFn>" isn't trivial to comprehend

9:34 Borkdude: gunnarahlberg: who is a string?

9:34 clgv: Borkdude: lol. there is a high probability that any random function from clojure.core wont work with random select types and values of paramters

9:35 Borkdude: clgv: of course, that's why theres doc ;)

9:35 clgv: gunnarahlberg: you want to do (defn greet[who] (str "Greetings " who))

9:35 gunnarahlberg: clgv exacty

9:36 what is interesting is that the error message doesn't tell me that

9:36 Borkdude: gunnarahlberg: if who is a string, then (who "greeting") applies "greeting" to a string, which is not a function, hence the error

9:36 clgv: with your "variable" its just: (defn greet[who] (str greetings who))

9:37 Borkdude: why don't these error messages tell us what the value of the thing that isn't a function is, that would be helpful

9:37 gunnarahlberg: Borkdude, thank you. How do we tell that to someone new to clojure?

9:37 clgv: gunnarahlberg: 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

9:37 gunnarahlberg: clgv ok

9:38 Borkdude: gunnarahlberg: I agree, the error messages could be more informative

9:38 clgv: maybe it's time for one of those introdutory books to get you setup quickly. ;)

9:39 Borkdude: gunnarahlberg: you could have passed a function in the who parameter though

9:39 gunnarahlberg: then it would work ;)

9:39 gunnarahlberg: could, I must say

9:39 gunnarahlberg: I still think the error message could have said which of the parameter that the interpreter stumbled on

9:40 clgv, i've read a few intro book. My goal is to setup othres to grok clj

9:40 clgv: gunnarahlberg: 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 ;)

9:41 Borkdude: gunnarahlberg: I agree. I would like "The string {value of string} cannot be cast to IFn" better.

9:42 gunnarahlberg: Borkdude, yeah that looks about right

9:42 I'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

9:43 Borkdude: gunnarahlberg: I agree once more

9:43 gunnarahlberg: what about a repl that told you long descriptive tales of what went wrong. just give it an option, like, verbose

9:43 clgv: But I think you need at least one basic lesson in almost every programming language there is

9:44 Borkdude: ,("dude" "arg")

9:44 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn>

9:44 clgv: and in a Clojure one the semantics of a function call certainly has to be part of this first lesson

9:44 gunnarahlberg: clgv, thats true

9:44 Borkdude: I wonder how much trying and catching it would take in what places to make it more user friendly

9:46 clgv: there 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

9:47 gunnarahlberg: clgv, that would solve problems for experts. I'm talking beginners

9:47 Borkdude: is it possible to inject a global replacement for the standard ClassCastException that is more informative

9:47 without changing too much code

9:47 gunnarahlberg: Borkdude, where?

9:48 Borkdude: gunnarahlberg: in the clojure compiler for example

9:48 cemerick: Beginners 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.

9:48 clgv: $(inc cemerick)

9:49 cemerick: s/would help/that would help

9:49 clgv: &(inc cemerick)

9:49 lazybot: java.lang.RuntimeException: Unable to resolve symbol: cemerick in this context

9:49 Borkdude: cemerick: of course. but more informative error message would be a benefit to beginner and expert ;)

9:49 clgv: $inc cemerick

9:49 lazybot: ⇒ 7

9:49 cemerick: Borkdude: agreed — I was responding mostly to gunnarahlberg's "long descriptive tales of what went wrong" :-)

9:50 Even in such cases, we have to assume that people know about e.g. function position

9:50 gunnarahlberg: cemerick, that was maybe pushing it too far.

9:51 maybe I should write a tutorial repl for beginners, wonder how much work it would be

9:54 Borkdude: what was that site again where you could try different prog. languages?

9:54 kzar: Ring seems to give me a org.mortbay.jetty.HttpParser for the body of a request, how do I turn that into a string?

9:54 Borkdude: gunnarahlberg: sounds like a nice project

9:55 leo2007: how do people get documentation on a third party library?

9:55 clgv: gunnarahlberg: writing an own repl is pretty easy using clojure.main/repl

9:55 you could catch the exceptions and translate them in what you like them to be

9:55 gunnarahlberg: clgv cool, thx for the input

9:55 Borkdude, thx

9:57 clgv: gunnarahlberg: 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

9:57 it's using clojure.main/repl in its implementation

9:59 gunnarahlberg: a goal would be like ward says about clean code - " should do pretty much what you expected"

10:04 clgv, looks like a starting point, thx

10:07 jcromartie: ,(print \u2583)

10:07 clojurebot:

10:07 jcromartie: hm

10:07 works here but not in lein repl

10:07 frank: man, I really hate jet-lag, but at least I got my order for "the reasoned schemer" out

10:07 I think there is going to be a real spike for that book after the conference

10:09 jcromartie: why does my Clojure REPL print "?"

10:10 frank: works on my emacs slime repl

10:11 joegallo: are you running it via emacs, jcromartie?

10:11 or just in a shell, straight up?

10:11 frank: perhaps your shell, etc does not support the characterset

10:11 jcromartie: joegallo: no, OS X Terminal.app

10:12 other programs can print the character

10:12 i.e. Ruby or bash

10:13 joegallo: jcromartie: prints ? for me to, in terminal.app

10:13 s/to/too/

10:13 jcromartie: joegallo: from lein repl, to be specific

10:14 and in java -jar clojure-1.3.0.jar

10:14 hm

10:14 joegallo: does the same thing from iterm2 on osx

10:14 jcromartie: I wonder if it's Clojure or Java.

10:14 joegallo: but, but! it works just fine if i'm sshed into a linux host and run it there

10:14 same jars

10:14 jcromartie: http://hints.macworld.com/article.php?story=20050208053951714

10:14 interesting

10:15 joegallo: anyway, that's all i've got ;)

10:17 cemerick: jcromartie: what does (java.nio.charset.Charset/defaultCharset) return?

10:17 jcromartie: MacRoman

10:17 :P

10:17 who wants that!?

10:17 cemerick: that'll do it

10:17 you can thank Cupertino for that one

10:18 I think setting LANG is what fixes that. I've had `setenv LANG en_US.UTF-8` in my .tcshrc ~forever.

10:18 jcromartie: LANG in the shell?

10:18 environment?

10:18 cemerick: right

10:18 jcromartie: hm

10:19 michael_campbell: tcsh... wow.

10:19 cemerick: There's a java system property that sets it as well.

10:19 jcromartie: yes I just found it

10:19 -Dfile.encoding=UTF8

10:19 cemerick: sure

10:19 easier to set everything everywhere to utf8 IMO

10:20 michael_campbell: I try to burn as few cycles as possible on command-line rabbit holes. ;-)

10:20 michael_campbell: . /bin/sh, man! ;-)

10:20 frank: mmm, did not fix it for me: export LANG=n_US.UTF-8 still gets me ?

10:20 michael_campbell: honestly, I'm a zsh guy.

10:20 cemerick: frank: did you restart your repl?

10:21 frank: yup, got out, did the export and started again

10:21 still getting ? here, same as jcromartie

10:22 jcromartie: ah JAVA_TOOL_OPTIONS

10:23 export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"

10:23 that does the trick

10:24 frank: yup, the -Dfile.encoding works as well

10:25 cemerick: odd, I've never set that

10:25 jcromartie: JAVA_TOOL_OPTIONS just makes the actual "java" command-line tool pick up the specified options whenever it is run

10:25 you can see lein running two JVMs when you set that variable :)

10:25 frank: hope mac will switch to UTF8 one of these days, I have run in these kind of problems before

10:25 jcromartie: because it says "picked up ..." for the options

10:25 cemerick: yeah, it should grab your system default though…

10:25 jcromartie: yeah really

10:25 it's silly

10:27 frank: lucky I never run my repl from the terminal, and Emacs seems to do the right thing by defau;t

10:27 that is a first :-)

10:27 raek: it's really weird that java in OS X thinks the default encoding is MacRoman when OS X actually uses UTF-8...

10:28 frank: When working with Intellij java, default encoding is MacRoman as well

10:28 You need to change some setting somewhere to change to UTF-8

10:28 raek: I saw that this was actually documented somewhere

10:29 frank: was there a reason for this or some legacy stuff?

10:29 cemerick: ah-ha — LANG doesn't actually do anything: setting "Character Encoding" to UTF8 in Terminal.app does, though.

10:30 raek: basically it acknowledged that OS X really uses UTF-8 but the default encoding is MacRoman anyway.

10:30 it is really a bug in the OS X configuration of Java

10:31 anyway, noone should use the "default encoding" anyway

10:31 the whole idea of a platform default encoding assumes that all files, pipes and sockets the OS touches uses the same encoding

10:32 which is simply not true

10:32 lucian: sadly, MacRoman is in fact the default encoding on OS X

10:32 python defaults to it as well, and several system tools

10:32 raek: really? I thought only Java had this problem. that's bad.

10:34 Fossi: is 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:35 raek: what values does the condition need?

10:35 lucian: raek: it is an apple recommendation as well

10:35 Fossi: so far i only came up with using lazyness and a special marker, but that feels dirty

10:35 raek: the value before given to the map function or the value the map function returns?

10:35 ejackson: Fossi: while might be what you want

10:35 lucian: raek: it's the "right" thing to do, sort of

10:35 ejackson: ,(doc while)

10:35 clojurebot: "([test & body]); Repeatedly executes body while test expression is true. Presumes some side-effect will cause test to become false/nil. Returns nil"

10:35 ejackson: no, that's not it at all

10:36 raek: ,(doc take-while)

10:36 clojurebot: "([pred coll]); Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects."

10:36 ejackson: yeah thats it, or (for .... :while)

10:36 raek: Fossi: if your condition only depends on the function input, you can do it like this: (map f (take-while p coll))

10:37 yeah, for is a lot more flexible here (you can apply the :while before or after the function)

10:38 ,(for [x (range), :let [y (* x x)], :while (< y 5)] y)

10:38 clojurebot: (0 1 4)

10:38 raek: ,(for [x (range), :while (< x 5)] (* x x))

10:38 clojurebot: (0 1 4 9 16)

10:39 Fossi: hmm, 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:41 like http://pastebin.com/iUm1mZmK only with more params

10:41 ie a vector

10:41 um, ignore the stray reduce :>

10:44 it would work with recursion, but i dislike making macros recursive

10:46 clgv: Fossi: why not? they cant blow the stack afaik ;)

10:47 Fossi: in 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:47 raek: Fossi: recursive macros can be very simple. just let a macro (foo ...) expand into something that contains another (foo ...)

10:47 bhenry: i 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:48 raek: bhenry: I assume that the Google Closure library has such a function

10:50 bhenry: http://closure-library.googlecode.com/svn/docs/class_goog_Uri.html

10:50 getParameterValue

10:50 lucian: bhenry: don't you want document.querySelector[All] ?

10:50 bhenry: i don't know. i'm certainly no js expert

11:32 kzar: How do you make a reader from a string again?

11:33 oops got it (java.io.StringReader. "hello")

11:35 licenser: dun dun dun :)

11:40 Fossi: after lots of fichting them quotes: http://pastebin.com/PKF5SkLa

11:40 any way to get rid of the into [] ?

11:41 gfredericks: (into [] ...) ~ (vec ...)

11:42 Fossi: yeah, the question was more if there is a rest/more for vectors

11:42 gfredericks: ,(subvec [7 8 3 4 5] 1)

11:42 clojurebot: [8 3 4 5]

11:42 Fossi: okay

11:44 gfredericks: Fossi: I'm trying to figure out why you need params to be a vector there...

11:44 Fossi: if it's a list you get something like ("bar")

11:44 which gets evaluated

11:45 gfredericks: hmmm

11:45 Fossi: by (first ~params)

11:45 gfredericks: [~@(rest params)] could work

11:45 Fossi: hmmm, clever :>

11:45 gfredericks: wai

11:46 t

11:46 it _does_ get evaluated?

11:46 isn't it only the arg to the macro?

11:46 I don't see you emitting it anywhere, except recursively

11:46 Fossi: ah wait

11:46 clgv: when using (keyword "my-keyword") why does it always call java.lang.String.intern() even if the keyword already exists?

11:47 Fossi: i can change (first ~params) to ~(first params)

11:47 then it works with lists as well

11:47 gfredericks: clgv: what would you expect it to do?

11:47 joegallo: http://download.oracle.com/javase/6/docs/api/java/lang/String.html#intern%28%29

11:48 clgv: the problem is that call is using pretty much time

11:48 gfredericks: Fossi: ah ha; that makes sense.

11:48 joegallo: if 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:48 gfredericks: Fossi: didn't notice that detail

11:48 joegallo: if you intern a string and it is in the pool, you get the string from the pool instead

11:49 clgv: humm somehow java serialization can avoid this behavior but kryo serialization cannot

11:49 Fossi: anyway, i (still) don't believe this recursive version is much clearer/nicer than a plain old imperative one

11:49 kzar: arohner: I saw in the logs your Heroku app was timing out, you ever figure out how to fix it?

11:49 Fossi: guess i'll try that now

11:50 arohner: kzar: not really

11:50 gfredericks: Fossi: I'd think you could do it pretty simply without recursion

11:50 arohner: kzar: clj 1.3 might help

11:50 kzar: arohner: I get it sometimes and other times I don't, it's really annoying. I'm using 1.3

11:51 Fossi: gfredericks: that's what i told my collegue about 2 hours ago ;)

11:51 gfredericks: (if-let [first-bad-param (first (filter (complement payload) (keys params)))]

11:51 TimMc: haha

11:51 gfredericks: Fossi: something like that ^ I'm not sure I'd describe that as imperative

11:52 Fossi: well, not recursive then

11:52 is there a word for that? ;D

11:52 Bronsa: iterative?

11:52 TimMc: filter-complement -> remove

11:52 gfredericks: simplected :)

11:52 TimMc: $dec gfredericks

11:52 gfredericks: TimMc: you betcha!

11:52 lazybot: ⇒ 3

11:52 babilen: Hi 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:53 * gfredericks runs off to lunch

11:53 pjstadig: babilen: i usually just re "clojure-jack-in" and it kills and restarts swank

11:53 TimMc: gfredericks: You've done enough damage this morning!

11:54 babilen: pjstadig: Ah, that works. I wonder why I didn't try it :) Thanks!

11:55 TimMc: gfredericks: (the $dec was for that horrible word, not filter + complement :-P)

12:07 Fossi: if i change to the iterative way i just have to make sure i don't use our magic binding stuff

12:20 devn: hello everybody

12:22 note to self: don't set :checksum-deps true in project.clj right before a flight

12:23 pjstadig: devn: bummer

12:24 ejackson: oooh

12:24 bhenry: raek: i don't know how to use that getQueryData method in clojurescript

12:30 babilen: Hmm, 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:33 Ah, I had to remove the old .2 installation...

12:45 technomancy: babilen: C-c M-p is part of slime rather than clojure-mode

12:47 timvisher: is it possible to make difftest work with clojure-test-mode and/or slime?

12:48 babilen: technomancy: 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:48 technomancy: babilen: thanks! glad to hear you're getting the access you need.

12:49 iok: what's the equivalent to cons for appending?

12:49 michael_campbell: conj?

12:49 clojurebot: (conj {:a 1} (when true {:b 2}))

12:50 iok: conj sticks it in at the first position :(

12:51 cemerick: iok: where a value is added to a collection is polymorphic w/ respect to the collection's type

12:51 Bronsa: concat?

12:51 cemerick: conj adds to the front for lists, rear for vectors, etc.

12:51 michael_campbell: cemerick: yeah, that's what I was going to say ;-)

12:53 iok: concat was it.. thanks!

12:54 michael_campbell: perhaps 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:57 babilen: michael_campbell: I just use "lein repl" within or outside a project.

12:57 michael_campbell: gotcha.

12:58 * michael_campbell is an idiot. Didn't even think you COULD do a repl outside a project, using lein. Alas.

12:59 TimMc: Yeah, it runs from lein's own JVM.

12:59 michael_campbell: if you "lein repl" inside a lein project, does it do anything different/special with respect to the project?

12:59 zerokarmaleft: michael_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:59 TimMc: michael_campbell: From inside a project, it launches a separate JVM.

12:59 so you can choose a clojure version, etc.

12:59 babilen: michael_campbell: I should note that I mainly use "lein repl" within a project as I want 1.3 ...

13:00 michael_campbell: <nod>

13:02 babilen: michael_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:04 michael_campbell: I'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:04 I'm and old guy emacs user so will start playing with swank and all that soon enough.

13:05 didn't realize there was an Ubuntu package, even.

13:11 gfredericks: TimMc: oh, simplected. I see. Okay good. Simplifected then?

13:11 michael_campbell: awesome. Fogus' slides from the conj are up.

13:11 http://blog.fogus.me/2011/11/15/the-macronomicon-slides/ Slides 34 and 43 are the keepers.

13:14 TimMc: gfredericks: *cries*

13:32 technomancy: do the jark developers hang out on IRC?

13:36 shtutgart: hm, I have some weird behaviour, (class x) returns some clazz, but (instance? clazz x) returns false. Is there known reasons for that?

13:36 it's clojure 1.2 and I can't reproduce it

13:38 ok, i've recompiled the whole file and it's gone

13:39 technomancy: shtutgart: was it a defrecord or deftype?

13:40 shtutgart: defrecord

13:40 with one additional filed assoc'ed, if it matters

13:40 technomancy: yeah, you get really weird semantics with existing record instances when you reload the defrecord forms.

13:43 shtutgart: hm, but I can't remember recompiling the (defrecord ...) itself

13:43 only ns with import for that record

13:44 drguildo: which is the best data structure for checking whether it contains a value?

13:45 gtrak: set?

13:46 drguildo: how do i check whether it contains the value?

13:47 technomancy: drguildo: just call it

13:47 drguildo: (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:47 gtrak: drguildo, http://clojure.org/data_structures#Data%20Structures-Sets

13:47 drguildo: dunno if that's idiomatic

13:47 shtutgart: anyway, lesson learned: recompile the whole program first when things getting strange :)

13:47 drguildo: use contains? if you want bool

13:47 brehaut: drguildo: its extremely idiomatic to use a set as a function

13:48 drguildo: shtutgart: i thought that was for maps only?

13:48 gtrak: shtutgart, just don't hang on to the old instances?

13:48 technomancy: shtutgart: bonus lesson: use more predictable language constructs if you can.

13:48 drguildo: ok thanks

13:48 i assume hash-set is better than a standard set for my purposes?

13:49 gtrak: what's a standard set?

13:49 brehaut: ,(class #{})

13:49 clojurebot: clojure.lang.PersistentHashSet

13:49 technomancy: drguildo: hash-set is an implementation detail; you shouldn't think about them at that level.

13:49 drguildo: gtrak: dunno, whatever gets created using the #() syntax

13:49 shtutgart: drguildo: no, it works even for vectors and java arrays!

13:49 technomancy: what exactly do you mean?

13:50 edw: Is 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:50 technomancy: shtutgart: don't use records where a map will do; don't use protocols where a multimethod will do.

13:50 gtrak: edw, try passing in an array

13:51 edw: gtrak: Will do. Thanks.

13:51 gtrak: ,(doc into-array)

13:51 clojurebot: "([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:51 brehaut: bonus bonus lesson: dont use regexps when a parser would do

13:51 drguildo: technomancy: i'm not sure what you mean. i should just use #() and forget about the type of set?

13:52 technomancy: drguildo: use #{}, and yes, the type is immaterial

13:52 the point is that it's a set

13:52 drguildo: ok, thanks

13:53 technomancy: np

13:54 shtutgart: technomancy: 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:57 technomancy: give it a try; it's not as bad as you think it is.

14:06 shtutgart: I'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:18 amalloy: man, it looks like i missed a lot of bonus^n lessons

14:25 R4p70r: Is there a core function that retunrs a lazy seq of (coll, (rest coll) (rest (rest coll))) and so on?

14:26 Borkdude: R4p70r: isn't that reductions?

14:26 jcromartie: R4p70r: try (reductions rest coll)

14:26 I think

14:26 gtrak: neat

14:26 jcromartie: ,(reductions rest [1 2 3 4])

14:26 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: core$rest>

14:27 Borkdude: ,(doc reductions)

14:27 clojurebot: "([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:27 jcromartie: err

14:27 yeah

14:27 gtrak: ,(source reductions)

14:27 clojurebot: Source not found

14:28 shtutgart: repeatedly?

14:28 Borkdude: ,(doc rest)

14:28 clojurebot: "([coll]); Returns a possibly empty seq of the items after the first. Calls seq on its argument."

14:29 raek: ,(take 10 (iterate inc 0))

14:29 clojurebot: (0 1 2 3 4 ...)

14:29 R4p70r: right. 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:30 Borkdude: ,(reductions rest [[1 2 3 4]])

14:30 clojurebot: ([1 2 3 4])

14:30 raek: ,(take 10 (iterate rest (range 10))

14:30 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

14:30 raek: ,(take 10 (iterate rest (range 10)))

14:30 clojurebot: ((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:30 shtutgart: ah, iterate, right

14:30 Borkdude: ,(reductions + [1 2 3 4])

14:30 clojurebot: (1 3 6 10)

14:31 raek: ,(take-while seq (iterate rest (range 3)))

14:31 clojurebot: ((0 1 2) (1 2) (2))

14:31 R4p70r: ,(take 10 (iterate rest [1 2 3 4 5]))

14:31 clojurebot: ([1 2 3 4 5] (2 3 4 5) (3 4 5) (4 5) (5) ...)

14:31 raek: there!

14:31 R4p70r: raek, Thanks!

14:31 Raynes: &(reductions conj [] [1 2 3 4])

14:31 lazybot: ⇒ ([] [1] [1 2] [1 2 3] [1 2 3 4])

14:31 Raynes: Backwards, but close enough.

14:31 ;)

14:32 R4p70r: right

14:32 raek: R4p70r: that won't include (), though (don't know if you wanted that too)

14:32 Raynes: raek, of course, wins this battle, because this is precisely what iterate is for.

14:34 shtutgart: pretty often i'm writing someting like #(if (pred? %) (f %) %). How can I get rid of this % signs?

14:37 Raynes: (fn [x] (if (pred? x) (f x) x))

14:37 gfredericks: shtutgart: write a helper HOF?

14:37 amalloy: shtutgart: well! if you want to use the "useful" library, it has that already built-in

14:37 Raynes: inb4 but how di I get rid of the xes!?

14:37 gfredericks: or use amalloy's

14:37 amalloy: (to-fix pred? f) => (fn [x] (if (pred? x) (f x) x)))

14:37 shtutgart: Raynes: no, I mean what haskellers calling point-free style

14:39 Raynes: But yeah, this is called 'fix' in useful, right amalloy?

14:39 amalloy: shtutgart: 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:39 Raynes: Or given.

14:39 amalloy: Raynes: depends if he actually wants the function (use to-fix), or wants to apply it to an x immediately (use fix/given)

14:39 Raynes: I hate those names.

14:40 raek: since 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:40 shtutgart: amalloy: "useful" is a name of library, right?

14:40 Raynes: Well, sure it is.

14:40 amalloy: http://github.com/flatland/useful

14:40 Raynes: &((partial + 2) 3)

14:40 lazybot: ⇒ 5

14:40 Raynes: Just more long-winded.

14:40 amalloy: Raynes: that sounds like "not as easy" to me

14:41 shtutgart: amalloy: ok, i'll check it out, thanks!

14:41 Raynes: It sounded like "Clojure doesn't curry, so this would be hard."

14:42 But yes, it doesn't, and if typing out 'partial' for partial application is difficult for you, this is definitely harder. ;)

14:42 amalloy: shtutgart: specifically the function you wanted is somewhere in the neighborhood of https://github.com/flatland/useful/blob/develop/src/useful/fn.clj#L25

14:43 gfredericks: what do we mean by "clojure doesn't curry"?

14:44 pjstadig: ,(+ 1)

14:44 clojurebot: 1

14:44 Raynes: http://www.haskell.org/haskellwiki/Currying

14:44 pjstadig: er

14:44 kurtharriger: could use the threading operator

14:44 michael_campbell: for anon funcs which take > 1 parameter, is it idiomatic to use "% %2 %3..." instead of "%1 %2 %3..."?

14:44 pjstadig: ,(map +)

14:44 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$map>

14:44 kurtharriger: (-> 2 (+ 3) (+ 5))

14:44 gtrak: ,(partial + 1)

14:44 clojurebot: #<core$partial$fn__3794 clojure.core$partial$fn__3794@38c6be>

14:44 amalloy: michael_campbell: either is fine

14:44 Raynes: michael_campbell: It is idiomatic to use whatever you feel like using at any given time.

14:45 pjstadig: gfredericks: if clojure curried then (map +) would return a function that takes a seq

14:45 amalloy: kurtharriger: that's not really the same thing

14:45 michael_campbell: Raynes: right now I feel like reading the "useful" source, which is where I saw it, so... you guys are making my decisions! =D

14:45 gfredericks: pjstadig: is it kind of just a syntactic distinction then?

14:45 pjstadig: which you can obviously get with partial

14:45 gtrak: ,((apply partial '(+ 1)) 2)

14:45 clojurebot: 2

14:45 shtutgart: amalloy: 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:45 brehaut: gfredericks: easy partial application is feature of curried functions, but curried functions are not partial application

14:46 Raynes: And here is where the fog begins to thicken.

14:46 gfredericks: brehaut: man there's like three different parts of that where I don't know what you're talking about

14:46 devn: the plot thickens!

14:46 pjstadig: gfredericks: i don't think it is just a syntactic distinction

14:47 brehaut: gfredericks: time for haskell type signatures!

14:47 gfredericks: does "curried function" mean a function which has had some of its arguments filled in?

14:47 I think I decently understand how currying works in haskell :/ maybe.

14:47 brehaut: gfredericks: normal_function :: (a,b,c) -> r

14:47 gfredericks: curried_function :: a -> b -> c -> r

14:47 gtrak: hmm, why doesn't ((apply partial '(+ 1)) 2) return 3?

14:47 gfredericks: hrm.

14:47 amalloy: gfredericks: 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:47 gtrak: when ((partial + 1) 2) returns 3

14:48 amalloy: gtrak: i was wondering if you'd picked that example by accident or what

14:48 gfredericks: amalloy: I understand how that works in haskell, I'm just having trouble applying it to this clojure discussion

14:48 amalloy: (not= + '+)

14:48 gfredericks: I think I get it now though.

14:48 gtrak: amalloy, ah, it's just a straight symbol and not the function?

14:49 gfredericks: is currying incompatible with multiple-arities?

14:49 amalloy: gtrak: '(+ 1) is a list containing a symbol

14:49 scottj: strangeloopers: was it clear how sussman's propagator idea was different from cl-cells/dataflow?

14:49 pjstadig: gfredericks: i believe in a curried language, multiple arities are just syntactic sugar

14:50 gtrak: scottj, sussman's propagator is probably much more involved since it doesn't exist :-)

14:50 brehaut: gfredericks: its by itself no; its incompatible with multiple arities (or varargs) in combination with a lack of static generic types

14:50 shtutgart: by 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:50 gfredericks: pjstadig: so is this possible in haskell? (fn ([a b] (* a b)) ([a b c] (+ a b c)))?

14:50 brehaut: gfredericks: via deep magic ;)

14:50 scottj: gtrak: oh his code was psuedocode?

14:50 * pjstadig wishes he knew haskell

14:51 amalloy: shtutgart: it just returns whatever some-seq is. if it's a seq, then pretending to be a vector would be a lie

14:51 brehaut: gfredericks: you have to use return type polymorphism and some typeclass voodoo but yes, completely achievable

14:51 gtrak: scottj, i think the mathy stuff worked, but he was proposing something much grander

14:51 gfredericks: brehaut: it sounds ambiguous :/

14:52 brehaut: gfredericks: pervasive finickity types make it not the case

14:52 gfredericks: so 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:53 brehaut: gfredericks: f :: int -> int -> int is different to f :: int -> int -> (int -> int)

14:53 gfredericks: what's the difference?

14:53 oh wait

14:53 sorry

14:53 miscounted some ints

14:53 Borkdude: If pred? would only return its arg and nil otherwise, you can just do (comp f pred?), but maybe that's not idiomatic?

14:54 brehaut: gfredericks: remeber that ML family languages dont need parens on a function call

14:54 gfredericks: brehaut: so did I summarize it poorly...?

14:54 was I wrong?

14:54 shtutgart: amalloy: indeed; so it's a &'s fault

14:54 brehaut: gfredericks: ah i imissed yur summary

14:55 gfredericks: you are correct; my bad

14:55 Borkdude: no wait, sorry

14:55 bullshit

14:55 ;)

14:57 gfredericks: so in haskell you can have two functions with the same name and argument types but different return types?

14:57 amalloy: shtutgart: 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:58 brehaut: gfredericks: yes, but only if you define them with a typeclass

14:58 gfredericks: the canonical example is read

14:58 &heval 1 + 1

14:58 lazybot: java.lang.RuntimeException: Unable to resolve symbol: heval in this context

14:59 amalloy: for example, consider (defmacro add-and-print [& args] (let [func (cons `+ args)] `(print ~func)))

14:59 $heval 1 + 1

14:59 lazybot: ⇒ 2

14:59 brehaut: amalloy: thanks

14:59 $heval (read "1") :: String

14:59 lazybot: ⇒ "*Exception: Prelude.read: no parse

15:00 brehaut: $heval (read "1") ::Int

15:00 lazybot: ⇒ 1

15:00 brehaut: $heval (read "1") :: Float

15:01 lazybot: ⇒ 1.0

15:01 brehaut: gfredericks: ^

15:01 devn: $heval (read "1")

15:01 lazybot: ⇒ *Exception: Prelude.read: no parse

15:01 gfredericks: brehaut: that example sure was canonical!

15:01 brehaut: gfredericks: :P

15:02 $heval read "\"1\""

15:02 lazybot: ⇒ *Exception: Prelude.read: no parse

15:02 gfredericks: well. Thanks for the haskell lesson everybody.

15:02 amalloy: does ##(inc lazybot) do inline karma?

15:02 lazybot: java.lang.RuntimeException: Unable to resolve symbol: lazybot in this context

15:03 devn: there's your answer :)

15:03 gtrak: is haskell eval sandboxed too?

15:03 gfredericks: devn: that just means that's not the syntax for it :P

15:03 Bahman: Is it possible to recur from a lambda function?

15:03 brehaut: gtrak: trivially so ;)

15:03 gtrak: Bahman, trampoline

15:03 gfredericks: Bahman: you can name it with (fn foobar [a] a) also

15:04 brehaut: $heval performUnsafeIO

15:04 gfredericks: if you have limited recurring to do

15:04 lazybot: ⇒ Not in scope: `performUnsafeIO'

15:04 gtrak: brehaut, ah, right, you need some sort of monad

15:04 Bahman: Thanks.

15:04 brehaut: gtrak: specifically you need the IO monad

15:05 shtutgart: amalloy: yeah I agree, that's the truth, but... that [~@coll]s just make me sad :)

15:07 amalloy: trampoline sounds like a terrible answer to this question, fwiw

15:08 gtrak: why?

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

15:10 mrnex2010: Hi, 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:10 gfredericks: mrnex2010: use (apply str b)

15:10 amalloy: unlikely to be what he wants

15:10 mrnex2010: it concatenates them

15:11 gfredericks: mrnex2010: or (pr-str b), sorry

15:11 mrnex2010: yep, i want it to respect the structure

15:11 amalloy: &(pr-str (range 4))

15:11 lazybot: ⇒ "(0 1 2 3)"

15:11 mrnex2010: fucking a!

15:11 thanks

15:11 im building a proof of concept for non dev builds, from rhickey's keynote

15:11 gfredericks: IRC: one guy answers real fast, then the other guy sits back and figures out why he's wrong.

15:12 mrnex2010: thx a lot gfredericks & amalloy

15:12 gregh: gfredericks: also, stack overflow

15:12 gfredericks: no doubt

15:13 gtrak: gfredericks, sometimes i just say things

15:13 gfredericks: gtrak: I find that's a good way to learn

15:14 vectors are like eager functors, but more simplected.

15:14 * gfredericks waits

15:14 gtrak: lol

15:14 brehaut: gfredericks: ouch

15:14 gtrak: vectors are hashsets with integer indicies

15:14 and an easy iteration capability

15:15 gfredericks: index-sets of the form (range N)

15:15 key-sets rather

15:15 gtrak: yes, non-negative integers

15:16 brehaut: aka natural numbers

15:16 gfredericks: "The Nats"

15:16 gtrak: "There is no universal agreement about whether to include zero in the set of natural numbers"

15:17 fool

15:17 :-)

15:17 brehaut: goddamn mathematicians going and messing with me again

15:17 gfredericks: eh it's just about names

15:17 gtrak: http://en.wikipedia.org/wiki/Natural_number#History_of_natural_numbers_and_the_status_of_zero

15:18 brehaut: i thought the whole point of the term natural numbers was because whole numbers was ambigious :P

15:18 gfredericks: there should be a name for "the other set". Maybe "The Unnatural Numbers". It means whichever set the natural numbers doesn't.

15:18 I prefer to include 0, as otherwise "positive integers" is readily available

15:19 gtrak: i think 'non-negative' implies 0 more than 'positive'

15:19 gfredericks: yes

15:19 I mean positive integers is a name for Z+

15:19 i.e. (1,2,...)

15:19 I'm just going to stop talking.

15:19 gtrak: rather 'positive ints' doesn't imply 0 as much as non-negative ints

15:19 Bahman: Does anyone know to what address can I send my suggestions If I have for "Joy of Clojure"?

15:20 ...have some for...

15:21 Raynes: /dev/null

15:21 ;)

15:21 TimMc: technomancy: Oh god what is this thing where there should be "fn"...

15:22 what have you done

15:22 Bahman: Raynes: I have received some letters from hell that asked me to stop pumping everything (mostly garbage) to /dev/null :-)

15:22 gtrak: Bahman, http://joyofclojure.com/errata/

15:22 Raynes: Heh

15:22 michael_campbell: TimMc: the function symbol in emacs?

15:22 TimMc: Yes.

15:22 Bahman: gtrak: Thanks.

15:22 TimMc: I started using emacs-starter-kit at work.

15:22 michael_campbell: TimMc: yeah, that's special, isn't it. There's a lambda in there somewhere too

15:23 TimMc: It messes up my column counts.

15:24 technomancy: You don't know what powers you're playing with!

15:24 michael_campbell: I'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:25 amalloy: <3 ido

15:25 TimMc: ido is the wonderful thing that makes buffer and FS navigation easy?

15:25 amalloy: yes

15:25 TimMc: <3

15:25 michael_campbell: "easy" in RIch Hickey's terms, sure. "Simple"... no.

15:26 TimMc: right

15:26 michael_campbell: and I'm just used to the old-school way of doing it. so my finger memory is all confused now

15:26 TimMc: It took me a while to figure out how to create a file with a space in the name. :-)

15:26 michael_campbell: I haven't tried; how do you?

15:26 TimMc: Something to do with C-q

15:27 michael_campbell: ah, right. standard emacs quoting

15:27 tyconnell: Someone says emacs, and I have a chicken lady moment.

15:27 amalloy: TimMc: you can also press C-f again to switch out of ido

15:27 michael_campbell: I had to figure out how to open "the current directory in which the file you're looking at is sitting".

15:27 C-x C-f . C-j.

15:28 TimMc: C-j is enter?

15:28 ish

15:28 amalloy: tyconnell: i would goodle for "chicken lady moment", but for fear of what i might find

15:28 pauldoo: when clojurescripting, is it sensible to have an almost empty html file, and emit the dom content through a "main()" function triggered onload?

15:30 TimMc: michael_campbell: Aha, I found the little bastard: .emacs.d/starter-kit-lisp.el:61

15:30 dnolen: pauldoo: emitting dom content from JS is going to be slower than having the markup already there on the page to manipulate via JS.

15:31 pauldoo: dnolen: slower in what sense? runtime performance, loading time, development time..

15:31 TimMc: pauldoo: http://ejohn.org/blog/dom-documentfragments/

15:32 dnolen: pauldoo: runtime performance, loading time - maybe even development time - generating DOM via code is error-prone.

15:32 pauldoo: ahh ok - I'm really not fussed about runtime performace. still "hello worlding" my way around google closure + clojurescript.

15:33 I was just interested if emitting from clojurescript is seen as more flexible or idiomatic in some way

15:33 michael_campbell: TimMc: Thanks!

15:33 amalloy: pauldoo: your app also won't work at all without js enabled. if you emit actual html, you can at least have nice fallbacks

15:34 dnolen: pauldoo: 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:34 pauldoo: dnolen: right-o. I understand

15:35 dnolen: creating DOM trees in code is just crazy tedious.

15:35 pauldoo: even with the power of macros?! surely not… :p

15:35 TimMc: michael_campbell: I'm imagining that scene in the Matrix where they extract the "bug" from Neo's abdomen.

15:35 michael_campbell: hahahah

15:35 dnolen: pauldoo: I was going to say that :) but I consider it bad practice.

15:36 not macros - DOM generation via code.

15:36 pauldoo: dnolen: 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:37 michael_campbell: TimMc: how did you remove it; just comment out the add-hook?

15:37 dnolen: pauldoo: 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:38 gtrak: pauldoo, take a look at pinot

15:38 there's a dom.cljs

15:38 https://github.com/ibdknox/pinot/blob/master/src/pinot/dom.cljs

15:41 michael_campbell: Other than 4clojure, are there other sorts of "solve these puzzles in clojure" type sites to get one more familiar with the language?

15:41 gtrak: labrepl

15:41 klauern: I've yet to try it, but clojure koans sounds fun: https://github.com/functional-koans/clojure-koans

15:42 jjido: rosettacode

15:42 TimMc: michael_campbell: I nuked the whole top level add-hook thing, yeah.

15:42 pauldoo: 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:43 pauldoo: TimMc: thanks

15:43 scottj: michael_campbell: there's also a site w/ euler project solutions

15:44 michael_campbell: Thanks scottj, jjido, klauern, gtrak - all bookmarked!

15:45 R4p70r: Is clojure sort a stable sort?

15:45 TimMc: I bet it uses the Java Collections sort, so look there.

15:45 gtrak: R4p70r, java sort is timsort in java7 i think

15:45 jjido: michael: what is your prog background ?

15:46 Raynes: $cd sort

15:46 lazybot: clojure.core/sorted-map: http://clojuredocs.org/v/1494

15:46 clojure.core/sorted?: http://clojuredocs.org/v/1558

15:46 clojure.core/sorted-map-by: http://clojuredocs.org/v/1783

15:46 TimMc: R4p70r: j.u.Collections/sort is stable

15:46 michael_campbell: jjido: 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:46 TimMc: ,(doc sort)

15:46 clojurebot: "([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:47 TimMc: Yup, that's probably it.

15:47 gtrak: michael_campbell, lisp is a good thing to learn then

15:47 michael_campbell: jjido: 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:47 Raynes: Kind of strange that searching clojuredocs for sort or clojure.core/sort gives you everything *but* sort itself on top.

15:47 klauern: I find myself struggling with clojure, but I think of it as a good thing. :)

15:47 * Raynes wonders if it actually had an API call to look up a specific var.

15:47 klauern: Really stretches you to think about things differently

15:47 TimMc: Raynes: ClojureDocs uses different orderings for the dropdown autosuggest and the actual search page.

15:48 gtrak: clojure/lisp/scheme shows you the essence of things

15:48 michael_campbell: gtrak: <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:48 R4p70r: Thanks

15:49 scottj: Raynes: clojure.core/sort is the first result for me in the autocomplete search box and in the search results for sort

15:49 michael_campbell: and 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:49 Raynes: scottj: I was referring to the API search endpoint.

15:49 I can already see that becoming a meme.

15:50 gtrak: michael_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:50 amalloy: Raynes: it's been a meme for longer than you've been alive

15:50 Raynes: Indeed.

15:50 michael_campbell: *chuckle*

15:51 jcromartie: signed bytes are insane

15:51 why does Java have signed bytes

15:51 gfredericks: signed bytes and rvm.

15:51 amalloy: i sign all my bytes. don't want anyone impersonating me

15:52 jcromartie: rvm?

15:52 michael_campbell: gpg signed bytes. only 2K overhead for each one.

15:52 jcromartie: heh :)

15:52 R4p70r: I love having these "source" links right in the documentation but loading core.clj from github makes Firefox really slow.

15:52 gfredericks: jcromartie: ruby version manager. My current source of pain.

15:52 jcromartie: ah yes

15:53 rvm is insane

15:53 Is there a good bit/byte packing/unpacking lib for Clojure?

15:53 amalloy: michael_campbell: that'll be a language primitive in the next compiler i write

15:53 jcromartie: a la Ruby's String#unpack :)

15:53 amalloy: ultra-secure

15:53 michael_campbell: amalloy: Nice. I've always wanted to write a compiler and to save space, the error message table would just be, "No."

15:54 brehaut: michael_campbell: have you looked at prolog?

15:54 amalloy: hah

15:54 michael_campbell: "looked at" in the strictest sense of the word, yes. Not even begun to delve into its idioms or usage.

15:54 TimMc: michael_campbell: "Ugh, why would you think that would work?" "Haha, as if!" "That is not valid syntax." "You're missing a thing."

15:55 Raynes: That last one is golden.

15:55 gtrak: prolog says that stuff?

15:55 brehaut: gtrak: No.

15:55 michael_campbell: TimMc: 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:55 amalloy: TimMc: elected for president of the Clojure Error Messages committee???

15:55 lazybot: amalloy: Oh, absolutely.

15:56 R4p70r: michael_campbell, Pascal has semicolons?

15:56 TimMc: michael_campbell: That might be a brilliant ues-case for a condition system.

15:56 michael_campbell: R4p70r: absolutely. But when I write it, evidently too few ;_)

15:56 brehaut: gtrak, michael_campbell: prolog answers any query it cant satisfy (or when it has exausted its results) with "No."

15:57 gtrak: michael_campbell, better than python, >>> exit replies 'Use exit() or Ctrl-Z plus Return to exit'

15:57 michael_campbell: brehaut: Hah, awesome. And I didn't patent the idea - blast it!

15:57 gtrak: yes, that's a class misfeature of a UI.

15:57 gtrak: it knows unambiguously i want to exit, and insists on being pedantic :-)

15:58 michael_campbell: thus, "pythonista".

15:58 TimMc: gtrak: Luckily it knows about C-d

15:58 amalloy: (def exit (lazy-seq (System/exit 0)))

15:58 Raynes: I like Python's approach -- yo, do it right or don't do it at all.

15:58 brehaut: gtrak: there should be only one, obvious, (for a dutchman) way to do anything

15:58 gtrak: even at the repl?

15:58 Raynes: Yes.

15:59 brehaut: gtrak: it satisfies all the criteria for the pythonism :P

15:59 gtrak: lamesauce

15:59 michael_campbell: The 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:59 TimMc: amalloy: Haha, nice!

16:00 I demand that Leiningen use that.

16:00 gtrak: brehaut, 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:00 R4p70r: michael_campbell, Guess you're right I've done some Turbo Pascal but it seems I have forgoten a lot of it.

16:00 brehaut: gtrak: you wont find me defending python very much ;)

16:00 amalloy: or (def exit (delay (System/exit 0))). this lets you issue a macho-sounding (force exit)

16:05 huh. i seem to have gotten emacs into a state where clojure-jack-in displays "error in process filter: Cyclic keymap inheritance"

16:06 Bahman: I 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:06 Raynes: amalloy: When that happens, the solution is usually to keep doing it until it works.

16:06 Bahman: function

16:06 amalloy: Raynes: amusingly, that's how i got into this state

16:07 Raynes: Heh

16:07 gtrak: how big of a prog is emacs?

16:07 amalloy: i think that question has a countably-infinite number of correct answers. clarify intent?

16:08 gtrak: source LOC

16:08 just curious

16:08 amalloy: iirc it's a couple million lines if you add together the C and elisp?

16:08 gtrak: oh jesus :-)

16:09 technomancy: https://www.ohloh.net/p/emacs/analyses/latest

16:09 gtrak: so we can't rewrite it in clojure?

16:09 technomancy: that insane leap last year was the merge of cedet

16:09 amalloy: dang, who is this Other guy. he gets a lot done

16:09 Bahman: gtrak: With Swing? phew

16:10 Raynes: gtrak: Everybody tries it, everybody fails.

16:10 gtrak: ha, well the rendering could be anything

16:10 amalloy: whoa this chart *is* interactive

16:10 gtrak: Raynes, people actually try to write emacs?

16:10 Raynes: $google Haskell yi

16:10 lazybot: [Yi - HaskellWiki] http://www.haskell.org/haskellwiki/Yi

16:10 michael_campbell: gtrak: 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:11 gtrak: damn, that's a lot of lips

16:11 michael_campbell: and includes both *.el and *.elc (the compiled versions of the .el)

16:11 Bahman: gtrak: Though it would be nice to have a web-based Clojure IDE which stores the source files on the server/cloud.

16:11 gtrak: lisp

16:11 technomancy: wow, the amount of C in emacs has actually gone down since '08; that's encouraging

16:11 gtrak: Bahman, yea, you don't really need a full emacs for that though

16:12 amalloy: emacs has 195 lines of java code in it? i wonder what it does and where it is

16:12 technomancy: amalloy: tests, I'm sure

16:12 amalloy: ah. yes

16:12 cedet-java autocomplete tests

16:12 Bahman: amalloy: That's when they tried to reduce the speed of Emacs key-reader to make programmers feel they type fast :-D

16:13 brehaut: LispReader.java is the reader implementation for clojure right?

16:13 michael_campbell: amalloy: and 776 lines of C# (!?)

16:13 amalloy: michael_campbell: if you want to do this sort of analysis you should check out cloc

16:13 Bahman: So folks, any idea about my problem?

16:14 Raynes: &(require 'clojure.repl)

16:14 lazybot: ⇒ nil

16:14 Raynes: &(clojure.repl/find-doc "print")

16:14 lazybot: ⇒ ------------------------- 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:14 Raynes: Heh, 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:15 amalloy: michael_campbell: the C# is a miscount by cloc, afaict

16:15 Bahman: Thanks Raynes.

16:15 michael_campbell: Ah.

16:15 amalloy: it's a .cs file meaning something other than C#

16:16 michael_campbell: <nod> RMS allowing C# code in the source base did seem suspect.

16:16 amalloy: ah. a tutorial in czech

16:17 brehaut: phwoar, theres a lot of stuff happing in the reader

16:17 gtrak: yea

16:19 brehaut: the java formatting for the clj imp still surprises me

16:20 gtrak: i think it shows how little respect rich has for classes

16:20 brehaut: lol

16:21 gtrak: the try-catch is really odd though

16:21 licenser: neat neat :) I start to like clojurescript

16:22 Bahman: In which namespace can I find 'javadoc'?

16:22 gtrak: he puts { } on the same indentation as the insides

16:23 Raynes: Bahman: Pretty sure there is no 'javadoc' function.

16:23 TimMc: There was...

16:23 brehaut: clojure.java.javadoc/javadoc ?

16:23 TimMc: I think it was a contrib

16:23 Raynes: Really?

16:23 brehaut: ,(apropos 'javadoc)

16:23 Raynes: Holy crap.

16:24 clojurebot: ()

16:24 Raynes: http://clojure.github.com/clojure/clojure.java.javadoc-api.html

16:24 licenser: Raynes mate :)

16:24 now are you?

16:24 Raynes: Fantastic.

16:25 licenser: great great :) I read your slides, I am seriously impressed with what you did there :)

16:25 TimMc: gtrak: He also eschews Javadocs, it seems.

16:25 Raynes: licenser: <3

16:25 gtrak: yea, it's quite hard to read

16:25 maybe deliberately

16:26 TimMc: Trying to interop from the Java side is pretty rough.

16:26 gtrak: i wonder if he uses emacs for java

16:28 brehaut: gtrak: perhaps its to shock you into realise you are reading ordinary java code and to read it careful

16:29 gtrak: i think it's probably because he works alone most of the time

16:29 michael_campbell: The brace style is "Whitesmith", looks like.

16:30 brehaut: whatever the brace style is, ive got my work cut out making a valid tokenizer

16:30 klauern_: I'm having some trouble with the korma library and WHERE clauses

16:30 michael_campbell: http://en.wikipedia.org/wiki/Indent_style#Whitesmiths_style

16:30 klauern: For instance, if I type this:

16:31 (sql-only (select bobs (where (:ROWNUM [< 50]))))

16:31 I get back

16:31 "SELECT * FROM bobs WHERE "

16:31 Now, could it be that since ROWNUM is a pseudocolumn, it doesn't work?

16:32 michael_campbell: what do you get when you use something other than :ROWNUM?

16:32 klauern: The same

16:32 (sql-only (select bobs (where (:id [< 50]))))

16:32 "SELECT * FROM bobs WHERE "

16:32 michael_campbell: >:-\

16:33 klauern: It seems odd

16:33 brehaut: klauern: does (where (< :id 50)) do anything different?

16:33 hiredman: klauern: I think that is supposed to be a map

16:33 klauern: changes it a bit

16:33 "SELECT * FROM bobs WHERE 10"

16:33 hiredman: {:id [> 50]}

16:34 (but I've never used korma, dunno)

16:34 klauern_: Yeah, i'm just starting to play around with it

16:34 TimMc: I've always been uncomfortable with the select/from/where syntax.

16:35 hiredman: http://sqlkorma.com/ the examples have it as a map

16:35 TimMc: It should be FROM/WHERE/GROUP-BY/HAVING/SELECT/LIMIT or something

16:36 jcromartie: I 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:37 like, in Korma, a dry-run or getting the SQL is the extra step, whereas in ClojureQL actually executing it is the extra step

16:37 right?

16:37 kephale: what is the best way to reduce a boolean sequence with or? i'm guessing #(or %1 %2) isn't

16:37 clojurebot: to 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:37 technomancy: dakrone: 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:37 dakrone: technomancy: I am planning to if I ever have any time, but by all means feel free to get to it before I do :)

16:38 technomancy: dakrone: got my hands full with designing 2.0; thanks. =)

16:40 TimMc: kephale: some

16:40 licenser: technomancy: kudos for joining forces with cake

16:40 TimMc: &(some [false nil 2 true])

16:40 lazybot: clojure.lang.ArityException: Wrong number of args (1) passed to: core$some

16:40 TimMc: &(some identity [false nil 2 true])

16:40 lazybot: ⇒ 2

16:40 technomancy: licenser: thanks, but it wasn't my idea. =)

16:40 kephale: mmm with identity

16:40 TimMc: cool, ty

16:41 * Raynes is very happy to work with technomancy.

16:41 TimMc: Yeah, it's a little silly, but whatever.

16:41 Raynes: Because I want Leiningen stickers.

16:41 licenser: technomancy: no matter all involved showed really personal greatness I think :) so rare to see people join forces and not devide

16:42 technomancy: hm; I should see if my new employer could finance the second run of stickers.

16:44 cemerick: technomancy: it'd likely be essentially free if they were printed on the same sheets as the other heroku stickers

16:45 TimMc: technomancy: leiningen.core/exit accepts an optional exit code... do you think anyone actually uses that?

16:46 scottj: have your cake and lein it too

16:46 technomancy: TimMc: sure; it's mostly for CI contexts to communicate to jenkins/travis whether to consider the build successful

16:47 TimMc: technomancy: Ah... so it's not just for the REPL, right. But what about REPL users?

16:47 technomancy: I'd be surprised if repl users care about the exit code

16:47 devn: Raynes: you joining heroku?

16:48 technomancy: theoretically you could do "lein repl, deploy" and have the deploy task only go through if you had a zero exit code

16:48 Raynes: devn: He means the Leiningen + Cake teams.

16:48 devn: oh, sorry, just stumbled in

16:48 technomancy: I'd be surprised if anyone actually did that, but it should work.

16:53 jcromartie: so

16:53 tyconnell: @mac users: is there a preferred EMACS application?

16:53 jcromartie: this whole "spark" script thing on HN today

16:54 I think I wasted my day playing with UTF and weird terminal stuff

16:54 a

16:54 and doing it in Ruby, and then Clojure, and the Java *just to remind me how annoying it would be*

16:55 someone 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:55 like, I want to believe programming in Java is not that bad

16:55 Bahman: Is there a macro equivalent to Common Lips's WITH-OPEN-FILE ?

16:55 brehaut: with-open

16:55 clojurebot: Gabh mo leithscéal?

16:55 Bahman: brehaut: Thanks.

16:56 TimMc: jcromartie: Link to the HN sparklines post?

16:56 technomancy: tyconnell: http://emacsformacosx.com is the way to go

16:56 jcromartie: TimMc: http://news.ycombinator.com/item?id=3237478

16:56 and now compare Java and clojure :) https://gist.github.com/3517ed2c343bbbc3adae

16:57 but I don't know... is there a better way to do it in Java?

16:58 tyconnell: technomancy: thanks

16:59 bhenry: is there an implicit do on when?

16:59 Raynes: bhenry: Yes.

17:00 bhenry: thanks

17:00 Raynes: &(macroexpand '(when foo bar))

17:00 lazybot: ⇒ (if foo (do bar))

17:08 aaelony: hey 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:09 TimMc: aaelony: Transitive dependency?

17:09 aaelony: TimMc: not sure what I would eliminate...

17:09 technomancy: that's weird; top-level dependency declarations should always take precedence

17:10 aaelony: if you have maven installed, "mvn dependency:tree" is really helpful for these kind of situations

17:10 * technomancy needs to get someone to port that to lein

17:10 aaelony: technomancy: let try that mvn command

17:10 TimMc: `lein pom` first

17:11 technomancy: oh yeah, good point

17:11 aaelony: here's the pom: http://pastie.org/2869273

17:12 technomancy: that's a lot of snapshots. =(

17:12 aaelony: ok, I'll see about removing snapshots

17:13 technomancy: aaelony: well, it's unrelated to the problem you're having

17:13 just a good idea to avoid them in real production apps

17:13 aaelony: makes sense

17:13 jcromartie: I wonder if this Zach Holman guy is trolling.

17:15 anyway

17:17 devn: where?

17:17 clojurebot: where is your source code

17:18 devn: jcromartie: what are you referring to?

17:19 jcromartie: devn: 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:19 devn: oh, heh, yeah I saw that

17:19 hiredman: I'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:19 jcromartie: jcromartie: 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:20 seriously, the earthquake data doesn't even render correctly

17:20 devn: jcromartie: it's portable

17:20 jcromartie: barely

17:20 hiredman: a long with some kind of inference budget per lookup

17:20 Raynes: jcromartie: Talking to yourself is a sign of mental illness.

17:20 jcromartie: the first version didn't work on OS X

17:20 Raynes: hah oops

17:21 michael_campbell: Raynes: I think NOT talking to yourself is a sign of that too. Perhaps more so!

17:21 Raynes: I'm terrible company.

17:21 brehaut: hiredman: that would be very cool

17:22 devn: michael_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:22 joly: Talking to yourself is ok, and answering yourself isn't too bad. But if you start going "What?!", then you're in trouble.

17:22 Borkdude: You can always hit M-x doctor

17:22 michael_campbell: I find myself asking me, Dude, seriously, WTF? more often than I'd like.

17:23 I 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:23 devn: get a rubber duck :)

17:24 R4p70r: Anyone know if the doctor source code actually worth reading? I remember reading something about it in "Coders at work"...

17:24 Borkdude: Just wondering, is there any standard on how to annotate Java in a code review?

17:25 michael_campbell: Borkdude: that's often some company standard.

17:25 have never seen a canonical way, other than "the Sun java coding standard" or somesuch

17:30 hiredman: anyone know if there is a way to get cl-format to human format numbers like -h on du?

17:31 Borkdude: michael_campbell: any suggestions on how to annotate it, just use comments, can I use javadoc to get an overview of them, etc?

17:38 devn: hiredman: oh man, it's been awhile since I looked at that. I remember there being a ton of cl printing options in clojure

17:43 tcj: I 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:43 ...using Clojure. Is this right? Any advice? Would it make sense to store my config as a global map?

17:44 technomancy: tcj: just a static map read off the classpath is pretty common

17:46 tcj: technomancy: Just so I'm clear... this would be something like config.clj available in my CP. Correct?

17:46 technomancy: tcj: sure

17:46 tcj: cool. Thanks!

17:51 kurtharriger: tcj: 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:52 tcj: sorry copied the git url not the http url https://github.com/4clojure/4clojure

18:04 Borkdude: kurtharriger: cool! I think I'm going to use it as well

18:05 technomancy: Borkdude: mind if I privmsg?

18:05 Borkdude: technomancy: go ahead

18:06 tcj: Borkdude: thanks. I'll have a look

18:13 mjwhitt: ok, I have a stupid question, how do I println to stderr?

18:13 technomancy: clojurebot: what is the most horrible thing?

18:13 clojurebot: most horrible thing is http://tinyurl.com/b65o8e

18:13 ibdknox: lol

18:13 technomancy: ~botsnack

18:13 clojurebot: Thanks! Can I have chocolate next time

18:14 Raynes: mjwhitt: (binding [*out* *err*] (println "I'm out of errs"))

18:14 ibdknox: mjwhitt: (binding [*out* *err*] (println "hey"))

18:15 hm

18:15 :p

18:15 mjwhitt: lol jynx

18:15 Raynes: I win.

18:15 ibdknox: yeah yeah. ;)

18:15 mjwhitt: thanks guys

18:17 hiredman: so 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:18 Arafangion: clojurebot: Do you like hiredman's idea?

18:18 clojurebot: Huh?

18:18 ibdknox: lazybot: what about you???

18:18 lazybot: ibdknox: Yes, 100% for sure.

18:18 It's AWWWW RIGHT!

18:19 ibdknox: Raynes: wtf is that? ^

18:19 Raynes: It's a command.

18:19 And a hook.

18:19 brehaut: questionmarks???

18:19 ibdknox: the it's awww right part?

18:19 lazybot: brehaut: How could that be wrong?

18:19 Raynes: You just triggered two things at once.

18:19 ibdknox: lol

18:19 cuz I'm awesome

18:19 Raynes: The 'it's awwww right" part is the 'what' command.

18:20 ibdknox: ah

18:20 Raynes: $what do you think of Noir?

18:20 lazybot: It's AWWWW RIGHT!

18:22 Arafangion: Personally, I think clojurebot's already the most realistic.

18:22 ibdknox: lol

18:22 Arafangion: I mean, most of the time i ask a girl a question, they respond much the same.

18:28 R4p70r: Sites like 4clojure.com and online REPLs use Java sandboxing I guess?

18:28 ibdknox: R4p70r: Clojail

18:29 R4p70r: ibdknox, I'll have to read about that.

18:32 Raynes: R4p70r: 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:35 Borkdude: Raynes: I liked your slides, especially the one about being a Stuart Sierra groupie

18:35 https://github.com/relevance/clojure-conj/blob/master/2011-slides/anthony-grimes-clojail.pdf <-- slides

18:38 amalloy: technomancy: i don't remember the huge mess of php errors last time i saw that link. it kinda makes it even more horrible

18:38 ibdknox: everybody loves PHP errors

18:39 it's the hallmark of a great site ;)

18:39 amalloy: and they're so severe! severity 8192 is serious business!

18:41 ibdknox: that's damn near nuclear holocaust severity

19:01 hm

19:02 clojurebot appears to be showing the same thing from clojars over and over

19:03 alexbaranosky: ibdknox: I'm thinking of doing a 5-minute lightning talk on Noir at work this week

19:03 ibdknox: alexbaranosky: cool :D

19:03 alexbaranosky: ibdknox: going to see if I can somehow cram Mongo into there as well, but 5 minutes is pretty tight

19:04 ibdknox: mongo's pretty simple, so I could possibly see it working

19:04 alexbaranosky: exactly

19:06 amalloy: ibdknox: twice in a row is "over and over"? we are harsh masters to our slavebots

19:06 ibdknox: :p

19:06 alexbaranosky: rofl

19:06 ibdknox: amalloy: listen. They are here for our satisfaction

19:06 technomancy: clojurebot: eventual consistency is for losers

19:06 clojurebot: You don't have to tell me twice.

19:07 ibdknox: if they start to get out of line, we have to keep them in check... otherwise you get skynet

19:07 amalloy: technomancy: you might in fact have to tell him twice, if you want to make sure you get the same answer back before tomorrow...

19:07 ibdknox: lol

19:07 technomancy: nice

19:08 ibdknox: ~eventual consistency

19:08 clojurebot: eventual consistency is for losers

19:14 ninjudd: ibdknox: 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:15 bendlas is working on a blog post about the future of clojureql, so he'll be interested in your thoughts too

19:19 ibdknox: ninjudd: I definitely think it would make sense

19:19 I suspect there are a couple things that will need to happen to enable it, namely the subselect stuff I mentioned

19:26 alexbaranosky: ibdknox: 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:26 ibdknox: hm I think so? though I didn't write that tutorial

19:27 * ibdknox goes to find his congomongo code

19:27 alexbaranosky: ibdknox: you've got a link to it on Noir, so I thought maybe you're aware of it

19:27 on the Noir site)

19:27 ibdknox: alexbaranosky: yep yep, I know what you're talking about. I know it *did* work

19:27 but congomongo has been changing some

19:28 (for the better)

19:28 alexbaranosky: wait, let me try something, dont' spend any moe time on it

19:28 I used a newer version of congomongo, silly me

19:29 ibdknox: the latest versions of congomongo make it really easy to use

19:29 much easier than that older version

19:30 we use it for our logging code

19:30 and what we have isn't much more complicated than what's in the congomongo readme :)

19:31 alexbaranosky: mongo thinks about data much the way Clojure thinks of data, which makes them feel like a good match

19:31 ninjudd: ibdknox: think it makes sense to split the backend sql compiler out into a separate project we can all contribute to?

19:32 brehaut: from 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:33 ibdknox: ninjudd: 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:34 amalloy: brehaut: 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:35 brehaut: amalloy: thats a bit difficult. i guess i'll just be extremely permissive about what looks like symbols then

19:36 ninjudd: ibdknox: yeah. no hurry. FWIW, we could steal the name sqleton (pronounced sqeleton) from our incomplete schema migration library

19:36 budu: hi

19:36 ibdknox: ninjudd: haha that's a good name :)

19:36 budu: i've got a small question about ClojureScript

19:36 ninjudd: or name it after some other indian food ;) vindaloo?

19:36 ibdknox: lol

19:37 Bahman: How do I swap two characters in a string?

19:37 ninjudd: Naan or Basmati? since that's what you put your Korma on

19:37 budu: it currently doesn't support Refs nor STM

19:37 ibdknox: Naan *is* delicious

19:37 amalloy: ninjudd: sqeleton is not a very thorough pronunciation guide :P. neets to start more like squell

19:38 ninjudd: sqleton, rhymes with skeleton

19:38 ibdknox: I mean really you know it's got to be a good library if it's named after food

19:38 * ibdknox goes to rename Noir

19:38 ibdknox: lol

19:38 now I need a library named Brisket :D

19:38 jcromartie: sqleton... nice

19:38 budu: does someone knows if it will get implemented one day?

19:38 ninjudd: the most important part of deciding if something should be a separate library *is* figuring out a name for it

19:38 ibdknox: budu: why do you need them?

19:38 amalloy: budu: javascript doesn't have multiple threads so there's not much point

19:39 ibdknox: ninjudd: true...

19:39 budu: ok

19:39 jcromartie: masala has a nice ring

19:39 budu: forgot about that!

19:39 ibdknox: budu: atom's exist though

19:39 budu: so you can pretend :D

19:39 amalloy: Raynes: you should write a lazybot plugin that registers every word ibdknox says as a library on clojars

19:39 Raynes: Sure.

19:39 amalloy: then sell em

19:39 ibdknox: noooooo those are *mine*

19:40 I was surprised I got watchtower

19:40 amalloy: ibdknox: i'll be using my new "noooooo" library to generate xml

19:40 soap, maybe

19:40 ibdknox: amalloy: haha

19:40 technomancy: clojurebot: via soap?

19:41 clojurebot: "They enable us to send XML messages through SOAP. Through SOAP!!!" (http://www.youtube.com/watch

19:41 technomancy: =(

19:41 ibdknox: lol

19:41 budu: ibdknox: btw, congratulation on Korma

19:41 ibdknox: budu: haha thanks :)

19:41 budu: ibdknox: i haven't used it yet but it looks great

19:41 ibdknox: we'll see if you say the same thing once you use it ;)

19:42 budu: i'm thinking about adding support for delimited identifiers

19:42 ibdknox: delimited identifiers?

19:42 budu: quoted tables, columns name

19:42 ibdknox: ah

19:42 everything is quoted now

19:42 though spaces are problematic for that...

19:43 budu: already! cool

19:43 ibdknox: people actually put spaces in their table names?

19:43 that's terribel

19:43 terrible*

19:43 budu: yeah, check out 0.3.0-alpha

19:43 I was productive on the plane ride back :)

19:43 budu: yeah the SQL standard is quite permissive with delimited identifier

19:43 alexbaranosky: ibdknow: I think I've seen space-serpated reporting db table names

19:47 mabes: is 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:48 cgray: here'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:48 technomancy: ibdknox: I love committing on a plane.

19:49 ibdknox: technomancy: gotta use that time for something :)

19:49 mabes: cgray: 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:49 gfredericks: That was a movie with Samuel L Jackson, right?

19:49 technomancy: ibdknox: I also watched one of the videos from last year's conj

19:49 cgray: mabes: i'm on 1.3

19:50 mabes: cgray: 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:52 cgray: mabes: I think the problem is trying to call subs

20:02 nickmbailey: whats the best way to get the 3rd, 6th, 9th, etc items out of a collection

20:02 take-nth is almost what i want but it gives the first element than skips n

20:02 ibdknox: drop 3

20:02 and then take nth

20:02 cgray: (map last (partition 3 coll))

20:02 ibdknox: ,(doc take-nth)

20:02 clojurebot: "([n coll]); Returns a lazy seq of every nth item in coll."

20:03 brehaut: M isnt the only suffix for numbers now is it?

20:03 ibdknox: ,1.0N

20:03 hiredman: ,1N

20:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 1.0N>

20:03 1N

20:03 hiredman: bleh

20:03 brehaut: thanks

20:03 ibdknox: hm

20:03 brehaut: and it always has to be capitalized?

20:03 nickmbailey: drop and take-nth should work, thanks

20:04 ibdknox: ,(take-nth 3 (range 1 11))

20:04 clojurebot: (1 4 7 10)

20:04 ibdknox: ,(take-nth 2 (range 1 11))

20:04 clojurebot: (1 3 5 7 9)

20:04 nickmbailey: ,(take-nth 3 (drop 2 (range 1 9)))

20:04 clojurebot: (3 6)

20:05 nickmbailey: ^thats what i wanted

20:05 ibdknox: yep yep, I was just playing around with it :)

20:05 brehaut: fantastic. i have working number tokenizer and its only 62 lines long :S

20:05 nickmbailey: the doc for take-nth seems confusing

20:05 at least to me

20:06 cgray: ,(map last (partition 3 (range 10)))

20:06 clojurebot: (2 5 8)

20:06 budu: i've got another question...

20:06 ibdknox: ,(take-nth 3 (range 10))

20:06 clojurebot: (0 3 6 9)

20:06 ibdknox: ,(rest (take-nth 3 (range 10)))

20:06 clojurebot: (3 6 9)

20:06 gfredericks: ,(->> 10 range (take-nth 3) rest)

20:06 clojurebot: (3 6 9)

20:06 budu: does somebody knows what happened with the contrib.datalog library

20:07 technomancy: budu: its author seemed to indicate it should be rewritten

20:07 seems doubtful it'll be promoted to 1.3

20:07 budu: i was thinking it could be rewritten using core.logic

20:08 but that job seem over my current capabilities

20:08 technomancy: what better way to extend your capabilities

20:08 budu: hehehe

20:09 i'll have a look at the code but i don't promise anything

20:09 i'm just getting into core.logic, it's fun

20:09 cgray: how do you translate 'var foo = { bar: 4, baz: 5 }' into cljs?

20:09 ibdknox: my 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:09 budu: and give me headashes at the same time! ;-)

20:10 technomancy: sqleton is pretty great

20:10 ibdknox: cgray: as in you need that line exactly?

20:10 cgray: ibdknox: well, that idea

20:11 ibdknox: cgray: (let [foo {:bar 4 :baz 5}] ...) ?

20:11 gfredericks: hrm..clutch still depends on contrib

20:11 cgray: ibdknox: i think i need the names not to be munged though...

20:11 ibdknox: cemerick: shame! ^

20:12 cgray: there's a magical js-object function I think

20:12 cgray: ibdknox: I'm looking at http://code.google.com/apis/maps/documentation/javascript/overlays.html#Markers

20:12 ibdknox: cgray: ah

20:12 Bahman: Suppose 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:12 ibdknox: cgray: just provide strings as keys and you'll be fine

20:12 cgray: ibdknox: ok, thanks

20:16 ibdknox: budu: as far as you know double-quotes work for all dbs right?

20:16 budu: in terms of delimited identifiers

20:29 ninjudd: technomancy: thanks! =)

20:37 budu: ibdknox: no

20:38 ibdknox: better answer.. nearly

20:39 ibdknox: budu: what are the corner cases?

20:40 the lists I found seemed to indicate "some-ident" would work everywhere

20:40 budu: ibdknox: in fact (after revision) in term of input all RDBMS accept quoted identifiers

20:41 ibdknox: it's just that when querying the schema for SQL Server for example it will return bracketed identifiers by default

20:42 ibdknox: budu: ah, I see. I should be ok then, since I never interpret the results myself/ask for the schema

20:42 budu: ibdknox: also for MySQL the ANSI_QUOTES mode must be enabled, but i think it is by default now

20:43 ibdknox: budu: yeah it used to be back-tick right?

20:43 budu: ibdknox: exactly

20:43 ibdknox: budu: k, thanks :)

20:43 budu: funny example from MySQL doc: CREATE TABLE `a``b` (`c"d` INT);

20:44 preceded by "The following statement creates a table named a`b that contains a column named c"d: "

20:44 crazy stuff!!!

20:44 ibdknox: wow

20:44 this is an example of flexibility gone wrong

20:45 alexbaranosky: yikes!

20:45 ibdknox: I hate SQL. :p

20:45 hiredman: ~A is X

20:45 clojurebot: 'Sea, mhuise.

20:45 budu: there's so much hilarious stuff inside the SQL standard and implementations doc, forgot about most of them to maintain my sanity

20:45 hiredman: ~X is B

20:46 clojurebot: You don't have to tell me twice.

20:46 hiredman: A?

20:46 clojurebot: A is X

20:46 hiredman: hmm

20:46 A?

20:46 clojurebot: A is X

20:46 hiredman: I guess

20:46 ibdknox: hiredman: you're trying to turn clojurebot into an inference engine?

20:46 hiredman: A?

20:46 clojurebot: A is B

20:46 hiredman: trying?

20:47 ibdknox: haha :)

20:47 budu: this is weird

21:07 aperiodic: ~succ 0 is 1

21:07 clojurebot: Ok.

21:07 bhenry: working 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:09 aperiodic: ~succ (n + 1) is succ (succ n)

21:09 clojurebot: Ok.

21:09 aperiodic: ~0 + 1 is 1

21:09 clojurebot: Roger.

21:09 brehaut: simple profiling of my syntaxhighligher brush has it at about 7 times faster than the regexp based solution im hoping to replace

21:10 ibdknox: brehaut: nice :)

21:10 * aperiodic waits for clojurebot to tell him *all* the natural numbers

21:11 brehaut: ibdknox: yeah im stoked :) brutally imperative code sometimes pays off

21:12 cemerick: ibdknox: ?

21:13 ibdknox: cemerick: oh, somebody said something about clutch uses contrib and I was being funny :p

21:13 cemerick: ah :-)

21:13 all of its usage is 1.3-safe

21:13 modulo irritating warnings about earmuffed vars

21:13 ibdknox: stupid earmuffs

21:14 cemerick: ibdknox: settled in again after the conj?

21:14 ibdknox: cemerick: I got back at like 9:30 last night

21:15 cemerick: oh, right

21:15 my sense of time was totally destroyed between saturday night and monday morning

21:16 amalloy: ibdknox: almost 24 hours! why no new libraries yet?

21:16 cemerick: I got one hour of sleep before my flight on Sunday :-P

21:18 ibdknox: cemerick: lol :p

21:19 amalloy: I needed a dash of sleep ;)

21:20 I did however sketch out some stuff on the plane for some nice time helpers ;)

21:23 gfredericks: `lein search` is not kidding about taking a while to download indexes

21:25 chouser: my sense of time was destroyed from pretty much the start of the conj until yesterday

21:26 cemerick: Man, I feel bad about messing with nREPL's protocol now. :-(

21:26 chouser: I was going to follow that up with a funny anicdote, but it turns out not to be funny.

21:27 cemerick: why's that?

21:27 brehaut: syntax 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:27 cemerick: chouser: https://twitter.com/#!/kotarak/statuses/136567617304543232

21:27 He knew it was coming, but still…

21:27 brehaut: opacity:.75?

21:27 brehaut: personally im leaning towards c) as it falls back to b) with the appropo CSS anyway

21:27 cemerick: yeah exactly

21:27 cemerick: +1

21:28 brehaut: sold!

21:29 chouser: interesting.

21:30 cemerick: That's client #4.

21:30 * cemerick feels like an idiot for not doing a thorough design process on the protocol itself in addition to the semantics

21:42 TimMc: technomancy: Is the most horrible thing that that page is made almost entirely of PHP errors?

21:42 bhenry: almost 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:47 alexbaranosky: bhenry: sweet. Too bad you can't show it off

21:50 amalloy: show off the compiled js. nobody will be able to find the NDA-protected stuff in all that, eh?

21:51 alexbaranosky: amalloy you're always thinking these great ideas

21:51 ;)

22:02 amalloy: do you know of a 1.3 ordered map implementation?

22:03 amalloy: alexbaranosky: 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:04 alexbaranosky: we're using yours in Midje

22:04 amalloy: actually 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:05 alexbaranosky: amalloy: looks like we have an entire copy of your library pasted into Midje :\

22:06 amalloy: guess Brian was rushed, and just tweaked yours

22:06 amalloy: alexbaranosky: i can't say i blame him. i released a version that contains silly benchmarking crap

22:16 alexbaranosky: 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:18 alexbaranosky: amalloy: was looking at the code spew in the Midje source. didn't realize he had forked your project

22:19 amalloy: all the same, i'll pull in his changes and push a new version to clojars

22:19 alexbaranosky: yeah that'd be great

22:19 looks like all he really had to do was change the deps ?????

22:19 amalloy: yes

22:23 alexbaranosky: deployed his changes to clojars. happy testing

22:24 alexbaranosky: thanks

22:35 amalloy: update Midje to use the new jar.

22:36 amalloy: correction, *updated*

22:49 does anyone know where I can find an immigrate function?

22:53 amalloy: alexbaranosky: in the blackest pits of hell

22:53 alexbaranosky: amalloy: or in Midje

22:54 amalloy: seriously immigrate is vile and evil

22:54 alexbaranosky: I 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:54 I wonder what we're using it for

22:54 amalloy: i added something like it to useful recently, though, so i can't really take a moral high ground

22:55 alexbaranosky: probably for re-exporting stuff from semi-sweet into sweet or something like that

22:55 alexbaranosky: yep

22:55 aperiodic: does immigrate move things between namespaces?

22:56 alexbaranosky: doc: "Create a public var in this namespace for each public var in the

22:56 namespaces named by ns-names. The created vars have the same name, root

22:56 binding, and metadata as the original except that their :ns metadata

22:56 value is this namespace."

22:56 ibdknox: evil.

22:57 aperiodic: why would you do that rather than requiring the namespace?

22:57 alexbaranosky: requiring it wouldn't make it public to consumers of the namespace???

22:57 lazybot: alexbaranosky: Oh, absolutely.

22:59 alexbaranosky: looks like this way you don't have to use both midje.sweet AND midje.checkers

23:00 amalloy: i 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:00 eg, specifically we wanted useful.core to be a conglomeration of useful.*

23:00 alexbaranosky: amalloy: I'd be open to hearing other ways of achieving the same effect

23:01 aperiodic: yeah, 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:01 amalloy: aperiodic: nothing else, so far

23:01 ibdknox: ordered?

23:02 amalloy: ibdknox: maps and sets that retain insertion order

23:02 alexbaranosky: we use ordered-map for the binding map created from the tabular macro

23:03 ibdknox: I see

23:03 amalloy: alexbaranosky: fold checkers into sweet (probably not viable), or create another namespace that does nothing but re-export sweet&checkers

23:03 even call it sweet if you want, and rename the existing sweet to sweet-impl

23:04 alexbaranosky: honestly... it is causing any harm

23:04 wtfcoder: when including clojure-contrib in dependenices of package.clj do i need to specify a repository, lein deps results in not found in repos

23:04 alexbaranosky: I'd rather spend time fixing a bug

23:04 or doing a new feature

23:04 amalloy: alexbaranosky: i kinda agree. i'm overly aggressive about this issue, like a number of others. you have to learn to ignore me

23:04 alexbaranosky: of course, I appreciate the convo about it

23:05 ibdknox: alexbaranosky: I never listen to amalloy

23:05 amalloy: ibdknox: surprisingly apropos, unless...surely you didn't listen to me in order to decide to agree!?

23:06 wtfcoder: you probably asked for a version that doesn't exist, and also you meant project.clj

23:07 brehaut: amalloy: i have local lookup working for the brush :)

23:07 wtfcoder: yes, and yes..do I have be explicit with version number or can I just put 1.*.* and let it grab the latest

23:08 PPaul: (inc wtfcoder)

23:08 lazybot: ⇒ 1

23:09 PPaul: (inc)

23:09 (inc 1)

23:09 lazybot: ⇒ 2

23:09 PPaul: (inc (inc 1))

23:09 lazybot: ⇒ 1

23:09 PPaul: no

23:09 amalloy: wtfcoder: 1.*.* is [1.0.0,2.0.0)

23:10 though there are a lot of people who think version ranges are bad for the soul

23:10 wtfcoder: okay, 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:13 technomancy: version ranges are incompatible with repeatable builds

23:13 ibdknox: yeah, I don't like ranges

23:14 technomancy: which is OK for libraries (assuming you've tested it with everything in the range) but terrible for applications

23:14 version ranges that include versions that don't yet exist are an anathema

23:14 wtfcoder: following 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:14 ibdknox: you can't know if your stuff will work for a future version

23:14 wtfcoder: technomancy, idbknox, on reflective that makes sense, absolutely.

23:15 technomancy: wtfcoder: 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:15 amalloy: ibdknox: in theory it would be fine if everyone followed semver strictly

23:16 wtfcoder: okay, 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:16 ibdknox: amalloy: that's a big if :p

23:16 wtfcoder: s/clojure/clojar

23:16 amalloy: indeed

23:17 technomancy: wtfcoder: "lein search" will show you all the version numbers

23:17 but you have to download the indices first, (one time) which is pretty slow

23:17 it'll tell you which repo it comes from

23:18 most jars have a pom inside that includes license and URL if the author has specified it

23:19 that's an interesting idea for a feature though

23:21 in case anyone's, you know, looking for a project idea, hint hint

23:22 wtfcoder: working on getting hello world going before given consideration ;)

23:23 klauern: I'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:24 http proxy settings, Maven settings, private Maven server, Windows...

23:24 technomancy: klauern: would love to get more folks kicking the tires, reporting bugs, etc.

23:24 klauern: are you on the leiningen mailing list?

23:24 klauern: I don't think so

23:25 Is that the google group?

23:25 technomancy: yeah

23:25 I'll announce it there once that's transitioned

23:25 klauern: I'll have to update some settings if I am, because I don't get emails from that group (yet)

23:26 technomancy: the 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:36 choffstein: Can anyone point me to the docs for -?>

23:36 I can't seem to find it anywhere online

23:36 amalloy: i don't think -?> made it into new-contrib

23:37 it's really just -> with a short-circuit on any nil

23:37 brehaut: (clojure.algo.monads/domonad clojure.algo.monads/maybe-m […] …) ;)

23:37 amalloy: ouch

23:37 brehaut: no?

23:37 fine

23:37 amalloy: brehaut the dream-crusher

23:38 brehaut: lol

23:40 rsenior: -?> is a little masked by the defnilsafe macro

23:40 but it's here: https://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/incubator.clj

23:41 choffstein: awesome. thanks

23:42 brehaut: 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:42 brehaut: choffstein: it was mostly a joke ;)

23:43 amalloy: $dict wreak

23:43 lazybot: amalloy: verb-transitive: To inflict (vengeance or punishment) upon a person.

23:44 choffstein: Man lazybot is helpful

23:55 amalloy: choffstein: we'll stop adding features as soon as it's possible to do everything you could possibly want without leaving #clojure

Logging service provided by n01se.net