#clojure logs

2015-02-01

00:08ToBeReplacedraspasov: (apply map vector your-list-of-lists)
00:10raspasovToBeReplaced - nice!
00:10raspasovthat's the kind of thing I was looking for :)
00:23avshalomhi all, i'm working in the cider repl, and wonder do i suppress output?
00:23avshalomi'm wondering if there is a *print* variable...
00:27Jabberzany recommendations on db migration libraries for on-going systems .. drift, ragtime, lobos? Are any of these widespread and/or actively maintained?
00:38ToBeReplacedraspasov: yeah... there's pretty much always a pretty way; knowing that "apply map" facilitates "unzip" helps
00:40raspasovyea it's good :) and I think more or less the same efficiency as the (reduce)
01:11krat0sprakharhi all, i've been trying to reimplement juxt for a 4clojure problem
01:11krat0sprakharhere's mine and the reference implementation
01:11krat0sprakharhttps://www.refheap.com/96749
01:12krat0sprakhari'm sure i'm missing a few cases since my implementation is so minimal
01:12krat0sprakharany idea which testcases will fail with my-juxt?
01:36kirgreetings all
01:40kirIs there a way I can output Clojure-Reader processed text files and also the java version pre-compilation to byte-code?
01:42kirI'm looking to concretize some concepts
01:43scottjsee reify
01:44scottjj/k
01:47cflemingkir: There is no java version pre-compilation
01:47cflemingkir: Clojure compiles directly to bytecode
01:52krat0sprakharcfleming: after your recommendation, i tried cursive yesterday
01:52krat0sprakharits awesome :D
01:53krat0sprakharthe ideavim plugin is great as well.. thanks a lot :)
01:53kircfleming : I see. Thx. Off I go to wade though the src with a debugger
01:53kirthrough*
02:05cflemingkrat0sprakhar: Great, I'm glad you're liking it!
02:06cflemingkir: What are you trying to discover?
02:08krat0sprakharcfleming: any clue about https://www.refheap.com/96749
02:10cflemingkrat0sprakhar: What do you want a clue on?
02:11krat0sprakharso i've been trying to implement
02:11krat0sprakharthe juxt function.. for a 4clojure problem
02:12cflemingRight.
02:12cflemingLooks like it's working, right?
02:13krat0sprakharyeah.. it works
02:13krat0sprakharbut why is the clj.core implementation
02:13krat0sprakharso elaborate?
02:13krat0sprakhari'm surely missing a few cases (thats why mine is minimal)
02:13krat0sprakharbut i'm not able to figure out what are those cases
02:15cflemingI think it's for efficiency - apply and reduce are slower than a normal invoke, so they have fast paths for up to 3 parameters
02:18krat0sprakharoh ok.. thanks a lot! :D
02:18krat0sprakhari've seen this pattern in a lot of core functions..
02:18cflemingYeah, I think that's why
02:18krat0sprakharcool.. thanks!
02:18cflemingNo worries
03:06expezany alternatives to friend when securing a REST backend?
03:10Jaoodexpez: buddy
03:13expezJaood: Any thoughts about which one is easier to use with liberator? Security really isn't a concern at this point because I'm not sure I'll ever get any users :p
03:18Jaoodexpez: I haven't use friend or liberator, so can't say, this tutorial was posted recently: http://rundis.github.io/blog/2015/buddy_auth_part1.html
03:19Jaoodcompojure suits me for small APIs
03:20krat0sprakharcompojure is like the flask of clojure ecosystem
03:27ianhedoesitthis discussion is relevant to me! I'm working on a compojure project which includes file uploading and I'm having trouble figuring out how to do it. all the information I see online is from years ago.
03:27justin_s3ithianhedoesit: there is a middleware for file uploads
03:27justin_s3ithhttps://ring-clojure.github.io/ring/ring.middleware.multipart-params.html
03:29ianhedoesitI don't know what to do with that information! I've never written anything that could upload or receive files. this is all new to me. I suppose I should spend some more time just learning about the process of file uploads in general.
03:30joonas_ianhedoesit: that's the fun of programming, we are allowed to build prototypes to learn and then integrate the new knowledge to our work.
03:30justin_s3ithianhedoesit: you create an upload form for the html side, this will work the same way it would with any other server, plenty of examples are online
03:31justin_s3ithianhedoesit: that middleware, if wrapped around your handler, detects the upload and puts it in the request map as documented, then your handler can use the request map to access the file
03:32ianhedoesitjoonas_: yeah but anything to do with servers seems like magic to me.
03:40joonas_ianhedoesit: meteor.com abstracts most of the server stuff away and you can program it with cljs
04:08ianhedoesitjoonas_: I've heard of meteor, but I'm not sure if it's something I want to use. It seems like a great tool for actually getting something done that people will use, but this is more a learning experience with Clojure, servers, databases, heroku, etc.. I enjoy stumbling over myself while I learn to make something that looks and functions poorly. :)
04:09ianhedoesitbut! since I first said I had an issue about an hour ago, I'm able to upload the contents of a file and surface them on a website, which is part of my goal.
04:09joonas_ianhedoesit: I understand, I am the same
05:08Xackhm, trying to use `lein install` to test a template i have modifier, and i get
05:08XackFailed to resolve version for luminus/lein-template:lein-template:jar:RELEASE: Could not find metadata luminus/lein-template:lein-template/maven-metadata.xml in local (/home/zack/.m2/repository)
05:09Xackaaand, nvm, i was using `lein new` wrong
05:50krat0sprakharquick question everyone - how do i clear the locals in an open cursive REPL window?
05:50TEttingercfleming to the rescue?
05:51krat0sprakharTEttinger: :D
05:51cflemingkrat0sprakhar: What do you mean by clear the locals?
05:51krat0sprakharif i define (def x 124)
05:51krat0sprakhari want to clear its value
05:51krat0sprakharso that i get x as undefined
05:52TEttinger(doc undef)
05:52clojurebotNo entiendo
05:52TEttingerjust guessing here
05:52cfleming(doc ns-unmap)
05:52clojurebot"([ns sym]); Removes the mappings for the symbol from the namespace."
05:52krat0sprakharhehe.. clojurebot is awesome
05:52krat0sprakharoh ok.. so i have to do it manually.. got it.. (or i can just close and open a new window)?
05:53krat0sprakharwhat does locals clearing mean in this document - https://cursiveclojure.com/userguide/repl.html
05:53krat0sprakhar?
05:53cflemingkrat0sprakhar: So (ns-unmap *ns* 'x)
05:54krat0sprakharyup.. i have a lot of such variables lying around.. so i just started a new session.. thanks!
05:54cflemingkrat0sprakhar: Ummm, it's explained in that doc :)
05:54cflemingkrat0sprakhar: That's something else, for debugging
05:54cflemingkrat0sprakhar: But yeah, you can stop and restart the REPL to get a fresh one any time
05:55krat0sprakharok.. sorry.. i did try reading it.. i guess i'm too noob it understand it at this stage :D
05:55krat0sprakharthanks!
05:55dysfunokay, well let's try and explain it more simply
05:56dysfunbasically, in a garbage collected language, when something is no longer accessible, it's free to be collected and the memory used freed for use for something else
05:56dysfunin some languages, you 'free' memory by assigning the equivalent of nil to it
05:57dysfunbecause of the design of clojure data structures, the compiler effectively does this to certain data
05:57dysfunto make sure that they will be freed
05:57dysfunit should only be an optimisation. and in production code, it doesn't matter
05:57dysfunbut if you're trying to debug something, it can occasionally cause surprising results
05:57dysfunhence, there's an option to turn it off
05:58krat0sprakharoh.. thats helpful.. thanks for explaining dysfun!
05:58dysfunyou're welcome
05:59krat0sprakharalthough to fully appreciate i do need to run into one of those "surprising results".. which i'm sure will come with experience
05:59dysfunwell i've been doing clojure full time for about a year now and i've not run across such a situation yet
05:59krat0sprakharhaha...
05:59krat0sprakharbtw, does anyone else agrees that 4clojure is damn addictive
06:00krat0sprakharinstead of doing my office work and i'm spending all my time on it :D
06:00dysfuni got bored of it pretty quickly and started solving real problems instead
06:01krat0sprakharoh hmm.. i'm still looking out for some ideas
06:01AeroNotixdysfun: did you put a suit and tie on as well?
06:01AeroNotixReal Problems for Real Programmers
06:01krat0sprakhar:D
06:01dysfunthere's no such thing as a real programmer
06:01SagiCZkrat0sprakhar: 4clojure is really frustrating for me.. every problem takes me so long... even the easy ones!
06:01cflemingkrat0sprakhar: You'll find locals clearing very annoying very quickly if you use the debugger
06:01dysfunwe're all amateurs. we still have no idea how to build enormous systems
06:01krat0sprakharSagiCZ: +1
06:02cflemingkrat0sprakhar: Basically your local variables will frequently be set to nil by magic
06:02SagiCZkrat0sprakhar: but i agree it is a damn good exercise for anyone starting with clojure.. it helps you understand the internals better
06:02krat0sprakharcfleming: yup! dysfun explained it very well..
06:03krat0sprakharSagiCZ: yeah.. had it allowed named functions it would've been better..
06:03dysfunalso note that i don't use a debugger though
06:03krat0sprakharme neither..
06:03dysfuni architect my code for maximum repl-friendliness
06:04krat0sprakharso this is from an HN comment - but do anyone find it hard to read others clojure code?
06:04krat0sprakharthe 4clojure solutions by others
06:04krat0sprakharhalf of time i have to spend an equivalent amount of time to get how the code does what it does
06:04dysfuni can't comment about the 4clojure solutions, but i've read through a lot of clojure libraries by now and it seems mostly fine
06:04krat0sprakhar*does anyone
06:05krat0sprakharoh ok..
06:05krat0sprakharthats a relief
06:05dysfunthe problem isn't one of clojure in particular, but of turing completeness and the halting problem
06:05krat0sprakharunreadable code is due to halting problem? how?
06:05dysfunhowever, for the record, i find that clojure libraries are generally well organised and fairly easy to track because of the focus on building simple things
06:06Glenjaminclojure.core is not a good place to look for examples of neat clojure
06:06dysfunwell there are infinite ways to express a given operation
06:06dysfunfor example, how do you take a map and keywordify the keys?
06:06dysfuni can think of at least 3 ways in the first second
06:07SagiCZkrat0sprakhar: 4clojure is basically codegolf.. it mentions there that you shouldnt take the solution of other people as idiomatic clojure code.. it is not
06:07krat0sprakharSagiCZ: Oh it does? I must have missed that note.. :D
06:08dysfunincidentally there is a kind of clojure golf i'm fond of - the one where you look again at the standard library and see if you can simplify the logic
06:08dysfunthe cheatsheet is quite good for that
06:15dysfunkrat0sprakhar: the other thing that strikes me is that as clojure is getting older, we've gotten so much better infrastructure. library quality has improved massivley and libraries use each other more
06:15SagiCZas for the unreadable code.. there was some nice article about code density from one of the members of this channel but i forgot who it was from
06:15dysfundocumentation seems a lot less of an issue than when i first started clojure a few years ago
06:15SagiCZit was bbloom
06:16SagiCZkrat0sprakhar: read it.. it might make you feel less stupid http://www.brandonbloom.name/blog/2013/06/24/code-density/
06:16krat0sprakharSagiCZ: haha thanks!
06:16krat0sprakharhttp://en.wikibooks.org/wiki/Clojure_Programming/Examples/Norvig_Spelling_Corrector
06:16SagiCZdysfun: i must say i still think that clojure documentation is subpar
06:16hellofunka lot of the code in clojure.core has been written the way it is for performance optimizations that can cover a wide range of potential uses. it's often not an ideal example of writing clojure since it's basically the engine of the whole system.
06:16krat0sprakhari think this is the best example
06:16krat0sprakharvery hard to understand what this does
06:17krat0sprakhareven though its by Rich Hickey himself
06:17dysfunSagiCZ: yeah, but a lot of it piggybacks on java-y stuff, so quelle surprise
06:18dysfunhellofunk: see also most languages. if you read strict.pm (in the perl core) you'd have a fit. i once put an excerpt of it on a slide at a perl conference and asked people to identify it
06:18dysfun(mostly because it does magic stuff at compile time involving bit-twiddling to set up some parser variables
06:19krat0sprakharSagiCZ: Thats a great article! Thanks a lot
06:19dysfunhellofunk: i also note that i find it particularly painful reading the java source of clojure, which i've had to do a lot of recently
06:21krat0sprakharWhen you start writing some object-oriented code, you spend a bunch of time creating classes and defining the shape of your domain. There is some delay between when you begin typing and when you run head first into the problem at hand.
06:21krat0sprakharpretty cool observation in the article
06:21dysfundepends how you write your OO code. mine usually has a pretty functional expression
06:22dysfunbut i expect that article is talking about the java way
06:22dysfunand java has
06:22dysfunpretty much the worst code density of any language
06:23dysfunlisp syntax lendds itself quite well to density as well, it's not just the libraries
06:27SagiCZdysfun: so in what language do you write your OO code?
06:28SagiCZi mean writing functional program in java is somewhat possible but far from idiomatic and may induce some stress on your coworkers
06:34dysfunSagiCZ: i write whatever i need to to get the job done. some of my favourite languages with OO support are perl and python
06:34dysfuni choose to avoid writing java where possible. and doing some c++ recently reminded me why i gave it up all those years ago
06:35SagiCZugh.. implying that c++ is ---- than java?
06:36dysfunwell frankly i'd rather write neither
06:36SagiCZi actually cant understand why would anyone still use c++ nowadays.. reminds me of southpark's manbearpig
06:36SagiCZi see
06:36dysfunat least c++ still has a purpose
06:36SagiCZjava does not have a prupose?
06:37dysfunjava had a purpose. now there are so many jvm languages it doesn't.
06:37SagiCZi dont think any jvm language is as mature as java
06:37dysfunbut clojure runs fast enough for small stuff and i wouldn't even try and build large scale stuff in java
06:37dysfuncan you imagine having to deal with all the concurrency crap?
06:38SagiCZthere are other things you have to deal with when you switch to clojure
06:39dysfunanything in particular?
06:40SagiCZbugs and subpar documentation
06:41dysfunclojure's documentation is better than most languages
06:41dysfunbugs are reasonably rare events and generally easily worked around
06:41SagiCZi am just comparing to java
06:41dysfuni find clojure documentation much more palatable than java on the whole
06:41SagiCZclojure's documentation is often cryptic and incomplete.. i read reduce's documentation 15 times not getting any closer to understading what it actually does
06:42dysfunah yes. occasionally i've had to google "clojure func-name" to see someone using something
06:43dysfunbut i do that in java too
06:43cflemingdysfun: I'd definitely argue on the doc and the bugs
06:43dysfunmore so in java because i want to see some full and complete working open source code so i can figure ou the library
06:43cflemingThere are a ton of pretty glaring bugs open in the tracker
06:43SagiCZdysfun: but the thing is.. most of clojure docs COULD be written BETTER.. they just arent..
06:44cflemingAnd I'd agree that the docs are, well, patchy
06:44Glenjaminclojuredocs examples are a big help
06:44dysfuncfleming: and yet i rarely run across them. perhaps because the authors of the libraries i used already worked around them
06:44cflemingdysfun: I guess you don't AOT
06:44dysfuni do not
06:44dysfuni'm aware that's a pain point though
06:44SagiCZi must always mention core.async/tap doc which blatantly omits what it actually returns..
06:45cflemingGlenjamin: Yeah, that is for sure - I use that all the time
06:45dysfunSagiCZ: patches welcome
06:45sobeli think the docs could use examples, or maybe a usage guide needs to exist for core functions
06:45sobeli've faced that too, where i'm pretty sure i want to use a function but i gotta search for examples to be sure
06:45Glenjamini think that's best left to userland
06:45SagiCZdysfun: i dont know how to patch.. maybe its something i should work on and stop complaining
06:45sobelprobably
06:46dysfunSagiCZ: pretty easy. take a fork on github, change the docs, generate a patch, sign the contributor agreement and file a bug on the wiki attaching a patch
06:46sobelSagiCZ: well, you gotta nail down the problem before you can do anything about it. but yeah, at some point complaining is its own end
06:46Glenjamindysfun: then wait 2 years
06:46dysfuni really wish they'd take pull requests on github though
06:46cfleming(inc Glenjamin)
06:46lazybot⇒ 12
06:46Bronsacfleming: dysfun there are a lot of bugs/enhancements open in the tracker with trivial patches written months if not years ago.
06:47Glenjamincore is extremely slow moving, which can be a good thing
06:47Glenjaminbut core is pretty big
06:47Bronsa(inc cfleming) ;; also here's your inc
06:47lazybot⇒ 9
06:47SagiCZBronsa: so what's the hold up? who is responsible? pitchforks ready?
06:47cflemingBronsa: Ahhhhh
06:47sobeli hope there's a dev rhythm and structure, not just constantly integrating community pull requests
06:47dysfunBronsa: that's sad :/
06:47sobel"cadence" they call it
06:48cflemingdysfun: This is why so many people run patched Clojure versions
06:48SagiCZdysfun: so as you can see.. you can't say clojure is as mature as java.. it may certainly be an advantage at times
06:48SagiCZbut not always
06:48BronsaSagiCZ: I don't like to accuse anyone in particular but the core team with the exception of a couple of guys is not active at all
06:48dysfunall i can say is i rarely run across real problems. but i can see other people do
06:48SagiCZBronsa: that sentence alone scares me to death... feels like they are abandoning clojure
06:49BronsaSagiCZ: no, that's definitely not the case :)
06:49SagiCZwell then i guess they deem it good enough?
06:50dysfunSagiCZ: clojure is a vessel for shipping a commercial database solution, after all
06:50sobelhuh
06:50SagiCZdysfun: what?
06:50dysfunthat was most definitely tongue in cheek
06:51sobeloic
06:51dysfunbut what i mean is that datomic relies on clojure and so long as they want to keep selling it, they're going to have to keep clojure going
06:51cflemingI don't think anyone thinks that Clojure is being abandoned
06:51sobelsounds like it was a runaway hit for them
06:52SagiCZwell i wouldnt want to spend another minute on something that's dead end
06:52cflemingBut patches and fixes take a long time, for better or worse.
06:52sobelclojure isn't a dead end
06:52dysfunwell, they've done the impossible. they've made lisp palatable to a large audience
06:52krat0sprakharis there a language that does patching and fixing well?
06:52cflemingHey, we're all here because we like it
06:52cflemingBut that doesn't mean it's perfect
06:52BronsaSagiCZ: we're saying that's the contributing process is slow, nobody is claiming that clojure is dead
06:53SagiCZBronsa: okay okay
06:53sobelmy biggest problem with clojure (and lisp for that matter) is i suck at it
06:53krat0sprakharsobel: :D
06:53dysfunmany of us in this channel are building our businesses on clojure and trust that it's going to continue to be a good choice
06:53SagiCZsobel: i must second this..
06:54SagiCZdysfun: so its a good reason to stop and think about it
06:54dysfunand given the scurrilous rumours i've heard of scala going closed source, it's looking great right now
06:54Bronsacfleming: my impression is that the core team doesn't have the time anymore to maintain it as it should, puredanger has been hired to do that job but: - he is just one person - he still depends on the core team.
06:55krat0sprakharscala compile times are just obnoxious..
06:55krat0sprakharthe only reason i'd prefer scala over clojure will be for static typing
06:55cflemingBronsa: That sounds about right. He's more active actually working on the language recently though, by the looks of it.
06:55dysfuns/compile times are/is/; # FTFY
06:55cflemingBronsa: I'd love to see more people with commit rights.
06:56Bronsacfleming: just rich & stu AFAIK
06:56cflemingBronsa: You, for a start :)
06:56SagiCZtbaldridge does not have commit rights?
06:57krat0sprakhari just signed up for tbaldridge's clojure series :D
06:58BronsaSagiCZ: http://dev.clojure.org/download/attachments/1572892/workflow.png?version=1&modificationDate=1372878725482
06:58cflemingBronsa: Yeah, looks like Stu is committing all Alex's patches
06:58Bronsacfleming: it'd be a lot better just to have more than one active jira screener (alex)
06:59cflemingBronsa: Yeah, no doubt
06:59Bronsafor a while it's been mostly alex screening, rich accepting/declining, stu committing and a couple of occasional other screeners. but with the mole of open tickets it's definitely not enough imho
07:00sobela mole is a lot of open tickets
07:01AeroNotixBronsa: moving away from Jira would also help
07:01AeroNotixit's an absolutely tyrannical way of working
07:01sobelwhy
07:01SagiCZjira is ok
07:02AeroNotixsobel: horrible UI, slow, hard to find things
07:02sobelthat sounds like a personal gripe, not an impediment to the whole team
07:02BronsaAeroNotix: agreed that jira sucks but it's definitely not the main issue
07:03SagiCZAeroNotix: whats better than jira?
07:03cflemingAgreed
07:04sobeli don't think it's that bad. feature/defect tracking is hard.
07:05AeroNotixGithub is fine enough for trivial clojure libs
07:05AeroNotixPerhaps not core clojure
07:05sobeldoes github provide multi-version tracking?
07:05dysfunjira is basically the git approach to issue management. sadly you have to build it out a lot to make it useful
07:05AeroNotixsobel: you imply that you *need* that for every project
07:05dysfunsobel: yes
07:06SagiCZjira has ten times more features than github repo
07:06sobelAeroNotix: no, i don't. i just think it's more useful for projects that get used in multiple versions concurrently, simply because deployments don't upgrade the moment you publish new code
07:06p_lSagiCZ: and can be unwieldy to use.
07:07p_lI should know, I deal with it every day
07:07SagiCZp_l: i work with it daily as well, why else would i talk about it
07:07sobelit's pretty god for building team workflows
07:07p_lJira can be good, yes
07:08sobelyou can also make a mess with it. shouldn't be a new concept for this audience.
07:08AeroNotixI find it's good for shepherding subpar junior programmers through a mildly complex connected issues
07:08SagiCZbut jira is NOT impediment for any team project.. thats just nonsense
07:08AeroNotixSagiCZ: incorrect
07:08AeroNotixAre you US-based?
07:08SagiCZno
07:08AeroNotixEU?
07:09SagiCZyes... your answer for jira replacement is github? seriously?
07:09AeroNotixSagiCZ: for trivial projects, yeah
07:09sobeldo you have anything constructive to add that isn't just mud-slinging at jira?
07:09AeroNotixsobel: of course, I get that you like Jira. But don't try to label it as simple mud-slinging because you don't like what I have to say.
07:09dysfunhonestly, github issues isn't that bad. you can abuse tags to do most things and email integration is nice
07:09sobelgithub is not a credible replacement. juniors are not the only ones who need tools to keep teh team cohesive.
07:09SagiCZwhat company works mostly on "trivial project"?
07:10sobelAeroNotix: it's not that i like or dislike jira, it's that you say things about it that i don't find sensible
07:10AeroNotixSagiCZ: a lot of companies have small projects that are trivial
07:10dysfuna huge bbc project i'm involved with is currently using github issues
07:10SagiCZAeroNotix: for tiny projects we use gitlab.. not github
07:10SagiCZbecause it is free and can be run locally
07:10AeroNotixgitlab is better than github
07:10jazikHi! What shall I do to improve my chances at gsoc 15? I'm relatively new to Clojure
07:10SagiCZfor anything worth our money we use jira.. without issues
07:10dysfuni disagree quite strongly with that. i don't like gitlab at all
07:11dysfunand quite happily give github not very much money every month
07:11AeroNotixit's got a much finer grained control over permissions and tagging, yet has none of the baggage associated with JIRA
07:11SagiCZdysfun: i find it to be very simplified github which has its drawbacks yes
07:11AeroNotixI regularly see >12 second page load times with JIRA as well, this is my main gripe with it.
07:11dysfungithub is pretty powerful and i argue that it scales well enough
07:12dysfunjira performance is quite annoying, yes
07:12AeroNotixand people build in these incredibly complex workflows, coupled with the perf. It's *horrible* to use to get work done.
07:12dysfunand when i've been sat in the project management seat i got quite angry
07:12sobeli have never seen these horrible jira load times people complain about. i know it's possible, but where i've worked, they have apparently solved it
07:12dysfunmost jira instances are not set up properly
07:12AeroNotixsobel: do you host it yourself or something?
07:12sobeluser workflows are not jira's fault
07:13AeroNotixsobel: you can say that about a lot of things
07:13SagiCZAeroNotix: of course we host our own jira..
07:13sobelAeroNotix: not sure, it wasn't my role/responsibility. i just know it worked.
07:13dysfunthey're a symptom
07:13sobelAeroNotix: i just did. it's a configurable tool. the mess you make with it is not the fault of the tool.
07:13AeroNotixThe ability to be able to make complex workflows is JIRA's fault.
07:13dysfunjazik: do you have some code on github?
07:13sobelbullshit
07:13sobelthat is ridiculous
07:13AeroNotixsobel: it definitely is the fault of the tool.
07:13sobellol
07:13AeroNotixlook at C++ or something
07:14AeroNotixthe language actively encourages you to make bad decisions
07:14AeroNotixJIRA is like that
07:14sobelyou're drunk
07:14SagiCZseems like this is a matter of opinion.. but to say that clojure is slowed down because of jira is just ludicrous!
07:14AeroNotixso many buttons and knobs to play with, project managers go crazy with the possibilities and ruin it for everyone
07:14dysfunokay, now we're just trading insults. maybe you'd like to take it outside
07:14sobeli'm sorry. power tools are for grown ups. grow up.
07:14AeroNotixThis just in: Jira is a power tool.
07:15AeroNotixdon't get butthurt because I don't like it.
07:15sobelwe get you don't like it
07:15AeroNotixI think it could be done properly, I just find it rarely is.
07:15sobeldo you get programmable tools?
07:15AeroNotixOf course.
07:15dysfunso, i hear there's this lisp that runs on the jvm....
07:15sobeldysfun: sounds too complex.
07:15AeroNotixjust like with Lisp, you're supposed to do things in moderation
07:15sobeldysfun: it will be abused because programmers cannot handle their own complexity. blame the tool.
07:15AeroNotixHalf the jira stuff I've been exposed to is incredibly complex and unnecessary.
07:16dysfunugh. just cut it out
07:16AeroNotixsobel: FYI I am just forced to use workflows, I never create them
07:16dysfunpeople have different tastes
07:16sobelindeed
07:16dysfuni've never worked with a well set-up jira fwiw
07:16dysfunand i hate that administrators take the piss with it
07:17sobeli've seen it both ways
07:17dysfunand i don't like the general approach
07:17dysfunbut i also know people swear by it
07:17dysfunone of them was one of my developers, which surprised me
07:17sobelit's like a lot of things. when it's good, you can't live without it, when it sucks, you start to think you could
07:17dysfunno, you really can live without it
07:17dysfunit's just a tool
07:18dysfuni'm sure you think some of the things i like suck
07:18sobeli know my product managers would be in a real pinch to manage the backlog and prioritize work across our somewhat complex array of versions in the field
07:19hellofunkdumb question: how does Jira tracking compare with Github issues?
07:19dysfunbut all i'm getting is "but emacs is so much better than vi"
07:19dysfunhellofunk: GH issues is much more basic, in short
07:19hellofunkdysfun: what features specifically?
07:19sobeldysfun: sorry that's all you're getting. my basic view is jira is like git, a construction set, and if you don't know the domain, the tool will only become part of the problem
07:19dysfunhellofunk: fewer fields to fill out, using tagging for organisation
07:20dysfunsobel: right. which doesn't necessarily lead to a preference for a particular tool
07:20cfleminghellofunk: You can make JIRA do whatever you want, it's extremely configurable - that also means it's often slow and complex
07:20sobeldysfun: sure, and i don't have a particular preference, i just like configurable workflow and this isn't my core expertise; i just know jira meets that need
07:20hellofunkbut JIRA is basically issue tracking, right? What types of configurations and complexity is usually introduced with JIRA?
07:20dysfunsobel: and most hatred of jira is individual configurations too
07:21cfleminghellofunk: GH issues is brain-dead simple, but if you need something it doesn't offer (issue priority, off the top of my head) you're out of luck
07:21dysfuncfleming: you can fake it with tags
07:21sobeldysfun: it comes with pretty good generic/common workflows. my view is, you need a good reason to justify modifying. bigger orgs do have good reasons!
07:21cflemingdysfun: Sure, I could fake the whole thing with a text file too :)
07:21dysfunsobel: and it's often left to someone who isn't actually working on those problems to set jira up
07:21sobeldysfun: and i've seen the downsides, too. i'm not saying it's a panacea, just a good configurable system. not even the only.
07:21hellofunkcfleming: i see. i used issue priority by putting labels on issues with varying priority
07:22dysfunsobel: so it's a human problem, but you see how people associate it with jira when most people do jira badly?
07:22dysfuncfleming: org-mode is quite good and checks into git nicely
07:22Bronsaif we're just complaining about jira ok -- but I'll say it again: the issue with contributing to clojure isn't jira. it would be the same whether we used gh issues or sent patches via mail.
07:23AeroNotixBronsa: what do you believe the issue is?
07:23jazik dysfun : Yeah, but only simple stuff like annotations etc.
07:23sobeldysfun: sure, and people say the same things about java
07:23cfleminghellofunk: To give you an example, at my last job we had a JIRA project for prod deployments. We could customise the workflow such that a deployment had to pass through various states, and in the last state 4 people from a group of approvers had to all approve the deployment before it happened. We could program JIRA to provide all that workflow, new screens, new concepts that aren't built in etc
07:23AeroNotixJIRA puts a barrier to entry on raising issues/trivial patches, though.
07:23AeroNotix(maybe you want that? who knows)
07:24sobeldysfun: doesn't mean the jvm is bad like they say, just means they did it wrong. maybe it is difficult, and most people don't try hard enough.
07:24dysfunaccepting pull requests would make the whole process more streamlined
07:24hellofunkcfleming: ah, thanks, that's a good example.
07:24cfleminghellofunk: At its core it's really a complex workflow engine that just happens to have an issue tracker built with it by default.
07:25sobeli remember when other programmers bitched about cvs and whined about how it just meant more bugs whenever they had to merge their code with the team
07:26dysfuncfleming: in the same sense that bloated goats was a distributed database that happened to ship with an email client? :)
07:26BronsaAeroNotix: the contributing process has a number of significant bottlenecks caused by the lack of an actual dev team
07:27cflemingdysfun: Googling bloated goats did not provide the answer I was looking for, although I did learn a lot
07:27dysfunhahaha
07:27dysfunlotus notes
07:27cflemingAhhh
07:28cflemingI do remember hating notes quite a lot
07:28dysfuni quit a job because their notes setup was so ridiculously crap
07:28sobeli quit one because they wanted me to become a ruby dev
07:29dysfunthere seems to be a surprising amount of money available for ruby contractors right now
07:29sobel(they had a great JIRA, to their credit)
07:29hyPiRionand COBOL developers as well
07:29BronsaAeroNotix: the fact that I'm contributor #11 to clojure with just 14 commits says a lot imho
07:29AeroNotixBronsa: indeed
07:29sobelapparently the startup community figured out rails is shorthand for "a little better than PHP hackers"
07:30krat0sprakharsobel: :D
07:30sobeli can't argue the value prop
07:30dysfunhyPiRion: danger money for COBOL developers! but can you imagine the tedium? one naming scope, remember?
07:31dysfunone day i woke up and realised that life's too short to do things you don't want to do for money
07:32dysfunas programmers, we can get away with that
07:32sobelthat is a principle i live by
07:32krat0sprakharclojure is in gsoc 15? wow! wish i were a student again :D
07:32sobeli have no misunderstanding, it is a privileged life
07:33dysfunsobel: we can continue this in #clojure-offtopic if you like
07:40imancdo other lisps generally have a (recur) form, or do they optimise recursive functions automatically?
07:42AeroNotiximanc: of the big Lisps, Scheme is the only one which *requires* it
07:42AeroNotixindividual CL implementations might implement TCO.
07:43dysfunjazik: well it shows you can program, that's a start. anything in clojure?
07:44dysfunmost CLs i think implement TCO these days
07:44AeroNotixdysfun: but it's not required by the spec
07:44jazikYeah, I added annotations in typed clojure
07:44dysfunand note that it's not the recur form, it's the automatic TCO
07:44dysfunAeroNotix: no. only scheme requires it
07:44AeroNotixdysfun: that's.... what I said.
07:44AeroNotix^^^^
07:44jazikdysfun: Yeah, I added annotations in typed clojure
07:44dysfunyes, i can read. i thought we were stating the obvious.
07:44imancinteresting. I thought maybe (recur) was purely due to limitations in the JVM.
07:45dysfunjazik: aha. right. i thought you meant java-style annotations
07:45jazikdysfun: :)
07:45dysfunimanc: yes. it is. scheme implements automatic tail call optimisation
07:46dysfunwhen the scheme implementation sees it's tail recursive, it transforms it into a computed goto
07:47Bronsadysfun: I believe scheme's TCO transforms every tail call into gotos, not just recursive calls
07:47dysfunloop/recur enables you to get the performance benefit you'd get from TCO on the jvm
07:48dysfunBronsa: don't remember off the top of my head but i suspect you're right
07:48AeroNotixTCR not TCO
07:49imancMakes sense.
07:49AeroNotixI kinda like the (recur) form
07:49dysfuni kinda like continuations
07:50krat0sprakharare people using core.typed in production?
07:50sobeli really like CSP. i got into Go-lang because it looked so easy there, but it's even easier in clojure
07:50krat0sprakhari mean is the library production ready?
07:51AeroNotixGod I hope people aren't using core.typed in production
07:51AeroNotixI heard there was a company that had 40% of their codebase under core.typed. I pity them.
07:51dysfunwhat makes you say that?
07:51AeroNotixIt's horrific.
07:52AeroNotixIt takes a long time to spec even the smallest of functions, the annotation syntax is, frankly, invasive
07:52imancbet they were a java outfit who decided to go functional
07:52AeroNotixand a lot of core.clojure does not have specs. So you either have to spec them, or tell it to ignore them.
07:52dysfunso there are pain points
07:53dysfunit's a work in progress
07:53AeroNotixdefinitely. Needs a tonne of work.
07:53dysfunbut the question is whethere it's safe for production
07:53AeroNotixDefine safe
07:53dysfunand i'd say yes it's safe
07:53AeroNotixdefine production
07:53AeroNotixIs it safe for you to write the code and have it not blow up? Sure.
07:53dysfunsafe can be "won't cause unexpected ill-effects"
07:53dysfunproduction can be "live environment"
07:54cfleming"Is it useful enough for some people to be worth the effort in their production apps"
07:54AeroNotixis it safe for you to piddle about with things that cost money and have arguably small gains? Depends.
07:54cflemingThe answer is clearly yes
07:54cflemingBecause people are using it like that
07:54AeroNotixYupp, some people find it useful.
07:54cflemingSo, probably not horrific, then.
07:55AeroNotixFor me, it is. I tried doing it to a couple of our apps here. Took a long time to convince core.typed of even the most trivial of things.
07:55muhukHi all
07:55AeroNotix~4 months ago?
07:56clojurebotCool story bro.
07:56AeroNotixhaha
07:56AeroNotixowned by a bot
07:56dysfunwell it's better to work it in from the start
07:56AeroNotixI've heard that, too.
07:57dysfunsee also: i18n and l10n, unicode support...
07:57AeroNotixa bit different
07:57sobelsee also: security, performance
07:57sobelsee also: datastore independence
07:58AeroNotixwith perf it's definitely different.
08:05dysfunsobel: not just datastore either. pick frameworks that are portable across hosts
08:05dysfungood luck running a google appengine app on AWS
08:06sobelyup
08:49sveriHi, I am trying to build an uberjar, which works, but emits this warning: If you only need AOT for your uberjar, consider adding :aot :all into your
08:49sveri:uberjar profile instead. I have :main declared in my profile.clj, but also :uberjar {:aot :all ...} as the warning suggests. Leaving out the :main declaration won't recognize my main class and I cannot run the generated jar then. What is the correct approach to building an uberjar with a -main method?
08:57tomjacksveri: what's the path to `:uberjar {:aot :all ...}` in your project.clj?
08:59tomjackit should be (defproject foo ... :profiles {:uberjar {:aot :all}})
08:59tomjackkind of surprised leiningen doesn't warn if you raise {:uberjar ...} there, but on reflection kind of not surprised either
09:00tomjacksveri: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L163
09:01sveritomjack: awesome, it seems to be working :-)
09:02sveriat least the compile, but it does not recognize the main class automatically?
09:02tomjackworks for me
09:02hyPiRionsveri: did you start out with `lein new app myproject` or just `lein new myproject`?
09:03sverihyPiRion: I am trying to build my own template and want to provide an uberjar task
09:03hyPiRionah
09:03sveritomjack: I just tried without the :main directive, will try it with :main^:skip-aot now
09:04hyPiRionhave a look at the project.clj generated by `lein new app ...`
09:04tomjackwhat's ^:skip-aot for?
09:04tomjack"^:skip-aot will not disable AOT compilation of :main when :aot is :all or contains the main class"
09:05sveritomjack: I thought this caused the warning, but it didn't
09:06sveriSo the trick is to put :uberjar into the :profiles path
09:06sveri(inc tomjack)
09:06lazybot⇒ 4
09:06tomjack(inc hyPiRion)
09:06lazybot⇒ 63
09:07tomjackI suppose someone has already complianed that it's not (swap! lazybot inc) oslt?
09:07tomjack(nom/fresh [someone]
09:08hyPiRionyes
09:08hyPiRion:p
09:17tomjackis it possible for maps of the name munges advanced compilation does to be made available to cljs code at runtime?
09:27dysfunyou can generate source maps
09:34tomjack(for!
09:34tomjackoops
09:50gfrederickstomjack: that password is too short, easy to crack
09:59dysfun(inc gfredericks)
09:59lazybot⇒ 115
10:18michaelr525`hey
10:18michaelr525`can reloaded.repl be used with leaven?
11:07justin_s3ithas long as it's not passover I don't see why not
11:14AeroNotixhas anyone seen a threadsafe function throttler that doesn't rely on core.async?
11:14AeroNotixI got this https://gist.github.com/6c9ac7cb4f5e7067eb44
11:21sverianyone from the cljx project here? Are there known problems using dash in namespace for cljx files and cljs builds?
11:25poushkarHow do I add a new value to :categories vector? (def global (atom {:categories []})
11:25poushkarthank you
11:26AeroNotixpoushkar: real question is why do you think you need that global?
11:26poushkar@AeroNotix it’s a ClojureScript app (Reagent) and I need some place for general app data
11:26AeroNotixAh so you're a JS dev
11:26AeroNotixok
11:26Bronsapoushkar: (swap! global update-in [:categories] conj new-val)
11:27poushkar@Bronsa oh I see, thanks a lot
11:28Bronsapoushkar: FYI there's no need to add "@" to highlight somebody in IRC
11:28poushkarBronsa: ok, thank you
11:29tomjackI disliked slack's convention, but now I think it may be valuable -- it seems useful to be able to refer to someone by nick without causing colors to show up on their screen
11:29tomjack@someone: sorry..
11:29Bronsatomjack: except most clients will highlight that anyway
11:30tomjackright
11:30tomjackwhich is why slack's convention could be more valuable than IRC's convention
11:31tomjack(not that we can do anything about it)
11:57justin_s3ithwhatever you say, t o m j a c k
11:58AeroNotixall slack does is reinvent what already exists but puts a pretty face on it
11:59zactshello
12:00zactshow may I properly convert between java string objects and clojure strings, which I believe are lazy seqs?
12:01justin_s3ithzacts: clojure strings are java strings
12:01zactsnamely I'm having difficulties with slurp and with-open
12:02justin_s3ithzacts: you can use (apply str s) if you got a lazy seq processing a string and want a string again
12:02zactsBufferedReader
12:02zactsobject
12:02justin_s3ithzacts: you don't need with-open if you use slurp
12:02zactsand slurp is giving me errors too
12:02justin_s3ithcan you describe one of these errors?
12:02zactslike dir/.txt doesn't exist
12:03justin_s3ithzacts: OK, what file did you ask for when you got that message?
12:03zactseven though I'm providing something like (slurp (str "dir/" name ".txt"))
12:03justin_s3ithzacts: then name is nil
12:03zactshum.. but name shouldn't be let me check
12:05zactsyou are correct sir!
12:05zactsa bug in what I'm doing
12:06zactsI put in a println and it's definitly nil at this point
12:06zactsthanks man
12:06zactshuh, how can I get a (trace) procedure
12:06zactsto trace procedure calls and what they return?
12:06zactsa simple one
12:07zactsso I don't have to do so many (do println data)
12:07AeroNotixzacts: trace-var
12:07AeroNotixor trace-vars
12:07justin_s3ithzacts: (do println data) is silly
12:07justin_s3ith(if you mean that literally)
12:08zactsoh thanks man
12:08zactsyeah, that's what I've been doing a bit justin_s3ith
12:08justin_s3ith,(do :a :b)
12:08clojurebot:b
12:08justin_s3ith,(do :any :thing :at :all)
12:08clojurebot:all
12:09zactsoh yeah that
12:09zactsthanks man
12:09justin_s3ith,(do println :a :b :C :D :e)
12:09clojurebot:e
12:11zactsAeroNotix: what lib do I need to load to get trace-var / trace-vars?
12:11zactss/load/require/
12:11justin_s3ithclojure.tools.trace
12:11zactswell I can look it up myself
12:11zactsah, but thanks
12:11justin_s3ithyou'll need to add it to your project.clj
12:12zactsI see
12:13justin_s3ithhttps://github.com/clojure/tools.trace this page describes how to use it pretty well
12:14zactsneato
12:18AeroNotixI just added a bunch of features to tools.trace actually.
12:18AeroNotixin my fork, gonna see what people think. http://dev.clojure.org/jira/browse/TTRACE-10
12:19zactsoh nice AeroNotix
12:20zactsAeroNotix: I'll be sure to check it out man
12:20AeroNotixcool
12:20zactshuh, one question
12:20zactswell actually nevermind
12:20zactsI figured it out
12:50zactshuh, how may I pass a user defined sort function to sort-by?
12:50zacts(no pun intended)
12:50SagiCZ(doc sort-by)
12:50clojurebot"([keyfn coll] [keyfn comp coll]); Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item). If no comparator is supplied, uses compare. comparator must implement java.util.Comparator. If coll is a Java array, it will be modified. To avoid this, sort a copy of the array."
12:50aoeu(add 1 1)
12:50SagiCZ,(+ 1 1)
12:50clojurebot2
12:50aoeu(* 2 2)
12:50clojurebot4
12:51aoeu(print "yo")
12:51SagiCZ,(print "yo")
12:51clojurebotyo
12:51zactshuh,
12:51zacts"If no comparator is supplied, uses compare."
12:51SagiCZzacts: yeah.. but only if the items implement comparable
12:51aoeu(> 2 3)
12:51SagiCZotherwise it would throu exception
12:51aoeu,(> 2 3)
12:51clojurebotfalse
12:52zactsoh ok
12:52mirfI'm trying to keep a count of repetitions when doing repeatedly, is there a simple way to do it?
12:52SagiCZ,(sort-by < (range 10))
12:52clojurebot(0 1 2 3 4 ...)
12:52SagiCZ ,(sort-by > (range 10))
12:52clojurebot(0 1 2 3 4 ...)
12:52SagiCZ ,(sort-by identity (range 10))
12:52clojurebot(0 1 2 3 4 ...)
12:52aoeulet x = x + x
12:52justin_s3ith,(sort > (range 10))
12:53clojurebot(9 8 7 6 5 ...)
12:53justin_s3ithSagiCZ: ^
12:53justin_s3ithsort-by needs a comparator
12:53zactsso what should the keyfn return?
12:53zactsoh
12:53justin_s3ith> and < are not comparators
12:53zactsso I shouldn't return vectors
12:53SagiCZof course
12:53SagiCZi am sorry zacts
12:53zactsthe keyfn should not return a sorted two item vector?
12:54SagiCZzacts: i think it should just return a value
12:54zactsand what should the return values look like?
12:54zacts-1 0 1?
12:54zactsor something?
12:54hyPiRionbetter example: ##(sort-by :index [{:index 1 :foo 2} {:index 3 :bar 4}])
12:54lazybot⇒ ({:index 1, :foo 2} {:index 3, :bar 4})
12:54SagiCZhttp://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html
12:54justin_s3ithzacts: a comparator should return positive, 0 or negative to indicate the relationship between the items
12:55zactsah, ok that makes sense now, thanks
12:55justin_s3ithalso, sort-by takes an extra optional comparison function
12:56justin_s3ithlike ##(sort-by :index (comp #(* -1 %) compare) [{:index 1 :foo 2} {:index 3 :bar 4}])
12:56lazybot⇒ ({:index 3, :bar 4} {:index 1, :foo 2})
12:56justin_s3iththat does a reverse sort by :index
12:56hyPiRionjustin_s3ith: why not just > for comparefn?
12:56justin_s3ithhyPiRion: > is not a comparator
12:57justin_s3ithhyPiRion: or does it do the right thing with true/false result?
12:57hyPiRion,(sort-by :f > [{:f 1, :b 4} {:f 2, :b 4} {:f -1, :a :zap}])
12:57clojurebot({:b 4, :f 2} {:b 4, :f 1} {:f -1, :a :zap})
12:57zactsoh cool
12:57justin_s3ithhyPiRion: thanks!
12:57justin_s3ithhyPiRion: here I thought it needed to be a proper comparator
12:58hyPiRionjustin_s3ith: It's confusing, but
12:58hyPiRion,(instance? java.util.Comparator >)
12:58clojurebottrue
12:58justin_s3ithwoah
12:58justin_s3ithwell OK then
12:58hyPiRion,(instance? java.util.Comparator (fn [] :wat))
12:58clojurebottrue
12:58justin_s3ithlol
12:58justin_s3ithquite unexpected, thanks
13:00hyPiRionWhich brings me to the weird thing: Why is there not a generalised max-key that uses comparators?
13:04tapuuHello
13:04tapuuWhat is the best way to learn clojure for someone who is already familiar with lisp syntax and functional programming?
13:05justin_s3ithtapuu: use grimoir as a reference to clojure.core, and try to make something cool
13:05justin_s3ith~grimoire
13:05clojurebotgrimoire is a nifty set of api docs at http://grimoire.arrdem.com/
13:05justin_s3ithwe should redirect that factoid (though at least for now that works)
13:06tapuujustin_s3ith: I'll try that, thanks
13:06hyPiRiontapuu: and use 4clojure.com if you want some small and easy katas
13:06justin_s3ithtapuu: and you'll probably be better off using lein if you aren't already (though I hear good things about boot) - either way, a good dep manager that can find clojure deps is good to have
13:07justin_s3ithhyPiRion: there are some small hard ones on there too :)
13:07tapuuhyPiRion: this looks good, I'll take a look
13:17tapuuClojure agents seem similar to Tvars in haskell
13:18justin_s3ithtapuu: except you don't write a value, you send it a function which when supplied the current val, returns the new one
13:19justin_s3ithtapuu: which is useful for transitive operations from multiple threads
13:20justin_s3ithit helps avoid the lockup / race possibilities that a read / write combo can otherwise risk
13:20tapuujustin_s3ith: TVars end up being similar under the hood since you cant perform any IO inside an Stm transaction, so it just ends up being a pure function
13:20justin_s3ithtapuu: OK
13:21tapuucan the agent functions block?
13:21justin_s3ithtapuu: they don't block the caller, but they do exclusively hold the agent until completed
13:22justin_s3ithtapuu: but there is await
13:22justin_s3ithtapuu: which is kind of like blocking for the caller
13:22justin_s3ith(doc await)
13:22clojurebot"([& agents]); Blocks the current thread (indefinitely!) until all actions dispatched thus far, from this thread or agent, to the agent(s) have occurred. Will block on failed agents. Will never return if a failed agent is restarted with :clear-actions true."
13:22tapuujustin_s3ith: Is it possible to implement something like a blocking queue using agents?
13:23justin_s3ithtapuu: we have actual queues like clojure.lang.PersistentQueue/EMPTY that are better suited for this purpose
13:23justin_s3iththough of course you could put said queue inside an agent, sure
13:23tapuujustin_s3ith: ok, that makes sense
13:24justin_s3ithtapuu: for queue based asynchronous operations you should check out core.async
13:24justin_s3ithwhich is a lib that implements Concurrent Sequential Processes
13:24justin_s3ithends up being a nice model
13:24tapuujustin_s3ith: ok, thanks
13:24justin_s3iththere are lots of good docs for core.async, including some excellent videos from tbaldridge who often hangs out here
13:26tapuuare there any good resources that focus on how to design/structure large applications using agents/csp?
13:28justin_s3ithnot that I know of, though they may exist. But the design of this stuff (like most of Clojure) is guided by the general principle that it should scale to bigger applications.
13:28dnolentapuu: well agents are a pretty different approach than csp, there's a lot of literature on CSP out there
13:29hellofunktapuu: check out the intersting books on concurrency architecture by Ben-Ari. There is also a book called something like "Seven Models of Concurrency"
13:29tapuudnolen: well I meant the type of csp implemented by core.async
13:30dnolentapuu: the version of CSP implemented by core.async isn't particularly different from the classic ones, maybe some more knobs
13:30justin_s3ithtapuu: type of csp? you mean the specific syntax of core.async as opposed to other implementations of the model?
13:31tapuujustin_s3ith: well, I'm looking for resources explicitly about clojure rather than anythign else
13:32raspasovtapuu: introductory resources?
13:32tapuuI think I should be okay with general csp stuff if it's that simple though
13:33tapuuraspasov: yes
13:33raspasovI always recommend https://aphyr.com/posts/301-clojure-from-the-ground-up-welcome and the rest of the Clojure from the ground up posts on Aphyr's blob
13:33tomjackI've wondered how buffers factor in to using something like Hoare's formal approach to understand core.async
13:34raspasovhelped clear a lot of things for me when I was getting started
13:34raspasovblog*
13:34tapuuraspasov: thanks for that, I'll read this
13:34tomjackit would be nice if the answer for non-dropping buffers was "you don't have to think about it at all"
13:36tomjackor I guess at least "you don't have to think about it at all if you only care about XYZ semantic attributes of your program"
13:36tapuuI've got plenty of resources to get started with now, thanks for all your help everyone!
13:36raspasovnp, any time
13:37raspasovtomjack: how would that work?
13:39tomjackwork?
13:39tomjackwhat work?
13:40raspasov"it would be nice if the answer for non-dropping buffers was "you don't have to think about it at all""
13:40raspasovI am just wondering how you can achieve that
13:45justin_s3ith"it" here meaning "the way core.async buffering alters the standard csp semantics" right?
13:51jinagaranoI'm trying to populate a database with default values, then update a subset of those values. When i run both functions separately in a REPL, they work. when i execute the code calling one function after the other, they write nothing to the DB. does anyone have an idea why? i'm using sqlite and clojure.java.jdbc
13:52tomjackuhh
13:52tomjackit would be a proof I guess
13:52tomjackI dunno whether there is such a proof, or what exactly the statement of the theorem would be
13:52tomjackthat's my question :)
13:54maikol_Hi, I’m working with reagent and i have figwheel setup. When I save my core.cljs I get this error: “Uncaught Error: Assert failed: Invalid Hiccup form: [nil] (valid-tag? (nth v 0))” and my reagent code disapears. If I go and save my dev.cljs the view renders fine. Can someone help me? This is my core.cljs https://gist.github.com/Maikol/5822c230be9f759c3507
13:54tomjackI guess, is there some interesting subset of core.async which can be translated to something like Hoare's CSP, and such that the behavior of the core.async programs matches the formal semantics, without any assumptions about whether the channels involved have either no buffers or fixed buffers?
13:54dnolenmaikol_: #clojurescript also exists for CLJS specific questions
13:55maikol_Oka, thank you
13:56gfredericksI want a library for casual file-backed data structures
13:56gfredericksoptimized for storing the file in git, i.e. readable diffs
13:56dnolenmaikol_: also the ClojureScript mailing list and Reagent mailing list are good places to ask questions if you don't get a response in the channels
13:57SagiCZmailing lists are so 1985..
13:57tcrayford____so is irc ;)
13:57SagiCZthats at least 1995
13:58maikol_thanks dnolen, I will try there
13:58raspasovtomjack: those are good questions and I'm not sure about the answer :)
14:08tomjackcasual?
14:10olivierrrhttp://youtu.be/HM1Zb3xmvMc
14:12raspasovolivierrr: lol
14:13olivierrrhahah.
14:14raspasovhahah "there's nothing cooler than a macro"
14:20gfrederickstomjack: i.e., only suitable for personal-scale use
14:23gfredericksbecause slow
14:26gfredericksthe algorithm I'm imagining would also require a diffing/patching library
15:01gfredericksis it weird that clojure doesn't have some sort of read-only reference built-in?
15:06michaelr525sente with liberator, does it make sense or am i asking for troubles?
15:07dnolenfinally real incremental compilation for ClojureScript https://github.com/clojure/clojurescript/commit/05d0209c388bb1955af7170d573afae4d26695e1
15:08tcrayford____dnolen: very nice!
15:08tcrayford____assume that brings compilation times down a bunch?
15:33dnolentcrayford____: well we had incremental compilation before but it wouldn't recompile dependents so that was source errors and issues
15:36dnolens/source/source of
15:37tcrayford____ah gotcha. neat then :)
15:53dnolentcrayford____: but yeah way faster
16:25PigDudednolen: this is awesome
16:26dnolenPigDude: :)
17:00sdegutisWhat desktop OS do you use, and how content are you with it?
17:05PigDudesdegutis: mac os 8. meets all my needs.
17:05sdegutisPigDude: you jokin
17:05sdegutisi no it
17:05PigDudesdegutis: well i switch between that and debian woody
17:06PigDudesdegutis: i use an alphasmart on the go
17:07sdegutisPigDude: oh you mean Mac OS X 10.8 ?
17:09tcrayford____sdegutis: I use haskell (it's like emacs but statically typed)
17:10sdegutistcrayford____: that's not an OS. Also, are you trolling me?
17:10tcrayford____oh, thought PigDude already started there. My apologies
17:11PigDudesdegutis: last i checked you can't play Meat Gone Bad on OSX 10.8, so no.
17:14dnolenhttps://github.com/clojure/clojurescript/commit/28e6070691e89f5fe35ae8f8a196ae1048fbf07d, eliminates some macro usage differences between CLJ and CLJS
17:14sdegutisdnolen: oh
17:35dnolenClojureScript 0.0-2755 released
17:36AeroNotixstorm is... kinda hard to grok with *everything being a macro*.
17:37raspasovAeroNotix: are you talking about Apache Storm?
17:38AeroNotixyeah
17:38AeroNotixthey have a Clojure DSL.
17:46crazydiamondHi. Can you tell if my beginner code is good or not? http://dpaste.com/0BNS35S In terms of style, proper idioms/functions usage etc
17:48AeroNotixcrazydiamond: no
17:48AeroNotixreorganize needs massively reorganizing
17:48crazydiamondwould you suggest to split it into many functions?
17:49AeroNotixI would suggest giving a modicum of effort to indentation
17:49raspasovcrazydiamond: look into (->) and (->>) macros, it generally makes it easier for you and the people reading your code to understand what's going on, especially in nested (map) and (filter) operations
17:50raspasovhttp://clojuredocs.org/clojure.core/-%3E
17:50crazydiamondthanks AeroNotix and raspasov!
17:50AeroNotixcrazydiamond: without changing the code, look how more readable this is https://gist.github.com/AeroNotix/31266390fb1f71f03760
17:51crazydiamondI was guessing that map((fn [x] ...) ...) is wrong
17:51crazydiamondyep, much readable :)
17:51raspasovit's not "wrong" and perf-wise it does not make a difference, just not very nice to read :)
17:52AeroNotixthe performance of the programmer is oftentimes more important than the performance of the application.
17:52raspasov^^ yes :)
17:52raspasovor the perf of the readers after you lol
17:52dyreshark^
17:53AeroNotix"the programmer" here is both readers and writers.
17:54raspasovsure :)
18:00sdegutisdnolen: oh
18:34justin_s3ith$mail jinagarano are you using map or for the insertions? that sounds like a laziness problem
18:34lazybotMessage saved.
19:14vasHi. I am trying to play with enlive (net.cgrand.enlive) but am unable to figure out how to make all the parts (tagsoup) play with classpath. any suggestions appreciated
19:16AeroNotixvas: what have you tried?
19:18vaswell, even though i had enlive 1.1.5 in my lein deps, compiling in a cider repl couldn't locate it.. so i git cloned enlive and moved the contents of its src directory to pacha/src [my project's src dir]
19:19AeroNotixthat's not how it works
19:19AeroNotixvas: how did you add it to your lein deps?
19:19AeroNotixproject.clj should have the coordinate information added to the :dependencies key
19:20vasokay, that is there.
19:20AeroNotixand do `lein deps`
19:20vasAeroNotix: so far so good...
19:20AeroNotixvas: lein repl
19:21AeroNotixthen use/require something from enlive
19:21AeroNotixe.g.
19:21AeroNotix(use 'net.cgrand.jsoup)
19:24vasAeroNotix: returns nil. i think that is a good sign
19:25AeroNotixyup
19:26vasAeroNotix: okay, cool. thanks for your help. it must mean that something is a'wry with cider.
19:26AeroNotixvas: you need to restart your CIDER's jvm if you want to add dependencies (unless you use something like pomegranite)
19:26AeroNotixdid you try to use the same JVM?
19:27vasAeroNotix: ah, that makes sense... i am not sure how to check which JVM i'm dancing in or how to restart it.
19:39vasAeroNotix: aha.
20:04vaslove this irc channel, thanks everyone for being so helpful all the time (=
20:05gfredericks,(-> inc inc inc inc inc inc inc inc quote)
20:06clojurebot(inc (inc (inc (inc (inc (inc (inc inc)))))))
20:18notbrentha
20:18notbrent,(-> 1 inc inc inc inc inc)
20:18clojurebot6
20:19notbrent,(doc inc)
20:19clojurebot"([x]); Returns a number one greater than num. Does not auto-promote longs, will throw on overflow. See also: inc'"
20:19notbrentneat
20:19notbrent,(println "stdout")
20:19clojurebotstdout\n
20:21notbrent,(print ",(print \"hello\")")
20:21clojurebot,(print "hello")
20:21notbrent:p
20:22m4farrel,(print "notbrent: hello")
20:22clojurebotnotbrent: hello
20:23notbrent,(doall (map inc) (range 50))
20:23clojurebot#<ClassCastException java.lang.ClassCastException: clojure.core$map$fn__4507 cannot be cast to java.lang.Number>
20:23notbrenter oops
20:23notbrent,(doall (map inc (range 50))
20:23clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
20:23notbrent)
20:23notbrent,(doall (map inc (range 50)))
20:23clojurebot(1 2 3 4 5 ...)
20:23notbrentI see..
20:23notbrent,(doall (map inc (range 500000)))
20:23clojurebot(1 2 3 4 5 ...)
20:24notbrent,(doseq [n (range 10)] (println n)))
20:24clojurebot0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n
20:24notbrent,(doseq [n (range 100)] (println n)))
20:24clojurebot0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n91\n92\n93\n94\n95\n96\n97\n98\n99\n
20:24notbrenthmm I wonder if there is a limit on that :p
20:31o0rebelious0o,((fn [] (let [three-digit-nums (range 100 1000)]
20:31o0rebelious0o(->> (for [a three-digit-nums
20:31o0rebelious0o b three-digit-nums]
20:31o0rebelious0o(* a b))
20:31o0rebelious0o(filter #(= (seq (str %1))(reverse (str %1))))
20:31o0rebelious0o(apply max))))
20:31clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
20:32o0rebelious0o,((fn [] (let [three-digit-nums (range 100 1000)](->> (for [a three-digit-nums b three-digit-nums] (* a b))(filter #(= (seq (str %1))(reverse (str %1)))) (apply max))))
20:32clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
20:32o0rebelious0o,((fn [] (let [three-digit-nums (range 100 1000)](->> (for [a three-digit-nums b three-digit-nums] (* a b))(filter #(= (seq (str %1))(reverse (str %1)))) (apply max)))))
20:32clojurebot906609
20:32o0rebelious0oyayy clojurebot
20:34o0rebelious0o,((fn [] (let [three-digit-nums (range 100 1000)](->> (for [a three-digit-nums b three-digit-nums] (* a b))(filter #(= (seq (str %1))(reverse (str %1)))) (apply max)))))
20:34clojurebot906609
20:47mercwithamouthcan someone explain reify to me in dummy terms...
20:48mkcpmercwithamouth: you might be interested in this article http://decomplecting.org/blog/2014/10/29/reify-this/
20:49mercwithamouthmkcp: thanks..reading over now
20:52mercwithamouthok that makes a little more sense
21:41vasHiya. Is there a preferred way to serve static files (such as .css) in compojure routes? I have a catch-all at the end of my routes list but unfornuately serve-file is not resolvable
21:45vasoh nevermind, the correct way to serve static resources is via ring, it seems.
21:46vas(=
21:52Lewixhttps://gist.github.com/6ewis/3f7e8297bb2a17933d0a
21:52Lewixany idea why i get a compile error
21:57safetydid you mean to do (.x this)
21:57safetyor (.-x this)
22:35Lewixsafety: nope
22:37Lewixsafety: thanks for pointing me in the right direction though :)
22:38PigDudeLewix: where is the function `y' defined?
22:38LewixPigDude: exactly it wasnt
22:39PigDudeLewix: the clojure compiler can't compile a function unless everything in it is already defined
22:39PigDudeLewix: coming from a language like Python that might be unexpected. i find it annoying. but that's the way it is.
22:40LewixPigDude: it makes sense actually
22:40Lewixthanks
22:40PigDudeLewix: sure, that's subjective. either way you'll get a compile error like you see there if `y' isn't defined yet
22:50vasyay! documentation is the best invention since penicillin
23:24devasiawhich library is best for handling image resize and crop in Clojure?
23:37zapho53(Still) trying to grok core.async. Can anyone show me a core.async equivalent of this: http://pastebin.com/JM1wEz5z ?
23:46benzrfhm