#clojure logs

2013-09-09

00:00arrdemjustin_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
00:00justin_smithyeah, I just wondered if there was some subtlety I was missing there
00:00arrdemjustin_smith: this is also A Bad Idea.
00:01justin_smithI 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
00:02arrdemyeah... (to the rest of the chan) for this reason why don't we have a (defn-) when we have (def-)?
00:03justin_smith(def- fn [] ...) is easy enough to use
00:03arrdemah. defn- is a thing.
00:03justin_smithwell I formated that wrong, but
00:03justin_smithI think it is def- that is not a thing
00:04justin_smithfrankly I rarely think I need either
00:04coventry`technomancy: Special-casing it worked nicely. Thanks.
00:04arrdemyep. def- is not a thing.
00:04arrdembut you can def ^:private to the same effect.
00:05arrdemso... if you want to hide something you can? *shrug*
00:21justin_smithtechnomancy: 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
00:38amalloyjustin_smith: tip #1: a clearer description of the problems than "weird issues" will help technomancy (or whoever) figure it out
00:46dobry-denWhat'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?
00:48cgagpr-str i think
00:49dobry-dencgag: yeah thanks, that works
01:48callenhttp://euroclojure.com/2013/speakers/
01:48callenseriously, read it ^^
01:49jack_rabbitk
01:58s4muelthat's quite a list.
01:58callens4muel: read Tellman's bio.
01:58ztellmanstole it from http://en.wikipedia.org/wiki/Pierre_Menard,_Author_of_the_Quixote
01:58s4muelI did, and laughed at the 'discarded as too easy' bit
01:59s4muelah, the more you know.
02:00ztellmanmost of my bios are quotes from stories that I just read
02:00ztellmansaves me having to figure out what the right amount of humblebrag is
02:00callenztellman: never enough humble or brag in a well executed humblebrag.
02:00callenask aphyr, he's really good at it.
02:01ztellmanI'll ask for notes tomorrow
02:01callenztellman: now you've pointed me to something fun to read. Thanks :)
02:01ztellmanif you've never read borges, also check out Library of Babel, The Aleph, Lottery of Babylon, and Funes the Memorious
02:02ztellmanalso Tlon, Uqbar, Orbis Tertius
02:02ztellman(that's one title)
02:03technomancyI usually put "greatest sword fighter in the world" in the bios I submit
02:03callenztellman: I haven't but he was on my list, I'll bump him up after I finish HMS Surprise. Thanks :)
02:03SeanCorfieldcallen: several of those bios are pretty funny but ztellman's takes the biscuit! (hi zach)
02:04s4muelthe program page on euroclojure leaves much to the imagination
02:04ztellmantechnomancy: 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?
02:04callentechnomancy: have you read The Expanse series?
02:04ztellmanSeanCorfield: hey, it's been a while, I keep missing the SF meetups
02:04ztellmanI should fix that
02:04technomancyztellman: always nice to have the pressure ease up
02:04technomancycallen: I don't think so
02:04callenztellman: I went to the last one, great conversations. I've resolved to start going more, you should too.
02:05callentechnomancy: one of the characters is a coffee fiend supposedly. Thought it might be a character you could identify with properly.
02:05SeanCorfieldztellman: I'm taking a break from the SF meetups - after running them for two years
02:05SeanCorfieldAmit 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
02:05ztellmanSeanCorfield: will you be at StrangeLoop or the Conj?
02:06SeanCorfieldboth
02:06ztellmancool, we should catch up
02:07ztellmanthankfully I'll only be listening at this one, so I have plenty of time
02:07SeanCorfieldyup... lots of conferences this year: PyCon, Clojure/West, MongoSF, cf.Objective(), LambdaJam, Strange Loop, Clojure/conj :)
02:07ztellmangotta say, EuroClojure is going to be the high point for me, but that's only because I get to expense a trip to Berlin
02:08ztellmanStrangeLoop's lineup looks amazing, as usual, though
02:08SeanCorfieldYeah, company's sending me to that... going to the conj on my own dime
02:08SeanCorfieldEuroClojure looks like fun...
02:09SeanCorfieldI'm off to England at the end of the month... for a cat show... :)
02:09ztellmanwow, transatlantic travel with a pet
02:09ztellmanthat sounds fun
02:09SeanCorfieldNext year, I'll probably speak at Scotch on the Rocks in Edinburgh in June, as my once a year tript to the UK
02:09SeanCorfieldNah, we don't take cats overseas - my wife is judging in Solihull, so we'll go see my family
02:10ztellmanaha
02:10SeanCorfieldWe're making a run at an International Winner with a kitten right now over here in the US tho' :)
02:11ztellmanwhat are cats judged on?
02:12SeanCorfieldeach breed has a written standard - there are 70+ breeds
02:13SeanCorfieldit's all about conformation
02:13SeanCorfieldexcept for "HouseHold Pets" - they're judged on beauty / cuteness :)
02:13ztellmanare there activities they perform, or is it just conformation in appearance?
02:14SeanCorfieldjust conformation, although agility exists as a separate competition
02:14SeanCorfieldhttp://catagility.org/
02:14ztellmanCat agility is fun for you AND your cat
02:14ztellmanTIL
02:14SeanCorfieldare you "just" attending both strange _and_ the conj?
02:15SeanCorfield^loop
02:15ztellmanthat and EuroClojure
02:15SeanCorfieldah, but you're speaking at EC...
02:16ztellmanoh, I see, "just" attending
02:16ztellmanyes, not speaking at either
02:17ztellmanlast year kind of wrecked me, especially the Conj
02:17ztellmanI proposed a talk on writing a Go AI before I had written one
02:17callenegads.
02:17SeanCorfieldand they accepted it :)
02:17ztellmanit was a backup proposal
02:17ztellmanI mean, in retrospect, of course that's the one they'll choose
02:17SeanCorfieldI submitted three talks to cf.Objective() 2013.. and they accepted all threee..
02:17callenSeanCorfield: lol.
02:18ztellmanbut I was focused on the other one, which is the one I'm giving at EuroClojure this year
02:18callenztellman: what's the talk aboot?
02:18ztellmancallen: pure pretention
02:18ztellmanit's called "States and Nomads: Handling Software Complexity"
02:18callenpretension?
02:18callen...nomads?
02:18ztellmanbasically Borges, Deleuze, and others as they relate to software
02:19callenmonads...or nomads?
02:19ztellmanno typos, nomads
02:19ztellmanand not state, states
02:19SeanCorfield"States and Nomads"... cute :)
02:19ztellmanI thought so
02:20ztellmanbtw, 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
02:20ztellmanthe amount of time I've spent debugging something before realizing I need to use clojure.core/and
02:20ztellmanI swear
02:21callenFSA compiler for Clojure?
02:22ztellmanbasically
02:24ztellmanstrongly influenced by Ragel: http://www.complang.org/ragel/
02:24SeanCorfieldThe last few years have made me a bit more cautious about proposing topics for conferences...
02:24callenI was going to ask.
02:25callenI don't believe I've ever given a talk.
02:25callenoutside of my own company, anyway.
02:25ztellmanSeanCorfield: yeah, I dunno, it forces me to crystallize certain ideas that would probably remain vague and unspoken without the pressure of the talk
02:26ztellmanbut it's pretty stressful
02:26SeanCorfieldI got too adventurous one year and gave five talks at one conference(!) and spoke at three others as well.. way, way, way, too much!
02:26ztellmanwow
02:26callenSeanCorfield - John Bunyan of our time.
02:26ztellmanyeah, I ran into Nathan Marz a few months back, and he suggested just giving the same talk everywhere
02:27ztellmanbut I think I'd have to create some Storm-equivalent before that flies
02:27SeanCorfieldSometimes 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 :)
02:27callenSeanCorfield: part of the problem is knowing what they're already tired of seeing by the time they look at your proposal.
02:28ztellman"man, another Go AI?"
02:29SeanCorfieldI 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
02:29SeanCorfieldI should have just submitted the ORM talk (I don't like ORMs :)
02:29ztellmanit seems unfair to accept all of them, honestly
02:29ztellmanthe assumption can't be that you've assembled the talk before submitting the proposal
02:29SeanCorfieldBut at least I got to talk about Clojure in the polyglot talk again
02:31SeanCorfieldfor next june's conference, the hint has been that a clojure talk would be accepted, so i mustn't grumble :)
02:31ztellmanstill, three talks
02:32SeanCorfieldztellman: the assumption is that you can deliver whatever you propose :)
02:32ztellmanSeanCorfield: I'll keep that in mind in the future, I guess
02:32ztellmananyway, out for the night
02:32callenI wouldn't have expected them to accept multiple proposals either.
02:33SeanCorfieldi've had two talks accepted at several conferences over the years... occasionally three... depends on the conference and the topics...
02:34SeanCorfieldand I've picked up other speakers' topics when they've dropped out... which is not recommended to be honest
02:38callenSeanCorfield: re: cat agility - how do you convince the cat to obey you?
02:38callenI've scarcely been able to get them to visit me when I didn't have food in my hand :(
02:38SeanCorfielddepends on the cat :)
02:39SeanCorfieldwe have a girl who was one of the first "clear rounds" on iCAT
02:39SeanCorfieldand then she lost interest
02:39SeanCorfieldso they do what _they_ want
02:39SeanCorfieldbut that cat loves car rides and hotels, and going out to dinner at restaurants with patios
02:40callenthat's adorable ;_;
02:42SeanCorfieldhttps://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
02:42SeanCorfieldshe did iCAT precisely once...
02:42callenSeanCorfield: SO CUTE X_X
02:43callenokay, enough cats in Clojure. *rubs temples* must focus.
02:43SeanCorfieldhttp://bangles.com/mystique/ <-- more cuteness (the same cat)
03:00callenhttps://gist.github.com/sritchie/6440578
03:08TEttingerSeanCorfield, damn that's a good cat. my tuxedo cat knows a command, bite and claw you unpredictably.
03:11SeanCorfieldthe current kitty we're running to championship https://sphotos-a-lax.xx.fbcdn.net/hphotos-frc3/1186771_645271042158938_913519589_n.jpg
03:12SeanCorfieldcallen: what was that apropos? thrift rings a bell but i can't remember what it is?
03:12callenSeanCorfield: nothing in particular. I'm kind of obsessed with Instaparse lately.
03:12callenSeanCorfield: Thrift is a protocol.
03:13SeanCorfieldah, yes... instaparse did seem cool... haven't had a use for it yet tho'...
03:13callenSeanCorfield: I might have an @work reason to use it soon.
03:15callenI might need a semi-custom query language to wrap datalog/datomic
03:15callento that end, if anybody knows of a SQL parser in Clojure, let me know :)
03:36ddellacostaany experiences with Docker + Clojure app deployments?
03:45SegFaultAXddellacosta: I've been toying with a project at work to use docker in our build server.
03:45SegFaultAXddellacosta: Which for us is pretty damn close to deployment.
03:46ddellacostaSegFaultAX: close enough for me…heh. Liking it? Bad things?
03:46SegFaultAXDocker 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.
03:46SegFaultAXI don't really get how image maintenance works yet.
03:47SegFaultAXLike 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...
03:48SegFaultAXWhat 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.
03:48ddellacostahmm, interesting
03:48SegFaultAXI just don't really grok yet how that works with deeply nested stacks of images.
03:48ddellacostagotcha. 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.
03:49SegFaultAXddellacosta: Yup.
03:49ddellacosta*serve
03:49SegFaultAXThe other thing that isn't clear is security.
03:49ddellacostaSegFaultAX: okay, that is useful info.
03:49ddellacostaSegFaultAX: howso?
03:49SegFaultAXIt 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.
03:50SegFaultAXYou should check out aufs, it's pretty sick.
03:50ddellacostaokay.
03:51ddellacostaare you talking about: http://aufs.sourceforge.net?
03:51SegFaultAXProbably.
03:51ddellacostahaha, okay.
03:51ddellacostathanks for the info SegFaultAX.
03:51SegFaultAXIt's the docker filesystem.
03:51ddellacostaah, I see
03:52SegFaultAXI mean to say that's what docker uses.
03:52ddellacostagotcha: http://docs.docker.io/en/latest/terms/filesystem/
03:52SegFaultAXAnyway, it provides really excellent filesystem-level isolation.
03:53SegFaultAXddellacosta: 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.
03:53ddellacostaSegFaultAX: that is *so* exactly the kind of thing I was thinking
03:54ddellacostaSegFaultAX: which is why I wanted to ask about it
03:54ddellacostaSegFaultAX: ideally I could have a setup for CI/integration tests too
03:54SegFaultAXI'm working on it in my 20% time.
03:54SegFaultAXAlong with a few other projects.
03:54ddellacostaSegFaultAX: which could be just a different set of configs w/same Clojure project
03:54ddellacostayeah, that sounds super cool
03:56SegFaultAXddellacosta: In my mind, docker is to servers as java is to applications.
03:56SegFaultAXAs long as the JVM is there, I don't have to care about whatever is under me, it'll just work.
03:56ddellacostaSegFaultAX: totally, that's a good analogy
03:57SegFaultAXThat'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.
03:57SegFaultAXHeroku is essentially LXCaaS
03:57SegFaultAXDocker makes that attainable for us mere mortals.
03:57ucbSegFaultAX: I take it you're using docker in prod and liking it?
03:58arrdemLXCaaS?
03:58ddellacostayeah, was going to ask the same
03:58SegFaultAXarrdem: LXC as a service.
03:58SegFaultAXucb: Not in prod yet, no. But in my 20% time I've been working on a project to use docker in our build environment.
03:59SegFaultAXucb: I'm still pretty fresh so I don't fully grok everything yet, but it's been pretty awesome so far.
04:01ucbSegFaultAX: 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.)
04:02SegFaultAXucb: 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.
04:02SegFaultAXNot to say we'll start using it in prod, but that's the test to see if it's even viable.
04:07ro_stCljs 0.0-1877 doesn't seem to be available yet?
04:08ro_stdnolen: is 0.0-1877 up? lein isn't finding it
04:08ro_stsuper keen to try your perf improvement!
04:14ambrosebscan anyone think of an inner class in the Java standard lib? just need to test core.typed's inner class syntax.
04:15opqdonutMap$Entry
04:15ambrosebsopqdonut: cheers
04:18hyPiRionGurr, the EuroClojure lineup is too good, and the plane tickets are cheap too.
04:19hyPiRionMy wallet will not like me for doing this
04:22ro_sthyPiRion: you'll regret not going far more than you will regret going
04:24hyPiRionro_st: yes, which is why my wallet is crying at the moment
04:24hyPiRionJust need to find a hotel first
04:29ddellacostawoah, EuroClojure
04:29ddellacostawonder how much a ticket would be…hrmm
04:30SegFaultAXTicket + Hotel + Food probably around $2500
04:30SegFaultAXIf you're going for the conference plus a little sight seeing.
04:30ddellacostaSegFaultAX: probably have someone I can stay with. Mostly worried about plane tix
04:30SegFaultAXIf you just want to go for the conference and live frugally otherwise, probably less than $2k
04:31sontekI was looking at conj today, they don't have the talks listed yet though
04:31sontekPretty cheap for a conference though
04:31ddellacostabelch, too much this year probably…will save up to finally attend a Clojure conference in 2014 I guess. ;-(
04:32ddellacostabelch = blech, freaking spellcheck
04:32sontekhttp://clojure-conj.org/
04:36ddellacostasontek: unfortunately, that one would probably cost me even more to fly to
04:36scottjI think it's an awesome venue for the Conj. If you fly into reagan you can't get more convenient than that
04:36ro_sti went to CW in Portland this year. was worth the 27 hours it took to get there
04:36scottj(granted having it in the town you live in is probably better)
04:36ro_stdefinitely going next year again
04:37ddellacostajust too much $…*sigh*
04:37ddellacostacan't wait until they start having Clojure conferences in Asia. That'll be the day...
04:39hyPiRionddellacosta: That would actually be neat. Are there any major Clojure players (companies) in Asia?
04:39scottjhyPiRion: nope. just httpkit
04:39ddellacostahyPiRion: none whatsoever that I know of
04:39hyPiRion:/
04:40scottjthe author of httpkit is in Shanghai iirc
04:40ddellacostaBeijing if this is to be believed: https://github.com/shenfeng
04:40scottjahh, yeah
04:41scottjddellacosta: where are you?
04:41ddellacostascottj: Japan, a development wasteland
04:41ddellacostascottj: I'm being harsh, but not that harsh
04:42ddellacostacrap, I saw some company in China using a shit-ton of Clojure and now I can't remember the link
04:43ro_stthey do Ruby there, don't they? -grin-
04:44ddellacostaro_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...)
04:45ddellacostaro_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
04:46ddellacostaeveryone gets paid shit, and works 60+ hour weeks
04:46ddellacostaI'm generalizing.
04:46ddellacostaSorta bitter…sorry. haha
04:46ro_stthat sounds horrible
04:46ro_stno innovation?
04:47ddellacostaro_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.
04:48ro_sti'm sure those people are there. you just need to find them and hang out
04:48ro_ststart a Clojure UG
04:48ddellacostaro_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.
04:49ro_stabsolutely. cmdrdats and i run the Clojure UG in Cape Town, South Africa. well worth the effort
04:49ddellacostanow that you mention it, I haven't searched for Japanese Clojure groups recently, let me see...
04:49ddellacostaro_st: cool! Very good to know. Yeah, I'm sure it's worth it.
04:49ro_sthard work, and sometimes thankless, but in the long run, worth it
04:50ucbddellacosta: if you're depressed about the state of affairs where you are, you should pay me a visit. Mostly sharepoint/.NET developers up here.
04:50ddellacostaucb: where are you?
04:50ucbddellacosta: Aberdeen, Scotland
04:50ro_stwhat's the current status of Clojure CLR?
04:50ro_stabandoned?
04:50ddellacostaucb: honestly, I have nothing to complain about, I like living here. Just miss the U.S. dev culture sometimes (I'm an American).
04:51ucbddellacosta: 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!)
04:51ddellacostaucb: haha, gotcha.
04:52ucb:)
04:52hyPiRionucb: Hah, monopolised by the oil industry?
04:52ucbhyPiRion: absolutely. Aberdeen is (allegedly) the oil capital of Europe.
04:53hyPiRionucb: That's more of an Aberdeeen thing, not Scotland itself, right?
04:53ucbhyPiRion: 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.
04:53ro_stoil be roight back
04:53ucb(until the big companies went bust)
04:54hyPiRionah
04:55ucbfor 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).
04:55ucbhyper numbers even
04:59hyPiRionOver here it's generally just Java, and perhaps some Scala.
04:59hyPiRionI wouldn't be surprised if I could count the amount of Clojure programmers on two hands.
05:01sheldonhwhen 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)?
05:03ucbhyPiRion: I'd be surprised if I could use more than a single finger to count the number of clojure programmers up here ;)
05:03ro_stwe use known first by convention
05:03hyPiRionucb: Well, I don't mean professionally :p
05:03ucbhyPiRion: me neither
05:04hyPiRionoh :(
05:04sheldonhro_st: thanks
05:10ucbhyPiRion: yeah, oh well. :)
05:10ucbthere's always IRC and stuff
05:29javehello
05:32ucbhey jave
05:58Apage43ucb: The guy who built hypernumbers was a coworker of mine for a while, nowadays he's at mozilla.
05:59ucbApage43: interesting. Does that mean that HN is dead? (well, vixo now)
06:00Apage43ucb: probably. At least in the sense of being an erlang shop.
06:00ucbright
06:00ucbshame
06:02Apage43or the current guy seems to just be working on it by himself
06:03ucbI hardly know Gordon for that matter :)
06:03Apage43current guy is gordon
06:03Apage43old guy who worked on it way back was dale
06:04ucboh, right, dale
06:04ucbit did sound weird that Gordon was with mozilla now
06:04Apage43yeah ha
06:05Apage43Dale worked at Couch(One,Base) for a while, which is how I know him.
06:05ucbah, I see. You sill work for CouchOne/Base?
06:06Apage43Yep.
06:06Apage43(That is we were working for Couchone, which became Couchbase after acquisition)
06:06ucbcool
06:06ucbright.
06:07Apage43quite a bit of erlang here.
06:08ucbyeah, no kidding :) Erlang and C/C++ I take it?
06:08Apage43Pretty much.
06:09Apage43a number of the extra tools that ship with it are python, but the server itself is erlang and C/C++
06:09sheldonhcool. you could call your staff directory Couchface.
06:13Apage43no 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.)
06:17ucbApage43: nice :)
06:38glosolihey, what's some good library for authentication ?
06:39hyPiRion$google clojure friend
06:39hyPiRionOh lazybot's still down
06:39sheldonhthat is a very big hammer answer to a very poorly defined question
06:40sheldonh(but i'm probably just knee-jerking to big libraries for small jobs)
06:40glosoliwell I need to control authentication of users for my web app, with various restriction rules for certain users on certain routes hmm
06:41glosolinot sure how to be more detailed emm
06:41glosoliI could add that I am using Ring and Compojure
06:41hyPiRionglosoli: https://github.com/cemerick/friend should work then
06:41glosolithanks
06:43sheldonhif it ends up feeling big, but you still want a library, take a look at https://github.com/noir-clojure/lib-noir
06:44glosoliok thanks, gonna check it out
07:34TEttingerhey #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?
07:36clgvTEttinger: thats wrong usage. def's are always toplevel
07:36TEttingerclgv, thanks
07:36clgvTEttinger: if you really must, you can use alter-var-root but I suppose you should change your implementation to a more idiomatic one.
07:37TEttingerhow 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
07:37zRecursive,(doc ->)
07:37clojurebot"([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."
07:37clgvTEttinger: do you really need that global value? if so for some kind of registry you can use an atom or ref as its value
07:37hyPiRionPass it as a value.
07:38TEttingerit is only so other functions can have access to a worldmap once it's generated
07:38clgvTEttinger: sounds like circular dependencies which you should resolve
07:38TEttingerhyPiRion, you're probably right
07:39TEttingeractually that would be a better policy
07:39TEttingerjust pass around one state variable, mutate the state if needed, pass it on? continuation passing style, kinda
07:39hyPiRionyeah
07:40hyPiRionTEttinger: 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))
07:40clgvsounds better that way ^^
07:40hyPiRionWon't handle mutation though, but it's at least good for constants
07:40TEttingerwell unfortunately it needs much more than width, the width is so it can make sense of a 2d array...
07:41hyPiRion(binding [*width* w *array* arr] ...) then
07:41hyPiRionin either case, you can put everything in a map
07:44TEttingerok, 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 ?
07:45TEttingerohhh
07:45TEttingerI get it now
07:45TEttingerit's looking up the variable, when it's bound it finds the right one
07:45hyPiRionTEttinger: yeah, that's how I tend to do it for CLI apps where those variables doesn't vary.
07:45TEttingerthese will change, just not often
07:46hyPiRionah. Well, I'd put those in an atom then
07:47TEttingeryeah, I can just def an atom with a default value and then have init give it a real value. easy
07:54TEttingerthanks hyPiRion
07:54hyPiRionnp
08:40muhoowat? i'm confused. i'm enqueuing stuff into a lamina channel, and getting stack overflows.
08:40muhoooh, it's all one thread :-/
08:40muhoodammit.
08:41mdrogalisMooorning.
08:45arrdemgrrrr don't say that
10:12borkdudedoes anyone know how to run one single feature with lein cucumber? say I have a x.feature in features/subdir
10:25vijaykiranborkdude: lein cucumber features --name "FEATURE NAME" seems to work :)
10:27borkdudethanks
10:46gfrederickswould a clojure.lang.ErrorInfo class be appropriate?
10:54silasdaviscan I do better than (merge original (into {} key-value-pairs))?
10:55gfredericks,(merge {1 2} [[3 4] [5 6]])
10:55clojurebot{[3 4] [5 6], 1 2}
10:55gfrederickso_O
10:56silasdavisyeah I was hoping that would work
10:56gfredericksoh dear
10:56gfredericksI think that happens because merge relies on the anomolous feature of conj
10:56silasdavis,(merge {1 2} '([3 4] [5 6]))
10:56clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry>
10:57silasdavis,(merge {1 2} '((3 4) (5 6)))
10:57clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.util.Map$Entry>
10:57shoky,(into {1 2} [[3 4] [5 6]])
10:57clojurebot{1 2, 3 4, 5 6}
10:57kaw,(into {1 2} [[3 4] [5 6]])
10:57clojurebot{1 2, 3 4, 5 6}
10:57gfredericks,(into {1 2} [[3 4] [5 6]])
10:57clojurebot{1 2, 3 4, 5 6}
10:57gfrederickssilasdavis: ^ howsabout that?
10:57silasdaviskaw, shoky yeah I was hoping to do better than that, see above
10:58silasdavisoh, yeah I don't need merge
10:58silasdavis,(into {1 2} [[1 4] [5 6]])
10:58clojurebot{1 4, 5 6}
10:58silasdavisfine, duh, thanks
10:58gfredericksoh man I don't think I've ever been more unoriginal than that
11:01silasdavishah, leading question
11:01silasdavisnot to worry
11:03gfredericksI really like this catch-data lib I wrote a few months back
11:07jjttjj`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:10bjajjttjj`: nrepl.el
11:11technomancyjjttjj`: nrepl-discover too
11:11jjttjj`Cool thanks!
11:12jjttjj`f
11:32serycjon:exit
11:33konr:wq
11:34ambrosebsis there anything special in the leiningen dependency string needed to download the "slim" Clojure jars from sonatype?
11:34ambrosebs"1.5.1-slim" doesn't seem to work.
11:37squidzwith 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:37xeqiambrosebs: try [org.clojure/clojure "1.5.1" :classifier "slim"]
11:39TimMcslim has docstrings and stuff removed?
11:39ambrosebs(inc xeqi)
11:39ambrosebsthanks
11:39llasramlazybot is still sick?
11:40hyPiRionyes
11:40ambrosebsTimMc: just AOT.
11:40llasramPoor thing
11:40ambrosebsTimMc: I'm not using it, just working out how to make a core.typed slim jar.
11:40ambrosebsseems to work!
11:41silasdavis,(clojure.set/union [2 4 5] [2 4])
11:41clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>
11:41llasramsilasdavis: all the clojure.set functions require their arguments to be sets
11:41silasdavisif that's the case don't you think it should throw an exception
11:42silasdavisrather than doing something unexpected
11:42silasdaviswould be useful if it did a union and returned the input type, or at least a seq..
11:42silasdavis?
11:42hyPiRionWell, first you need to require clojure.set
11:42hyPiRion,(require 'clojure.set)
11:42clojurebotnil
11:42silasdavis,(clojure.set/union [2 4 5] [2 4])
11:42clojurebot[2 4 5 2 4]
11:43hyPiRionunion is essentially a pretty way of saying into.
11:43hyPiRionwith some speed tweaks
11:45justin_smith,(clojure.set/union #{:a} #{:b} #{:c})
11:45clojurebot#{:a :c :b}
11:45justin_smith,(into #{:a} #{:b} #{:c})
11:45clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$into>
11:46llasramsilasdavis: Potentially, but GIGO is a pretty firmly embedded Clojure error-handling idiom
11:46coventry`justin_smith: union uses (reduce into).
11:46coventry`(For more than two arguments.)
11:47justin_smithit uses reduce conj for two args
11:47coventry`Yeah, I'm trying to figure out why that is.
11:47mimieuxHi all!
11:49silasdavisllasram, that's fair enough if it is garbage, but taking a union on non-sets is quite useful
11:50bmabeytbaldridge: this report is more for you but jira automatically assigned it to Rich: http://dev.clojure.org/jira/browse/ASYNC-22
11:50silasdavis,(clojure.set/union #{2 4 5} [2 4])
11:50clojurebot#{2 4 5}
11:50coventry`Oh, into does (reduce conj) too, but there's some extra logic...
11:50silasdavis,(clojure.set/union [2 4] #{2 4 5})
11:50clojurebot#{2 4 5}
11:51tbaldridgebmabey: yeah, that's a bug, there's about 20 different versions of (. ) and I missed a few.
11:51coventry`,(clojure.set/union [2 4 5] #{2 4})
11:51clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>
11:51tbaldridgebmabey: in the mean time, why not use (Numbers/add 1 2) ?
11:51mimieuxGiven the following (fn [& {:keys [host port]}] (println (str host ":" port)), is there a way to apply the following map {:host "localhost" :port 5555}?
11:51mimieuxto match the fn args?
11:52silasdavis,(clojure.set/union [2 4 5] #{2 4})
11:52clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>
11:52silasdavis,(clojure.set/union [2 4] #{2 4 5})
11:52clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>
11:52silasdavisoh times out does it
11:52bmabeytbaldridge: I would if I was writing the code by hand but this other form is being emitted by another macro
11:52silasdavis,(require '[clojure.set :as set])
11:52clojurebotnil
11:52silasdavis,(clojure.set/union [2 4 5] #{2 4})
11:52clojurebot[2 4 5 2 4]
11:52coventry`Anyway, that form returns [2 4 5 2 4], because set orders the arguments by length.
11:52silasdavis,(clojure.set/union #{2 4 5} [2 4])
11:52clojurebot#{2 4 5}
11:53coventry`Seems a little sketchy. :-)
11:53silasdavis,(clojure.set/union [2 4] #{2 4 5})
11:53clojurebot#{2 4 5}
11:53silasdavis,(clojure.set/union [2 4 5] #{2 4 5})
11:53clojurebot[2 4 5 2 4 ...]
11:53silasdaviscoventry`, yes!
11:54silasdavisis there a forum for suggesting improvements to core libraries?
11:54AimHere,(clojure.set/union '(2 4) #{2 4 5})
11:54clojurebot#{2 4 5}
11:54AimHere,(clojure.set/union '(2 4) [2 4 5])
11:54clojurebot[2 4 5 2 4]
11:54silasdavis,(clojure.set/union '(2 4 5) #{2 4 5})
11:54clojurebot(5 4 2 2 4 ...)
11:54silasdavis,(clojure.set/union '(2 4 5 6) #{2 4 5})
11:54clojurebot(5 4 2 2 4 ...)
11:54AimHereIt's just conjing the elements of one onto t'other
11:54silasdavis,(clojure.set/union '(2 4 5 6) #{2 4 5 7 8})
11:54clojurebot#{2 4 5 6 7 ...}
11:55AimHereAnd hoping that the result is still a set
11:55AimHere,(clojure.set/union [[:a :b] [:c :d]] {:foo :bar})
11:55clojurebot[[:a :b] [:c :d] [:foo :bar]]
11:55AimHere,(clojure.set/union {:foo :bar} [[:a :b] [:c :d]] )
11:55clojurebot[[:a :b] [:c :d] [:foo :bar]]
11:56silasdavisyeah and it's using the count to decide the order
11:56silasdavisit makes sense from the implementation, but it's not very nice for a consumer
11:57AimHere,(clojure.set/union [:foo :bar] {:a :b, :c :d} )
11:57clojurebot[:foo :bar [:a :b] [:c :d]]
11:57AimHere,(clojure.set/union [:foo :bar] {:a :b, :c :d :e :f} )
11:57clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
11:58AimHereI think I'll just use clojure.set/union for set unions and nothing else
11:58silasdavis,(#(into #{} %1 %2) [2 3 4 5] [2 3 4])
11:58clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$into>
11:59seangrov`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:59silasdavis,(#(into (into #{} %1) %2) [2 3 4 5] [2 3 4])
11:59clojurebot#{2 3 4 5}
11:59silasdaviswould that be such a bad union implementation?
11:59Chousukefor vectors? I don't think you can get any better
11:59Chousukeunless the vectors are sorted already
12:01hyPiRionthe easiest one is probably just (defn union [& colls] (reduce into #{} colls))
12:02AimHerehyPiRion, The actual implementation doesn't look all that different from that
12:03AimHerehyPiRion, except in the case where there are only two collections
12:04hyPiRionor one, or zero.
12:05silasdaviswhat would be the best way to propose a change, do they accept pull requests?
12:06coventry`http://clojure.org/contributing
12:11seangrov`ClojureCup looks like fun http://clojurecup.com/
12:16dnolenseangrov`: oh got it, yes, thanks for bringing it up!
12:29xeqiambrosebs: are you making the "normal" core.typed lib contain :aot'd code?
12:29ambrosebsxeqi: yes
12:29xeqiare there issue with that and changing clojure versions?
12:32ambrosebsxeqi: I'm not sure.
12:32xeqifor 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:32ambrosebsOk, I'm targeting 1.5.1 atm so I haven't tested others.
12:36clgvxeqi: 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:38ambrosebsgood to know.
12:42dnolentbaldridge: we might need to clean up some things in core.async to account for keywords change in ClojureScript?
12:43tbaldridgednolen: I assume identical? no longer works?
12:43dnolentbaldridge: it no longer works, if you want to compare keywords you have to use keyword-identical?
12:43dnolentbaldridge: or just use =
12:44tbaldridgednolen: yeah, it kindof stinks that we'll have to take the performance hit there, but I guess it can't be helped
12:45dnolentbaldridge: 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:45tbaldridgednolen: 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:46tbaldridgednolen: oh yeah, that we should also take a look at.
12:46tbaldridgeor should we just wait for a better code generator in the compiler?
12:47dnolentbaldridge: CLJS ANF pass to optimize away these extra fns is on my todo list
12:48dnolentbaldridge: to be clear you just can't use identical? with keyword anymore, doesn't matter if compile time constants because of incremental compilation
12:48dnolentbaldridge: we only generate the constants table under advanced optimizations
12:48dnolentbaldridge: thus the tests fail under simple because of presence of identical? + keywords usage
12:48dnolentbaldridge: pretty sure if we fix those, everything will work again
12:50silasdavisIs there a more succint way of writing:
12:50silasdavis,(mapcat (fn [[k vs]] (map (fn [v] [k v]) vs)) {:a [1 2 3] :b [4 5 6]})
12:50clojurebot([:a 1] [:a 2] [:a 3] [:b 4] [:b 5] ...)
12:50silasdavissort of an associative expansion
12:51silasdavisI mean in terms of higher order functions
12:51ucbsilasdavis: you could try with (fn [[k vs]] (interleave (repeatedly k) vs)) instead of the map
12:52xeqi&(for [[k vs] {:a [1 2 3] :b [4 5 6]} v vs] [k v])
12:52ucb(mapcat (fn [[k vs]] (interleave (constantly :a) vs) {:a [1 2 3] :b [4 5 6]})
12:52silasdavisucb, yes think I prefer that, thanks
12:52xeqi,(for [[k vs] {:a [1 2 3] :b [4 5 6]} v vs] [k v])
12:52clojurebot([:a 1] [:a 2] [:a 3] [:b 4] [:b 5] ...)
12:52ucbeek, constantly I think
12:52ucb,(doc constantly)
12:52clojurebot"([x]); Returns a function that takes any number of arguments and returns x."
12:52ucb,(doc repeatedly)
12:52clojurebot"([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:53ucb:/
12:53silasdavis(repeat k)
12:53ucbI always forget which one it is ...
12:53ucb,(doc repeat)
12:53clojurebot"([x] [n x]); Returns a lazy (infinite!, or length n if supplied) sequence of xs."
12:53ucbyeah, that one :)
12:53tbaldridgednolen: 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:54tbaldridgeI can always make a singleton object and then do identical? on that.
12:54silasdavisxeqi, that's nice thanks
12:59dnolentbaldridge: 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:59dnolentbaldridge: so I think cost is going to be negligible
13:00tbaldridgednolen: 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:00dnolentbaldridge: yes = is a bit hit because not fast fail.
13:01dnolentbaldridge: if perf is the most important think keyword-identical? fits the bill
13:01dnolens/think/thing
13:17silasdavisinverse to my last request, can anyone do better than:
13:18silasdavis,(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:18clojurebot{:b (6 5 4), :a (3 2 1)}
13:18silasdavisto factor the expansion
13:20sdegutisIs 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:23dissipate__sdegutis: he's clearly out of control and must be stopped
13:24sdegutisThere could be a perfectly legitimate reason.. I'm just wondering if the rationale is documented anywhere.
13:26mdrogalissdegutis: Yeah I always wondered it myself sdegutis
13:26sdegutisI 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:27sdegutisNot that this can change now, but I'm thinking for the future.
13:28xeqisdegutis: I've seen uses where computed values are important, but google is failing me
13:28xeqialso, 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:28callendnolen: 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:28sdegutisxeqi: 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:29dnolencallen: the github wiki
13:29sdegutisxeqi: Oh, that's sneaky.
13:29xeqior just use the leiningen.core.project api
13:29callendnolen: thanks
13:29xeqisdegutis: or nicely extendable
13:29sdegutisxeqi: Oh yeah, I suppose I can use that from an external project. Thanks :)
13:30danielszmulewiczIs there a leiningen API? I would like to get a list of locally installed leiningen plugins programmatically.
13:30sdegutisxeqi: Implicit things always make me raise an eyebrow. Not that they're not good, I just use extra caution with them.
13:31xeqidanielszmulewicz: as in the ones specified by :plugins in the project map?
13:31danielszmulewiczActually, I would like to know those in profiles.clj
13:31danielszmulewiczbut yes, under the :plugins key
13:35xeqidanielszmulewicz: 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:36danielszmulewiczxeqi: right, I'm perusing the docs, thanks.
13:36xeqidanielszmulewicz: what would you do with a list of plugins from each profile?
13:37danielszmulewiczxeqi: I'm depending on a particular plugin, if it is not found, I want to halt the program
13:38xeqidanielszmulewicz: can you add that plugin to your plugins :dependencies to make sure its there?
13:39danielszmulewiczxeqi: 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:39danielszmulewiczxeqi: https://github.com/weavejester/environ
13:41callenclojure.walk is...really nice.
13:41danielszmulewiczxeqi: 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:42danielszmulewiczxeqi: if that makes sense...
13:42xeqiI don't understand the last sentence
13:43xeqiif you need profiles set up a certain way, why not have the template add them to the project.clj?
13:43danielszmulewiczxeqi: right, that would work too. I'm stoopid.
13:44callenevery time I use :refer :all I end up regretting it.
13:45danielszmulewiczxeqi: thanks. That's the best solution.
13:45xeqidanielszmulewicz: np
13:55dnolencallen: 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:55znusgyhello -- 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:56zphdsam goofing around with clojure.async. Is a 'go' block without '!<', '>!', 'alts!' as same as a 'thread' block?
13:56zphdssince both of them return a channel
13:56callendnolen: cool. Thanks for all your work :)
14:06danielszmulewiczI 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:09muhooOT, but is there a simple commandline linux tool that'll decode ics or exchange vcalendar into readable human text?
14:11callenmuhoo: http://tewok.com/software/vcal-2.2
14:15glosoliah this damn ac-nrepl was driving me nuts believing that it was Emacs who caused various crashes
14:15danielszmulewiczI 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:16danielszmulewiczglosoli: still no company equivalent?
14:16glosolidanielszmulewicz: what's no company equivalent emm
14:16danielszmulewiczglosoli: company is the rival of autocomplete
14:17danielszmulewiczhttp://www.emacswiki.org/emacs/CompanyMode
14:17danielszmulewiczglosoli: http://company-mode.github.io/
14:17Raynesglosoli: I gave up on ac-nrepl after many long days of blood sweat and tears.
14:17glosolidanielszmulewicz: wow thanks, gonna check this out
14:17glosoliRaynes: Yeah, but for me it was different I sincerely believed it was Emacs fault lool
14:19danielszmulewiczglosoli: I think it was Steve Purcell who said there was no reason that autocomplete in the nrepl should depend on ac.
14:19justin_smithoddly, I recently switched to using ac and ac-nrepl, and have yet to see an issue
14:19callentechnomancy: can I get you to push limit-break to clojars?
14:20glosolidanielszmulewicz: correct me if I am wrong, Company Mode is a replacement for Ac yes ?
14:20borkdudeI 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:21danielszmulewiczglosoli: yes, and it's pretty fine one, too. Although I stopped bothering with autocomplete modes.
14:21glosolidanielszmulewicz; thanks for suggetions!:) gonna try it now
14:22danielszmulewiczglosoli: just remember it won't work in the nrepl
14:22danielszmulewiczglosoli: and there's no clojure I believe
14:22glosolidanielszmulewicz: hmm damn :D
14:23danielszmulewiczglosoli: Ah, I found it: https://github.com/clojure-emacs/ac-nrepl/issues/30
14:24danielszmulewiczglosoli: but I think company-mode can use ac as a back-end
14:26ystaeldanielszmulewicz: regarding the svg namespace graph, you may be thinking of itmmc/nephila ?
14:26ystael*timmc
14:27danielszmulewiczystael: thanks! that's the one! Spot on!
14:28muhooyay, emacs, M-x icalendar-import-file :-)
14:28glosolidanielszmulewicz: 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:28callenmuhoo: you didn't try the link I sent? :(
14:29danielszmulewiczglosoli: it's supposed to be like ac (autocomplete), not ac-nrepl
14:29glosolidanielszmulewicz:Not that I am ware of, but what's so wrong with ac (autocomplete0?
14:29danielszmulewiczglosoli: it's a global autocompletion framework.
14:30danielszmulewiczglosoli: I never said anything was wrong with it.
14:30glosolidanielszmulewicz: aa I might be assuming too much most of the times, sorry :)
14:30danielszmulewiczglosoli: :-)
14:30TimMcdanielszmulewicz: It doesn't do SVG yet, but maybe someone will send me that pull request. (Probably an easy enhancement.)
14:31danielszmulewiczTimMc: Oh, I've mixed it up (I must have though about liberator's svg tracing output). Never mind, png is mighty fine too :-)
14:32dissipate__i have a book reading plan: clojure programming -> on lisp -> let over lambda -> learn you a haskell. anyone have any other recommendations?
14:32danielszmulewiczdissipate_: start with "on lisp"
14:32danielszmulewiczdissipate_: it's the most important one of the three (not talking about haskell)
14:32dissipate__danielszmulewicz: i thought that was an intermediate/advanced book?
14:33callendissipate__: do not start with on lisp.
14:33dissipate__hehe
14:33callendissipate__: start with clojure programming.
14:33callendissipate__: I would consider doing Joy of Clojure after Clojure Programming, were I you.
14:33amalloy&(shuffle '(CP OL LoL LYAH))
14:33danielszmulewiczdissipate__: no, "on lisp" is about the philosophy of lisp, it's very gradual and beginner's friendly
14:33dissipate__callen: so my plan is good?
14:33amalloyRaynes: where is lazybot?
14:33callendissipate__: yes, but I'd add JoC. It's exceptional.
14:33callenamalloy: being lazy, apparently.
14:34danielszmulewicz+1 for the joy of clojure
14:34callenamalloy: you'll get your thunks later.
14:34dissipate__callen: isn't JoC weak on macros?
14:34Raynesamalloy: MIA. I'll put out a BOLO for him.
14:34danielszmulewiczdissipate__: yes it is
14:34danielszmulewiczfor macros read "on lisp"
14:34callendissipate__: 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:35dissipate__danielszmulewicz: i'll get to 'on lisp'
14:35callendissipate__: you really need to cool your fucking jets on the macros. They're not the end-all be-all.
14:35ystael<- read JoC, writes code other people hate anyway
14:35mtpmacros are a good tool
14:35Rayneslols
14:35mtpthey are not for everything
14:35callenI love macros, but I don't eagerly seek excuses to use them either.
14:35dissipate__ok, so it is: clojure programming -> joy of clojure -> on lisp -> let over lambda -> learn you a haskell
14:35callendissipate__: excellent.
14:35mtpi would move On Lisp to the end
14:36danielszmulewiczdissipate__: "on lisp" will teach you everything important about lisp, then read "joy of clojure" which is clojure specific but also very philosophical
14:36RaynesUgh, no.
14:36callendanielszmulewicz: nope.
14:36mtpCljPr -> LoL -> Joy -> LYAH -> On Lisp
14:36mtpbut that's just me. :)
14:36callenmtp: LoL needs to be later and preferably after On Lisp.
14:36dissipate__mtp: isn't let over lambda an advanced text?
14:36callendissipate__: quite.
14:36Raynesdissipate__: 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:36mtpreally?
14:36danielszmulewiczdissipate__: yes, very hardcore
14:37callenLoL is really just a more advanced On Lisp IMHO
14:37mtpI only flipped through LoL; it seemed rather practical and down-to-earth to me
14:37mtpmy head is kind of on upside-down, though :)
14:37dissipate__danielszmulewicz: cool. i'm loading these up on my kindle paper white.
14:37danielszmulewiczClojure is built on the shoulders of a giant, and that giant is Lisp
14:38callendanielszmulewicz: what part of On Lisp did you like best?
14:38RaynesMore importantly, why isn't there a homebrew formula for these silly opinions?
14:38danielszmulewiczcallen: everything I should say
14:38callenyou 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:38danielszmulewiczRaynes: ah, you still feel hurt
14:38callendanielszmulewicz: really? lets get specific. What was your favorite part?
14:39callenI know what mine was. What's yours?
14:39danielszmulewiczI sense a vendetta here
14:39ystaelis 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:39RaynesI'm less hurt as I am surprised that you're giving such bad advice to people at the moment.
14:39callenystael: you're not missing much unless you're a CL fascist like me.
14:39RaynesIf 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:39danielszmulewiczJust voicing my opinion, and respecting other's too
14:39callenOL and LoL are best for firming up Lispy/macro patterns after you've been writing Clojure for awhile.
14:40danielszmulewiczit's all good
14:40dissipate__Raynes: unfortunately, AFAIK, there are no in depth macro books in clojure :(
14:40RaynesBecause you don't need them.
14:40callenthat's doing a disservice to JoC. I think it covers them sufficiently.
14:40dissipate__Raynes: why not?
14:40callenyou seriously should not be diving into heavy-duty macro-ology. Clojure is powerful enough to have more than one tool in the box.
14:40RaynesBecause you don't.
14:40RaynesYou 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:41dissipate__Raynes: so clojure programming + joy of clojure is enough?
14:41danielszmulewiczAgreed, you don't jump in writing macros
14:41RaynesYes. And then On Lisp will still be there after you've learned Clojure.
14:41RaynesIt has lots of good stuff to teach, but it's not somewhere you start.
14:41callendissipate__: 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:42dissipate__Raynes: hmm, strange. everyone keeps saying one of the main features of lisp/clojure is macros. :P
14:42kawHm, I'm trying out core.typed, should I be able to typecheck (defn f [xs] (map str xs)) as [(NonEmptySeqable Number) -> (NonEmptySeqable String)]?
14:42RaynesIt's a selling point. Macros allow you to do amazing things, dissipate__.
14:42danielszmulewiczdissipate__: you can peruse them all and develop a sense of what's best for you
14:43RaynesIt'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:43callendissipate__: 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:43RaynesMacros are to be avoided unless they are expressly needed.
14:43kawI 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:43callenyou should make a concerted effort to exhaust other possibilities before resorting to them.
14:43RaynesAnd usually they're just a colorful layer on top of a function-based API.
14:43dissipate__Raynes: that's good to know. so these advanced texts on macros are mostly for theoretical exploration?
14:44callendissipate__: partly. you need to understand that CL users used macros a lot because they didn't have much else to work with.
14:44Raynesdanielszmulewicz: 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:44callendissipate__: they had to fashion their own bizarre universes from macros and banging things together in order to get things done.
14:44callenwe have better tools now
14:44ztellman2001: A Clojure Odyssey
14:44dissipate__callen: so in clojure functions are used a lot more?
14:45RaynesTons tons tons more.
14:45RaynesFunctions in Clojure are the bee's knees, its legs, and potentially its arms.
14:45dissipate__that's good since they are easier to compose
14:45Raynes</eminem quote>
14:45callendissipate__: much.
14:46danielszmulewiczRaynes: 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:46dissipate__BTW, has anyone gained any insights into clojure/lisp by learning haskell?
14:47nDuffdissipate_: Haskell is worth learning for insight into pure functional programming -- which is certainly relevant in Clojure.
14:47callendissipate__: some, but I wouldn't worry about it for now.
14:47Raynesdanielszmulewicz: Entitlement?
14:47RaynesDo elaborate.
14:47callenI really want to see the video.
14:47callenmy morning needs this.
14:48RaynesI 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:48callenwell if either of you can dredge up a link, I'd be appreciative.
14:48dissipate__callen: yeah, i'm definitely not worrying about haskell for quite awhile. the haskell community seems steadfastly committed to native binary executables.
14:48danielszmulewiczRaynes: Well, that's how I interpreted the video, but I'll be glad to hear your intention…
14:49dissipate__callen: when i even inquired about developing an interpreter or a JVM compiler, they snapped at me in #haskell.
14:49callenlol.
14:49callendissipate__: they do that a lot.
14:50callendissipate__: if you want to make them really mad, write trivial applications in terms of unsafePerformIO
14:50dissipate__i pointed out that a huge chunk of industry has moved away from native binary executables. i guess they don't care.
14:50callenand do all your control flow in Cont
14:50danielszmulewiczRaynes: it was a family guy video, you don't remember?
14:50RaynesOh wait!
14:50callendissipate__: they don't. I wouldn't mind native binaries sometimes, but yeah, they're kinda defensive.
14:50Raynesdanielszmulewicz: 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:50technomancyto me haskell and ocaml are interesting *because* they produce native binaries
14:51dissipate__callen: no web development shop i know of is doing native binaries.
14:51tbaldridge(inc technomancy)
14:51ztellmanRaynes: what on earth is going on in this conversation
14:51lazybot⇒ 74
14:51glosoliheh I actually loved how some guy in haskell room spent hour convincing me to use Emacs, it all ended up very well lol
14:51kawHmm, 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:51danielszmulewiczRaynes: Same scenario, different video
14:52callenztellman: I'm a little confused but I know the origins of this one, it's pretty great.
14:52callentrying really hard not to break out into rasping, hacking laughter at the office right now.
14:52coventry`Welcome back, lazybot.
14:52Raynesdanielszmulewicz: 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:52dissipate__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:53technomancydissipate__: who cares what "the industry" is doing?
14:53technomancyif you want ML on a VM, you use F#
14:53danielszmulewiczRaynes: That's why I'm saying feeling of entitlement, you equate clojure community with your private lawn
14:53dissipate__technomancy: apparently we do, that's why we aren't using common lisp, and compiling to the JVM, right?
14:53Raynesdanielszmulewicz: I said 'our', not 'my'.
14:54RaynesFeel free to change it to 'theirs'. I don't use cljs.
14:54danielszmulewiczRaynes: Our is mine too
14:54technomancydissipate__: it's good for somethings and bad for some things
14:54technomancyI'm glad there are options
14:54rhg135i'm wondering how equality on strings work being java objects
14:54technomancyif every good language targetted the JVM it would be horrible
14:54dissipate__technomancy: would haskell be ruined if there was a good interpreter written for it that was ported to a number of architectures?
14:55hyPiRionrhg135: first you check if they have the same pointer, then length, then char-by-char. (I would guess)
14:55technomancyI don't know anything about haskell specifically
14:55rhg135so it's inefficient?
14:55RaynesThere 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:55dissipate__*shrug*, maybe the native binary thing bugs more more than it should
14:56hyPiRionHow would it be more efficient?
14:56RaynesAnyways, we've been clogging up this channel with nonsensical stuff that is said and done for a bit too long already.
14:56Ember-you can download haskell compiler for multiple platforms, I fail to see the problem here
14:56muhooalright, 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:56callendanielszmulewicz: 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:56callenmuhoo: need a little more context.
14:56Ember-VM is great to have but it is *not* an ultimate solution which suits into every situation
14:56muhoozombie functions that can't be killed
14:56coventry`muhoo: Have you seen this? http://code.nomad-labs.com/2011/12/09/mother-fk-the-scheduledexecutorservice/
14:56callenmuhoo: at-at?
14:56dissipate__Ember-: never said it was. i'm just saying, have it as an option.
14:56muhoocoventry`: yeah, i posted it here last night :-/
14:57dbeIs 'vec' more efficient then 'apply vector'? Why does 'vec' exist, is it just a shortcut?
14:57Raynesztellman: It's Monday, man.
14:57Ember-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:57muhooat-at does use that service, and i am wrapping all my functions, that's not the problem
14:57dissipate__Ember-: for instance, you can compile python scripts to native binaries.
14:57ztellmanRaynes: lawn metaphor Monday
14:57RaynesYes.
14:57callen,(vector "abc")
14:57clojurebot["abc"]
14:57callen,(vec "abc")
14:57clojurebot[\a \b \c]
14:57Ember-sure, that doesn't make em fast (python built as binaries that is)
14:57Ember-and you lose the portability
14:57tbaldridgedissipate__: not exactly...it's more like bundling them with the interpreter vm
14:58dbecallen, Huh. Interesting.
14:58Ember-and yes, I was thinking that too
14:58muhoothe 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:58Ember-that python binaries have just the vm with em
14:58dbe,(apply vector "abc")
14:58clojurebot[\a \b \c]
14:58callenmuhoo: what pool? is this a library?
14:58Raynescallen: I think he is talking about samaaron's at-at.
14:58dissipate__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:58muhooi am indeed
14:59Rayneshttps://github.com/overtone/at-at
14:59Raynescallen: ^
14:59Ember-dissipate__: neither have I but that doesn't mean I would never do those
14:59muhooand sam does not appear to be about at this hour of the day/night/etc
14:59Ember-there is very much place for native apps
14:59Ember-and it would be horrible to make all those ppl making native apps to just use c or c++
14:59Ember-:)
14:59dissipate__Ember-: yep, systems programming. but haskell is not good for that either.
14:59mattmossc++ ftw yah woot
15:00mattmossdon't deny haterz
15:00mattmosslolz
15:00rhg135ohnoez
15:00hyPiRion$seen lazybot
15:00lazybotlazybot was last seen joining on #eleventhbit 24 minutes and 39 seconds ago.
15:00Ember-I for one am typing this message in iterm which has a ssh connection to my server running irssi
15:00hyPiRionOhai, it's back
15:00muhoooh wait, maybe he sends them off to a different thread and doesn't hold on to the return vals. or maybe scheduledwhateverthign does
15:00Ember-all native apps
15:00RayneshyPiRion: You just found a bug.
15:00Ember-I see no point in doing that stuff with vm based software
15:00RayneshyPiRion: The channel is ##eleventhbit, not #eleventhbit.
15:00Ember-maybe irssi, but well... Not really
15:01Ember-VM has an overhead always, you don't create small utility apps with it
15:01hyPiRionRaynes: wehey, everyday usage
15:01ToxicFrogEmber-: I do!
15:01rhg135i agree
15:01Ember-in my opinion: VM based languages for "big" apps, native for performance critical or small apps
15:01ToxicFrogBut 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:01rhg135the jvm is way too slow to start for scripts et al
15:01dissipate__Ember-: that's true. everything has tradeoffs.
15:02danielszmulewiczRaynes: Oh, here's the link you've sent me: http://www.youtube.com/watch?v=lGOzOfMMuYQ
15:02ToxicFrogEmber-: also, not all VMs are as slow to start up as the JVM. Try any Lua implementation, for starters.
15:02RaynesAh!
15:02dissipate__rhg135: yep. that eliminates clojure from being used as a scripting language. but there is Racket.
15:02Ember-yes, and dart vm starts in under 200 ms
15:02muhoohmm well in this case the error may have been caused by catching without rethrowing something. but still.
15:02rhg135ik
15:02Raynesdanielszmulewicz: The video is pretty funny though, right?
15:02Raynes:)
15:02coventry`Is it possible to infer from the organization of clojure/test/clojure/test_clojure/ which test files pertain to core.clj?
15:02rhg135the jvm is awesome tho
15:02Ember-there's the memory penalty too with VMs
15:02hyPiRionwell, the clojure jvm implementation is at least a bad fit for scripting
15:02danielszmulewiczRaynes: Yes, but showing clear signs of entitlement imho
15:03Raynesdanielszmulewicz: lol, okay man.
15:03Ember-small long running apps each having their separate VM is not such a good idea
15:03hyPiRionClojure itself may be a better fit if some native implementation existed
15:03danielszmulewiczRaynes: cool
15:03Ember-even if memory is cheap these days
15:03Ember-but anyway, I'm not bashing VMs, not at all
15:03rhg135llvm clojure needs to be a thing
15:03Ember-like I said, I do 95% of my coding with VM based languages such as Clojure or Java
15:04Ember-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:04Ember-no offence
15:05rhg135mhm
15:05tbaldridgerhg135: 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:05rhg135how so?
15:06ToxicFrogEmber-: 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:06ToxicFrogSome VMs are entirely suitable for small apps.
15:06rhg135python runs ok
15:06tbaldridgerhg135: 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:07rhg135true
15:07mtpi read 'highly opinionated' compiler :)
15:07rhg135maybe that's why c++ sucks so much
15:07rhg135well paertly
15:08coventry`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:08ToxicFrogI 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:09rhg135meh
15:09rhg135the jvm is working great
15:09hyPiRionToxicFrog: in addition, a faster development cycle means that you can optimize the code "earlier on"
15:09rhg135how about clojurescript
15:10hyPiRionconsequently, it's a bit hard to compare these things. Like apples and oranges.
15:10rhg135v8 is getting fast
15:10tbaldridgerhg135: yep, I've seen people do scripting with clojurescript. Good idea imo.
15:10rhg135yea
15:10dnolenrhg135: CLJS is slowly moving towards bootstrapping, will be interesting to see what people do when we get there.
15:10rhg135js isn't just for web imo
15:10ToxicFrog(all that said, I hate hate HATE the long startup times of anything written in clj)
15:11rhg135ToxicFrog, cljs
15:12ToxicFrogrhg135: how easy is that to deploy outside the browser?
15:12rhg135in some respects i think nodejs and v8 could eclipse some reasons we use the jvm
15:12hiredmanyou know, you can write shebang style scripts in clojure, rich added support for #! as a "comment" just for that purpose
15:13ToxicFrogTo end users without a clojure install, I mean
15:13tbaldridgehiredman: doesn't really get around the startup times though
15:13ToxicFrogWith clj I can 'lein uberjar' and get something anyone with a JVM can use
15:13hiredmantbaldridge: sure
15:14hiredmanbut when me script is something cron runs at midnight, what do I care?
15:14mdrogalishiredman: Wait, can you elaborate?
15:14rhg135idk, i use bash a lot
15:14mdrogalisI wasn't aware #! had any meaning, or seen it anywhere.
15:14mdrogalis(In context of clj)
15:14mikerod,(reify java.util.List (isEmpty [_] true))
15:14clojurebot#<AbstractMethodError java.lang.AbstractMethodError: sandbox$eval29$reify__30.iterator()Ljava/util/Iterator;>
15:15mikerod(reify java.util.Collection (isEmpty [_] true))
15:15rhg135and since i do like a zillion things on this box it does matter
15:15mikerod,(reify java.util.Collection (isEmpty [_] true))
15:15clojurebot#<sandbox$eval59$reify__60 sandbox$eval59$reify__60@1f2507f>
15:15noonianI 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:15mikerodHmm, why does (reify java.util.List (isEmpty [_] true)), throw the AbstractMethodError?
15:15supersymmdrogalis: I sure haven't seen it anywhere either
15:15hiredmanmdrogalis: you know what a shebang line is?
15:16hiredmanhttps://gist.github.com/hiredman/3422228 is valid clojure and valid shell
15:16mdrogalishiredman: Si
15:16supersymoh nice
15:16mdrogalisHuh, no kidding. I never knew.
15:16mdrogalisThanks for the bit of knowledge.
15:17hiredmanyeah, well, no one seems to use it
15:20dissipate__anyone know when the next edition of the 'joy of clojure' is coming out?
15:20rhg135not soon enough lol
15:21danielszmulewiczdissipate__: you can grab it with a 45% off coupon now
15:21tbaldridgeall that being said, I really want OCaml on the JVM with a s-expr syntax
15:21technomancytbaldridge: have you tried Yeti?
15:21dissipate__danielszmulewicz: on which site? safari books?
15:21technomancyjust curious
15:21danielszmulewiczdissipate__: manning
15:22tbaldridgetechnomancy: no, but I've done stuff with F# I assume they are similar.
15:22technomancyyeah, F# is probably more polished
15:22dissipate__danielszmulewicz: what's the coupon?
15:22callenyeah but who wants to miss out on the opportunity to use the Abominable Snowman language?
15:23danielszmulewiczdissipate: http://weblogs.java.net/blog/manningpubs/archive/2013/09/03/clojure-changes-way-you-think-joy-clojure-2e-45
15:23danielszmulewiczdissipate__: mlfogus2jn is the coupon
15:23dissipate__danielszmulewicz: cool, thanks!
15:23danielszmulewiczdissipate__: welcome
15:23nDuffhiredman: 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:24muhoothis is fucked. at-at is probably not what i want, after spending a day integrating it.
15:24bbloomtbaldridge: what is it about ocaml you want precisely?
15:24danielszmulewiczmuhoo: quartzite?
15:24patchworkmuhoo: What do you need to do?
15:25tbaldridgebbloom: the type system...and eff's handlers, but that's not Ocaml I know.
15:25tbaldridgebbloom: 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:25muhooneither lamina
15:26dissipate__danielszmulewicz: strange, the second edition is flagged as 'early access' with 'pre-order' http://www.manning.com/fogus2/
15:26ztellmanmuhoo: what are you trying to do?
15:26bbloomtbaldridge: yeah, i hear ya
15:26glosolidissipate__: it is
15:26bbloomtbaldridge: have i managed to sell you on the handlers idea? :-) it's good stuff right?!
15:26muhooztelllman, 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:27danielszmulewiczdissipate__: 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:27muhooand allowing me to STOP the thing if it gets out of hand too
15:27tbaldridgebbloom: 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:27glosolidissipate_: I have it :) ItMost of the chapters are finished, CLJS is not :) moreover, a lot of reviewing is required to be done
15:27ztellmanmuhoo: is there a timing component?
15:27ztellmanwhy at-at?
15:27bbloomtbaldridge: it is definitely possible. i have it working in an interpreter
15:27glosolidissipate_: Other than that, it's awesome book I am reading through atm :)
15:27bbloomtbaldridge: it's just slow as hell b/c it manually maintains it's own stack frames
15:27dissipate__danielszmulewicz: ah, i see. i'll pick it up in december then. i'm busy with 'clojure programming' anyways.
15:27muhooztellman: yes, i need to insert a delay between each network request
15:28ztellmanmuhoo: use a simple queue, and a consumer that sleeps?
15:28dissipate__glosoli: are you going to wow us all with your idiomatic clojure? :P
15:28bbloomtbaldridge: 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:28ztellmanit has to be an unbounded queue, if jobs are enqueueing sub-jobs
15:28glosolidissipate_: I am just beginner :) I couldn't wow anyone
15:28muhooztellman: i had that. i was using lamina/enqueue and channels.
15:28dissipate__glosoli: have you gone through 'clojure programming' yet?
15:29muhoothe problem was massive stack overflows when a task i popped off of the channel then pushed a new function onto the channel
15:29bbloomtbaldridge: 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:29glosolidissipate_: Like half of it, I did not like it :) No offense to anyone
15:29muhoomy general async/concurrency chops are weak though. i'm sure i'm doing something wrong
15:29dissipate__glosoli: how about 'clojure in action'?
15:29ztellmanmuhoo: right, that's because in lamina the enqueue and receive can happen on the same thread
15:29glosolidissipate_: Never tried that one
15:30ztellmanso instead have a separate thread on a normal java queue
15:30tbaldridgebbloom: yeah, I haven't dug into it that deep yet.
15:30ztellmana separate thread consuming from a queue, that is
15:30glosolidissipate_: 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:30muhooztellman: 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:30dissipate__i have clojure programming. i'm getting joy of clojure and clojure in action.
15:31ztellmanmuhoo: if you're doing blocking reads, you should be safe
15:31muhooztellman: safe from what, specifically?
15:31dissipate__glosoli: which part did you stop reading?
15:31ztellmanmuhoo: recursion from enqueueing sub-tasks
15:32ztellmanso @(read-channel ch) is fine, (run-pipeline (read-channel ch) …) may cause grief
15:32glosolidissipate_: 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:32ztellmangotta run, let me know if that helps
15:33dissipate__glosoli: have you done any haskell?
15:34glosolidissipate_: 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:34muhooztellman: right
15:34glosolidissipate_: still, it's more like out of interest, not that I have any actual use for it
15:34muhooztellman: thanks. i haven't been using pipelines.
15:34dissipate__glosoli: same here. i do want to learn haskell as well though since it is supposed to be the most amazing FP language.
15:35nDuffdissipate_: personally, I'm not a big fan of Clojure in Action.
15:35technomancynDuff: same
15:35dissipate__nDuff: what's your beef with it?
15:35muhooztellman: 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:36muhooztellman: i.e. i had (future (lamina/receive-all ch #'pop-req))
15:36glosolidissipate_: I do barely care in statements such as " most something" , they are usually overrated
15:36muhooztellman: should that work? or was that a dumb thing to do?
15:37nDuffdissipate_: 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:37technomancy"The Joy of Connecting to MySQL Databases" as per fogus
15:37technomancy(he wasn't talking about that book, but it's a great name)
15:38dissipate__nDuff: that's the point of the book though. to get you going with common industry based tasks like writing a web app.
15:38nDuffdissipate_: ...if you can't do that already with the tools given in JoC and Clojure Programming, they've failed you.
15:38dissipate__glosoli: haskell is based on deep mathematical theories. we should stand in awe of it. :P
15:39technomancyI read the sample chapter on multimethods and I was more confused at the end of it than before I started
15:39glosolidissipate_: And yet there is future to disapprove stuff all the time heh
15:39technomancythat was an early draft though; final edition might have been better
15:39nDuffdissipate_: moreover, any book that glosses over "how to use a specific bunch of libraries" gets outdated as soon as those libraries do.
15:39dissipate__nDuff: true. but books based on a certain version of the language like 'clojure programming' can get outdated as well
15:39technomancynDuff: also the choice of libraries looked a bit like "here's a bunch of stuff the author wrote"
15:40silasdavisis there a map values so you can do (map-values update map) rather than (into {} (map (fn [[k v]] [k (update v)]) map))
15:40silasdavis?
15:40nDuffdissipate_: *shrug*. Anyhow -- I read it, and considered my time spent doing so wasted. YMMV.
15:40silasdavisor something better than the last monstrosity
15:41dissipate__nDuff: yeah, i'm much more interested in clojure programming and joy of clojure for sure.
15:41technomancysilasdavis: that's commonly considered a strange omission from clojure.core
15:41Bronsasilasdavis: you can either use reduce-kv or zipmap
15:41timsganyone know of good libraries for extending destructuring? the core macro's kind of gnarly
15:42timsgwell, function, strictly speaking
15:42dissipate__nDuff: should we just be happy that people are bothering to write about clojure in any event?
15:42nDuffdissipate_: sure, but that's not to say that all things that are written are worth reading.
15:43Bronsasilasdavis: (zipmap (keys the-map) (map update (vals the-map))) or (reduce-kv (fn [m [k v]] (assoc m k (update v)) {} the-map))
15:43devni wrote some macros like that awhile ago, what are you interested in doing in particular that you cant do now?
15:47mdrogalistechnomancy: There was a good question posed earlier. Why a macro in the Lein project file, and not a pure data structure?
15:47upwardindexIn 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:48danielszmulewiczdissipate__: there's an upcoming title focusing on web development: http://pragprog.com/book/dswdcloj/web-development-with-clojure
15:50danielszmulewiczdissipate__: And there's another initiative geared towards beginners: http://www.braveclojure.com/
15:51dissipate__danielszmulewicz: thanks, bookmarked!
15:52dissipate__danielszmulewicz: what's your opinion of 'clojurescript: up and running'?
15:53danielszmulewiczdissipate__: I haven't read it.
15:55ystaeldissipate__: 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:56danielszmulewiczdissipate__: 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:56danielszmulewiczIt's free too: http://daly.axiom-developer.org/clojure.pdf
15:57dissipate__ystael: that sounds useful
15:59danielszmulewiczystael: thanks. sounds useful indeed
15:59dissipate__danielszmulewicz: that looks great, thanks.
15:59ystaeldissipate__: 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:59ystaeli don't know, as i haven't done much with cljs since then.
15:59danielszmulewiczystael: yeah, things move fast with cljs
16:00dissipate__does anyone know where i can get the video to this talk: http://lanyrd.com/2013/clojurewest/sccgmc/ (winning the war on javascript)
16:00ztellmanmuhoo: yeah, that means that when you enqueue you'll immediately enter the receive-all callback
16:00coventry`upwardindex: Can you post your behavior.clj? Which git tag are you at?
16:00ztellmanso enqueueing a sub-task is basically recursion
16:00cemerickhas 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:00danielszmulewiczdissipate__: Don't know, but Bodil's talks are grea
16:00danielszmulewiczt
16:01dissipate__danielszmulewicz: i'm interested in the tools she used to win the war
16:01danielszmulewiczdissipate__: she wrote her own die. catnip
16:01ztellmancemerick: what are you using for gzip?
16:01ztellmanthere should be ways to flush the compressor
16:01danielszmulewiczdissipate__: ide
16:02danielszmulewiczdissipate__: https://github.com/bodil/catnip
16:02dissipate__danielszmulewicz: BTW, is bodil a man by birth?
16:02danielszmulewiczdissipate__: wouldn't think so
16:02danielszmulewiczdissipate__: hailing from Sweden
16:03dissipate__danielszmulewicz: she sounded like a he in one of her talks.
16:03danielszmulewiczdissipate__: Norway sorry
16:03upwardindexcoventry`: 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:03danielszmulewiczdissipate__: yeah, she has a deep voice
16:03riggerhmm, she has stuff on vimeo and youtube from last year, but nothing newer
16:03dissipate__danielszmulewicz: ah i see. i enjoyed her talk on introduction to FP concepts.
16:04danielszmulewiczdissipate__: top notch presenter
16:04dissipate__danielszmulewicz: yep, i agree.
16:06cemerickztellman: 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:07cemerickztellman: .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:07ztellmancemerick: ha, didn't know that
16:08cemerickztellman: 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:08coventry`upwardindex: Sorry, not going to be much help.
16:09cemerickthough, 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:09upwardindexcoventry`: no worries, probably something touched on later in the tutorial
16:10ztellmancemerick: I guess it only matters in the case of SSE, though
16:11Raynesdissipate__: Holy shit did you actually say that.
16:11Rayneso_o
16:11dissipate__Raynes: say what?
16:12tbaldridgedissipate__: that highly offensive comment about Bodil, you do know that many of the members of the Clojure community hang out here right?
16:12mtpwhy does it matter what someone was at birth
16:12Raynesdissipate__: Just… taken by surprise...
16:12mtpwere you there for their birth? does it affect you in any way?
16:12dissipate__tbaldridge: sorry to offend. i was actually inquiring to avoid offending.
16:13mtpdissipate__: step 1: if someone identifies as a thing, they are that thing.
16:13mtpstep 2: there is no step 2.
16:13RaynesBut you just added a step 2.
16:13Raynes:(
16:13mtpno, i added a lack of a step 2. :)
16:14dissipate__mtp: i was inquiring to make sure i didn't say something offensive when referring to a gender specific thing
16:14tbaldridgedissipate__: 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:15mtpdissipate__: you /didn't need to inquire/
16:15mtpyou had all the information you needed in the word 'she'
16:15mtp<:|
16:15dissipate__mtp: in retrospect, you are right. my apologies.
16:15mtpthank you
16:16tbaldridgeso, the weather is nice in Denver this time of the year.
16:16mtpi'm also not right, i'm left. :)
16:16mtpwhat's the weather like in Denver?
16:16cemerickrkneufeld: Have you been using any gzip compression in your SSE-based services w/ Pedestal?
16:16dissipate__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:17danielszmulewiczyippie! first ever edition of read-eval-print-love just got in the mail: http://readevalprintlove.fogus.me/sakura/
16:17mtpask fewer questions, listen more
16:17mtpthink things through, then ask if you still don't understand
16:18tbaldridgecemerick: 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:18tbaldridgeI'm not sure how gzip fits in with that, however.
16:19aphyras 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:19aphyr<back to clojure>
16:20cemericktbaldridge: 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:20dissipate__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:21hyPiRionthen you should know that it is a very personal thing
16:21ztellmandissipate__: if you're curious about a person, talk to them
16:22technomancymdrogalis: you can actually do (def project {}) if you like =)
16:22technomancybut you have to quote all your dependency symbols, so it's pretty annoying
16:23Bronsaor just quote the :dependencies vector?
16:23technomancysure
16:23technomancyand plugins, etc.
16:23hyPiRionor just quote the whole map
16:24bbloom(def project (merge '{normal map here} (some-dynamic-bit-here)))
16:24technomancyand 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:24technomancyalso I'm not sure it would work if you put relative paths in the raw project map. defproject adds in absolute paths
16:25mdrogalistechnomancy: Never knew! Thanks :)
16:26technomancymdrogalis: but when it was written read-eval was secret functionality. I might do it differently now that it's documented
16:26technomancywell... maybe documented is the wrong word. it's no longer shrouded in absolute secrecy.
16:27mdrogalistechnomancy: #=?
16:28hyPiRion~#=
16:28clojurebothttps://twitter.com/richhickey/status/134645361796055040
16:29technomancymdrogalis: yeah
16:30mdrogalisHah
16:31naegis there a way to only allow certain keys in a (defn)?
16:31naegwith (defn f [first & ...]) it will take any key
16:31technomancynaeg: you need preconditions for that
16:32mdrogalisYeah, my thoughts exactly
16:32naegnot getting that one?
16:33rasmustonaeg: something like this maybe? {:pre ((set (keys args) #{:my :allowed :args}))}
16:33mdrogalisnaeg: Are you familiar with preconditions in general?
16:33rasmustonaeg: oops, I'm missing a paren there after '(keys args)
16:33mikerodI'll try once more, :) Can someone give some explanation of why
16:33mikerod,(reify java.util.List)
16:33clojurebot#<AbstractMethodError java.lang.AbstractMethodError: sandbox$eval57$reify__58.iterator()Ljava/util/Iterator;>
16:33mikerod,(reify java.util.Collection)
16:33clojurebot#<sandbox$eval87$reify__88 sandbox$eval87$reify__88@55e5f4>
16:34tbaldridgemikerod: because the reify implements Iterator, clojurebot is trying to print the elements
16:34naegisn't it a bit "unsafe" to simply take any key without letting the user know? what's the idea behind it?
16:34rasmustonaeg: here's a good reference about :pre/:post in general: http://blog.fogus.me/2009/12/21/clojures-pre-and-post/
16:35tbaldridgenaeg: if you aren't trying to read that key, it has no effect. how is that unsafe?
16:35mikerodtbaldridge: does this apply to the REPL as well then?
16:35tbaldridgemikerod: probably
16:35naegrasmusto: but that's additional work I'd have to do whenever I use keyword args
16:35mikerodtbaldridge: ah, that could certainly make some sense.
16:35rasmustonaeg: in certain cases it could be? It's basically left up to you to enforce
16:35technomancynaeg: yes, I often avoid & in favour of multiple bodies in order not to lose arity checking
16:35rasmustonaeg: you could write a macro
16:35mdrogalisnaeg: https://gist.github.com/MichaelDrogalis/6500824
16:36mdrogalisAlright, I'm done for today. See you guys.
16:36naegmy question is purely theoretically - see here: http://www.reddit.com/r/lisp/comments/1m1opf/parameter_lists_in_common_lisp_and_clojure/
16:36nDuffnaeg: that doesn't look like a question
16:37naegthe first comment
16:37Bronsatbaldridge: that's not quite it
16:37nDuffnaeg: what part of that is a question? It's a comparison.
16:37coventry`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:37nDuffnaeg: ...anyhow -- Clojure's keyword args aren't so great, because the JVM doesn't have support for good keyword args.
16:37Bronsatbaldridge: it's because there's a print-method defined for j.u.List and not one for j.u.Collection
16:38naegnDuff: oh, i was refering to my question. whether it isn't unsafe to quietly take any key when using & in the args list
16:38coventry`Sorry, s|tools.reader|tools.reader/read-eval|
16:38nDuffAhh.
16:38naegand 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:39technomancynaeg: it's a trade-off; clojure chooses flexibility/speed over safety usually
16:39tbaldridgenaeg: there's a difference there, Clojure really never attempts to hold your hand. It takes the opinion that garbage-in = garbage-out.
16:40naegI like most of the design aspects/ideas in clojure (still learning though), but this seems odd to me
16:40naegespecially because I'm a huge fan of keyword args in general
16:40tbaldridgenDuff: or just don't hand garbage to your functions, no reason to create more work for yourself :-P
16:40nDuffnaeg: That behavior stays close to what the underlying platform can do efficiently.
16:41technomancynaeg: 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:41Bronsacoventry`: I just reimplemented it how LispReader.java does, I have absolutely no idea why it's like this in that implementation though
16:42coventry`Bronsa: Thanks.
16:42bbloomBronsa: maybe a staging issue? probably don't want the circular dependency between the reader & the compiler
16:43hiredmanthe eval of read-eval is a restricted subset of eval
16:43Bronsabbloom: 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:44bbloomBronsa: i mean it can call arbitrary static methods right? isn't that basically arbitrarily powerful?
16:44bbloomf
16:44coventry`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:45coventry`*modifying the source file*
16:45hiredmancoventry`: the restrictions on what can be evaled are by design
16:45naegI 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:46Bronsacoventry`: yes, but I didn't want to make #= do more than what one would expect knowing the limitations of LispReaders' #=
16:46callenah that feel when you actually have users.
16:48Bronsahiredman: 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:48Bronsaonly ones*
16:48naegthanks for the info
16:48coventry`callen: I'm not complaining, just curious.
16:49coventry`naeg: Why not give a cite? http://clojure-log.n01se.net/date/2013-09-09.html#16:35f
16:49bbloomBronsa: 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:49callencoventry`: huh?
16:49tbaldridge(inc bbloom)
16:49lazybot⇒ 16
16:50technomancybbloom: probably why it was kept secret for so long
16:50coventry`callen: never mind.
16:50technomancyonly really came out once they realized people were using the reader on untrusted data
16:50callencoventry`: :(
16:51coventry`callen: Thought you were referring to this conversation. Hence, never mind.
16:51bbloomread-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:52callencoventry`: oh sorry.
16:56coventry`Oh, I see. Didn't realize how limited the evaluation in #= is.
17:12MisterSinisterHi folks. Could someone help me do something with Leiningen?
17:12rasmusto~anyone
17:12clojurebotanyone is anybody
17:13rasmustooh
17:13MisterSinisterLol, nice one. :P
17:14MisterSinisterAnyways, 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:15technomancyMisterSinister: right now the best you can do is create a new template
17:15MisterSinisterAnd how do I do that?
17:15technomancyI would take a patch to make the default templates check the user profile to see which default dependencies it sholud insert
17:15technomancyMisterSinister: `lein help templates`
17:15MisterSinisterThanks - I'll look at that.
17:16technomancysure
17:20MisterSinisterAnother question - generic.arithmetic. If I *use*, rather than require, it into my Clojure program, will it break anything?
17:22coventry`(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:23nopromptdnolen: thanks for your core.async posts. they've really helped me a lot this weekend.
17:23dnolennoprompt: glad to hear it
17:24nopromptdnolen: have you tried pairing watches with channels?
17:24dnolennoprompt: I have got around to that, seems like a good idea for some use cases
17:25dnolens/have/haven't
17:25nopromptdnolen: i was trying to figure out how to do some kind of data-bindingish stuff that way.
17:25tbaldridgenoprompt: paired with (sliding-buffer 1), they'd work quite nicely, imo
17:26noprompttbaldridge: i'll try it out.
17:26nopromptonce things started clicking, i got really excited.
17:26Apage43you can sometimes write with :use at first and then have https://github.com/technomancy/slamhound sort you out later
17:27MisterSinisterIs everything technomancy writes some kind of literary reference?
17:27technomancyeverything newer than 2008
17:28nopromptoff topic but one thing i discovered this weekend were js/HTMLCollection and js/NodeList. those are kind of scary.
17:28MisterSinisterSo basically, slamhound just does all the namespace-making work for you?
17:28MisterSinisterBy the looks of it?
17:28technomancysometimes it has to guess
17:29Apage43kinda. 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:29Apage43for me it's generally useful to cleanup things i'm requiring but no longer using
17:29MisterSinisterLast thing. How would I include stuff from clojure-contrib?
17:29noprompton the other hand i'm wondering if you couldn't observe them some how for changes since they are "live" lists.
17:29MisterSinisterLike, what do I add to dependencies?
17:30timsgAnyone know how to access the doc strings sometimes attached as metadata to namespaces?
17:30nopromptnot sure if that makes any sense or not.
17:30technomancyMisterSinister: same as any lib: rad the readme
17:30bbloomMisterSinister: 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:30technomancyread
17:31MisterSinisterbbloom: 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:33Apage43,(meta (clojure.lang.Namespace/find 'clojure.core))
17:33clojurebot{:doc "Fundamental library of the Clojure language"}
17:33bbloomMisterSinister: 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:33technomancydo you really only work on GUI projects?
17:33Apage43^ timsg
17:33bbloomMisterSinister: seems like a place where copy-paste is your friend :-P
17:34MisterSinisterbbloom: 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:34MisterSinistertechnomancy: An example.
17:35noonianin 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:36nopromptone thing i'm confused about is when should i use put! instead of >! etc?
17:36technomancyMisterSinister: that can happen. you'll get a warning.
17:36tbaldridgenoprompt: use put! when you don't want to wait for the response. >! for when you want to wait
17:36technomancybetter to stick to require
17:37tbaldridgenoprompt: put! is async put, >! is sync put
17:37bbloomMisterSinister: you can use (:refer-clojure :exclude [+ *])
17:37bbloomin your ns form
17:37bbloomto avoid that warning within the one namespace
17:37tbaldridgenoprompt: 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:37MisterSinisterbbloom: Would that mean I have to define methods + * for Number if I want to add numbers?
17:38MisterSinister+ and *
17:38tbaldridgenoprompt: https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async/impl/channels.cljs#L57
17:38bbloomMisterSinister: you can refer to the clojure ones by full qualification: clojure.core/+
17:38bbloomMisterSinister: or you can use an alias:
17:38tbaldridgewhere MAX-QUEUE-SIZE is currently 1024
17:38MisterSinisterbbloom: Thanks, that helps.
17:38noprompttbaldridge: so would you recommend considering sliding-buffer in situations where you want to use put! ?
17:38bbloom(:refer-clojure :as clj :exclude [* +])
17:38bbloomclj/+
17:38bbloomor even rename them:
17:39tbaldridgenoprompt: most of the time, yes.
17:39bbloom(:refer-clojure :rename {+ core+})
17:39MisterSinisterI'm still a noob at Clojure. :P
17:39bbloom(doc refer)
17:39clojurebot"([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:39tbaldridgenoprompt: 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:40tbaldridgenoprompt: also note that this is an anti-pattern: (go (>! c 42)) as that's exactly the same as put!
17:40MisterSinisterAlrighty, thanks everyone! That helps.
17:40nopromptinteresting
17:41bbloomtbaldridge: well exactly the same but even slower! :-P
17:41tbaldridgebbloom: correct
17:41coventry`Is ##(instance? clojure.lang.IFn (fn [] 1)) a reliable way to test that a value is callable?
17:42lazybot⇒ true
17:42bbloomcoventry`: ##(doc ifn?)
17:42lazybot⇒ "([x]); Returns true if x implements IFn. Note that many data structures (e.g. sets and maps) implement IFn"
17:42coventry`bbloom: Thanks.
17:42MisterSinisterYeah, as I recall, all IFns implement both Runnable and Callable.
17:42nopromptso is put! the analogue of go's ->
17:43bbloomnoprompt: no
17:43bbloomnoprompt: go's -> is like >!
17:43bbloomnoprompt: in go, you'd have to do: go function() { x -> c }
17:43bbloomif my syntax is right
17:43tbaldridgenoprompt: put! is the analogue to (go (>! c 42))
17:43bbloomfunc () ....
17:44noprompttbaldridge: oh! right! ok i get it now.
17:44hyPiRionit's the other way around, bbloom
17:44hyPiRiongo func() { chan <- elem }
17:44hyPiRion(just fyi)
17:45nopromptso is (go (<! c 42)) the same as (take! c 42)?
17:47nopromptoh whoops nm
17:48nopromptsorry for all these questions, i'm trying to understand this.
17:50bbloomhyPiRion: dur, right. thx
17:59maximus_Is there any way to pretty print java objects from clojure?
17:59maximus_For debugging purposes?
18:01nopromptcallen: did you see this https://github.com/stanaka/dash-at-point#readme
18:01dissipate__does anyone know if qi has been ported to clojure?
18:01ivanhttp://readevalprintlove.fogus.me/ Dylan is a lisp?
18:03technomancydissipate__: I think someone is working on it, but the license makes it hard to care.
18:03dissipate__technomancy: ah, i didn't know qi was tied up with a proprietary license. :(
18:04technomancythere'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:09dissipate__technomancy: what kind of legal issues would arise if qi's type system was ported into clojure's core?
18:09RaynesNone, because that's almost certainly not going to happen :p
18:09technomancyI think qi doesn't have the same interop goals as clojure
18:10dissipate__technomancy: or rather, ported into core.typed
18:10technomancyso they have a lot more freedom to build out the type system
18:10dissipate__Raynes: sorry, meant core.typed
18:12dissipate__Raynes: i want to bring all of APL into Clojure's special forms.
18:14dnolenivan: yep
18:16ivaninteresting, I should have schooled myself with wikipedia
18:17Raynesnoprompt: How's things?
18:17nopromptRaynes: ok. still busy as hell outside of work. hoping things settle down soon. :-/
18:17nopromptRaynes: u?
18:18Raynesnoprompt: 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:18RaynesEr, java 6.
18:18RaynesMONDAYS, MAN.
18:18RaynesNothing for 'em.
18:19Raynesnoprompt: I'm fine. Have a roommate all of a sudden.
18:19SegFaultAXRaynes: It's definitely a Monday. We've already had to do 2 reverts on our code. :(
18:19RaynesSegFaultAX: I'm fixing merge conflicts. :(
18:20clj_newb_2345I need to build a single page app that uses websockets. What clojure libraries should I be using?
18:20clj_newb_2345(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:21nopromptRaynes: oh, no worries. :-) glad i didn't break anything. i try really hard not to. :-P
18:21francis_wolke`clj_newb_2345: http-kit serverside and socket.io client side is what I use. Also, google closure has a websocket implementation.
18:21Raynesclj_newb_2345: lamina has websocket stuff that I think coworkers use for things and stuff.
18:21clj_newb_2345google closure was a messy for me
18:21clj_newb_2345I'm already using http-kit on server side
18:22callennoprompt: I did now. Thanks.
18:22francis_wolke`clj_newb_2345: socket.io is much less so. I can post a refheap of the code if you'd like
18:22clj_newb_2345francis_wolke`: sure that'd be great
18:22clj_newb_2345also, what "gui library" do you use clinet side?
18:23clj_newb_2345I've been looking at backbone, angular, ember
18:23clj_newb_2345and not sure how they're different
18:23nopromptRaynes: just read the thread. has fs been bumped to the next major version?
18:23Raynesnoprompt: No.
18:23SegFaultAXI personally wouldn't use ember against a non-rails backend.
18:23nopromptRaynes: what does it need to get there?
18:23Raynesnoprompt: One moment.
18:24SegFaultAXNot 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:24clj_newb_2345no, I'm using clojure on the backend
18:24SegFaultAXThen again, I we use marionette which is a whole new level of brain damage.
18:24clj_newb_2345probably either monger, redis, or datomic
18:24clj_newb_2345backbone.marionette?
18:25SegFaultAXclj_newb_2345: Yes.
18:25francis_wolke`clj_newb_2345: refheap.com/18483
18:25SegFaultAXclj_newb_2345: Backbone by itself is pointless.
18:25Raynesnoprompt: 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:25SegFaultAXclj_newb_2345: It doesn't provide nearly enough functionality to justify using it alone.
18:26Raynesnoprompt: The more complicated issue and the one I've been lazy about is https://github.com/Raynes/fs/issues/38
18:26nopromptRaynes: yeah i remember that one.
18:26Raynesnoprompt: 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:26callennoprompt: oh yeah man, this dash-at-point thing is pimp. it even prefixes the language type. NICE WORK
18:26Raynes:p
18:26callennoprompt: thanks for sharing that :D
18:29callennoprompt: how has clang been treating you?
18:29clj_newb_2345francis_wolke`: thanks
18:31nopromptRaynes: 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:31Raynesnoprompt: Appreciated. No worries. You're not obligated to do anything. :)
18:32nopromptcallen: clang isn't too bad. i submitted a few small patches last week. i was also messing with it along side mrhyde.
18:32callennoprompt: I might end up using it, so I'm keeping my ear to the ground.
18:33nopromptcallen: but the whole thing just feels hakish. it feels like there's a better way.
18:34ystaello
18:34ystaelsorry
18:34callennoprompt: I saw that it smacked the $parse around to inject cljs compat. something to think about.
18:35nopromptcallen: yeah, that's actually one of neat things.
18:36nopromptcallen: i'm using it on a project right now and it works fine but, like i said, it feels hackish.
18:36akurilinHey 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:36nopromptcallen: but feelings are for rubyists.
18:36noprompt:-P
18:36callennoprompt: I feel similarly...about Rubyists...
18:36coventry`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:37callenakurilin: 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:38akurilincallen, assuming I'm already doing the http codes right, should I basically come up with my own internal error schema?
18:39nopromptthis 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:39callenakurilin: more or less, just follow the pattern of the protocol you're using and stick to it.
18:39lgs32acoventry: game over i guess.
18:39amalloycoventry`: try macroexpanding the defn, and see if it looks suspicious
18:39akurilincallen, I'm not sure what that means tbh.
18:40clj_newb_2345somewhat 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:40lgs32acoventry: does defn work in other namespaces
18:40callenakurilin: if it's predominantly a JSON API, then return JSON.
18:40coventry`amalloy. Oh, duh. Thanks. (def tst (G__212620/fn ([] 1))) I must have eval'd something in the wrong namespace...
18:41akurilincallen, I see, thanks!
19:02nopromptdnolen: i noticed that with links and form submissions you need to do a "regular" listen + preventDefault. is there reason why?
19:03nopromptdnolen: iow. it seems like by the time i pull the event off the channel it's to late to call .preventDefault.
19:09MisterSinisterI think there's something about defrecord I'm not getting.
19:10MisterSinisterSince I keep getting this error here:
19:10MisterSinisterCompilerException java.lang.ClassFormatError: Duplicate method name&signature in class file...
19:10MisterSinisterI'm trying to have the record implement a protocol, and it keeps giving me this error.
19:11coventry`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:11lazybotjava.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!
19:11coventry`(Which complains about no such namespace d)
19:17dnolennoprompt: 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:18dnolennoprompt: 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:18callenis it common to expect a burst of activity on a channel with nothing happening later and then timeout the "taking" from the channel?
19:19dnolennoprompt: 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:19callenspecifically to funnel data from a callback to somebody else. or should I just use an atom?
19:19technomancycallen: IRC channel or something else? =P
19:19callencore.async
19:19callentechnomancy: didn't you hear? this is #core.async every time, all the time.
19:20nopromptdnolen: it's only a minor annoyance. but then again i guess that's what abstraction is for.
19:20dnolencallen: not sure what you mean by "nothing happening"
19:20callendnolen: nobody is going to put into the channel after the initial burst.
19:21callenI'm sanity-checking that this is a problem-modelling mismatch
19:21dnolencallen: like to handle the case if somebody doesn't take?
19:21callenthe 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:21callendnolen: it's to funnel data from a callback with a closed over channel to somebody else who gets handed the channel.
19:22callenbut the burst of data is a one-off.
19:22callenit's not a persistent relationship.
19:24callenI'm just marshalling a seq of data from a callback that will begin recv'ing and funneling the data but only "once".
19:24callenby all means tell me if I'm doing something dumb.
19:25dnolencallen: I guess I don't see a problem?
19:25callenIt felt like I might be doing something wrong.
19:26callendnolen: believe it or not, I doubt myself sometimes ;)
19:28dnolennoprompt: 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:36dnolennoprompt: 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:36nopromptdnolen: what do you mean by "coordination atom"?
19:37dnolennoprompt: just an atom you can bang on to trigger prevent default
19:38nopromptdnolen: like with a watch?
19:38nopromptdnolen: this is very new ground for me. :-/
19:40dnolennoprompt: look at html-menu-events http://swannodette.github.io/2013/08/17/comparative/
19:40dnolennoprompt: in my design listen takes an extra fn parameter which can interact with the event before it enters a channel
19:41nopromptdnolen: reading...
19:43dnolennoprompt: 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:43dnolennoprompt: 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:48clj_newb_2345what is the clojurescript alternative to jquery?
19:49nDuffclj_newb_2345: cljs _can_ be used with jQuery.
19:49clj_newb_2345ya
19:49clj_newb_2345but suppose for rthe sake of purity
19:49clj_newb_2345I wnated pure clojurescript
19:49dnolenclj_newb_2345: I don't recomment it personally, GClosure doesn't pretty much everything need w/o adding another 32 of Gzipped code
19:50nDuffclj_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:50nDuffclj_newb_2345: ...though if you want something that's cljs all the way down, I don't know that that exists.
19:50dnolenclj_newb_2345: GClosure *does* everything I mean
19:50clj_newb_2345dnolen: are you not recommenting jquery, or are you not recommending google closure?
19:51clj_newb_2345dnolen: even for mobile apps?
19:51clj_newb_2345actually, i'm stupid, i should mention taht i'm targeting the iphone and the nexus 4
19:51dnolenclj_newb_2345: not recommending it ever with CLJS
19:51clj_newb_2345dnolen: is "it" jquery or is "it" google closure?
19:51clj_newb_2345I'm getting confused by the anarmorphic macros
19:51dnolenclj_newb_2345: I don't recommend jQuery.
19:51clj_newb_2345I understand now. :-)
19:51dnolenclj_newb_2345: unless you're depending on jQuery UI, which I also don't recommend
19:52clj_newb_2345dnolen: so you recommend google closure instead ?
19:52dnolenclj_newb_2345: yep
19:52clj_newb_2345actually, I was wondering if someon refactored out pedestal's rendering libraries
19:52dnolenclj_newb_2345: thought it doesn't have have usable widgets, but I'm comfortable writing those myself.
19:52clj_newb_2345I like this idea of just sending "diffs" and the right htings happening
19:52dnolenyour mileage may very
19:56dissipate__dnolen: is there a pure clojurescript widget toolkit?
19:57dissipate__i haven't been able to find one
19:57dnolendissipate__: there is not
19:57dissipate__dnolen: why did you recommend google closure widgets?
19:58dnolendissipate__: I specifically did not recommend them
19:58dnolendissipate__: but there's a single JS widget library I would recommend, they're all abominations for the most part
19:58dnolen"there's not a single"
19:59dissipate__member:clj_newb_2345 member:dnolen: member:so you recommend google closure instead ?
19:59dissipate__[member:dnolen member:clj_newb_2345: yep
19:59dnolendissipate__: over jQuery, nothing to do w/ widgets
19:59clj_newb_2345wtf is this whole "member:" thing?
19:59clj_newb_2345https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-01.md <-- my next readig project
19:59dnolenif you use jQuery for basic DOM facilities and cross-browser quirks, GClosure is just as good and optimizable
19:59clj_newb_2345anyone recommend against it?
20:00dnolenclj_newb_2345: it looks pretty good
20:01dissipate__clj_newb_2345: my IRC client is a clojure REPL, members of the chat are labeled as such.
20:08llambdahm is it okay to use lein-serve in production? e.g. serve-headless?
20:08llambdaer ring-serve, rather
20:09technomancyllambda: it's possible, but uberjars are way easier
20:10technomancyeasier not to screw up
20:10llambdatechnomancy: yeah i'm actually compiling it into an uberjar
20:11dissipate__anyone know if this site is up to date? http://www.clojure-toolbox.com/
20:11technomancyllambda: 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:11llambdai 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:12technomancyllambda: https://github.com/technomancy/syme/blob/master/src/syme/web.clj#L140
20:12llambdaah so it is better to use run-jetty directly, technomancy?
20:12technomancyIMO it's better. others disagree.
20:13llambdai'm inclined to go with your opinion :)
20:13llambdathank you for the advice!
20:13technomancynp
20:21danielszmulewicztechnomancy: I'm running `lein with-profile production task`, is this sufficient to "remove the other profiles" or is there additional things to do?
20:21technomancydanielszmulewicz: that's enough for profiles, but you probably want trampoline too
20:21danielszmulewicztechnomancy: so that leiningen exits the jam?
20:22danielszmulewiczjvm
20:22devngood evening
20:22technomancyyeah
20:22danielszmulewicztechnomancy: thanks.
20:22technomancyin the past some profile settings interacted badly with trampoline... all the known bugs have been fixed
20:22devntechnomancy: is syme back and working?
20:22technomancybut uberjars are always going to be simpler
20:22technomancydevn: i've used it a couple times since you mentioned the issues
20:22devnawesome
20:23devni think i might give it a try with someone i'm working with tomorrow
20:24Raynesdevn: How's things?
20:24technomancyI want to toss out the DB and replace it with a write-only event log
20:26technomancyI should probably do that to clojars first tho
20:27devnRaynes: pretty good
20:27devnyou?
20:27clojurebotyou are likely to be eaten by a grue.
20:27technomancyclojurebot: botsnack
20:27clojurebotThanks, but I prefer chocolate
20:42coventry`What's the right way to catch an IllegalArgumentException? E.g., ##(try (take 2 'foo) (catch Exception e nil))
20:42lazybotjava.lang.SecurityException: You tripped the alarm! catch is bad!
20:42coventry`(That fails to catch the IllegalArgumentException from trying to seq 'foo, in my hands.)
20:42coventry`Hmm, why is catch dangerous?
20:44technomancyit's dangerous to expose in an arbitrary-eval bot
20:44callentechnomancy: embrace danger!
20:44callenexcitement!
20:45coventry`I'm curious about how catch could be used maliciously.
20:46technomancyyou could construct a loop that would never exit
20:47coventry`,((fn [] (recur)))
20:47coventry`Hope I didn't break it.
20:47clojurebotExecution Timed Out
20:49coventry`How is throw different?
20:49coventry`/worse?
20:49coventry`Even if I try to catch IllegalArgumentException, it fails. Bizarre.
20:52xeqitechnomancy: I've been using datomic-free lately in a project, and it would work well for the clojars event logs as well
20:52akurilincallen, 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:53technomancyxeqi: strongly object to introducing a proprietary dependency
20:53callenakurilin: I implicitly memoize it by def'ing a map and using it as if it were an fn.
20:53callenakurilin: I use weavejester/environ with it.
20:54callenxeqi: <3
20:54callenxeqi: I like datomic, but a proprietary dependency in a community resource like clojars is a little scurry.
20:55akurilincallen, sounds good, thx!
20:55callentechnomancy: talk to me about event logs.
20:55callentechnomancy: I love this stuff. Live for this stuff. Whatcha need stranger?
20:55technomancycallen: I need like a week to sit down and just make it work =)
20:55technomancywell, we could use some review
20:55xeqicallen, technomancy: agreed, just found it humorous how similar the ideas are
20:56technomancyxeqi: if we had a nontrivial amount of data I might be more inclined to look for other options
20:56callenxeqi: is he planning to write an event sourcing system?
20:56technomancycallen: it's already written =)
20:56technomancyit's just not fully switched on
20:57xeqitechnomancy: 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:57xeqiah
20:57callentechnomancy: gerd dermert
20:57technomancyI'm just not sure I trust it yet
20:57callentechnomancy: write tests.
20:58xeqitechnomancy: ah, fun w/ a staging environment
20:58technomancyI'm not good at that like xeqi =)
20:58callenI heard if you write enough unit tests you can prove god doesn't exist.
20:58technomancythe cool thing is both code paths co-exist
20:58callenor at least, that's what Rubyist told me.
20:58callenwhat a*
20:58technomancyso we could run another instance that reads from the event stream or something on another port
20:59technomancyargh; gotta go but we should talk event streams some time
21:04ddellacostacallen: trying to think of the appropriate Hitchhiker's Guide to the Galaxy quote for unit tests + existence of god
21:05ddellacostaANYHOO, 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:06callenddellacosta: 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:07callenddellacosta: in this case, it's unlikely to hurt you though.
21:08ddellacostacallen: 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:09ddellacostacallen: I gotta figure out whether or not it is worth it to really do it The Right Way in this case or not...
21:09callenI must be getting too predictable. Time to start randomly giving destructive advice.
21:09callenddellacosta: all else fails, leave a comment warning.
21:10callen;; forgive me, this relies on implicit ordering. Feel free to egg my house if this ruins your day.
21:10ddellacostacallen: haha, no, it's more to say, I knew *someone* was going to say that.
21:10callenddellacosta: it's okay, I'll give more interesting advice in future.
21:10ddellacostacallen: haha, perfect.
21:10callenI need to start spreading the gospel of #=
21:10ddellacostacallen: nothing wrong with being the voice of reason, you know.
21:11ddellacostacallen: woah, what is #=? haven't seen that one
21:11ddellacosta#_ makes me mad
21:11ddellacostaheh
21:13xeqiddellacosta: #= is read-eval, basically clojure might eval code as part of reading it
21:13ddellacostaxeqi: thanks. That reader syntax is a pain to Google.
21:14`rhg#= ftw
21:14`rhgso many holes lol
21:15xeqi`rhg: have you found an arbitrary code execution with *read-eval* false in 1.5+?
21:15`rhgno
21:15`rhgbut some cba to bind it
21:16mangeddellacosta: Could you use (apply map vector (map (juxt :k1 :k2 :k3) some-seq-of-maps)) instead?
21:16francis_wolke``rhg: cba?
21:17`rhgi stole it from an english dude
21:17`rhgmeans could but im too lazy
21:17ddellacostamange: oh wow, let me try that, may just do it
21:17francis_wolke`k
21:18callen`rhg: most polite rendering I've seen.
21:18`rhg:D
21:20ddellacostamange: 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`rhgclojure does that
21:22ddellacosta`rhg: not sure what you meant by that, but feel like I probably agree
21:22`rhgmakes simple work best
21:22ddellacosta`rhg: ah. Yep, agree
21:23`rhgi dont really like the jvm, but clojure is so addictive
21:24mlb-How can I refer to an anonymous function inside said functions declaration?
21:24xeqimlb-: (fn scoped-name [] ... (scoped-name ...))
21:24hyPiRionor just recur, in certain cases.
21:25mlb-hyPiRion: yeah... don't wanna have to take the time to rewrite function in TCO style
21:25mlb-xeqi: I assume scoped-name is only in the anonymous function's scope?
21:25hyPiRion,(recur) ;D
21:25mtpwrite it that way in the first place :)
21:26mtpbnew
21:26clojurebotExecution Timed Out
21:26mtperrrrrrp
21:26xeqimlb-: yes
21:26mlb-xeqi: awesome, thanks
21:27mlb-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:28callen`rhg: ditto, but I'm warming to the JVM
21:28callenmodulo start time.
21:28callenhaving something "hella fuckin' fast" is cool.
21:29`rhgsame
21:52drusellersWhat 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`rhgalmost, but not quite
21:54sdegutisdrusellers: 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:54drusellerssdegutis: ok, that makes sense in the context of my link as well.
21:54drusellersthank you
21:55callendrusellers: it's nothing to do with being private.
21:55xeqisdegutis: did you see technomancy's awnser about why project.clj is not just a data structure?
21:55sdegutisxeqi: never
21:55drusellerscallen: not in the terms of defn, but more of a way to notate it. especially in this case of using a macro. eh?
21:56drusellersdefn-
21:56callendrusellers: 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:56callendrusellers: defn- is private, but * as a notation has absolutely no connection with being "private".
21:56drusellerscallen: agreed
21:56drusellerscallen: notation of something lower level
21:56callendrusellers: slightly. I would emphasize the "counterpart" part.
21:56callendrusellers: I encourage people to use the * fns in Korma.
21:56drusellerscallen: ok cool
21:56callenwhen the macros don't suit them, that is.
21:57callenanything meant to be private, will be.
21:57sdegutisxeqi: Ah, just read now: http://logs.lazybot.org/irc.freenode.net/%23clojure/2013-09-09.txt
21:57callendrusellers: it's an old pattern from other Lisps.
21:57Apage43in 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:57sdegutisAlthough I wonder why the defaults come from under project.clj rather than being merged over it.
21:58drusellerscallen: excellent
21:59drusellerssdegutis: thank you as well
21:59xeqisdegutis: can you explain the orientation metaphor
22:00sdegutisxeqi: Actually, never mind it. It might not make sense.
22:16akurilinAssuming 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:17callenakurilin: define nested? I use (context ...) when there's a route prefix.
22:18sdegutisakurilin: I don't do MVC. I do FI.
22:18akurilinas in users/favorites or something like that
22:18sdegutisWhere I = Interface, usually HTTP, and F = Feature, i.e. my own personal code.
22:18callenakurilin: so you have multiple things under "users/*"?
22:18callenakurilin: if that's in fact what you mean, then what I said applies. route prefix.
22:19callenuse context in this case.
22:19callenif not, please elaborate.
22:21akurilincallen, 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:21callenakurilin: yes it is.
22:25akurilinThere 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:25akurilinAs 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:26akurilinThe latter approach is actually tempting. Define something like routes.clj and have everything in there for the entire web all.
22:26callenakurilin: you probably want to centralize the routes. It makes reorganization and seeing where things live easier. It's also more idiomatic to Compojure.
22:26akurilin*app
22:26callenI usually do my routes per-file at the bottom, but that can work too.
22:28akurilincallen, 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:28coventry`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:28coventry`"it *can't* find "baseLoader""
22:28akurilinmy refactoring todos list grows at a much higher rate than the items get checked off :|
22:29callenakurilin: are you relatively new to Clojure and Clojure web projects?
22:29akurilincallen, For sure.
22:29callenIf so, that's pretty normal.
22:30callenThere 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:30callenThe book by yogthos should address some of that.
22:30akurilincallen, it's on the reading list for sure, I'm all about cherry picking
22:30callenas thou wilt. Just mentioning.
22:31callenakurilin: we need to grab a meal sometime.
22:31akurilincallen, would love to.
22:31callenI'm sick at the moment, but assuming I don't actually perish, I could do something later this week.
22:32akurilincallen, 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:33callenakurilin: you see my PM?
22:42ghena1986http://bit.ly/183GBEv
22:43akurilinWhat 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:43akurilinWould be nice to have someone confirm that it's a good role model.
23:09callenakurilin: looks reasonable.
23:20coventry`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:21coventry`Oh, is lazybot dead again?
23:21coventry`,(do (defrecord mrk [b]) #user.mrk{:b 1})
23:21clojurebot#<RuntimeException java.lang.RuntimeException: Record construction syntax can only be used when *read-eval* == true>
23:21muhooi played around with bishop, used in a project, but now wonder if it's just too much incidental complexity
23:21muhooREST in general feels that way to me sometimes, like it's forced.
23:24coventry`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:25sdegutisWow. It just hit me that Clojure is actually a serious competitor to Java now for many many tasks.
23:26eggheadsdegutis: if you ignore the adoption curve
23:27amalloycoventry`: 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:27sdegutisegghead: I'm only talking technically.
23:28sdegutisIt's not just some makeshift duct-taped thing strapped on top of Java. It's legit.
23:28eggheadsdegutis: technically I'd say it's already beaten java, at least in feature set & expressiveness
23:28sdegutisegghead: Yeah, for most apps that I can think of, I'd use Clojure over Java.
23:29callenmuhoo: I straddle the line between REST and RPC in most of my apps.
23:29callenmuhoo: I'm generally not comfortable with REST APIs in terms of how they express and communicate state.
23:31coventry`amalloy: Thanks, that's great.
23:34SorellaHello, 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:34coventry`I should start looking in useful for these kinds of things.
23:35justin_smithSorella: (io/resource "path/relative/name")
23:35justin_smithbonus. that works from inside the dir before making the jar, or from inside the jar after shipping and loading in another project
23:36justin_smithclojure.java.io/resource, that is
23:37Sorellajustin_smith, does that work for resources that are outside of the JAR? I have a directory with `app.jar templates/`.
23:37justin_smithit works for anything in classpath / resource path
23:38clj_newb_2345besides 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:38coventry`What is a unit of code-in-a-file called in clojure? A module? (Coming from python.)
23:39clj_newb_2345function ?
23:39justin_smitha file? usually one ns per file is the convention
23:39coventry`I guess I can just call this "eval-file". Thanks.
23:39Sorellajustin_smith, oh, awesome. Thanks :)
23:43justin_smithcoventry`: http://clojure.org/compilation says that each file, each fn, and each gen-class will produce a class file
23:44ddellacostahmm, 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:44ddellacosta*#@$! IE8
23:52callenddellacosta: inst?
23:53ddellacostacallen: 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:53callenddellacosta: test on Himera?
23:54ddellacostacallen: yah, one sec
23:54ddellacostagood idea
23:57zanescallen: Can you say more about your discomfort with REST and how it expresses and communicates state?