#clojure log - Sep 09 2013

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

0:00 arrdem: justin_smith: however a question that I've seen a few times is symbol replication in order to expose more structured APIs. This means that one way or another you wind up with (def foo my.other.ns/foo) repeated a bunch of times in order to get all the bits you want in one place

0:00 justin_smith: yeah, I just wondered if there was some subtlety I was missing there

0:00 arrdem: justin_smith: this is also A Bad Idea.

0:01 justin_smith: I think that comes from the .h/.c convention (and other variations on this), people wanting data / structure in one file and code / functionality in another

0:02 arrdem: yeah... (to the rest of the chan) for this reason why don't we have a (defn-) when we have (def-)?

0:03 justin_smith: (def- fn [] ...) is easy enough to use

0:03 arrdem: ah. defn- is a thing.

0:03 justin_smith: well I formated that wrong, but

0:03 I think it is def- that is not a thing

0:04 frankly I rarely think I need either

0:04 coventry`: technomancy: Special-casing it worked nicely. Thanks.

0:04 arrdem: yep. def- is not a thing.

0:04 but you can def ^:private to the same effect.

0:05 so... if you want to hide something you can? *shrug*

0:21 justin_smith: technomancy: any tips on using a jni lib installed via apt? I am getting weird issues and don't know if it is because of misconfiguration or a broken .deb or what

0:38 amalloy: justin_smith: tip #1: a clearer description of the problems than "weird issues" will help technomancy (or whoever) figure it out

0:46 dobry-den: What's the simplest way to write a map { :topic/created #inst "2013-09-07..." :topic/name "test" } to an edn file so it actually appears just like that, #inst and all?

0:48 cgag: pr-str i think

0:49 dobry-den: cgag: yeah thanks, that works

1:48 callen: http://euroclojure.com/2013/speakers/

1:48 seriously, read it ^^

1:49 jack_rabbit: k

1:58 s4muel: that's quite a list.

1:58 callen: s4muel: read Tellman's bio.

1:58 ztellman: stole it from http://en.wikipedia.org/wiki/Pierre_Menard,_Author_of_the_Quixote

1:58 s4muel: I did, and laughed at the 'discarded as too easy' bit

1:59 ah, the more you know.

2:00 ztellman: most of my bios are quotes from stories that I just read

2:00 saves me having to figure out what the right amount of humblebrag is

2:00 callen: ztellman: never enough humble or brag in a well executed humblebrag.

2:00 ask aphyr, he's really good at it.

2:01 ztellman: I'll ask for notes tomorrow

2:01 callen: ztellman: now you've pointed me to something fun to read. Thanks :)

2:01 ztellman: if you've never read borges, also check out Library of Babel, The Aleph, Lottery of Babylon, and Funes the Memorious

2:02 also Tlon, Uqbar, Orbis Tertius

2:02 (that's one title)

2:03 technomancy: I usually put "greatest sword fighter in the world" in the bios I submit

2:03 callen: ztellman: I haven't but he was on my list, I'll bump him up after I finish HMS Surprise. Thanks :)

2:03 SeanCorfield: callen: several of those bios are pretty funny but ztellman's takes the biscuit! (hi zach)

2:04 s4muel: the program page on euroclojure leaves much to the imagination

2:04 ztellman: technomancy: this is before you realize, midway through your talk, that your chances of being the biggest badass in the world have been stolen by an Aleutian with a grudge?

2:04 callen: technomancy: have you read The Expanse series?

2:04 ztellman: SeanCorfield: hey, it's been a while, I keep missing the SF meetups

2:04 I should fix that

2:04 technomancy: ztellman: always nice to have the pressure ease up

2:04 callen: I don't think so

2:04 callen: ztellman: I went to the last one, great conversations. I've resolved to start going more, you should too.

2:05 technomancy: one of the characters is a coffee fiend supposedly. Thought it might be a character you could identify with properly.

2:05 SeanCorfield: ztellman: I'm taking a break from the SF meetups - after running them for two years

2:05 Amit is not so wrapped up in Runa now (he's doing Zolodeck) and has more time so I've yielded to him for a while

2:05 ztellman: SeanCorfield: will you be at StrangeLoop or the Conj?

2:06 SeanCorfield: both

2:06 ztellman: cool, we should catch up

2:07 thankfully I'll only be listening at this one, so I have plenty of time

2:07 SeanCorfield: yup... lots of conferences this year: PyCon, Clojure/West, MongoSF, cf.Objective(), LambdaJam, Strange Loop, Clojure/conj :)

2:07 ztellman: gotta say, EuroClojure is going to be the high point for me, but that's only because I get to expense a trip to Berlin

2:08 StrangeLoop's lineup looks amazing, as usual, though

2:08 SeanCorfield: Yeah, company's sending me to that... going to the conj on my own dime

2:08 EuroClojure looks like fun...

2:09 I'm off to England at the end of the month... for a cat show... :)

2:09 ztellman: wow, transatlantic travel with a pet

2:09 that sounds fun

2:09 SeanCorfield: Next year, I'll probably speak at Scotch on the Rocks in Edinburgh in June, as my once a year tript to the UK

2:09 Nah, we don't take cats overseas - my wife is judging in Solihull, so we'll go see my family

2:10 ztellman: aha

2:10 SeanCorfield: We're making a run at an International Winner with a kitten right now over here in the US tho' :)

2:11 ztellman: what are cats judged on?

2:12 SeanCorfield: each breed has a written standard - there are 70+ breeds

2:13 it's all about conformation

2:13 except for "HouseHold Pets" - they're judged on beauty / cuteness :)

2:13 ztellman: are there activities they perform, or is it just conformation in appearance?

2:14 SeanCorfield: just conformation, although agility exists as a separate competition

2:14 http://catagility.org/

2:14 ztellman: Cat agility is fun for you AND your cat

2:14 TIL

2:14 SeanCorfield: are you "just" attending both strange _and_ the conj?

2:15 ^loop

2:15 ztellman: that and EuroClojure

2:15 SeanCorfield: ah, but you're speaking at EC...

2:16 ztellman: oh, I see, "just" attending

2:16 yes, not speaking at either

2:17 last year kind of wrecked me, especially the Conj

2:17 I proposed a talk on writing a Go AI before I had written one

2:17 callen: egads.

2:17 SeanCorfield: and they accepted it :)

2:17 ztellman: it was a backup proposal

2:17 I mean, in retrospect, of course that's the one they'll choose

2:17 SeanCorfield: I submitted three talks to cf.Objective() 2013.. and they accepted all threee..

2:17 callen: SeanCorfield: lol.

2:18 ztellman: but I was focused on the other one, which is the one I'm giving at EuroClojure this year

2:18 callen: ztellman: what's the talk aboot?

2:18 ztellman: callen: pure pretention

2:18 it's called "States and Nomads: Handling Software Complexity"

2:18 callen: pretension?

2:18 ...nomads?

2:18 ztellman: basically Borges, Deleuze, and others as they relate to software

2:19 callen: monads...or nomads?

2:19 ztellman: no typos, nomads

2:19 and not state, states

2:19 SeanCorfield: "States and Nomads"... cute :)

2:19 ztellman: I thought so

2:20 btw, as a PSA, redefining 'and' and 'or' is not a very good idea when you're still writing a namespace: https://github.com/ztellman/automat/blob/master/src/automat/core.clj#L71

2:20 the amount of time I've spent debugging something before realizing I need to use clojure.core/and

2:20 I swear

2:21 callen: FSA compiler for Clojure?

2:22 ztellman: basically

2:24 strongly influenced by Ragel: http://www.complang.org/ragel/

2:24 SeanCorfield: The last few years have made me a bit more cautious about proposing topics for conferences...

2:24 callen: I was going to ask.

2:25 I don't believe I've ever given a talk.

2:25 outside of my own company, anyway.

2:25 ztellman: SeanCorfield: yeah, I dunno, it forces me to crystallize certain ideas that would probably remain vague and unspoken without the pressure of the talk

2:26 but it's pretty stressful

2:26 SeanCorfield: I got too adventurous one year and gave five talks at one conference(!) and spoke at three others as well.. way, way, way, too much!

2:26 ztellman: wow

2:26 callen: SeanCorfield - John Bunyan of our time.

2:26 ztellman: yeah, I ran into Nathan Marz a few months back, and he suggested just giving the same talk everywhere

2:27 but I think I'd have to create some Storm-equivalent before that flies

2:27 SeanCorfield: Sometimes proposing an off the wall talk can really be a good thing to further your understanding but conferences can be a bit random about what they accept at times :)

2:27 callen: SeanCorfield: part of the problem is knowing what they're already tired of seeing by the time they look at your proposal.

2:28 ztellman: "man, another Go AI?"

2:29 SeanCorfield: I submitted "Learn you a what for great good" as an off the wall polyglot talk, "ORM, noSQL, and Vietname" and "Humongous MongoDB"... and all three got accepted so I had to create a lot of material

2:29 I should have just submitted the ORM talk (I don't like ORMs :)

2:29 ztellman: it seems unfair to accept all of them, honestly

2:29 the assumption can't be that you've assembled the talk before submitting the proposal

2:29 SeanCorfield: But at least I got to talk about Clojure in the polyglot talk again

2:31 for next june's conference, the hint has been that a clojure talk would be accepted, so i mustn't grumble :)

2:31 ztellman: still, three talks

2:32 SeanCorfield: ztellman: the assumption is that you can deliver whatever you propose :)

2:32 ztellman: SeanCorfield: I'll keep that in mind in the future, I guess

2:32 anyway, out for the night

2:32 callen: I wouldn't have expected them to accept multiple proposals either.

2:33 SeanCorfield: i've had two talks accepted at several conferences over the years... occasionally three... depends on the conference and the topics...

2:34 and I've picked up other speakers' topics when they've dropped out... which is not recommended to be honest

2:38 callen: SeanCorfield: re: cat agility - how do you convince the cat to obey you?

2:38 I've scarcely been able to get them to visit me when I didn't have food in my hand :(

2:38 SeanCorfield: depends on the cat :)

2:39 we have a girl who was one of the first "clear rounds" on iCAT

2:39 and then she lost interest

2:39 so they do what _they_ want

2:39 but that cat loves car rides and hotels, and going out to dinner at restaurants with patios

2:40 callen: that's adorable ;_;

2:42 SeanCorfield: https://sphotos-a-lax.xx.fbcdn.net/hphotos-ash3/554171_10151756477516055_1613185053_n.jpg that's our girl in her walking harness at the local mexican restaurant

2:42 she did iCAT precisely once...

2:42 callen: SeanCorfield: SO CUTE X_X

2:43 okay, enough cats in Clojure. *rubs temples* must focus.

2:43 SeanCorfield: http://bangles.com/mystique/ <-- more cuteness (the same cat)

3:00 callen: https://gist.github.com/sritchie/6440578

3:08 TEttinger: SeanCorfield, damn that's a good cat. my tuxedo cat knows a command, bite and claw you unpredictably.

3:11 SeanCorfield: the current kitty we're running to championship https://sphotos-a-lax.xx.fbcdn.net/hphotos-frc3/1186771_645271042158938_913519589_n.jpg

3:12 callen: what was that apropos? thrift rings a bell but i can't remember what it is?

3:12 callen: SeanCorfield: nothing in particular. I'm kind of obsessed with Instaparse lately.

3:12 SeanCorfield: Thrift is a protocol.

3:13 SeanCorfield: ah, yes... instaparse did seem cool... haven't had a use for it yet tho'...

3:13 callen: SeanCorfield: I might have an @work reason to use it soon.

3:15 I might need a semi-custom query language to wrap datalog/datomic

3:15 to that end, if anybody knows of a SQL parser in Clojure, let me know :)

3:36 ddellacosta: any experiences with Docker + Clojure app deployments?

3:45 SegFaultAX: ddellacosta: I've been toying with a project at work to use docker in our build server.

3:45 ddellacosta: Which for us is pretty damn close to deployment.

3:46 ddellacosta: SegFaultAX: close enough for me…heh. Liking it? Bad things?

3:46 SegFaultAX: Docker is really amazing, but there are a few things I don't really get yet because I've only been doing it a very short while.

3:46 I don't really get how image maintenance works yet.

3:47 Like if I build an image off of x1, y1, and z1, and then at some point in the future I need to update them to x2, y3, z2 or whatever...

3:48 What I /want/ to do is create an image stack using the ubuntu base, tooling, and all the runtime stuff I need. Then at the highest level are my application images.

3:48 ddellacosta: hmm, interesting

3:48 SegFaultAX: I just don't really grok yet how that works with deeply nested stacks of images.

3:48 ddellacosta: gotcha. So, on a surface level, it remains compelling enough that you'll keep playing with it to see if it can server your needs…to kind of sum up.

3:49 SegFaultAX: ddellacosta: Yup.

3:49 ddellacosta: *serve

3:49 SegFaultAX: The other thing that isn't clear is security.

3:49 ddellacosta: SegFaultAX: okay, that is useful info.

3:49 SegFaultAX: howso?

3:49 SegFaultAX: It provides excellent isolation, but I don't really know enough about the security model to say if it's safer than manually setting up lxc.

3:50 You should check out aufs, it's pretty sick.

3:50 ddellacosta: okay.

3:51 are you talking about: http://aufs.sourceforge.net?

3:51 SegFaultAX: Probably.

3:51 ddellacosta: haha, okay.

3:51 thanks for the info SegFaultAX.

3:51 SegFaultAX: It's the docker filesystem.

3:51 ddellacosta: ah, I see

3:52 SegFaultAX: I mean to say that's what docker uses.

3:52 ddellacosta: gotcha: http://docs.docker.io/en/latest/terms/filesystem/

3:52 SegFaultAX: Anyway, it provides really excellent filesystem-level isolation.

3:53 ddellacosta: The idea I have in my head that just seems so sexy is being able to have my build server turn my application into a docker image which it then pushes up to a private repo. Then I just signal all my servers to pull down the latest image.

3:53 ddellacosta: SegFaultAX: that is *so* exactly the kind of thing I was thinking

3:54 SegFaultAX: which is why I wanted to ask about it

3:54 SegFaultAX: ideally I could have a setup for CI/integration tests too

3:54 SegFaultAX: I'm working on it in my 20% time.

3:54 Along with a few other projects.

3:54 * ucb waves

3:54 ddellacosta: SegFaultAX: which could be just a different set of configs w/same Clojure project

3:54 * ddellacosta waves back at ucb

3:54 ddellacosta: yeah, that sounds super cool

3:56 SegFaultAX: ddellacosta: In my mind, docker is to servers as java is to applications.

3:56 As long as the JVM is there, I don't have to care about whatever is under me, it'll just work.

3:56 ddellacosta: SegFaultAX: totally, that's a good analogy

3:57 SegFaultAX: That's not to say docker won't have its shortcomings (java certainly does) but it allows us to build and deploy our applications at a higher level of abstraction.

3:57 Heroku is essentially LXCaaS

3:57 Docker makes that attainable for us mere mortals.

3:57 ucb: SegFaultAX: I take it you're using docker in prod and liking it?

3:58 arrdem: LXCaaS?

3:58 ddellacosta: yeah, was going to ask the same

3:58 SegFaultAX: arrdem: LXC as a service.

3:58 ucb: Not in prod yet, no. But in my 20% time I've been working on a project to use docker in our build environment.

3:59 * arrdem didn't know LXC was LinuX Container

3:59 SegFaultAX: ucb: I'm still pretty fresh so I don't fully grok everything yet, but it's been pretty awesome so far.

4:01 ucb: SegFaultAX: cool. The reason I'm asking is because we considered it but deemed it to early to put in prod (I didn't do the assessment mind you so I don't know the details.)

4:02 SegFaultAX: ucb: Build environment seems like a good beta for that. Each build is run in its own docker instance, the artifact of which is a deployable image.

4:02 Not to say we'll start using it in prod, but that's the test to see if it's even viable.

4:05 * ucb nods

4:07 ro_st: Cljs 0.0-1877 doesn't seem to be available yet?

4:08 dnolen: is 0.0-1877 up? lein isn't finding it

4:08 super keen to try your perf improvement!

4:14 ambrosebs: can anyone think of an inner class in the Java standard lib? just need to test core.typed's inner class syntax.

4:15 opqdonut: Map$Entry

4:15 ambrosebs: opqdonut: cheers

4:18 hyPiRion: Gurr, the EuroClojure lineup is too good, and the plane tickets are cheap too.

4:19 My wallet will not like me for doing this

4:22 ro_st: hyPiRion: you'll regret not going far more than you will regret going

4:24 hyPiRion: ro_st: yes, which is why my wallet is crying at the moment

4:24 Just need to find a hotel first

4:29 ddellacosta: woah, EuroClojure

4:29 wonder how much a ticket would be…hrmm

4:30 SegFaultAX: Ticket + Hotel + Food probably around $2500

4:30 If you're going for the conference plus a little sight seeing.

4:30 ddellacosta: SegFaultAX: probably have someone I can stay with. Mostly worried about plane tix

4:30 SegFaultAX: If you just want to go for the conference and live frugally otherwise, probably less than $2k

4:31 sontek: I was looking at conj today, they don't have the talks listed yet though

4:31 Pretty cheap for a conference though

4:31 ddellacosta: belch, too much this year probably…will save up to finally attend a Clojure conference in 2014 I guess. ;-(

4:32 belch = blech, freaking spellcheck

4:32 sontek: http://clojure-conj.org/

4:36 ddellacosta: sontek: unfortunately, that one would probably cost me even more to fly to

4:36 scottj: I think it's an awesome venue for the Conj. If you fly into reagan you can't get more convenient than that

4:36 ro_st: i went to CW in Portland this year. was worth the 27 hours it took to get there

4:36 scottj: (granted having it in the town you live in is probably better)

4:36 ro_st: definitely going next year again

4:37 ddellacosta: just too much $…*sigh*

4:37 can't wait until they start having Clojure conferences in Asia. That'll be the day...

4:39 hyPiRion: ddellacosta: That would actually be neat. Are there any major Clojure players (companies) in Asia?

4:39 scottj: hyPiRion: nope. just httpkit

4:39 ddellacosta: hyPiRion: none whatsoever that I know of

4:39 hyPiRion: :/

4:40 scottj: the author of httpkit is in Shanghai iirc

4:40 ddellacosta: Beijing if this is to be believed: https://github.com/shenfeng

4:40 scottj: ahh, yeah

4:41 ddellacosta: where are you?

4:41 ddellacosta: scottj: Japan, a development wasteland

4:41 scottj: I'm being harsh, but not that harsh

4:42 crap, I saw some company in China using a shit-ton of Clojure and now I can't remember the link

4:43 ro_st: they do Ruby there, don't they? -grin-

4:44 ddellacosta: ro_st: the hilarious thing about the Ruby community here is that it's all old-school, non-Rails folks, other than the foreigners they've imported (generalizing…kind of...)

4:45 ro_st: what I find mostly here are PHP folks doing web dev from like 10 years ago, Java folks doing bank-related stuff, and the sad suckers doing game dev

4:46 everyone gets paid shit, and works 60+ hour weeks

4:46 I'm generalizing.

4:46 Sorta bitter…sorry. haha

4:46 ro_st: that sounds horrible

4:46 no innovation?

4:47 ddellacosta: ro_st: ah, I'm making it out to be worse than it is. There are definitely some folks who are really into doing cool, interesting stuff. I think it's just less common than, say, Silicon Valley, because naturally folks gather where the money is.

4:48 ro_st: i'm sure those people are there. you just need to find them and hang out

4:48 start a Clojure UG

4:48 ddellacosta: ro_st: most definitely! I'm lazy, and have no one to blame but myself. I am going to the Hacker News Tokyo meet up on Weds. though, maybe I'll mention something about starting a Clojure UG/meetup/etc.

4:49 ro_st: absolutely. cmdrdats and i run the Clojure UG in Cape Town, South Africa. well worth the effort

4:49 ddellacosta: now that you mention it, I haven't searched for Japanese Clojure groups recently, let me see...

4:49 ro_st: cool! Very good to know. Yeah, I'm sure it's worth it.

4:49 ro_st: hard work, and sometimes thankless, but in the long run, worth it

4:50 ucb: ddellacosta: if you're depressed about the state of affairs where you are, you should pay me a visit. Mostly sharepoint/.NET developers up here.

4:50 ddellacosta: ucb: where are you?

4:50 ucb: ddellacosta: Aberdeen, Scotland

4:50 ro_st: what's the current status of Clojure CLR?

4:50 abandoned?

4:50 ddellacosta: ucb: honestly, I have nothing to complain about, I like living here. Just miss the U.S. dev culture sometimes (I'm an American).

4:51 ucb: ddellacosta: I know what you mean. There are quite a few cool things going on down in Edinburgh, but it's all pretty much monopolised by the oil industry up here (and their bloody share points!)

4:51 ddellacosta: ucb: haha, gotcha.

4:52 ucb: :)

4:52 hyPiRion: ucb: Hah, monopolised by the oil industry?

4:52 * hyPiRion lives in Norway, go figure.

4:52 ucb: hyPiRion: absolutely. Aberdeen is (allegedly) the oil capital of Europe.

4:53 hyPiRion: ucb: That's more of an Aberdeeen thing, not Scotland itself, right?

4:53 ucb: hyPiRion: yeah, that's why I said that there are cool things going on in Edi/Gla. And until recently Dundee was a games-dev hive.

4:53 ro_st: oil be roight back

4:53 ucb: (until the big companies went bust)

4:54 hyPiRion: ah

4:55 ucb: for instance, in Edinburgh you've got startups like SkyScanner and big companies like Amazon. There used to be (don't know if it's still going) a startup that had built their product in erlang too (hyper numbers).

4:55 hyper numbers even

4:59 hyPiRion: Over here it's generally just Java, and perhaps some Scala.

4:59 I wouldn't be surprised if I could count the amount of Clojure programmers on two hands.

5:01 sheldonh: when you use (=) to compare something of unknown value against something of known value (i.e. actual and expected), is there a convention for which comes first)?

5:03 ucb: hyPiRion: I'd be surprised if I could use more than a single finger to count the number of clojure programmers up here ;)

5:03 ro_st: we use known first by convention

5:03 hyPiRion: ucb: Well, I don't mean professionally :p

5:03 ucb: hyPiRion: me neither

5:04 hyPiRion: oh :(

5:04 sheldonh: ro_st: thanks

5:10 ucb: hyPiRion: yeah, oh well. :)

5:10 there's always IRC and stuff

5:29 jave: hello

5:32 ucb: hey jave

5:58 Apage43: ucb: The guy who built hypernumbers was a coworker of mine for a while, nowadays he's at mozilla.

5:59 ucb: Apage43: interesting. Does that mean that HN is dead? (well, vixo now)

6:00 Apage43: ucb: probably. At least in the sense of being an erlang shop.

6:00 ucb: right

6:00 shame

6:02 Apage43: or the current guy seems to just be working on it by himself

6:03 * ucb has no idea who the current guy is

6:03 ucb: I hardly know Gordon for that matter :)

6:03 Apage43: current guy is gordon

6:03 old guy who worked on it way back was dale

6:04 ucb: oh, right, dale

6:04 it did sound weird that Gordon was with mozilla now

6:04 Apage43: yeah ha

6:05 Dale worked at Couch(One,Base) for a while, which is how I know him.

6:05 ucb: ah, I see. You sill work for CouchOne/Base?

6:06 Apage43: Yep.

6:06 (That is we were working for Couchone, which became Couchbase after acquisition)

6:06 ucb: cool

6:06 right.

6:07 Apage43: quite a bit of erlang here.

6:08 ucb: yeah, no kidding :) Erlang and C/C++ I take it?

6:08 Apage43: Pretty much.

6:09 * ucb nods

6:09 Apage43: a number of the extra tools that ship with it are python, but the server itself is erlang and C/C++

6:09 sheldonh: cool. you could call your staff directory Couchface.

6:13 Apage43: no clojure though (but I do use it for internal tools. Basically if noone tells me something has to be in any particular language it winds up being in Clojure.)

6:17 ucb: Apage43: nice :)

6:38 glosoli: hey, what's some good library for authentication ?

6:39 hyPiRion: $google clojure friend

6:39 Oh lazybot's still down

6:39 sheldonh: that is a very big hammer answer to a very poorly defined question

6:40 (but i'm probably just knee-jerking to big libraries for small jobs)

6:40 glosoli: well I need to control authentication of users for my web app, with various restriction rules for certain users on certain routes hmm

6:41 not sure how to be more detailed emm

6:41 I could add that I am using Ring and Compojure

6:41 hyPiRion: glosoli: https://github.com/cemerick/friend should work then

6:41 glosoli: thanks

6:43 sheldonh: if it ends up feeling big, but you still want a library, take a look at https://github.com/noir-clojure/lib-noir

6:44 glosoli: ok thanks, gonna check it out

7:34 TEttinger: hey #clojure: if I (declare width) and then have a function to initialize width, (defn init [w] (def width w)) , will that def act as I want it and fill up the declared variable name?

7:36 clgv: TEttinger: thats wrong usage. def's are always toplevel

7:36 TEttinger: clgv, thanks

7:36 clgv: TEttinger: if you really must, you can use alter-var-root but I suppose you should change your implementation to a more idiomatic one.

7:37 TEttinger: how should I do this... I need to initialize the array stuff in the main program, but main imports this other module, and the other module needs to use main's array stuff after it's been initialized

7:37 zRecursive: ,(doc ->)

7:37 clojurebot: "([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."

7:37 clgv: TEttinger: do you really need that global value? if so for some kind of registry you can use an atom or ref as its value

7:37 hyPiRion: Pass it as a value.

7:38 TEttinger: it is only so other functions can have access to a worldmap once it's generated

7:38 clgv: TEttinger: sounds like circular dependencies which you should resolve

7:38 TEttinger: hyPiRion, you're probably right

7:39 actually that would be a better policy

7:39 just pass around one state variable, mutate the state if needed, pass it on? continuation passing style, kinda

7:39 hyPiRion: yeah

7:40 TEttinger: In case it turns into a bit of an overhead to pass around, put dynamic vars into their own namespace, and on initialization do (binding [*width* w] (run-game-here))

7:40 clgv: sounds better that way ^^

7:40 hyPiRion: Won't handle mutation though, but it's at least good for constants

7:40 TEttinger: well unfortunately it needs much more than width, the width is so it can make sense of a 2d array...

7:41 hyPiRion: (binding [*width* w *array* arr] ...) then

7:41 in either case, you can put everything in a map

7:44 TEttinger: ok, so hyPiRion, you're saying I should have a 3rd namespace that just has state, and is probably the only place with state, and just use bindings to the dynamic vars when needed? will the bindings stop once the scope ends on binding ?

7:45 ohhh

7:45 I get it now

7:45 it's looking up the variable, when it's bound it finds the right one

7:45 hyPiRion: TEttinger: yeah, that's how I tend to do it for CLI apps where those variables doesn't vary.

7:45 TEttinger: these will change, just not often

7:46 hyPiRion: ah. Well, I'd put those in an atom then

7:47 TEttinger: yeah, I can just def an atom with a default value and then have init give it a real value. easy

7:54 thanks hyPiRion

7:54 hyPiRion: np

8:40 muhoo: wat? i'm confused. i'm enqueuing stuff into a lamina channel, and getting stack overflows.

8:40 oh, it's all one thread :-/

8:40 dammit.

8:41 mdrogalis: Mooorning.

8:45 arrdem: grrrr don't say that

10:12 borkdude: does anyone know how to run one single feature with lein cucumber? say I have a x.feature in features/subdir

10:25 vijaykiran: borkdude: lein cucumber features --name "FEATURE NAME" seems to work :)

10:27 borkdude: thanks

10:46 gfredericks: would a clojure.lang.ErrorInfo class be appropriate?

10:54 silasdavis: can I do better than (merge original (into {} key-value-pairs))?

10:55 gfredericks: ,(merge {1 2} [[3 4] [5 6]])

10:55 clojurebot: {[3 4] [5 6], 1 2}

10:55 gfredericks: o_O

10:56 silasdavis: yeah I was hoping that would work

10:56 gfredericks: oh dear

10:56 I think that happens because merge relies on the anomolous feature of conj

10:56 silasdavis: ,(merge {1 2} '([3 4] [5 6]))

10:56 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry>

10:57 silasdavis: ,(merge {1 2} '((3 4) (5 6)))

10:57 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.util.Map$Entry>

10:57 shoky: ,(into {1 2} [[3 4] [5 6]])

10:57 clojurebot: {1 2, 3 4, 5 6}

10:57 kaw: ,(into {1 2} [[3 4] [5 6]])

10:57 clojurebot: {1 2, 3 4, 5 6}

10:57 gfredericks: ,(into {1 2} [[3 4] [5 6]])

10:57 clojurebot: {1 2, 3 4, 5 6}

10:57 gfredericks: silasdavis: ^ howsabout that?

10:57 silasdavis: kaw, shoky yeah I was hoping to do better than that, see above

10:58 oh, yeah I don't need merge

10:58 ,(into {1 2} [[1 4] [5 6]])

10:58 clojurebot: {1 4, 5 6}

10:58 silasdavis: fine, duh, thanks

10:58 gfredericks: oh man I don't think I've ever been more unoriginal than that

11:01 silasdavis: hah, leading question

11:01 not to worry

11:03 gfredericks: I really like this catch-data lib I wrote a few months back

11:07 jjttjj`: anyone know of any good emacs packages that would demonstrate sending clojure code to nrepl in elisp? I'm blanking out here beyond clojure-test-mode

11:10 bja: jjttjj`: nrepl.el

11:11 technomancy: jjttjj`: nrepl-discover too

11:11 jjttjj`: Cool thanks!

11:12 f

11:32 serycjon: :exit

11:33 konr: :wq

11:34 ambrosebs: is there anything special in the leiningen dependency string needed to download the "slim" Clojure jars from sonatype?

11:34 "1.5.1-slim" doesn't seem to work.

11:37 squidz: with cljsbuild there are different builds that you can specify like {:builds :dev {...} :prod {...}..., but how do I specify I want to run only that which is in the :prod build?

11:37 xeqi: ambrosebs: try [org.clojure/clojure "1.5.1" :classifier "slim"]

11:39 TimMc: slim has docstrings and stuff removed?

11:39 ambrosebs: (inc xeqi)

11:39 thanks

11:39 llasram: lazybot is still sick?

11:40 hyPiRion: yes

11:40 ambrosebs: TimMc: just AOT.

11:40 llasram: Poor thing

11:40 * llasram sends flowers

11:40 ambrosebs: TimMc: I'm not using it, just working out how to make a core.typed slim jar.

11:40 seems to work!

11:41 silasdavis: ,(clojure.set/union [2 4 5] [2 4])

11:41 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>

11:41 llasram: silasdavis: all the clojure.set functions require their arguments to be sets

11:41 silasdavis: if that's the case don't you think it should throw an exception

11:42 rather than doing something unexpected

11:42 would be useful if it did a union and returned the input type, or at least a seq..

11:42 ?

11:42 hyPiRion: Well, first you need to require clojure.set

11:42 ,(require 'clojure.set)

11:42 clojurebot: nil

11:42 silasdavis: ,(clojure.set/union [2 4 5] [2 4])

11:42 clojurebot: [2 4 5 2 4]

11:43 hyPiRion: union is essentially a pretty way of saying into.

11:43 with some speed tweaks

11:45 justin_smith: ,(clojure.set/union #{:a} #{:b} #{:c})

11:45 clojurebot: #{:a :c :b}

11:45 justin_smith: ,(into #{:a} #{:b} #{:c})

11:45 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$into>

11:46 llasram: silasdavis: Potentially, but GIGO is a pretty firmly embedded Clojure error-handling idiom

11:46 coventry`: justin_smith: union uses (reduce into).

11:46 (For more than two arguments.)

11:47 justin_smith: it uses reduce conj for two args

11:47 coventry`: Yeah, I'm trying to figure out why that is.

11:47 mimieux: Hi all!

11:49 silasdavis: llasram, that's fair enough if it is garbage, but taking a union on non-sets is quite useful

11:50 bmabey: tbaldridge: this report is more for you but jira automatically assigned it to Rich: http://dev.clojure.org/jira/browse/ASYNC-22

11:50 silasdavis: ,(clojure.set/union #{2 4 5} [2 4])

11:50 clojurebot: #{2 4 5}

11:50 coventry`: Oh, into does (reduce conj) too, but there's some extra logic...

11:50 silasdavis: ,(clojure.set/union [2 4] #{2 4 5})

11:50 clojurebot: #{2 4 5}

11:51 tbaldridge: bmabey: yeah, that's a bug, there's about 20 different versions of (. ) and I missed a few.

11:51 coventry`: ,(clojure.set/union [2 4 5] #{2 4})

11:51 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>

11:51 tbaldridge: bmabey: in the mean time, why not use (Numbers/add 1 2) ?

11:51 mimieux: Given the following (fn [& {:keys [host port]}] (println (str host ":" port)), is there a way to apply the following map {:host "localhost" :port 5555}?

11:51 to match the fn args?

11:52 silasdavis: ,(clojure.set/union [2 4 5] #{2 4})

11:52 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>

11:52 silasdavis: ,(clojure.set/union [2 4] #{2 4 5})

11:52 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>

11:52 silasdavis: oh times out does it

11:52 bmabey: tbaldridge: I would if I was writing the code by hand but this other form is being emitted by another macro

11:52 silasdavis: ,(require '[clojure.set :as set])

11:52 clojurebot: nil

11:52 silasdavis: ,(clojure.set/union [2 4 5] #{2 4})

11:52 clojurebot: [2 4 5 2 4]

11:52 coventry`: Anyway, that form returns [2 4 5 2 4], because set orders the arguments by length.

11:52 silasdavis: ,(clojure.set/union #{2 4 5} [2 4])

11:52 clojurebot: #{2 4 5}

11:53 coventry`: Seems a little sketchy. :-)

11:53 silasdavis: ,(clojure.set/union [2 4] #{2 4 5})

11:53 clojurebot: #{2 4 5}

11:53 silasdavis: ,(clojure.set/union [2 4 5] #{2 4 5})

11:53 clojurebot: [2 4 5 2 4 ...]

11:53 silasdavis: coventry`, yes!

11:54 is there a forum for suggesting improvements to core libraries?

11:54 AimHere: ,(clojure.set/union '(2 4) #{2 4 5})

11:54 clojurebot: #{2 4 5}

11:54 AimHere: ,(clojure.set/union '(2 4) [2 4 5])

11:54 clojurebot: [2 4 5 2 4]

11:54 silasdavis: ,(clojure.set/union '(2 4 5) #{2 4 5})

11:54 clojurebot: (5 4 2 2 4 ...)

11:54 silasdavis: ,(clojure.set/union '(2 4 5 6) #{2 4 5})

11:54 clojurebot: (5 4 2 2 4 ...)

11:54 AimHere: It's just conjing the elements of one onto t'other

11:54 silasdavis: ,(clojure.set/union '(2 4 5 6) #{2 4 5 7 8})

11:54 clojurebot: #{2 4 5 6 7 ...}

11:55 AimHere: And hoping that the result is still a set

11:55 ,(clojure.set/union [[:a :b] [:c :d]] {:foo :bar})

11:55 clojurebot: [[:a :b] [:c :d] [:foo :bar]]

11:55 AimHere: ,(clojure.set/union {:foo :bar} [[:a :b] [:c :d]] )

11:55 clojurebot: [[:a :b] [:c :d] [:foo :bar]]

11:56 silasdavis: yeah and it's using the count to decide the order

11:56 it makes sense from the implementation, but it's not very nice for a consumer

11:57 AimHere: ,(clojure.set/union [:foo :bar] {:a :b, :c :d} )

11:57 clojurebot: [:foo :bar [:a :b] [:c :d]]

11:57 AimHere: ,(clojure.set/union [:foo :bar] {:a :b, :c :d :e :f} )

11:57 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>

11:58 AimHere: I think I'll just use clojure.set/union for set unions and nothing else

11:58 silasdavis: ,(#(into #{} %1 %2) [2 3 4 5] [2 3 4])

11:58 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$into>

11:59 seangrov`: dnolen: re: the warnings, I meant it as a warning to anyone with existing code. It's a small change, and not much of a big deal. Not proposing any warnings be emitted from the compiler.

11:59 silasdavis: ,(#(into (into #{} %1) %2) [2 3 4 5] [2 3 4])

11:59 clojurebot: #{2 3 4 5}

11:59 silasdavis: would that be such a bad union implementation?

11:59 Chousuke: for vectors? I don't think you can get any better

11:59 unless the vectors are sorted already

12:01 hyPiRion: the easiest one is probably just (defn union [& colls] (reduce into #{} colls))

12:02 AimHere: hyPiRion, The actual implementation doesn't look all that different from that

12:03 hyPiRion, except in the case where there are only two collections

12:04 hyPiRion: or one, or zero.

12:05 silasdavis: what would be the best way to propose a change, do they accept pull requests?

12:06 coventry`: http://clojure.org/contributing

12:11 seangrov`: ClojureCup looks like fun http://clojurecup.com/

12:16 dnolen: seangrov`: oh got it, yes, thanks for bringing it up!

12:29 xeqi: ambrosebs: are you making the "normal" core.typed lib contain :aot'd code?

12:29 ambrosebs: xeqi: yes

12:29 xeqi: are there issue with that and changing clojure versions?

12:32 ambrosebs: xeqi: I'm not sure.

12:32 xeqi: for some reason I have an understanding that code :aot'd on 1.5.1 might not work on 1.4, or say 1.6. but I can't find any reference for that

12:32 ambrosebs: Ok, I'm targeting 1.5.1 atm so I haven't tested others.

12:36 clgv: xeqi: thats right there were some problems with changed implementation API. compiling with java 7 and running on java 6 (or earlier) wont work as well

12:38 ambrosebs: good to know.

12:42 dnolen: tbaldridge: we might need to clean up some things in core.async to account for keywords change in ClojureScript?

12:43 tbaldridge: dnolen: I assume identical? no longer works?

12:43 dnolen: tbaldridge: it no longer works, if you want to compare keywords you have to use keyword-identical?

12:43 tbaldridge: or just use =

12:44 tbaldridge: dnolen: yeah, it kindof stinks that we'll have to take the performance hit there, but I guess it can't be helped

12:45 dnolen: tbaldridge: I'd expect the hit to be pretty small based on my tests with ArrayMap. From what I tell a much bigger hit from all these superflous fns that showed up after bumping Closure.

12:45 tbaldridge: dnolen: I'm not sure that we will need to change it. the only place I use identical? with keywords is with compile-time constants. I don't think we'd ever get a runtime keyword in those places.

12:46 dnolen: oh yeah, that we should also take a look at.

12:46 or should we just wait for a better code generator in the compiler?

12:47 dnolen: tbaldridge: CLJS ANF pass to optimize away these extra fns is on my todo list

12:48 tbaldridge: to be clear you just can't use identical? with keyword anymore, doesn't matter if compile time constants because of incremental compilation

12:48 tbaldridge: we only generate the constants table under advanced optimizations

12:48 tbaldridge: thus the tests fail under simple because of presence of identical? + keywords usage

12:48 tbaldridge: pretty sure if we fix those, everything will work again

12:50 silasdavis: Is there a more succint way of writing:

12:50 ,(mapcat (fn [[k vs]] (map (fn [v] [k v]) vs)) {:a [1 2 3] :b [4 5 6]})

12:50 clojurebot: ([:a 1] [:a 2] [:a 3] [:b 4] [:b 5] ...)

12:50 silasdavis: sort of an associative expansion

12:51 I mean in terms of higher order functions

12:51 ucb: silasdavis: you could try with (fn [[k vs]] (interleave (repeatedly k) vs)) instead of the map

12:52 xeqi: &(for [[k vs] {:a [1 2 3] :b [4 5 6]} v vs] [k v])

12:52 ucb: (mapcat (fn [[k vs]] (interleave (constantly :a) vs) {:a [1 2 3] :b [4 5 6]})

12:52 silasdavis: ucb, yes think I prefer that, thanks

12:52 xeqi: ,(for [[k vs] {:a [1 2 3] :b [4 5 6]} v vs] [k v])

12:52 clojurebot: ([:a 1] [:a 2] [:a 3] [:b 4] [:b 5] ...)

12:52 ucb: eek, constantly I think

12:52 ,(doc constantly)

12:52 clojurebot: "([x]); Returns a function that takes any number of arguments and returns x."

12:52 ucb: ,(doc repeatedly)

12:52 clojurebot: "([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"

12:53 ucb: :/

12:53 silasdavis: (repeat k)

12:53 ucb: I always forget which one it is ...

12:53 ,(doc repeat)

12:53 clojurebot: "([x] [n x]); Returns a lazy (infinite!, or length n if supplied) sequence of xs."

12:53 ucb: yeah, that one :)

12:53 tbaldridge: dnolen: yeah, perhaps I'll figure out a better way to do looping then. As in tight loops we'll be executing a ton of identical? checks (one per SSA block).

12:54 I can always make a singleton object and then do identical? on that.

12:54 silasdavis: xeqi, that's nice thanks

12:59 dnolen: tbaldridge: yes but like I said I did months of perf testing between in master and possible keyword changes before landing - tight loop array scans where we call keyword-identical? at least 7 million times takes still < 95msec

12:59 tbaldridge: so I think cost is going to be negligible

13:00 tbaldridge: dnolen: okay, perhaps the perf is different in CLJS then. On the JVM, moving from = to identical? was one of the first things that jumped out at me when I ran the profiler.

13:00 dnolen: tbaldridge: yes = is a bit hit because not fast fail.

13:01 tbaldridge: if perf is the most important think keyword-identical? fits the bill

13:01 s/think/thing

13:17 silasdavis: inverse to my last request, can anyone do better than:

13:18 ,(reduce (fn [acc [k v]] (update-in acc [k] (partial cons v))) {} [[:a 1] [:a 2] [:a 3] [:b 4] [:b 5] [:b 6]])

13:18 clojurebot: {:b (6 5 4), :a (3 2 1)}

13:18 silasdavis: to factor the expansion

13:20 sdegutis: Is there any doc containing the rationale for why technomancy made project.clj not just be a data-structure but actual code? Do that many projects/plugins need to compute values within it?

13:23 dissipate__: sdegutis: he's clearly out of control and must be stopped

13:24 sdegutis: There could be a perfectly legitimate reason.. I'm just wondering if the rationale is documented anywhere.

13:26 mdrogalis: sdegutis: Yeah I always wondered it myself sdegutis

13:26 sdegutis: I think it would be easier for IDEs to parse if it was just a Clojure-map in a file that's implicitly wrapped in (quote).

13:27 Not that this can change now, but I'm thinking for the future.

13:28 xeqi: sdegutis: I've seen uses where computed values are important, but google is failing me

13:28 also, lein plugins can alter the project map, so for an IDE to get the real map used, it would have to reimplement the plugin mechanism

13:28 callen: dnolen: is there a document that outlines the "what you should know" semantic differences between Clojure and ClojureScript? And perhaps more relevantly, which of those differences are and aren't likely to change in the future.

13:28 sdegutis: xeqi: I've seen uses where they're used, such as to compute the version from a version.clj file, but that isn't necessary, just (questionably) conveneitn.

13:29 dnolen: callen: the github wiki

13:29 sdegutis: xeqi: Oh, that's sneaky.

13:29 xeqi: or just use the leiningen.core.project api

13:29 callen: dnolen: thanks

13:29 xeqi: sdegutis: or nicely extendable

13:29 sdegutis: xeqi: Oh yeah, I suppose I can use that from an external project. Thanks :)

13:30 danielszmulewicz: Is there a leiningen API? I would like to get a list of locally installed leiningen plugins programmatically.

13:30 sdegutis: xeqi: Implicit things always make me raise an eyebrow. Not that they're not good, I just use extra caution with them.

13:31 xeqi: danielszmulewicz: as in the ones specified by :plugins in the project map?

13:31 danielszmulewicz: Actually, I would like to know those in profiles.clj

13:31 but yes, under the :plugins key

13:35 xeqi: danielszmulewicz: there are some private functions in https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/project.clj that might be useful. but profile handling is the ugliest part of lein's code base. Maybe hyPiRion or technomancy would have a better idea

13:36 danielszmulewicz: xeqi: right, I'm perusing the docs, thanks.

13:36 xeqi: danielszmulewicz: what would you do with a list of plugins from each profile?

13:37 danielszmulewicz: xeqi: I'm depending on a particular plugin, if it is not found, I want to halt the program

13:38 xeqi: danielszmulewicz: can you add that plugin to your plugins :dependencies to make sure its there?

13:39 danielszmulewicz: xeqi: yes, you see, I'm depending on environ plugin, it needs to be set both in the dependencies, and in the profiles for added functionality

13:39 xeqi: https://github.com/weavejester/environ

13:41 callen: clojure.walk is...really nice.

13:41 danielszmulewicz: xeqi: I wrote a template for global use. That template defines `environ` in the dependencies, so that's good. But I also want users to configure their profiles.clj as per the plugin.

13:42 xeqi: if that makes sense...

13:42 xeqi: I don't understand the last sentence

13:43 if you need profiles set up a certain way, why not have the template add them to the project.clj?

13:43 danielszmulewicz: xeqi: right, that would work too. I'm stoopid.

13:44 callen: every time I use :refer :all I end up regretting it.

13:45 danielszmulewicz: xeqi: thanks. That's the best solution.

13:45 xeqi: danielszmulewicz: np

13:55 dnolen: callen: I don't really forsee any other big changes that aren't specifically related to ClojureScript in ClojureScript. These latest round of changes are something we've been pondering for more than a year

13:55 znusgy: hello -- I'm using map-key in seesaw and it works until I change focus to another window and back again (https://gist.github.com/anonymous/6498817) -- any idea why?

13:56 zphds: am goofing around with clojure.async. Is a 'go' block without '!<', '>!', 'alts!' as same as a 'thread' block?

13:56 since both of them return a channel

13:56 callen: dnolen: cool. Thanks for all your work :)

14:06 danielszmulewicz: I published a new template on clojars which is a fleshed out example of Stuart Sierra's reloaded workflow. A blog post will be published in the coming days, but you can already see/test it with: `lein new reloaded2 my-app`. I would love to have confirmation that `lein with-profile production run` successfully starts a server on port 8000. Thanks.

14:09 muhoo: OT, but is there a simple commandline linux tool that'll decode ics or exchange vcalendar into readable human text?

14:11 callen: muhoo: http://tewok.com/software/vcal-2.2

14:15 glosoli: ah this damn ac-nrepl was driving me nuts believing that it was Emacs who caused various crashes

14:15 danielszmulewicz: I remember reading an announcement of a new project that draws a chart of namespaces in svg. Alas, I can't remember the name. Anyone?

14:16 glosoli: still no company equivalent?

14:16 glosoli: danielszmulewicz: what's no company equivalent emm

14:16 danielszmulewicz: glosoli: company is the rival of autocomplete

14:17 http://www.emacswiki.org/emacs/CompanyMode

14:17 glosoli: http://company-mode.github.io/

14:17 Raynes: glosoli: I gave up on ac-nrepl after many long days of blood sweat and tears.

14:17 glosoli: danielszmulewicz: wow thanks, gonna check this out

14:17 Raynes: Yeah, but for me it was different I sincerely believed it was Emacs fault lool

14:19 danielszmulewicz: glosoli: I think it was Steve Purcell who said there was no reason that autocomplete in the nrepl should depend on ac.

14:19 justin_smith: oddly, I recently switched to using ac and ac-nrepl, and have yet to see an issue

14:19 callen: technomancy: can I get you to push limit-break to clojars?

14:20 glosoli: danielszmulewicz: correct me if I am wrong, Company Mode is a replacement for Ac yes ?

14:20 borkdude: I have trouble finding an element with clj-webdriver containing a &nbsp; "//tr[td[normalize-space()='€${nbsp}1,00']]" doesn't seem to do it. any advice?

14:21 danielszmulewicz: glosoli: yes, and it's pretty fine one, too. Although I stopped bothering with autocomplete modes.

14:21 glosoli: danielszmulewicz; thanks for suggetions!:) gonna try it now

14:22 danielszmulewicz: glosoli: just remember it won't work in the nrepl

14:22 glosoli: and there's no clojure I believe

14:22 glosoli: danielszmulewicz: hmm damn :D

14:23 danielszmulewicz: glosoli: Ah, I found it: https://github.com/clojure-emacs/ac-nrepl/issues/30

14:24 glosoli: but I think company-mode can use ac as a back-end

14:26 ystael: danielszmulewicz: regarding the svg namespace graph, you may be thinking of itmmc/nephila ?

14:26 *timmc

14:27 danielszmulewicz: ystael: thanks! that's the one! Spot on!

14:28 muhoo: yay, emacs, M-x icalendar-import-file :-)

14:28 glosoli: danielszmulewicz: I don't seem to get the concept of company hmm it's supposed to be similar to ac-nrepl if it had clojure backend or what ?

14:28 callen: muhoo: you didn't try the link I sent? :(

14:29 danielszmulewicz: glosoli: it's supposed to be like ac (autocomplete), not ac-nrepl

14:29 glosoli: danielszmulewicz:Not that I am ware of, but what's so wrong with ac (autocomplete0?

14:29 danielszmulewicz: glosoli: it's a global autocompletion framework.

14:30 glosoli: I never said anything was wrong with it.

14:30 glosoli: danielszmulewicz: aa I might be assuming too much most of the times, sorry :)

14:30 danielszmulewicz: glosoli: :-)

14:30 TimMc: danielszmulewicz: It doesn't do SVG yet, but maybe someone will send me that pull request. (Probably an easy enhancement.)

14:31 danielszmulewicz: TimMc: Oh, I've mixed it up (I must have though about liberator's svg tracing output). Never mind, png is mighty fine too :-)

14:32 dissipate__: i have a book reading plan: clojure programming -> on lisp -> let over lambda -> learn you a haskell. anyone have any other recommendations?

14:32 danielszmulewicz: dissipate_: start with "on lisp"

14:32 dissipate_: it's the most important one of the three (not talking about haskell)

14:32 dissipate__: danielszmulewicz: i thought that was an intermediate/advanced book?

14:33 callen: dissipate__: do not start with on lisp.

14:33 dissipate__: hehe

14:33 callen: dissipate__: start with clojure programming.

14:33 dissipate__: I would consider doing Joy of Clojure after Clojure Programming, were I you.

14:33 amalloy: &(shuffle '(CP OL LoL LYAH))

14:33 danielszmulewicz: dissipate__: no, "on lisp" is about the philosophy of lisp, it's very gradual and beginner's friendly

14:33 dissipate__: callen: so my plan is good?

14:33 amalloy: Raynes: where is lazybot?

14:33 callen: dissipate__: yes, but I'd add JoC. It's exceptional.

14:33 amalloy: being lazy, apparently.

14:34 danielszmulewicz: +1 for the joy of clojure

14:34 callen: amalloy: you'll get your thunks later.

14:34 dissipate__: callen: isn't JoC weak on macros?

14:34 Raynes: amalloy: MIA. I'll put out a BOLO for him.

14:34 danielszmulewicz: dissipate__: yes it is

14:34 for macros read "on lisp"

14:34 callen: dissipate__: JoC is so you don't write code other people hate and learn Clojure idioms and philosophies. macros are included, but they're just one tool in the toolbox.

14:35 dissipate__: danielszmulewicz: i'll get to 'on lisp'

14:35 callen: dissipate__: you really need to cool your fucking jets on the macros. They're not the end-all be-all.

14:35 ystael: <- read JoC, writes code other people hate anyway

14:35 mtp: macros are a good tool

14:35 Raynes: lols

14:35 mtp: they are not for everything

14:35 callen: I love macros, but I don't eagerly seek excuses to use them either.

14:35 dissipate__: ok, so it is: clojure programming -> joy of clojure -> on lisp -> let over lambda -> learn you a haskell

14:35 callen: dissipate__: excellent.

14:35 mtp: i would move On Lisp to the end

14:36 danielszmulewicz: dissipate__: "on lisp" will teach you everything important about lisp, then read "joy of clojure" which is clojure specific but also very philosophical

14:36 Raynes: Ugh, no.

14:36 callen: danielszmulewicz: nope.

14:36 mtp: CljPr -> LoL -> Joy -> LYAH -> On Lisp

14:36 but that's just me. :)

14:36 callen: mtp: LoL needs to be later and preferably after On Lisp.

14:36 dissipate__: mtp: isn't let over lambda an advanced text?

14:36 callen: dissipate__: quite.

14:36 Raynes: dissipate__: Just read Programming Clojure or JoC or both. Don't read On Lisp first, please. There is no reason to read a book with examples in a different Lisp when there are excellent books already available for Clojure specifically.

14:36 mtp: really?

14:36 danielszmulewicz: dissipate__: yes, very hardcore

14:37 callen: LoL is really just a more advanced On Lisp IMHO

14:37 mtp: I only flipped through LoL; it seemed rather practical and down-to-earth to me

14:37 my head is kind of on upside-down, though :)

14:37 dissipate__: danielszmulewicz: cool. i'm loading these up on my kindle paper white.

14:37 danielszmulewicz: Clojure is built on the shoulders of a giant, and that giant is Lisp

14:38 callen: danielszmulewicz: what part of On Lisp did you like best?

14:38 Raynes: More importantly, why isn't there a homebrew formula for these silly opinions?

14:38 danielszmulewicz: callen: everything I should say

14:38 callen: you can't learn Clojure without learning Lisp in the process, so it's best to just learn Clojure so you don't spend your first year(s) of Clojure writing CL'ish Clojure (like I did)

14:38 danielszmulewicz: Raynes: ah, you still feel hurt

14:38 callen: danielszmulewicz: really? lets get specific. What was your favorite part?

14:39 I know what mine was. What's yours?

14:39 danielszmulewicz: I sense a vendetta here

14:39 ystael: is there actually useful information in Let Over Lambda? i was put off early on by the incredibly smug tone and never went back to it

14:39 Raynes: I'm less hurt as I am surprised that you're giving such bad advice to people at the moment.

14:39 callen: ystael: you're not missing much unless you're a CL fascist like me.

14:39 Raynes: If you're learning Clojure, read a Clojure book. Don't read a book on macros for another Lisp. Read that later when you need to learn more.

14:39 danielszmulewicz: Just voicing my opinion, and respecting other's too

14:39 callen: OL and LoL are best for firming up Lispy/macro patterns after you've been writing Clojure for awhile.

14:40 danielszmulewicz: it's all good

14:40 dissipate__: Raynes: unfortunately, AFAIK, there are no in depth macro books in clojure :(

14:40 Raynes: Because you don't need them.

14:40 callen: that's doing a disservice to JoC. I think it covers them sufficiently.

14:40 dissipate__: Raynes: why not?

14:40 callen: you seriously should not be diving into heavy-duty macro-ology. Clojure is powerful enough to have more than one tool in the box.

14:40 Raynes: Because you don't.

14:40 You just simply do not use macros *that* often, and usually if they're so complex you need a whole book to be written on the topic, you're screwing something up somewhere very badly.

14:41 dissipate__: Raynes: so clojure programming + joy of clojure is enough?

14:41 danielszmulewicz: Agreed, you don't jump in writing macros

14:41 Raynes: Yes. And then On Lisp will still be there after you've learned Clojure.

14:41 It has lots of good stuff to teach, but it's not somewhere you start.

14:41 callen: dissipate__: I'd say so. You should go off and just use Clojure for awhile after reading CP and JoC. You can decide later if you have something else you want to learn.

14:42 dissipate__: Raynes: hmm, strange. everyone keeps saying one of the main features of lisp/clojure is macros. :P

14:42 kaw: Hm, I'm trying out core.typed, should I be able to typecheck (defn f [xs] (map str xs)) as [(NonEmptySeqable Number) -> (NonEmptySeqable String)]?

14:42 Raynes: It's a selling point. Macros allow you to do amazing things, dissipate__.

14:42 danielszmulewicz: dissipate__: you can peruse them all and develop a sense of what's best for you

14:43 Raynes: It's just that you don't need to do that level of metaprogramming that often, and when you do you usually don't need super complex stuff to do what you want.

14:43 callen: dissipate__: macros make things possible that aren't in other languages in the form of libraries, but you only need to write core.async once.

14:43 Raynes: Macros are to be avoided unless they are expressly needed.

14:43 kaw: I first tried it as just Seqable, but then I'm not allowed to pass it to reduce, so I think I need it to understand that map preserves nonemptiness

14:43 callen: you should make a concerted effort to exhaust other possibilities before resorting to them.

14:43 Raynes: And usually they're just a colorful layer on top of a function-based API.

14:43 dissipate__: Raynes: that's good to know. so these advanced texts on macros are mostly for theoretical exploration?

14:44 callen: dissipate__: partly. you need to understand that CL users used macros a lot because they didn't have much else to work with.

14:44 Raynes: danielszmulewicz: There is no vendetta here. I'm not dismissing your opinion, I'm worried that it is a damaging opinion for this new Clojure developer. Please take no personal offense.

14:44 callen: dissipate__: they had to fashion their own bizarre universes from macros and banging things together in order to get things done.

14:44 we have better tools now

14:44 ztellman: 2001: A Clojure Odyssey

14:44 dissipate__: callen: so in clojure functions are used a lot more?

14:45 Raynes: Tons tons tons more.

14:45 Functions in Clojure are the bee's knees, its legs, and potentially its arms.

14:45 dissipate__: that's good since they are easier to compose

14:45 Raynes: </eminem quote>

14:45 callen: dissipate__: much.

14:46 danielszmulewicz: Raynes: No problem, it is the homebrew reference here that made me think so, and the youtube video that you sent me showing the feeling of entitlement you display regarding the community. I appreciate that, too, mind you, but there is a diversity of opinion that needs to be maintained and respected.

14:46 dissipate__: BTW, has anyone gained any insights into clojure/lisp by learning haskell?

14:47 nDuff: dissipate_: Haskell is worth learning for insight into pure functional programming -- which is certainly relevant in Clojure.

14:47 callen: dissipate__: some, but I wouldn't worry about it for now.

14:47 Raynes: danielszmulewicz: Entitlement?

14:47 Do elaborate.

14:47 callen: I really want to see the video.

14:47 my morning needs this.

14:48 Raynes: I do recall sending him a video, but I don't know what it is and certainly can't imagine how it could show 'entitlement'

14:48 callen: well if either of you can dredge up a link, I'd be appreciative.

14:48 dissipate__: callen: yeah, i'm definitely not worrying about haskell for quite awhile. the haskell community seems steadfastly committed to native binary executables.

14:48 danielszmulewicz: Raynes: Well, that's how I interpreted the video, but I'll be glad to hear your intention…

14:49 dissipate__: callen: when i even inquired about developing an interpreter or a JVM compiler, they snapped at me in #haskell.

14:49 callen: lol.

14:49 dissipate__: they do that a lot.

14:50 dissipate__: if you want to make them really mad, write trivial applications in terms of unsafePerformIO

14:50 dissipate__: i pointed out that a huge chunk of industry has moved away from native binary executables. i guess they don't care.

14:50 callen: and do all your control flow in Cont

14:50 danielszmulewicz: Raynes: it was a family guy video, you don't remember?

14:50 Raynes: Oh wait!

14:50 callen: dissipate__: they don't. I wouldn't mind native binaries sometimes, but yeah, they're kinda defensive.

14:50 Raynes: danielszmulewicz: Are you sure it was a family guy video and not a Me Myself and Irene video of Jim Carrey taking a dump on someone's lawn?

14:50 technomancy: to me haskell and ocaml are interesting *because* they produce native binaries

14:51 dissipate__: callen: no web development shop i know of is doing native binaries.

14:51 tbaldridge: (inc technomancy)

14:51 ztellman: Raynes: what on earth is going on in this conversation

14:51 lazybot: ⇒ 74

14:51 glosoli: heh I actually loved how some guy in haskell room spent hour convincing me to use Emacs, it all ended up very well lol

14:51 kaw: Hmm, anyone have any idea about my question about core.typed? I'm guessing there's probably some way to get (reduce g (map f xs)) to typecheck?

14:51 danielszmulewicz: Raynes: Same scenario, different video

14:52 callen: ztellman: I'm a little confused but I know the origins of this one, it's pretty great.

14:52 trying really hard not to break out into rasping, hacking laughter at the office right now.

14:52 coventry`: Welcome back, lazybot.

14:52 Raynes: danielszmulewicz: Regarding the Homebrew formula, callen and I were simply taken by surprise that even after numerous core Clojurescript developers kept telling you that a cljs formula was a bad idea you kept at it for no particular reason other than to seemingly just get a strange victory. You can see how that feels a little like having someone do bad things to your lawn, right?

14:52 dissipate__: technomancy: but industry has moved firmly away from native binaries. i'm no fan of industry but there are advantages to virtual machines and interpreters. at least have the option of using one of those.

14:53 technomancy: dissipate__: who cares what "the industry" is doing?

14:53 if you want ML on a VM, you use F#

14:53 danielszmulewicz: Raynes: That's why I'm saying feeling of entitlement, you equate clojure community with your private lawn

14:53 dissipate__: technomancy: apparently we do, that's why we aren't using common lisp, and compiling to the JVM, right?

14:53 Raynes: danielszmulewicz: I said 'our', not 'my'.

14:54 Feel free to change it to 'theirs'. I don't use cljs.

14:54 danielszmulewicz: Raynes: Our is mine too

14:54 technomancy: dissipate__: it's good for somethings and bad for some things

14:54 I'm glad there are options

14:54 rhg135: i'm wondering how equality on strings work being java objects

14:54 technomancy: if every good language targetted the JVM it would be horrible

14:54 dissipate__: technomancy: would haskell be ruined if there was a good interpreter written for it that was ported to a number of architectures?

14:55 hyPiRion: rhg135: first you check if they have the same pointer, then length, then char-by-char. (I would guess)

14:55 technomancy: I don't know anything about haskell specifically

14:55 rhg135: so it's inefficient?

14:55 Raynes: There is no entitlement here danielszmulewicz. That's exactly why we requested core devs comment on it instead of pretending we were the end all and be all of opinions on the matter. You're singling me out for no particular reason. When people started disagreeing with you, that became their lawn. You continued and… now the… lawn… We should stop with the lawn metaphors.

14:55 dissipate__: *shrug*, maybe the native binary thing bugs more more than it should

14:56 hyPiRion: How would it be more efficient?

14:56 Raynes: Anyways, we've been clogging up this channel with nonsensical stuff that is said and done for a bit too long already.

14:56 Ember-: you can download haskell compiler for multiple platforms, I fail to see the problem here

14:56 muhoo: alright, i'm puzzled by a mundane matter: why at-at jobs just disappear from the schedule queue even though they are still running,and blocking, AFAICT

14:56 callen: danielszmulewicz: you had active ClojureScript devs saying it was a bad idea in the thread. Have you even so much as looked at the source to the compiler?

14:56 muhoo: need a little more context.

14:56 Ember-: VM is great to have but it is *not* an ultimate solution which suits into every situation

14:56 muhoo: zombie functions that can't be killed

14:56 coventry`: muhoo: Have you seen this? http://code.nomad-labs.com/2011/12/09/mother-fk-the-scheduledexecutorservice/

14:56 callen: muhoo: at-at?

14:56 dissipate__: Ember-: never said it was. i'm just saying, have it as an option.

14:56 muhoo: coventry`: yeah, i posted it here last night :-/

14:57 dbe: Is 'vec' more efficient then 'apply vector'? Why does 'vec' exist, is it just a shortcut?

14:57 Raynes: ztellman: It's Monday, man.

14:57 Ember-: dissipate__: different language then, you usually design your language based on a fact if you're going to run it on top of a VM or not

14:57 muhoo: at-at does use that service, and i am wrapping all my functions, that's not the problem

14:57 dissipate__: Ember-: for instance, you can compile python scripts to native binaries.

14:57 ztellman: Raynes: lawn metaphor Monday

14:57 Raynes: Yes.

14:57 callen: ,(vector "abc")

14:57 clojurebot: ["abc"]

14:57 callen: ,(vec "abc")

14:57 clojurebot: [\a \b \c]

14:57 Ember-: sure, that doesn't make em fast (python built as binaries that is)

14:57 and you lose the portability

14:57 tbaldridge: dissipate__: not exactly...it's more like bundling them with the interpreter vm

14:58 dbe: callen, Huh. Interesting.

14:58 Ember-: and yes, I was thinking that too

14:58 muhoo: the problem is that i've got a long-running function, i know it blocks forever, it's gotten itself into a weird lop state, and it's not showing up in the pool at all

14:58 Ember-: that python binaries have just the vm with em

14:58 dbe: ,(apply vector "abc")

14:58 clojurebot: [\a \b \c]

14:58 callen: muhoo: what pool? is this a library?

14:58 Raynes: callen: I think he is talking about samaaron's at-at.

14:58 dissipate__: Ember-: that's true. i realize there is a difference compiling for native vs. VM. native executables just feels old to me i guess. i haven't done native executables for years.

14:58 muhoo: i am indeed

14:59 Raynes: https://github.com/overtone/at-at

14:59 callen: ^

14:59 Ember-: dissipate__: neither have I but that doesn't mean I would never do those

14:59 muhoo: and sam does not appear to be about at this hour of the day/night/etc

14:59 Ember-: there is very much place for native apps

14:59 and it would be horrible to make all those ppl making native apps to just use c or c++

14:59 :)

14:59 dissipate__: Ember-: yep, systems programming. but haskell is not good for that either.

14:59 mattmoss: c++ ftw yah woot

15:00 don't deny haterz

15:00 lolz

15:00 rhg135: ohnoez

15:00 hyPiRion: $seen lazybot

15:00 lazybot: lazybot was last seen joining on #eleventhbit 24 minutes and 39 seconds ago.

15:00 Ember-: I for one am typing this message in iterm which has a ssh connection to my server running irssi

15:00 hyPiRion: Ohai, it's back

15:00 muhoo: oh wait, maybe he sends them off to a different thread and doesn't hold on to the return vals. or maybe scheduledwhateverthign does

15:00 Ember-: all native apps

15:00 Raynes: hyPiRion: You just found a bug.

15:00 Ember-: I see no point in doing that stuff with vm based software

15:00 Raynes: hyPiRion: The channel is ##eleventhbit, not #eleventhbit.

15:00 Ember-: maybe irssi, but well... Not really

15:01 VM has an overhead always, you don't create small utility apps with it

15:01 hyPiRion: Raynes: wehey, everyday usage

15:01 ToxicFrog: Ember-: I do!

15:01 rhg135: i agree

15:01 Ember-: in my opinion: VM based languages for "big" apps, native for performance critical or small apps

15:01 ToxicFrog: But they talk to the remote systems, so the ~5 seconds to start up the JVM is inconsequential compared to the time it takes to make 20+ HTTP round trips.

15:01 rhg135: the jvm is way too slow to start for scripts et al

15:01 dissipate__: Ember-: that's true. everything has tradeoffs.

15:02 danielszmulewicz: Raynes: Oh, here's the link you've sent me: http://www.youtube.com/watch?v=lGOzOfMMuYQ

15:02 ToxicFrog: Ember-: also, not all VMs are as slow to start up as the JVM. Try any Lua implementation, for starters.

15:02 Raynes: Ah!

15:02 dissipate__: rhg135: yep. that eliminates clojure from being used as a scripting language. but there is Racket.

15:02 Ember-: yes, and dart vm starts in under 200 ms

15:02 muhoo: hmm well in this case the error may have been caused by catching without rethrowing something. but still.

15:02 rhg135: ik

15:02 Raynes: danielszmulewicz: The video is pretty funny though, right?

15:02 :)

15:02 coventry`: Is it possible to infer from the organization of clojure/test/clojure/test_clojure/ which test files pertain to core.clj?

15:02 rhg135: the jvm is awesome tho

15:02 Ember-: there's the memory penalty too with VMs

15:02 hyPiRion: well, the clojure jvm implementation is at least a bad fit for scripting

15:02 danielszmulewicz: Raynes: Yes, but showing clear signs of entitlement imho

15:03 Raynes: danielszmulewicz: lol, okay man.

15:03 Ember-: small long running apps each having their separate VM is not such a good idea

15:03 hyPiRion: Clojure itself may be a better fit if some native implementation existed

15:03 danielszmulewicz: Raynes: cool

15:03 Ember-: even if memory is cheap these days

15:03 but anyway, I'm not bashing VMs, not at all

15:03 rhg135: llvm clojure needs to be a thing

15:03 Ember-: like I said, I do 95% of my coding with VM based languages such as Clojure or Java

15:04 but I do recognize the need for native apps beyond system level programming and imho saying that they are irrelevant today is just being ignorant

15:04 no offence

15:05 rhg135: mhm

15:05 tbaldridge: rhg135: I've done a ton of work on that subject, the more I work on it, I'm less convinced that it's a good idea

15:05 rhg135: how so?

15:06 ToxicFrog: Ember-: time -v cat /dev/null: 2.5MB resident, 0s. echo 'os.exit(0)' | time -v luajit: 3MB resident, 0s. echo '(System/exit 0)' | time -v lein repl: 350MB resident, 7s.

15:06 Some VMs are entirely suitable for small apps.

15:06 rhg135: python runs ok

15:06 tbaldridge: rhg135: a lot of clojure assumes a highly optimized compiler (JIT) and a super fast GC. HotSpot will regularly recompile portions of your code as it runs. Doing that with LLVM is super hard. Also, LLVM's GC support is pretty poor.

15:07 rhg135: true

15:07 mtp: i read 'highly opinionated' compiler :)

15:07 rhg135: maybe that's why c++ sucks so much

15:07 well paertly

15:08 coventry`: I've cloned core.clj into a separate namespace, and I want to run the clojure test suite using it. Is there a way to bind clojure/core in the namespace infrastructure to my new namespace? If not, I can just eval the tests in the context of the new ns, but a safe way of doing that kind of rebinding would be pretty cool.

15:08 ToxicFrog: I mean, yes, if you're operating at google scale things are different, a 2% increase in resource usage can mean you mean dozens or hundreds of additional machines - but for most things, optimizing for shorter development time and fewer bugs will be better for both you and for the user than optimizing away a few tens of milliseconds of startup time or a few megabytes of memory usage.

15:09 rhg135: meh

15:09 the jvm is working great

15:09 hyPiRion: ToxicFrog: in addition, a faster development cycle means that you can optimize the code "earlier on"

15:09 rhg135: how about clojurescript

15:10 hyPiRion: consequently, it's a bit hard to compare these things. Like apples and oranges.

15:10 rhg135: v8 is getting fast

15:10 tbaldridge: rhg135: yep, I've seen people do scripting with clojurescript. Good idea imo.

15:10 rhg135: yea

15:10 dnolen: rhg135: CLJS is slowly moving towards bootstrapping, will be interesting to see what people do when we get there.

15:10 rhg135: js isn't just for web imo

15:10 ToxicFrog: (all that said, I hate hate HATE the long startup times of anything written in clj)

15:11 rhg135: ToxicFrog, cljs

15:12 ToxicFrog: rhg135: how easy is that to deploy outside the browser?

15:12 rhg135: in some respects i think nodejs and v8 could eclipse some reasons we use the jvm

15:12 hiredman: you know, you can write shebang style scripts in clojure, rich added support for #! as a "comment" just for that purpose

15:13 ToxicFrog: To end users without a clojure install, I mean

15:13 tbaldridge: hiredman: doesn't really get around the startup times though

15:13 ToxicFrog: With clj I can 'lein uberjar' and get something anyone with a JVM can use

15:13 hiredman: tbaldridge: sure

15:14 but when me script is something cron runs at midnight, what do I care?

15:14 mdrogalis: hiredman: Wait, can you elaborate?

15:14 rhg135: idk, i use bash a lot

15:14 mdrogalis: I wasn't aware #! had any meaning, or seen it anywhere.

15:14 (In context of clj)

15:14 mikerod: ,(reify java.util.List (isEmpty [_] true))

15:14 clojurebot: #<AbstractMethodError java.lang.AbstractMethodError: sandbox$eval29$reify__30.iterator()Ljava/util/Iterator;>

15:15 mikerod: (reify java.util.Collection (isEmpty [_] true))

15:15 rhg135: and since i do like a zillion things on this box it does matter

15:15 mikerod: ,(reify java.util.Collection (isEmpty [_] true))

15:15 clojurebot: #<sandbox$eval59$reify__60 sandbox$eval59$reify__60@1f2507f>

15:15 noonian: I use lein exec so I can run clojure scripts as normal executable scripts, still has the long startup but I don't care that much

15:15 mikerod: Hmm, why does (reify java.util.List (isEmpty [_] true)), throw the AbstractMethodError?

15:15 supersym: mdrogalis: I sure haven't seen it anywhere either

15:15 hiredman: mdrogalis: you know what a shebang line is?

15:16 https://gist.github.com/hiredman/3422228 is valid clojure and valid shell

15:16 mdrogalis: hiredman: Si

15:16 supersym: oh nice

15:16 mdrogalis: Huh, no kidding. I never knew.

15:16 Thanks for the bit of knowledge.

15:17 hiredman: yeah, well, no one seems to use it

15:20 dissipate__: anyone know when the next edition of the 'joy of clojure' is coming out?

15:20 rhg135: not soon enough lol

15:21 danielszmulewicz: dissipate__: you can grab it with a 45% off coupon now

15:21 tbaldridge: all that being said, I really want OCaml on the JVM with a s-expr syntax

15:21 technomancy: tbaldridge: have you tried Yeti?

15:21 dissipate__: danielszmulewicz: on which site? safari books?

15:21 technomancy: just curious

15:21 danielszmulewicz: dissipate__: manning

15:22 tbaldridge: technomancy: no, but I've done stuff with F# I assume they are similar.

15:22 technomancy: yeah, F# is probably more polished

15:22 dissipate__: danielszmulewicz: what's the coupon?

15:22 callen: yeah but who wants to miss out on the opportunity to use the Abominable Snowman language?

15:23 danielszmulewicz: dissipate: http://weblogs.java.net/blog/manningpubs/archive/2013/09/03/clojure-changes-way-you-think-joy-clojure-2e-45

15:23 dissipate__: mlfogus2jn is the coupon

15:23 dissipate__: danielszmulewicz: cool, thanks!

15:23 danielszmulewicz: dissipate__: welcome

15:23 nDuff: hiredman: the $0 should be quoted -- otherwise it won't work correctly when run from a directory with whitespace or glob expressions in its name.

15:24 muhoo: this is fucked. at-at is probably not what i want, after spending a day integrating it.

15:24 bbloom: tbaldridge: what is it about ocaml you want precisely?

15:24 danielszmulewicz: muhoo: quartzite?

15:24 patchwork: muhoo: What do you need to do?

15:25 tbaldridge: bbloom: the type system...and eff's handlers, but that's not Ocaml I know.

15:25 bbloom: I'm a odd sort of guy that couldn't give a crap about types when it comes to "correctness", but there are times I want to write an entire library with types for performance alone.

15:25 muhoo: neither lamina

15:26 dissipate__: danielszmulewicz: strange, the second edition is flagged as 'early access' with 'pre-order' http://www.manning.com/fogus2/

15:26 ztellman: muhoo: what are you trying to do?

15:26 bbloom: tbaldridge: yeah, i hear ya

15:26 glosoli: dissipate__: it is

15:26 bbloom: tbaldridge: have i managed to sell you on the handlers idea? :-) it's good stuff right?!

15:26 muhoo: ztelllman, patchwork: a simple work queue, serializing access to a network connection, and allowing me to send jobs from one job without getting into stack overflow

15:27 danielszmulewicz: dissipate__: yes, it's not out yet, you're entering the meap program, so you can read it electronically, you'll get it shipped in December

15:27 muhoo: and allowing me to STOP the thing if it gets out of hand too

15:27 tbaldridge: bbloom: oh yeah, I'm sold. Not sure that it's possible in a dynamic language though. At least not as nicely as its done in eff

15:27 glosoli: dissipate_: I have it :) ItMost of the chapters are finished, CLJS is not :) moreover, a lot of reviewing is required to be done

15:27 ztellman: muhoo: is there a timing component?

15:27 why at-at?

15:27 bbloom: tbaldridge: it is definitely possible. i have it working in an interpreter

15:27 glosoli: dissipate_: Other than that, it's awesome book I am reading through atm :)

15:27 bbloom: tbaldridge: it's just slow as hell b/c it manually maintains it's own stack frames

15:27 dissipate__: danielszmulewicz: ah, i see. i'll pick it up in december then. i'm busy with 'clojure programming' anyways.

15:27 muhoo: ztellman: yes, i need to insert a delay between each network request

15:28 ztellman: muhoo: use a simple queue, and a consumer that sleeps?

15:28 dissipate__: glosoli: are you going to wow us all with your idiomatic clojure? :P

15:28 bbloom: tbaldridge: you'd need to completely defunctionalize in order to determine whether or not you need to capture multi-shot continuations, or if simple long jumps are enough, etc

15:28 ztellman: it has to be an unbounded queue, if jobs are enqueueing sub-jobs

15:28 glosoli: dissipate_: I am just beginner :) I couldn't wow anyone

15:28 muhoo: ztellman: i had that. i was using lamina/enqueue and channels.

15:28 dissipate__: glosoli: have you gone through 'clojure programming' yet?

15:29 muhoo: the problem was massive stack overflows when a task i popped off of the channel then pushed a new function onto the channel

15:29 bbloom: tbaldridge: i'm not convinced that types are the best path to that sort of optimization tho. i'm much more interested in abstract interpretation for that goal, since that's what you need to do to optimize effects anyway

15:29 glosoli: dissipate_: Like half of it, I did not like it :) No offense to anyone

15:29 muhoo: my general async/concurrency chops are weak though. i'm sure i'm doing something wrong

15:29 dissipate__: glosoli: how about 'clojure in action'?

15:29 ztellman: muhoo: right, that's because in lamina the enqueue and receive can happen on the same thread

15:29 glosoli: dissipate_: Never tried that one

15:30 ztellman: so instead have a separate thread on a normal java queue

15:30 tbaldridge: bbloom: yeah, I haven't dug into it that deep yet.

15:30 ztellman: a separate thread consuming from a queue, that is

15:30 glosoli: dissipate_: I am sure I will finish Clojure Programming at some point :) Might be bad mood at that time that complicated my feelings for that book

15:30 muhoo: ztellman: i had that. just a consumer thread. but there was some problem with it, i don't recall. i should go back and try that.

15:30 dissipate__: i have clojure programming. i'm getting joy of clojure and clojure in action.

15:31 ztellman: muhoo: if you're doing blocking reads, you should be safe

15:31 muhoo: ztellman: safe from what, specifically?

15:31 dissipate__: glosoli: which part did you stop reading?

15:31 ztellman: muhoo: recursion from enqueueing sub-tasks

15:32 so @(read-channel ch) is fine, (run-pipeline (read-channel ch) …) may cause grief

15:32 glosoli: dissipate_: I would need to check it was something after running graphics mazze or something in repl, I couldn't recall now, it was like couple weeks ago

15:32 ztellman: gotta run, let me know if that helps

15:33 dissipate__: glosoli: have you done any haskell?

15:34 glosoli: dissipate_: I have have gave some thoughts on Learn You Haskell, read couple pages, seemed interesting enough, will continue to read more in weekend I guess

15:34 muhoo: ztellman: right

15:34 glosoli: dissipate_: still, it's more like out of interest, not that I have any actual use for it

15:34 muhoo: ztellman: thanks. i haven't been using pipelines.

15:34 dissipate__: glosoli: same here. i do want to learn haskell as well though since it is supposed to be the most amazing FP language.

15:35 nDuff: dissipate_: personally, I'm not a big fan of Clojure in Action.

15:35 technomancy: nDuff: same

15:35 dissipate__: nDuff: what's your beef with it?

15:35 muhoo: ztellman: ah, i see what i may have been doing wrong. i was using receive-all instead of looping @(read-channel ch) in a thread

15:36 ztellman: i.e. i had (future (lamina/receive-all ch #'pop-req))

15:36 glosoli: dissipate_: I do barely care in statements such as " most something" , they are usually overrated

15:36 muhoo: ztellman: should that work? or was that a dumb thing to do?

15:37 nDuff: dissipate_: lots of focus on using specific libraries for specific practical purposes, but isn't particularly portable/useful knowledge. The O'Reilly book and JoC are both much better uses of time.

15:37 technomancy: "The Joy of Connecting to MySQL Databases" as per fogus

15:37 (he wasn't talking about that book, but it's a great name)

15:38 dissipate__: nDuff: that's the point of the book though. to get you going with common industry based tasks like writing a web app.

15:38 nDuff: dissipate_: ...if you can't do that already with the tools given in JoC and Clojure Programming, they've failed you.

15:38 dissipate__: glosoli: haskell is based on deep mathematical theories. we should stand in awe of it. :P

15:39 technomancy: I read the sample chapter on multimethods and I was more confused at the end of it than before I started

15:39 glosoli: dissipate_: And yet there is future to disapprove stuff all the time heh

15:39 technomancy: that was an early draft though; final edition might have been better

15:39 nDuff: dissipate_: moreover, any book that glosses over "how to use a specific bunch of libraries" gets outdated as soon as those libraries do.

15:39 dissipate__: nDuff: true. but books based on a certain version of the language like 'clojure programming' can get outdated as well

15:39 technomancy: nDuff: also the choice of libraries looked a bit like "here's a bunch of stuff the author wrote"

15:40 silasdavis: is there a map values so you can do (map-values update map) rather than (into {} (map (fn [[k v]] [k (update v)]) map))

15:40 ?

15:40 nDuff: dissipate_: *shrug*. Anyhow -- I read it, and considered my time spent doing so wasted. YMMV.

15:40 silasdavis: or something better than the last monstrosity

15:41 dissipate__: nDuff: yeah, i'm much more interested in clojure programming and joy of clojure for sure.

15:41 technomancy: silasdavis: that's commonly considered a strange omission from clojure.core

15:41 Bronsa: silasdavis: you can either use reduce-kv or zipmap

15:41 timsg: anyone know of good libraries for extending destructuring? the core macro's kind of gnarly

15:42 well, function, strictly speaking

15:42 dissipate__: nDuff: should we just be happy that people are bothering to write about clojure in any event?

15:42 nDuff: dissipate_: sure, but that's not to say that all things that are written are worth reading.

15:43 Bronsa: silasdavis: (zipmap (keys the-map) (map update (vals the-map))) or (reduce-kv (fn [m [k v]] (assoc m k (update v)) {} the-map))

15:43 devn: i wrote some macros like that awhile ago, what are you interested in doing in particular that you cant do now?

15:47 mdrogalis: technomancy: There was a good question posed earlier. Why a macro in the Lein project file, and not a pure data structure?

15:47 upwardindex: In the pedestal tutorial app, I created a :dec transform in addition to the :inc transform on my-counter. Later the tutorial binds the inc button to all transforms of my-counter. Is it possible to bind to only one tranform?

15:48 danielszmulewicz: dissipate__: there's an upcoming title focusing on web development: http://pragprog.com/book/dswdcloj/web-development-with-clojure

15:50 dissipate__: And there's another initiative geared towards beginners: http://www.braveclojure.com/

15:51 dissipate__: danielszmulewicz: thanks, bookmarked!

15:52 danielszmulewicz: what's your opinion of 'clojurescript: up and running'?

15:53 danielszmulewicz: dissipate__: I haven't read it.

15:55 ystael: dissipate__: I have read "clojurescript: up and running" and it did exactly what I wanted -- namely, it relieved me of the task of piecing together documentation from the web and figuring out what was outdated or inconsistent.

15:56 danielszmulewicz: dissipate__: There's something else I'll mention only for the sake of it. Clojure in Small Pieces. A literate version of Clojure. You read it like a book but it actually compiles into Clojure source. Tom Daly is the author, famous for being a literate programming advocate.

15:56 It's free too: http://daly.axiom-developer.org/clojure.pdf

15:57 dissipate__: ystael: that sounds useful

15:59 danielszmulewicz: ystael: thanks. sounds useful indeed

15:59 dissipate__: danielszmulewicz: that looks great, thanks.

15:59 ystael: dissipate__: however, this was immediately after the book's release -- it is entirely possible that the book is now less consistent and up to date than you would want.

15:59 i don't know, as i haven't done much with cljs since then.

15:59 danielszmulewicz: ystael: yeah, things move fast with cljs

16:00 dissipate__: does anyone know where i can get the video to this talk: http://lanyrd.com/2013/clojurewest/sccgmc/ (winning the war on javascript)

16:00 ztellman: muhoo: yeah, that means that when you enqueue you'll immediately enter the receive-all callback

16:00 coventry`: upwardindex: Can you post your behavior.clj? Which git tag are you at?

16:00 ztellman: so enqueueing a sub-task is basically recursion

16:00 cemerick: has anyone been able to get server-sent events working over gzip response compression? It seems that none of the typical implementations of the latter flush partial output, not very helpful for SSE's and the like.

16:00 danielszmulewicz: dissipate__: Don't know, but Bodil's talks are grea

16:00 t

16:01 dissipate__: danielszmulewicz: i'm interested in the tools she used to win the war

16:01 danielszmulewicz: dissipate__: she wrote her own die. catnip

16:01 ztellman: cemerick: what are you using for gzip?

16:01 there should be ways to flush the compressor

16:01 danielszmulewicz: dissipate__: ide

16:02 dissipate__: https://github.com/bodil/catnip

16:02 dissipate__: danielszmulewicz: BTW, is bodil a man by birth?

16:02 danielszmulewicz: dissipate__: wouldn't think so

16:02 dissipate__: hailing from Sweden

16:03 dissipate__: danielszmulewicz: she sounded like a he in one of her talks.

16:03 danielszmulewicz: dissipate__: Norway sorry

16:03 upwardindex: coventry`: It would be tag 2.0.11 but with a behavior.clj that has both inc and dec as such: https://www.refheap.com/18481

16:03 danielszmulewicz: dissipate__: yeah, she has a deep voice

16:03 rigger: hmm, she has stuff on vimeo and youtube from last year, but nothing newer

16:03 dissipate__: danielszmulewicz: ah i see. i enjoyed her talk on introduction to FP concepts.

16:04 danielszmulewicz: dissipate__: top notch presenter

16:04 dissipate__: danielszmulewicz: yep, i agree.

16:06 cemerick: ztellman: so far, tried amalloy's middleware, the jetty util filter, and the gzip support baked into tomcat's connector. It looks like Tomcat has a filter that uses a FlushableGzipOutputStream, which sounds promising.

16:07 ztellman: .flush on the JDK's gzip impl apparently only just started working in v7 *shrug* http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4813885

16:07 ztellman: cemerick: ha, didn't know that

16:08 cemerick: ztellman: was quite the suprise when my app was trying to stream SSEs to the browser, and nothing showed up until the stream was exhausted 10 minutes later, yet curl was getting stuff dripped to it properly.

16:08 coventry`: upwardindex: Sorry, not going to be much help.

16:09 cemerick: though, AFAICT, no gzip filters/middlewares I've looked at so far do any kind of flushing, so that eager behaviour is just the way it is...

16:09 upwardindex: coventry`: no worries, probably something touched on later in the tutorial

16:10 ztellman: cemerick: I guess it only matters in the case of SSE, though

16:11 Raynes: dissipate__: Holy shit did you actually say that.

16:11 o_o

16:11 dissipate__: Raynes: say what?

16:12 tbaldridge: dissipate__: that highly offensive comment about Bodil, you do know that many of the members of the Clojure community hang out here right?

16:12 mtp: why does it matter what someone was at birth

16:12 Raynes: dissipate__: Just… taken by surprise...

16:12 mtp: were you there for their birth? does it affect you in any way?

16:12 dissipate__: tbaldridge: sorry to offend. i was actually inquiring to avoid offending.

16:13 mtp: dissipate__: step 1: if someone identifies as a thing, they are that thing.

16:13 step 2: there is no step 2.

16:13 Raynes: But you just added a step 2.

16:13 :(

16:13 mtp: no, i added a lack of a step 2. :)

16:14 dissipate__: mtp: i was inquiring to make sure i didn't say something offensive when referring to a gender specific thing

16:14 tbaldridge: dissipate__: my point is, I can't think of a single good reason why anyone should ever ask a question like that in a public forum.

16:15 mtp: dissipate__: you /didn't need to inquire/

16:15 you had all the information you needed in the word 'she'

16:15 <:|

16:15 dissipate__: mtp: in retrospect, you are right. my apologies.

16:15 mtp: thank you

16:16 tbaldridge: so, the weather is nice in Denver this time of the year.

16:16 mtp: i'm also not right, i'm left. :)

16:16 what's the weather like in Denver?

16:16 cemerick: rkneufeld: Have you been using any gzip compression in your SSE-based services w/ Pedestal?

16:16 dissipate__: tbaldridge: one time i inadvertently asked a gay man if he was in the dating market for women, that was embarrassing (didn't know he was gay). i'm trying to avoid that.

16:17 danielszmulewicz: yippie! first ever edition of read-eval-print-love just got in the mail: http://readevalprintlove.fogus.me/sakura/

16:17 mtp: ask fewer questions, listen more

16:17 think things through, then ask if you still don't understand

16:18 tbaldridge: cemerick: I don't know if it matters, but Pedestal exposes SSE via a interface that gives you a (send-msg) function. Each call to that function flushes the stream.

16:18 I'm not sure how gzip fits in with that, however.

16:19 aphyr: as a gay dude, I'd much rather be asked in person, or mistaken for straight, than have my sexuality discussed in an IRC channel.

16:19 <back to clojure>

16:20 cemerick: tbaldridge: yeah, the gzip bits are generally lower-level than that. AFAICT, gzip and SSEs don't mix at all, at least pre-JDK7, and using any of the gzip methods I've looked into so far. Was just curious if anyone there had combined the two successfully given pedestal's SSE emphasis.

16:20 dissipate__: mtp: someone in another technical community i was in touch with went through a sex change and told me about their reasons and their story. it helped me understand them better.

16:21 hyPiRion: then you should know that it is a very personal thing

16:21 ztellman: dissipate__: if you're curious about a person, talk to them

16:22 technomancy: mdrogalis: you can actually do (def project {}) if you like =)

16:22 but you have to quote all your dependency symbols, so it's pretty annoying

16:23 Bronsa: or just quote the :dependencies vector?

16:23 technomancy: sure

16:23 and plugins, etc.

16:23 hyPiRion: or just quote the whole map

16:24 bbloom: (def project (merge '{normal map here} (some-dynamic-bit-here)))

16:24 technomancy: and there are defaults that are merged in even beyond profile stuff, (which you have to include yourself if you def project) so I think it would be a bit misleading to have it just as a map

16:24 also I'm not sure it would work if you put relative paths in the raw project map. defproject adds in absolute paths

16:25 mdrogalis: technomancy: Never knew! Thanks :)

16:26 technomancy: mdrogalis: but when it was written read-eval was secret functionality. I might do it differently now that it's documented

16:26 well... maybe documented is the wrong word. it's no longer shrouded in absolute secrecy.

16:27 mdrogalis: technomancy: #=?

16:28 hyPiRion: ~#=

16:28 clojurebot: https://twitter.com/richhickey/status/134645361796055040

16:29 technomancy: mdrogalis: yeah

16:30 mdrogalis: Hah

16:31 naeg: is there a way to only allow certain keys in a (defn)?

16:31 with (defn f [first & ...]) it will take any key

16:31 technomancy: naeg: you need preconditions for that

16:32 mdrogalis: Yeah, my thoughts exactly

16:32 naeg: not getting that one?

16:33 rasmusto: naeg: something like this maybe? {:pre ((set (keys args) #{:my :allowed :args}))}

16:33 mdrogalis: naeg: Are you familiar with preconditions in general?

16:33 rasmusto: naeg: oops, I'm missing a paren there after '(keys args)

16:33 mikerod: I'll try once more, :) Can someone give some explanation of why

16:33 ,(reify java.util.List)

16:33 clojurebot: #<AbstractMethodError java.lang.AbstractMethodError: sandbox$eval57$reify__58.iterator()Ljava/util/Iterator;>

16:33 mikerod: ,(reify java.util.Collection)

16:33 clojurebot: #<sandbox$eval87$reify__88 sandbox$eval87$reify__88@55e5f4>

16:34 tbaldridge: mikerod: because the reify implements Iterator, clojurebot is trying to print the elements

16:34 naeg: isn't it a bit "unsafe" to simply take any key without letting the user know? what's the idea behind it?

16:34 rasmusto: naeg: here's a good reference about :pre/:post in general: http://blog.fogus.me/2009/12/21/clojures-pre-and-post/

16:35 tbaldridge: naeg: if you aren't trying to read that key, it has no effect. how is that unsafe?

16:35 mikerod: tbaldridge: does this apply to the REPL as well then?

16:35 tbaldridge: mikerod: probably

16:35 naeg: rasmusto: but that's additional work I'd have to do whenever I use keyword args

16:35 mikerod: tbaldridge: ah, that could certainly make some sense.

16:35 rasmusto: naeg: in certain cases it could be? It's basically left up to you to enforce

16:35 technomancy: naeg: yes, I often avoid & in favour of multiple bodies in order not to lose arity checking

16:35 rasmusto: naeg: you could write a macro

16:35 mdrogalis: naeg: https://gist.github.com/MichaelDrogalis/6500824

16:36 Alright, I'm done for today. See you guys.

16:36 naeg: my question is purely theoretically - see here: http://www.reddit.com/r/lisp/comments/1m1opf/parameter_lists_in_common_lisp_and_clojure/

16:36 nDuff: naeg: that doesn't look like a question

16:37 naeg: the first comment

16:37 Bronsa: tbaldridge: that's not quite it

16:37 nDuff: naeg: what part of that is a question? It's a comparison.

16:37 coventry`: Why does tools.reader need all this complex logic? Can't it just run (eval) on the form it reads in on line 381? https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader.clj#L377

16:37 nDuff: naeg: ...anyhow -- Clojure's keyword args aren't so great, because the JVM doesn't have support for good keyword args.

16:37 Bronsa: tbaldridge: it's because there's a print-method defined for j.u.List and not one for j.u.Collection

16:38 naeg: nDuff: oh, i was refering to my question. whether it isn't unsafe to quietly take any key when using & in the args list

16:38 coventry`: Sorry, s|tools.reader|tools.reader/read-eval|

16:38 nDuff: Ahh.

16:38 naeg: and I came to that question through this comparison. I just thought that there has to be some reason why clojure does it that way

16:39 technomancy: naeg: it's a trade-off; clojure chooses flexibility/speed over safety usually

16:39 tbaldridge: naeg: there's a difference there, Clojure really never attempts to hold your hand. It takes the opinion that garbage-in = garbage-out.

16:39 * nDuff wonders if core.typed could be applicable there.

16:40 naeg: I like most of the design aspects/ideas in clojure (still learning though), but this seems odd to me

16:40 especially because I'm a huge fan of keyword args in general

16:40 tbaldridge: nDuff: or just don't hand garbage to your functions, no reason to create more work for yourself :-P

16:40 nDuff: naeg: That behavior stays close to what the underlying platform can do efficiently.

16:41 technomancy: naeg: there are a lot of cool things you can do with free-form maps that are a lot more difficult with fixed records, but you do have to be more careful.

16:41 Bronsa: coventry`: I just reimplemented it how LispReader.java does, I have absolutely no idea why it's like this in that implementation though

16:42 coventry`: Bronsa: Thanks.

16:42 bbloom: Bronsa: maybe a staging issue? probably don't want the circular dependency between the reader & the compiler

16:43 hiredman: the eval of read-eval is a restricted subset of eval

16:43 Bronsa: bbloom: I don't really see how circular dependencies could be a problem in this case, more likely it's just to limit its power or something like that

16:44 bbloom: Bronsa: i mean it can call arbitrary static methods right? isn't that basically arbitrarily powerful?

16:44 f

16:44 coventry`: Bronsa: All tools.reader tests seem to run fine if you replace the if starting on line 382 with (eval o), assuming the source file and running 'lein test' is the right way to test that.

16:45 *modifying the source file*

16:45 hiredman: coventry`: the restrictions on what can be evaled are by design

16:45 naeg: I hope you guys are ok with me stealing your knowledge and putting it on reddit without giving credit - if otherwhise, please let me know

16:46 Bronsa: coventry`: yes, but I didn't want to make #= do more than what one would expect knowing the limitations of LispReaders' #=

16:46 callen: ah that feel when you actually have users.

16:48 Bronsa: hiredman: bbloom is it unlikely the assumption that #= cherry-picks some eval features because those are the only needed when printing objects to embed them?

16:48 only ones*

16:48 naeg: thanks for the info

16:48 coventry`: callen: I'm not complaining, just curious.

16:49 naeg: Why not give a cite? http://clojure-log.n01se.net/date/2013-09-09.html#16:35f

16:49 bbloom: Bronsa: i dunno anything about the history of #=, but it seems like an exceedingly bad idea that i can only imagine was a temporary hack :-P

16:49 callen: coventry`: huh?

16:49 tbaldridge: (inc bbloom)

16:49 lazybot: ⇒ 16

16:50 technomancy: bbloom: probably why it was kept secret for so long

16:50 coventry`: callen: never mind.

16:50 technomancy: only really came out once they realized people were using the reader on untrusted data

16:50 callen: coventry`: :(

16:51 coventry`: callen: Thought you were referring to this conversation. Hence, never mind.

16:51 bbloom: read-eval, and it's involvement in print-dup, is a symptom of a confluence of bigger problems partially solved by tagged literals & some other mechanisms, but largely unaddressed

16:52 callen: coventry`: oh sorry.

16:56 coventry`: Oh, I see. Didn't realize how limited the evaluation in #= is.

16:57 * magomimmo https://twitter.com/meta_js

16:57 * magomimmo seems to be interesting

17:12 MisterSinister: Hi folks. Could someone help me do something with Leiningen?

17:12 rasmusto: ~anyone

17:12 clojurebot: anyone is anybody

17:13 rasmusto: oh

17:13 MisterSinister: Lol, nice one. :P

17:14 Anyways, is there some way to automatically have Leiningen add certain dependencies to its project file without me having to input them manually? Essentially, I want it to include those dependencies into the project file as soon as it's created.

17:15 technomancy: MisterSinister: right now the best you can do is create a new template

17:15 MisterSinister: And how do I do that?

17:15 technomancy: I would take a patch to make the default templates check the user profile to see which default dependencies it sholud insert

17:15 MisterSinister: `lein help templates`

17:15 MisterSinister: Thanks - I'll look at that.

17:16 technomancy: sure

17:20 MisterSinister: Another question - generic.arithmetic. If I *use*, rather than require, it into my Clojure program, will it break anything?

17:22 coventry`: (use) is great for exploration, but when you're writing something complex it's nice to have an easy way to account for everything in the current namespace.

17:23 noprompt: dnolen: thanks for your core.async posts. they've really helped me a lot this weekend.

17:23 dnolen: noprompt: glad to hear it

17:24 noprompt: dnolen: have you tried pairing watches with channels?

17:24 dnolen: noprompt: I have got around to that, seems like a good idea for some use cases

17:25 s/have/haven't

17:25 noprompt: dnolen: i was trying to figure out how to do some kind of data-bindingish stuff that way.

17:25 tbaldridge: noprompt: paired with (sliding-buffer 1), they'd work quite nicely, imo

17:26 noprompt: tbaldridge: i'll try it out.

17:26 once things started clicking, i got really excited.

17:26 Apage43: you can sometimes write with :use at first and then have https://github.com/technomancy/slamhound sort you out later

17:27 MisterSinister: Is everything technomancy writes some kind of literary reference?

17:27 technomancy: everything newer than 2008

17:28 noprompt: off topic but one thing i discovered this weekend were js/HTMLCollection and js/NodeList. those are kind of scary.

17:28 MisterSinister: So basically, slamhound just does all the namespace-making work for you?

17:28 By the looks of it?

17:28 technomancy: sometimes it has to guess

17:29 Apage43: kinda. It can guess what you're using, but I tend to make sure I've typed things that are actually there so it doesn't have to

17:29 for me it's generally useful to cleanup things i'm requiring but no longer using

17:29 MisterSinister: Last thing. How would I include stuff from clojure-contrib?

17:29 noprompt: on the other hand i'm wondering if you couldn't observe them some how for changes since they are "live" lists.

17:29 MisterSinister: Like, what do I add to dependencies?

17:30 timsg: Anyone know how to access the doc strings sometimes attached as metadata to namespaces?

17:30 noprompt: not sure if that makes any sense or not.

17:30 technomancy: MisterSinister: same as any lib: rad the readme

17:30 bbloom: MisterSinister: judging from your questions, it sounds like you're trying to eliminate the work of adding depedencies and namespace requires. are you just trying to approximate a rails-style auto-require so you don't need to manually specify those things?

17:30 technomancy: read

17:31 MisterSinister: bbloom: It's basically that, if I happen to want to add a lot of stuff from elsewhere that I use often, it'd be nice if any project I create with Leiningen comes preloaded with them. So I don't have to tell it manually to add seesaw, stuff from clojure-contrib, my own utilities etc. every time I make a new project.

17:33 Apage43: ,(meta (clojure.lang.Namespace/find 'clojure.core))

17:33 clojurebot: {:doc "Fundamental library of the Clojure language"}

17:33 bbloom: MisterSinister: but you also mentioned :use instead of :require -- I think you might be prematurely generalizing. unless you often create new projects w/ exactly the same dependencies

17:33 technomancy: do you really only work on GUI projects?

17:33 Apage43: ^ timsg

17:33 bbloom: MisterSinister: seems like a place where copy-paste is your friend :-P

17:34 MisterSinister: bbloom: Unrelated question. I wasn't quite sure if :use-ing a file that contains a multimethod named * would cause problems with core Clojure, which has a function named *.

17:34 technomancy: An example.

17:35 noonian: in general, I find it much cleaner to :require namespaces :as something, and then explicitly :refer to any function names that I don't want to have to namespace qualify

17:36 noprompt: one thing i'm confused about is when should i use put! instead of >! etc?

17:36 technomancy: MisterSinister: that can happen. you'll get a warning.

17:36 tbaldridge: noprompt: use put! when you don't want to wait for the response. >! for when you want to wait

17:36 technomancy: better to stick to require

17:37 tbaldridge: noprompt: put! is async put, >! is sync put

17:37 bbloom: MisterSinister: you can use (:refer-clojure :exclude [+ *])

17:37 in your ns form

17:37 to avoid that warning within the one namespace

17:37 tbaldridge: noprompt: be careful though, because the channel you are put!'ing into may be full, and then you'll just pile up a ton of pending puts, finally resulting in an error

17:37 MisterSinister: bbloom: Would that mean I have to define methods + * for Number if I want to add numbers?

17:38 + and *

17:38 tbaldridge: noprompt: https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async/impl/channels.cljs#L57

17:38 bbloom: MisterSinister: you can refer to the clojure ones by full qualification: clojure.core/+

17:38 MisterSinister: or you can use an alias:

17:38 tbaldridge: where MAX-QUEUE-SIZE is currently 1024

17:38 MisterSinister: bbloom: Thanks, that helps.

17:38 noprompt: tbaldridge: so would you recommend considering sliding-buffer in situations where you want to use put! ?

17:38 bbloom: (:refer-clojure :as clj :exclude [* +])

17:38 clj/+

17:38 or even rename them:

17:39 tbaldridge: noprompt: most of the time, yes.

17:39 bbloom: (:refer-clojure :rename {+ core+})

17:39 MisterSinister: I'm still a noob at Clojure. :P

17:39 bbloom: (doc refer)

17:39 clojurebot: "([ns-sym & filters]); refers to all public vars of ns, subject to filters. filters can include at most one each of: :exclude list-of-symbols :only list-of-symbols :rename map-of-fromsymbol-tosymbol For each public interned var in the namespace named by the symbol, adds a mapping from the name of the var to the var to the current namespace. Throws an exception if name is already mapped to something else in the current

17:39 tbaldridge: noprompt: perhaps not when it's closely tied to the use of take!, but yeah, put! is only ever really used at the edges of your program

17:40 noprompt: also note that this is an anti-pattern: (go (>! c 42)) as that's exactly the same as put!

17:40 MisterSinister: Alrighty, thanks everyone! That helps.

17:40 noprompt: interesting

17:41 bbloom: tbaldridge: well exactly the same but even slower! :-P

17:41 tbaldridge: bbloom: correct

17:41 coventry`: Is ##(instance? clojure.lang.IFn (fn [] 1)) a reliable way to test that a value is callable?

17:42 lazybot: ⇒ true

17:42 bbloom: coventry`: ##(doc ifn?)

17:42 lazybot: ⇒ "([x]); Returns true if x implements IFn. Note that many data structures (e.g. sets and maps) implement IFn"

17:42 coventry`: bbloom: Thanks.

17:42 MisterSinister: Yeah, as I recall, all IFns implement both Runnable and Callable.

17:42 noprompt: so is put! the analogue of go's ->

17:43 bbloom: noprompt: no

17:43 noprompt: go's -> is like >!

17:43 noprompt: in go, you'd have to do: go function() { x -> c }

17:43 if my syntax is right

17:43 tbaldridge: noprompt: put! is the analogue to (go (>! c 42))

17:43 bbloom: func () ....

17:44 noprompt: tbaldridge: oh! right! ok i get it now.

17:44 hyPiRion: it's the other way around, bbloom

17:44 go func() { chan <- elem }

17:44 (just fyi)

17:45 noprompt: so is (go (<! c 42)) the same as (take! c 42)?

17:47 oh whoops nm

17:48 sorry for all these questions, i'm trying to understand this.

17:50 bbloom: hyPiRion: dur, right. thx

17:59 maximus_: Is there any way to pretty print java objects from clojure?

17:59 For debugging purposes?

18:01 noprompt: callen: did you see this https://github.com/stanaka/dash-at-point#readme

18:01 dissipate__: does anyone know if qi has been ported to clojure?

18:01 ivan: http://readevalprintlove.fogus.me/ Dylan is a lisp?

18:03 technomancy: dissipate__: I think someone is working on it, but the license makes it hard to care.

18:03 dissipate__: technomancy: ah, i didn't know qi was tied up with a proprietary license. :(

18:04 technomancy: there's a pretty epic "I wasn't able to make money with my OSS so I'm gonna take my toys and go home" rant re: qi

18:09 dissipate__: technomancy: what kind of legal issues would arise if qi's type system was ported into clojure's core?

18:09 Raynes: None, because that's almost certainly not going to happen :p

18:09 technomancy: I think qi doesn't have the same interop goals as clojure

18:10 dissipate__: technomancy: or rather, ported into core.typed

18:10 technomancy: so they have a lot more freedom to build out the type system

18:10 dissipate__: Raynes: sorry, meant core.typed

18:12 Raynes: i want to bring all of APL into Clojure's special forms.

18:14 dnolen: ivan: yep

18:16 ivan: interesting, I should have schooled myself with wikipedia

18:17 Raynes: noprompt: How's things?

18:17 noprompt: Raynes: ok. still busy as hell outside of work. hoping things settle down soon. :-/

18:17 Raynes: u?

18:18 Raynes: noprompt: Sorry for all the Github pinging. You're probably thinking you broke everything. Not the case, I'm just explaining to Tony Batchelli why there is a version of fs that doesn't work on Java 7.

18:18 Er, java 6.


18:18 Nothing for 'em.

18:19 noprompt: I'm fine. Have a roommate all of a sudden.

18:19 SegFaultAX: Raynes: It's definitely a Monday. We've already had to do 2 reverts on our code. :(

18:19 Raynes: SegFaultAX: I'm fixing merge conflicts. :(

18:20 clj_newb_2345: I need to build a single page app that uses websockets. What clojure libraries should I be using?

18:20 (I need sockets since I need the server to push updates to the client and I don't want to use comet / long polling hacks)

18:21 noprompt: Raynes: oh, no worries. :-) glad i didn't break anything. i try really hard not to. :-P

18:21 francis_wolke`: clj_newb_2345: http-kit serverside and socket.io client side is what I use. Also, google closure has a websocket implementation.

18:21 Raynes: clj_newb_2345: lamina has websocket stuff that I think coworkers use for things and stuff.

18:21 clj_newb_2345: google closure was a messy for me

18:21 I'm already using http-kit on server side

18:22 callen: noprompt: I did now. Thanks.

18:22 francis_wolke`: clj_newb_2345: socket.io is much less so. I can post a refheap of the code if you'd like

18:22 clj_newb_2345: francis_wolke`: sure that'd be great

18:22 also, what "gui library" do you use clinet side?

18:23 I've been looking at backbone, angular, ember

18:23 and not sure how they're different

18:23 noprompt: Raynes: just read the thread. has fs been bumped to the next major version?

18:23 Raynes: noprompt: No.

18:23 SegFaultAX: I personally wouldn't use ember against a non-rails backend.

18:23 noprompt: Raynes: what does it need to get there?

18:23 Raynes: noprompt: One moment.

18:24 SegFaultAX: Not that ember is rails specific, not at all. But I don't see the benefit unless you're taking advantage specifically of Rails integration.

18:24 clj_newb_2345: no, I'm using clojure on the backend

18:24 SegFaultAX: Then again, I we use marionette which is a whole new level of brain damage.

18:24 clj_newb_2345: probably either monger, redis, or datomic

18:24 backbone.marionette?

18:25 SegFaultAX: clj_newb_2345: Yes.

18:25 francis_wolke`: clj_newb_2345: refheap.com/18483

18:25 SegFaultAX: clj_newb_2345: Backbone by itself is pointless.

18:25 Raynes: noprompt: https://github.com/Raynes/fs/issues/47 This is a big deal. The API needs to be audited to make sure all the functions are consistent in argument ordering and what they return (everything should return a File object and not a string unless it absolutely does not make sense, because you don't want to chain functions and make a new File object every time and then convert it to a string every time, that's silly).

18:25 SegFaultAX: clj_newb_2345: It doesn't provide nearly enough functionality to justify using it alone.

18:26 Raynes: noprompt: The more complicated issue and the one I've been lazy about is https://github.com/Raynes/fs/issues/38

18:26 noprompt: Raynes: yeah i remember that one.

18:26 Raynes: noprompt: If you want to take a look at that second one at some point, you'd definitely be jumpstarting a new fs dev cycle.

18:26 callen: noprompt: oh yeah man, this dash-at-point thing is pimp. it even prefixes the language type. NICE WORK

18:26 Raynes: :p

18:26 callen: noprompt: thanks for sharing that :D

18:29 noprompt: how has clang been treating you?

18:29 clj_newb_2345: francis_wolke`: thanks

18:31 noprompt: Raynes: ok. i've got a few things in the queue i need to take care of, but i'd like to help that situation out.

18:31 Raynes: noprompt: Appreciated. No worries. You're not obligated to do anything. :)

18:32 noprompt: callen: clang isn't too bad. i submitted a few small patches last week. i was also messing with it along side mrhyde.

18:32 callen: noprompt: I might end up using it, so I'm keeping my ear to the ground.

18:33 noprompt: callen: but the whole thing just feels hakish. it feels like there's a better way.

18:34 ystael: lo

18:34 sorry

18:34 callen: noprompt: I saw that it smacked the $parse around to inject cljs compat. something to think about.

18:35 noprompt: callen: yeah, that's actually one of neat things.

18:36 callen: i'm using it on a project right now and it works fine but, like i said, it feels hackish.

18:36 akurilin: Hey folks, is there a best practice for packaging errors for REST-style APIs? I'm now using :body {:error {:param-name ["present" "numeric"]}} etc, wondering if there's a better way or if perhaps something is going to bite me down the line.

18:36 noprompt: callen: but feelings are for rubyists.

18:36 :-P

18:36 callen: noprompt: I feel similarly...about Rubyists...

18:36 coventry`: Somehow, I've gotten a repl into a state where (fn [] 1) DWIW, but (defn tst [] 1) results in "No such var: G__212620/fn". I have been mucking around with dumping clojure.core into new namespaces, but at the repl *ns* is not G__212620, and (var defn) gives #'clojure.core/defn. Any ideas what could be going on?

18:37 callen: akurilin: use HTTP status codes as applicable, return errors formatted using internal error codes and messages in the same protocol/style the normal API uses.

18:38 akurilin: callen, assuming I'm already doing the http codes right, should I basically come up with my own internal error schema?

18:39 noprompt: this is my new favorite quote " Oh, holy shit, here is an IRC server, written in fucking javascript, and it's 400 lines of code."

18:39 callen: akurilin: more or less, just follow the pattern of the protocol you're using and stick to it.

18:39 lgs32a: coventry: game over i guess.

18:39 amalloy: coventry`: try macroexpanding the defn, and see if it looks suspicious

18:39 akurilin: callen, I'm not sure what that means tbh.

18:40 clj_newb_2345: somewhat off topic -- I have an app in clojurescript; how do I get the javascript console on chrome on nexus 7 when I view the page?

18:40 lgs32a: coventry: does defn work in other namespaces

18:40 callen: akurilin: if it's predominantly a JSON API, then return JSON.

18:40 coventry`: amalloy. Oh, duh. Thanks. (def tst (G__212620/fn ([] 1))) I must have eval'd something in the wrong namespace...

18:41 akurilin: callen, I see, thanks!

19:02 noprompt: dnolen: i noticed that with links and form submissions you need to do a "regular" listen + preventDefault. is there reason why?

19:03 dnolen: iow. it seems like by the time i pull the event off the channel it's to late to call .preventDefault.

19:09 MisterSinister: I think there's something about defrecord I'm not getting.

19:10 Since I keep getting this error here:

19:10 CompilerException java.lang.ClassFormatError: Duplicate method name&signature in class file...

19:10 I'm trying to have the record implement a protocol, and it keeps giving me this error.

19:11 coventry`: What's the right way to eval into a different namespace. I have been using (binding [*ns* ns]), but keep running into strange behavior like ##(let [ns (create-ns (gensym))] (binding [*ns* ns] (require '[clojure.core :as d]) (d/inc 0)))

19:11 lazybot: java.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!

19:11 coventry`: (Which complains about no such namespace d)

19:17 dnolen: noprompt: yep, there's no way around that since moving thing through channels is async and there's no guarantee when they will actually get delivered.

19:18 noprompt: if you look at my autocompleter stuff you'll see that these kinds of cases must be specially handled. IMO listen needs to take an atom or something like that to communicate event suppression.

19:18 callen: is it common to expect a burst of activity on a channel with nothing happening later and then timeout the "taking" from the channel?

19:19 dnolen: noprompt: annoying but not so different from JS where you going to have to this kind of thing via mutable state flag of some kind.

19:19 callen: specifically to funnel data from a callback to somebody else. or should I just use an atom?

19:19 technomancy: callen: IRC channel or something else? =P

19:19 callen: core.async

19:19 technomancy: didn't you hear? this is #core.async every time, all the time.

19:20 noprompt: dnolen: it's only a minor annoyance. but then again i guess that's what abstraction is for.

19:20 dnolen: callen: not sure what you mean by "nothing happening"

19:20 callen: dnolen: nobody is going to put into the channel after the initial burst.

19:21 I'm sanity-checking that this is a problem-modelling mismatch

19:21 dnolen: callen: like to handle the case if somebody doesn't take?

19:21 callen: the problem with using an atom for this is that I have to set some kind of await boolean to know when it's done.

19:21 dnolen: it's to funnel data from a callback with a closed over channel to somebody else who gets handed the channel.

19:22 but the burst of data is a one-off.

19:22 it's not a persistent relationship.

19:24 I'm just marshalling a seq of data from a callback that will begin recv'ing and funneling the data but only "once".

19:24 by all means tell me if I'm doing something dumb.

19:25 dnolen: callen: I guess I don't see a problem?

19:25 callen: It felt like I might be doing something wrong.

19:26 dnolen: believe it or not, I doubt myself sometimes ;)

19:28 dnolen: noprompt: in general you have little control over at point you convert from host event into core.async event - this is where issues around host event loop interaction and host resource management appear

19:36 noprompt: if you built some kind of framework you could always prevent default or something like that - but I think that would just end up being more surprising. Better to just take the coordination atom as an extra parameter

19:36 noprompt: dnolen: what do you mean by "coordination atom"?

19:37 dnolen: noprompt: just an atom you can bang on to trigger prevent default

19:38 noprompt: dnolen: like with a watch?

19:38 dnolen: this is very new ground for me. :-/

19:40 dnolen: noprompt: look at html-menu-events http://swannodette.github.io/2013/08/17/comparative/

19:40 noprompt: in my design listen takes an extra fn parameter which can interact with the event before it enters a channel

19:41 noprompt: dnolen: reading...

19:43 dnolen: noprompt: the problem is we want to allow tab key to trigger menu item selection, not HTML input field blur - very similar to the issues you're describing

19:43 noprompt: so if the menu is open we reset! allow-tab to true and suppress the browsers default behavior, this is all before we write the event into the channel for the rest of the system to consume.

19:48 clj_newb_2345: what is the clojurescript alternative to jquery?

19:49 nDuff: clj_newb_2345: cljs _can_ be used with jQuery.

19:49 clj_newb_2345: ya

19:49 but suppose for rthe sake of purity

19:49 I wnated pure clojurescript

19:49 dnolen: clj_newb_2345: I don't recomment it personally, GClosure doesn't pretty much everything need w/o adding another 32 of Gzipped code

19:50 nDuff: clj_newb_2345: Using Google Closure would actually be a bit closer, since cljs is relying on it already (and has support for its package mechanism).

19:50 clj_newb_2345: ...though if you want something that's cljs all the way down, I don't know that that exists.

19:50 dnolen: clj_newb_2345: GClosure *does* everything I mean

19:50 clj_newb_2345: dnolen: are you not recommenting jquery, or are you not recommending google closure?

19:51 dnolen: even for mobile apps?

19:51 actually, i'm stupid, i should mention taht i'm targeting the iphone and the nexus 4

19:51 dnolen: clj_newb_2345: not recommending it ever with CLJS

19:51 clj_newb_2345: dnolen: is "it" jquery or is "it" google closure?

19:51 I'm getting confused by the anarmorphic macros

19:51 dnolen: clj_newb_2345: I don't recommend jQuery.

19:51 clj_newb_2345: I understand now. :-)

19:51 dnolen: clj_newb_2345: unless you're depending on jQuery UI, which I also don't recommend

19:52 clj_newb_2345: dnolen: so you recommend google closure instead ?

19:52 dnolen: clj_newb_2345: yep

19:52 clj_newb_2345: actually, I was wondering if someon refactored out pedestal's rendering libraries

19:52 dnolen: clj_newb_2345: thought it doesn't have have usable widgets, but I'm comfortable writing those myself.

19:52 clj_newb_2345: I like this idea of just sending "diffs" and the right htings happening

19:52 dnolen: your mileage may very

19:56 dissipate__: dnolen: is there a pure clojurescript widget toolkit?

19:57 i haven't been able to find one

19:57 dnolen: dissipate__: there is not

19:57 dissipate__: dnolen: why did you recommend google closure widgets?

19:58 dnolen: dissipate__: I specifically did not recommend them

19:58 dissipate__: but there's a single JS widget library I would recommend, they're all abominations for the most part

19:58 "there's not a single"

19:59 dissipate__: member:clj_newb_2345 member:dnolen: member:so you recommend google closure instead ?

19:59 [member:dnolen member:clj_newb_2345: yep

19:59 dnolen: dissipate__: over jQuery, nothing to do w/ widgets

19:59 clj_newb_2345: wtf is this whole "member:" thing?

19:59 https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-01.md <-- my next readig project

19:59 dnolen: if you use jQuery for basic DOM facilities and cross-browser quirks, GClosure is just as good and optimizable

19:59 clj_newb_2345: anyone recommend against it?

20:00 dnolen: clj_newb_2345: it looks pretty good

20:01 dissipate__: clj_newb_2345: my IRC client is a clojure REPL, members of the chat are labeled as such.

20:08 llambda: hm is it okay to use lein-serve in production? e.g. serve-headless?

20:08 er ring-serve, rather

20:09 technomancy: llambda: it's possible, but uberjars are way easier

20:10 easier not to screw up

20:10 llambda: technomancy: yeah i'm actually compiling it into an uberjar

20:11 dissipate__: anyone know if this site is up to date? http://www.clojure-toolbox.com/

20:11 technomancy: llambda: if you use lein in production (whether lein run or lein ring) you have to be careful to add trampoliniing and removing the default profiles

20:11 llambda: i guess i want something that bootstraps and runs the ring server for me, so i just stuck the call to serve-headless into -main and then compiled an uberjar

20:12 technomancy: llambda: https://github.com/technomancy/syme/blob/master/src/syme/web.clj#L140

20:12 llambda: ah so it is better to use run-jetty directly, technomancy?

20:12 technomancy: IMO it's better. others disagree.

20:13 llambda: i'm inclined to go with your opinion :)

20:13 thank you for the advice!

20:13 technomancy: np

20:21 danielszmulewicz: technomancy: I'm running `lein with-profile production task`, is this sufficient to "remove the other profiles" or is there additional things to do?

20:21 technomancy: danielszmulewicz: that's enough for profiles, but you probably want trampoline too

20:21 danielszmulewicz: technomancy: so that leiningen exits the jam?

20:22 jvm

20:22 devn: good evening

20:22 technomancy: yeah

20:22 danielszmulewicz: technomancy: thanks.

20:22 technomancy: in the past some profile settings interacted badly with trampoline... all the known bugs have been fixed

20:22 devn: technomancy: is syme back and working?

20:22 technomancy: but uberjars are always going to be simpler

20:22 devn: i've used it a couple times since you mentioned the issues

20:22 devn: awesome

20:23 i think i might give it a try with someone i'm working with tomorrow

20:24 Raynes: devn: How's things?

20:24 technomancy: I want to toss out the DB and replace it with a write-only event log

20:26 I should probably do that to clojars first tho

20:27 devn: Raynes: pretty good

20:27 you?

20:27 clojurebot: you are likely to be eaten by a grue.

20:27 technomancy: clojurebot: botsnack

20:27 clojurebot: Thanks, but I prefer chocolate

20:42 coventry`: What's the right way to catch an IllegalArgumentException? E.g., ##(try (take 2 'foo) (catch Exception e nil))

20:42 lazybot: java.lang.SecurityException: You tripped the alarm! catch is bad!

20:42 coventry`: (That fails to catch the IllegalArgumentException from trying to seq 'foo, in my hands.)

20:42 Hmm, why is catch dangerous?

20:44 technomancy: it's dangerous to expose in an arbitrary-eval bot

20:44 callen: technomancy: embrace danger!

20:44 excitement!

20:45 coventry`: I'm curious about how catch could be used maliciously.

20:46 technomancy: you could construct a loop that would never exit

20:47 coventry`: ,((fn [] (recur)))

20:47 Hope I didn't break it.

20:47 clojurebot: Execution Timed Out

20:49 coventry`: How is throw different?

20:49 /worse?

20:49 Even if I try to catch IllegalArgumentException, it fails. Bizarre.

20:52 xeqi: technomancy: I've been using datomic-free lately in a project, and it would work well for the clojars event logs as well

20:52 akurilin: callen, regarding your comment on handling ring app configs, do you expose that config map through a function or a var? I'm wondering if there would be perf implications if I were to make that map anew each time from dozens of (env) calls. I could memoize it as well, although I wonder if there's ever a scenario where I'd want to change things.

20:53 technomancy: xeqi: strongly object to introducing a proprietary dependency

20:53 callen: akurilin: I implicitly memoize it by def'ing a map and using it as if it were an fn.

20:53 akurilin: I use weavejester/environ with it.

20:54 xeqi: <3

20:54 xeqi: I like datomic, but a proprietary dependency in a community resource like clojars is a little scurry.

20:55 akurilin: callen, sounds good, thx!

20:55 callen: technomancy: talk to me about event logs.

20:55 technomancy: I love this stuff. Live for this stuff. Whatcha need stranger?

20:55 technomancy: callen: I need like a week to sit down and just make it work =)

20:55 * callen sniffles dejectedly

20:55 technomancy: well, we could use some review

20:55 xeqi: callen, technomancy: agreed, just found it humorous how similar the ideas are

20:56 technomancy: xeqi: if we had a nontrivial amount of data I might be more inclined to look for other options

20:56 callen: xeqi: is he planning to write an event sourcing system?

20:56 technomancy: callen: it's already written =)

20:56 it's just not fully switched on

20:57 xeqi: technomancy: whats left to implement? I thought I had gotten all the writes to the files in and the atom cache working for the tests

20:57 ah

20:57 callen: technomancy: gerd dermert

20:57 technomancy: I'm just not sure I trust it yet

20:57 callen: technomancy: write tests.

20:58 xeqi: technomancy: ah, fun w/ a staging environment

20:58 technomancy: I'm not good at that like xeqi =)

20:58 callen: I heard if you write enough unit tests you can prove god doesn't exist.

20:58 technomancy: the cool thing is both code paths co-exist

20:58 callen: or at least, that's what Rubyist told me.

20:58 what a*

20:58 technomancy: so we could run another instance that reads from the event stream or something on another port

20:59 argh; gotta go but we should talk event streams some time

21:04 ddellacosta: callen: trying to think of the appropriate Hitchhiker's Guide to the Galaxy quote for unit tests + existence of god

21:05 ANYHOO, please someone tell me if it is bad to assume I can rely on the ordering of the set of collections returned from juxt?

21:06 callen: ddellacosta: it's best to avoid relying on ordering unless you're willing to force an ordering explicitly and potentially also reify it in the collection type.

21:07 ddellacosta: in this case, it's unlikely to hurt you though.

21:08 ddellacosta: callen: yeah, I knew you were gonna say that. I mean, I'm doing something like: ((juxt (partial map :k1) (partial map :k2) (partial map :k3)) some-map). I figure that, since we the functions will move through the map in the same order it's okay, but...

21:09 callen: I gotta figure out whether or not it is worth it to really do it The Right Way in this case or not...

21:09 callen: I must be getting too predictable. Time to start randomly giving destructive advice.

21:09 ddellacosta: all else fails, leave a comment warning.

21:10 ;; forgive me, this relies on implicit ordering. Feel free to egg my house if this ruins your day.

21:10 ddellacosta: callen: haha, no, it's more to say, I knew *someone* was going to say that.

21:10 callen: ddellacosta: it's okay, I'll give more interesting advice in future.

21:10 ddellacosta: callen: haha, perfect.

21:10 callen: I need to start spreading the gospel of #=

21:10 ddellacosta: callen: nothing wrong with being the voice of reason, you know.

21:11 callen: woah, what is #=? haven't seen that one

21:11 * callen cackles and disappears into a dark alley

21:11 ddellacosta: #_ makes me mad

21:11 heh

21:13 xeqi: ddellacosta: #= is read-eval, basically clojure might eval code as part of reading it

21:13 ddellacosta: xeqi: thanks. That reader syntax is a pain to Google.

21:14 `rhg: #= ftw

21:14 so many holes lol

21:15 xeqi: `rhg: have you found an arbitrary code execution with *read-eval* false in 1.5+?

21:15 `rhg: no

21:15 but some cba to bind it

21:16 mange: ddellacosta: Could you use (apply map vector (map (juxt :k1 :k2 :k3) some-seq-of-maps)) instead?

21:16 francis_wolke`: `rhg: cba?

21:17 `rhg: i stole it from an english dude

21:17 means could but im too lazy

21:17 ddellacosta: mange: oh wow, let me try that, may just do it

21:17 francis_wolke`: k

21:18 callen: `rhg: most polite rendering I've seen.

21:18 `rhg: :D

21:20 ddellacosta: mange: super cool. what's awesome about your snippet is that it is a shorter, better way to do what I was doing anyways, which was group those values together so I could clojure.string/join them. I was calling interleave, then partition…you just saved me two steps. Thanks!

21:21 `rhg: clojure does that

21:22 ddellacosta: `rhg: not sure what you meant by that, but feel like I probably agree

21:22 `rhg: makes simple work best

21:22 ddellacosta: `rhg: ah. Yep, agree

21:23 `rhg: i dont really like the jvm, but clojure is so addictive

21:24 mlb-: How can I refer to an anonymous function inside said functions declaration?

21:24 xeqi: mlb-: (fn scoped-name [] ... (scoped-name ...))

21:24 hyPiRion: or just recur, in certain cases.

21:25 mlb-: hyPiRion: yeah... don't wanna have to take the time to rewrite function in TCO style

21:25 xeqi: I assume scoped-name is only in the anonymous function's scope?

21:25 hyPiRion: ,(recur) ;D

21:25 mtp: write it that way in the first place :)

21:26 bnew

21:26 clojurebot: Execution Timed Out

21:26 mtp: errrrrrp

21:26 xeqi: mlb-: yes

21:26 mlb-: xeqi: awesome, thanks

21:27 mtp: haha, I'm certainly no stranger to doing that, but I'd prefer to keep this "simple" for my non-functionally oriented coworkers =]

21:28 callen: `rhg: ditto, but I'm warming to the JVM

21:28 modulo start time.

21:28 having something "hella fuckin' fast" is cool.

21:29 `rhg: same

21:52 drusellers: What does the idiom of naming a symbol with a postfix '*' mean (i.e. https://github.com/cemerick/friend-demo/blob/master/src/clj/cemerick/friend_demo/http_basic.clj#L16)

21:53 `rhg: almost, but not quite

21:54 sdegutis: drusellers: I've seen it mean "this is a private thing that the non-suffixed version uses internally" and "this is a lower-level version of the non-suffixed thing" and "this is a version of the non-suffixed thing that has other args or somehow behaves slightly differently"

21:54 drusellers: sdegutis: ok, that makes sense in the context of my link as well.

21:54 thank you

21:55 callen: drusellers: it's nothing to do with being private.

21:55 xeqi: sdegutis: did you see technomancy's awnser about why project.clj is not just a data structure?

21:55 sdegutis: xeqi: never

21:55 drusellers: callen: not in the terms of defn, but more of a way to notate it. especially in this case of using a macro. eh?

21:56 defn-

21:56 callen: drusellers: it sometimes mean it represents a slightly lower level component of an API, but it's closer to indicating a "counterpart", like insert vs. insert*, in Korma insert is a macro, insert* is the function counterpart to insert that does the real heavy-lifting.

21:56 drusellers: defn- is private, but * as a notation has absolutely no connection with being "private".

21:56 drusellers: callen: agreed

21:56 callen: notation of something lower level

21:56 callen: drusellers: slightly. I would emphasize the "counterpart" part.

21:56 drusellers: I encourage people to use the * fns in Korma.

21:56 drusellers: callen: ok cool

21:56 callen: when the macros don't suit them, that is.

21:57 anything meant to be private, will be.

21:57 sdegutis: xeqi: Ah, just read now: http://logs.lazybot.org/irc.freenode.net/%23clojure/2013-09-09.txt

21:57 callen: drusellers: it's an old pattern from other Lisps.

21:57 Apage43: in clojure.core, let* is the actual built in thing that binds names to values, and let is a macro that adds all the destructuring goodness (among other things), same for fn* and fn

21:57 sdegutis: Although I wonder why the defaults come from under project.clj rather than being merged over it.

21:58 drusellers: callen: excellent

21:59 sdegutis: thank you as well

21:59 xeqi: sdegutis: can you explain the orientation metaphor

22:00 sdegutis: xeqi: Actually, never mind it. It might not make sense.

22:16 akurilin: Assuming MVC, how do people generally organize nested routes? Do you make a separate controller for those, or do you stuff everything in the parent controller?

22:17 callen: akurilin: define nested? I use (context ...) when there's a route prefix.

22:18 sdegutis: akurilin: I don't do MVC. I do FI.

22:18 akurilin: as in users/favorites or something like that

22:18 sdegutis: Where I = Interface, usually HTTP, and F = Feature, i.e. my own personal code.

22:18 callen: akurilin: so you have multiple things under "users/*"?

22:18 akurilin: if that's in fact what you mean, then what I said applies. route prefix.

22:19 use context in this case.

22:19 if not, please elaborate.

22:21 akurilin: callen, right, I want both /users and /users/favorites to be valid resources, which I assume is possible in compojure. Sounds like context is the way to go.

22:21 callen: akurilin: yes it is.

22:25 akurilin: There seems to be an interesting trade-off where if you let each "controller" define its own routes, you now can only find out a subroute exists by looking at that individual controller.

22:25 As opposed to having one centralized place where all the routes are defined. Which is possible, but now you have to reference each controller's functions from there.

22:26 The latter approach is actually tempting. Define something like routes.clj and have everything in there for the entire web all.

22:26 callen: akurilin: you probably want to centralize the routes. It makes reorganization and seeing where things live easier. It's also more idiomatic to Compojure.

22:26 akurilin: *app

22:26 callen: I usually do my routes per-file at the bottom, but that can work too.

22:28 akurilin: callen, that's what I do now as well, and my point is that it looks like that'd make existence of nested routes tricky to spot.

22:28 coventry`: The form defining clojure.core/*clojure-version* fails when you run it under clojure.tools.trace/trace-forms with a complaint that it find "baseLoader". Why is this? https://www.refheap.com/18486

22:28 "it *can't* find "baseLoader""

22:28 akurilin: my refactoring todos list grows at a much higher rate than the items get checked off :|

22:29 callen: akurilin: are you relatively new to Clojure and Clojure web projects?

22:29 akurilin: callen, For sure.

22:29 callen: If so, that's pretty normal.

22:30 There aren't any prescriptive frameworks in popular use with Clojure (Pedestal doesn't count and new people shouldn't be using it), so people learn the idioms the hard way.

22:30 The book by yogthos should address some of that.

22:30 akurilin: callen, it's on the reading list for sure, I'm all about cherry picking

22:30 callen: as thou wilt. Just mentioning.

22:31 akurilin: we need to grab a meal sometime.

22:31 akurilin: callen, would love to.

22:31 callen: I'm sick at the moment, but assuming I don't actually perish, I could do something later this week.

22:32 akurilin: callen, tuesdays and thursdays are usually busy, but other than that I'm sure I'm a few blocks away from you. 9th and Market.

22:33 callen: akurilin: you see my PM?

22:42 ghena1986: http://bit.ly/183GBEv

22:43 akurilin: What are people's thoughts on the Stack Exchange API? I'm tempted to use it as reference for my own Compojuring. http://api.stackexchange.com/docs

22:43 Would be nice to have someone confirm that it's a good role model.

23:09 callen: akurilin: looks reasonable.

23:20 coventry`: This is interesting. You have to parse-and-eval forms one at a time. You can't batch up the parses for evaluation, because of the reader evaluation. ##(do (defrecord mrk [b]) #user.mrk{:b 1})

23:21 Oh, is lazybot dead again?

23:21 ,(do (defrecord mrk [b]) #user.mrk{:b 1})

23:21 clojurebot: #<RuntimeException java.lang.RuntimeException: Record construction syntax can only be used when *read-eval* == true>

23:21 muhoo: i played around with bishop, used in a project, but now wonder if it's just too much incidental complexity

23:21 REST in general feels that way to me sometimes, like it's forced.

23:24 coventry`: Does clojure have a better way to de-chunkify lazy seqs than fogus described in <http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/&gt;, these days?

23:25 sdegutis: Wow. It just hit me that Clojure is actually a serious competitor to Java now for many many tasks.

23:26 egghead: sdegutis: if you ignore the adoption curve

23:27 amalloy: coventry`: i wouldn't use fogus's approach - it's slightly more performant than, say, (defn unchunk [coll] (lazy-seq (when-first [x coll] (cons x (unchunk (rest coll)))))) but a lot less readable

23:27 sdegutis: egghead: I'm only talking technically.

23:28 It's not just some makeshift duct-taped thing strapped on top of Java. It's legit.

23:28 egghead: sdegutis: technically I'd say it's already beaten java, at least in feature set & expressiveness

23:28 sdegutis: egghead: Yeah, for most apps that I can think of, I'd use Clojure over Java.

23:29 callen: muhoo: I straddle the line between REST and RPC in most of my apps.

23:29 muhoo: I'm generally not comfortable with REST APIs in terms of how they express and communicate state.

23:31 coventry`: amalloy: Thanks, that's great.

23:34 Sorella: Hello, people. I'm writing a CLI that may use different templates, which are in turn represented as folders. These folders are located in the same directory as the JAR file. I need to copy one of those folders to the current-working-directory, what's the best way to do this? Is there a function/binding that tells me where the JAR is running from so I can get a path to the resources?

23:34 coventry`: I should start looking in useful for these kinds of things.

23:35 justin_smith: Sorella: (io/resource "path/relative/name")

23:35 bonus. that works from inside the dir before making the jar, or from inside the jar after shipping and loading in another project

23:36 clojure.java.io/resource, that is

23:37 Sorella: justin_smith, does that work for resources that are outside of the JAR? I have a directory with `app.jar templates/`.

23:37 justin_smith: it works for anything in classpath / resource path

23:38 clj_newb_2345: besides datomic, is there any database taht supports fast "versioning" ? i.e. I can easily say "I want to run this query -- on waht the datbase looked like 2 commits ago"

23:38 coventry`: What is a unit of code-in-a-file called in clojure? A module? (Coming from python.)

23:39 clj_newb_2345: function ?

23:39 justin_smith: a file? usually one ns per file is the convention

23:39 coventry`: I guess I can just call this "eval-file". Thanks.

23:39 Sorella: justin_smith, oh, awesome. Thanks :)

23:43 justin_smith: coventry`: http://clojure.org/compilation says that each file, each fn, and each gen-class will produce a class file

23:44 ddellacosta: hmm, just loading timestamps via cljs.reader in IE8 makes it barf? Anyone know a better way to handle this? I get "timestamp month field must be in range 1..12 1<=0<=1…"

23:44 *#@$! IE8

23:52 callen: ddellacosta: inst?

23:53 ddellacosta: callen: sorry, what about it? I'm using it, if that's what you're asking. There's just something weird going on with cljs.reader, inst, and IE8. I'm going to track it down and file a bug report, if appropriate

23:53 callen: ddellacosta: test on Himera?

23:54 ddellacosta: callen: yah, one sec

23:54 good idea

23:57 zanes: callen: Can you say more about your discomfort with REST and how it expresses and communicates state?

Logging service provided by n01se.net