#clojure logs

2012-10-01

00:11tomoj(= (__ 4) [[1 1 0 0] [0 1 1 0] [0 0 1 1]])
00:14tomoj(fn [n] (map #(into (vec %) (repeat (- n (count %)) 0)) (butlast (take-while (partial not-every? zero?) (map (partial map +) (iterate (partial cons 0) [1 1]) (repeat (repeat n 0)))))))
00:14tomojD:
00:16tomojwell, that take-while is stupid, but still, gotta be a better way
00:16xeqitomoj: is that a 4clojure problem?
00:16tomojnot that I know of
00:39Raynestomoj: Good lord, sir.
00:41tomoj(fn [n] (let [zeros (vec (repeat n 0))] (map #(assoc zeros % 1 (inc %) 1) (range (dec n)))))
00:41tomojhmm
01:51mindbender1tomoj: (fn [n] (let [_ n] [[1 1 0 0] [0 1 1 0] [0 0 1 1]]))
02:05spoon16anyone with experience configuring noir + nginx
02:16emezeskespoon16: What's your question?
02:25spoon16emezeske: I'm looking for an example that describes nginx + jetty configuration to host and run a noir app
02:26spoon16noir uses ring which has a jetty adapter which just runs an embedded instance of jetty, I suppose I'm not familiar enough with the nginx + jetty stack in general to know how to get started given a noir app that I have running locally
02:29tomojmindbender1: hah
02:29mindbender1tomoj: so simple.. why stress myself
02:32emezeskespoon16: I don't think there's much about the nginx config that would be jetty-specific
02:33emezeskespoon16: Probably proxy_pass dynamic requests to the noir app, and have nginx serve the static files
02:33emezeskespoon16: serve them directly, I mean
02:34spoon16yeah, that's what I was thinking… is there any reason that I would want to setup jetty separately or should I just use the embedded version that the noir app will start up?
02:35emezeskeI think it's fine to use the embedded version, but I'm not an expert on that.
02:37emezeskeProbably only need to do otherwise if there's some specific tuning you need to do
02:41spoon16emezeske: was just reading your latest blog post did you try to interop with clojurescript and a common js library like jquery?
02:41spoon16I see jayq
02:41emezeskeYep, I use jQuery very heavily, along with Twitter's Bootstrap plugins and a few other things
02:43spoon16you should put up the source
02:43emezeskeTo what?
02:44spoon16to School Seating Charts
02:44emezeskeI am kind of trying to make money on it, I think I'll refrain
02:45spoon16I figured… it's an interesting idea
02:45emezeskeOn the one hand, I would love to make it open source
02:45amalloyemezeske: just add 10M LOC and you can charge for a support contract
02:46emezeskeBut on the other hand, it would take someone 10 minutes to have their own app running :)
02:46emezeskeamalloy: Hahaha... I'd have to switch to Java to pull off 10M LOC
02:47spoon16just abstract out the algorithm, replace it with one that puts all the talkers together as close to the exit as possible
02:47emezeskeTouche... it might work
02:47spoon16emezeske: good blog post
02:48emezeskeThanks. I need to do the next one in the series... I've been lazy.
02:48emezeskeSoon... Soon.
02:50john2xis there an equivalent to Python's dir() function? to list all the properties, etc of an object..
02:54emezeskejohn2x: http://stackoverflow.com/questions/5821286/how-can-i-get-the-methods-of-a-java-class-from-clojure
02:54emezeskejohn2x: Maybe?
03:01ori-ljohn2x: what are you trying to do?
03:02john2xthanks emezeske. I think that'll do.. ori-l, I'm using a Java library with no docs (afaict), I'm trying to figure out what its objects are..
03:03ori-lah, right. ok then :)
03:17john2xnoob question, how do I include clojure-contrib in lein project.clj?
03:17the-kennymonolithic contrib is outdated, which part do you need?
03:21the-kennyhttp://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go might be helpful to decide which library you need :-)
03:23the-kennythen just Google for the package name for example clojure.data.codec and you'll usually find the entry for leiningens dependency key in the read me
03:24the-kennyexcuse the strange formulation, I'm on mobile
03:27tomojalso, "http://search.maven.org/#search\%7Cga\%7C1\%7C%s"
03:27tomojsince new contrib libraries are often in maven central
03:27tomoj(the %s is where your query should go)
03:28tomoj(and the other % may need to be unescaped)
03:33kralnamaste
03:39grayzonehi to all: how do I add classpath to the local lein project?
03:39grayzonethere are other ways besides addurl manual or copy the jar in the lib project or creating local maven repository?
03:49grayzonethe option : :extra-classpath-dirs ["........"] is correct or maybe deprecated for add classpath to lein project?
03:56tomojI think it is deprecated
03:57tomojgoogle for "extra-classpath-dirs lein 2"
04:09tomojis the SF meetup planned?
04:10otfrommorning
04:10otfromanyone here at Strata in London?
04:13Lajjlaotfrom, do you play StarCraft?
04:14otfromnope
04:14arrdemSC1 or SC2
04:14samphippenhello friends
04:14samphippenwho else is at strata :)
04:16samphippenI also play starcraft
04:17justicefriesi wish I was at strata
04:31wei_clojurescript question: how would I make goog.ui.Popup extend MyCustomPopupBase instead of goog.ui.PopupBase?
05:26mtdsamphippen: wish I was at strata too -- right around the corner on Old Broad Street but no ticket! Enjoy...
05:33mindbender1in clojure we have have procedural fns vs compositional fns
05:35steven123greetings, can anybody help me with init bindings in the repl? I've created a stackoverflow question: http://stackoverflow.com/questions/12663624/why-cant-clojure-repl-print-doc-binding-be-changed-in-clojure-repl
05:58steven123can anybody help me with init bindings in the repl? I've created a stackoverflow question: http://stackoverflow.com/questions/12663624/why-cant-clojure-repl-print-doc-binding-be-changed-in-clojure-repl
06:14steven123can anybody help me with init bindings in the repl? I've created a stackoverflow question: http://stackoverflow.com/questions/12663624/why-cant-clojure-repl-print-doc-binding-be-changed-in-clojure-repl
08:48augustlany ideas on how I can disable logging in test runs somehow? Using clojure.tools.logging now, tried adding a log4j-test.properties and setting {:jvm-opts ["-Dlog4j.configuration=log4j-test.properties"]} in project.clj, that didn't work though
08:50augustlalternatively, anyone know about a test framework for clojure with output that automatically handles logging, groups log output with relevant test cases, etc? ;)
08:52augustlhmm, a resources/log4j.properties containing "log4j.rootLogger=OFF" doesn't work either, I'm probably doing it wrong
08:54ssedanoHi, is there any vim plugin for ctags? I mean to add the functions list
09:08Moses_Hi, anyone know of an open source web app that uses friend? I can't seem to wrap my head around friend, so I'm looking for a good example of how its used.
09:11cemerickMoses_: Look at the mock-app namespace for a comprehensive…mock app: https://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj
09:12Moses_Wow, thank you, both for the help and for the awesome library!
09:12ro_sti'm really stuck. how do i resolve this? java.lang.ClassNotFoundException: org.apache.http.entity.mime.MultipartEntity
09:13ro_stusing clj-http on osx with oracle's jdk 7 u7
09:14ohpauleezro_st: Hmm, I've used the same library on the same jdk with the same os
09:15ro_stdriving me nuts
09:15ro_sthi btw :-)
09:16ro_stlooking at https://clojars.org/clj-http i see it needs http://search.maven.org/#artifactdetails%7Corg.apache.httpcomponents%7Chttpmime%7C4.2.1%7Cjar and i have that in my .m2
09:17ohpauleezyeah, so weird, it should just be in you .m2 and work
09:17ro_sti get this stack trace on the (ns) that brings clj-http in
09:17ohpauleezhello!
09:21ro_sti should probably use clj-http 0.5.5 and not use 0.1.3 -eyebrow-
09:24lotiagreetings all
09:25wingyis there a good way to read yaml files from clojure?
09:25ro_staside from https://github.com/lancepantz/clj-yaml, you mean?
09:26ro_stohpauleez: have you mucked with pushState in cljs yet?
09:27Lajjlaro_st, do you play STarCraft?
09:28wingyLajjla: i do
09:28wingy2 :)
09:28lotiais it better to simply download the incanter installer or to use lein
09:28ro_stLajjla: i used to.
09:31wingydonno if i should use clj or node.js for the backend :/
09:31wingylove clj the lang but love the node ecosystem
09:31ro_stclojure.
09:31Lajjlawingy, I knew it
09:31Lajjlayou all do.
09:31lotiawingy: as opposed to lein?
09:31ro_sti'd much rather be able to understand my code
09:32wingylotia: yeah
09:32wingyone thing that drove me back to node.js was that i thought i would use a lot of JS
09:32wingythick clients thin servers
09:33ro_stsunk cost fallacy
09:33wingybut it has showed that it is the opposite .. thin clients thick servers
09:33ro_styou always have a choice for the future :-)
09:33wingythe servers are doing everything and serving the HTML to the clients .. in this way we can use cheap mobile phones but have the greatest experience
09:33ro_stremember what uncle Rich said? simple vs easy. do you want ease, or simplicity?
09:33wingyhm yeah
09:33wingybut i hate java?
09:34wingyor jvm
09:34wingyits slow!
09:34ro_sthow much time do you spend deploying your code, and how much time do you spend reasoning about your code and writing it?
09:34ro_stwhich do you want to optimise for?
09:34wingythe latter!
09:35wingyah .. you sucker .. you are sucking me into clj again
09:35wingybut thats why i asked the question here .. wanted some feedback
09:35ro_st-grin-
09:36ro_stthe jvm is slow. but being able to see your entire solution on a single screenful of code is worth it
09:37wingyro_st: yeah hate js
09:37cemerick"the jvm is slow" is a meaningless statement
09:37wingyif you could choose
09:37unic0rnit's not that slow, but people rarely tend to optimize their code and profile it properly
09:37wingywould you like clj on its own platform rather than jvm?
09:37ro_stcemerick, unic0rn: when compared to node.js start up time on the command line, it's slow
09:37ro_stwhich is wingy's particular contention
09:38cemerickClojure is never "on its own platform".
09:38wingyro_st: true
09:38unic0rnstartup time is meaningless :)
09:38ro_stunic0rn: correct, if you work around it - repl, code-reloading, etc
09:38unic0rnhonestly, i wonder how much it would change if all the main api would be stored in separate class files instead of a jar archive
09:39unic0rncould be worth checking
09:39ro_sthey, i don't mind. i use flatland/drip and ssd. it's not slow for me
09:39wingyim using BAAS like ApiGee App Services
09:40wingyanyone having experiences with BAASes?
09:40wingykinvey, parse, stackmob, apigee
09:40ro_stnot i
09:41ohpauleezAs someone who has previously inherited a node.js system, don't do it
09:41wingyohpauleez: dont do node?
09:41ohpauleezit was fine at a small scale - local dev proxy server. But when scaled up to handle real app interaction it became a nightmare
09:42ohpauleezit was difficult to reason about, difficult to debug
09:42ohpauleezmulti-node setup to handle more scale is not as easy as "spinning another instance up"
09:42wingyohpauleez: im using heroku
09:42wingyps:scale web=3
09:42wingy:)
09:43ro_st*laughs @ cemerick's tweet*
09:43ohpauleezheroku will fix the latter, but not the former
09:43cemerickwhoa, add in some mongo, and you'll be web-scale in no time :-P
09:43ohpauleezhahaha
09:43ohpauleezfwiw, I've started down the path of CLJS on node for scripting apps - and so far it's been positive
09:44ro_stwingy: heroku does clojure just fine
09:44wingyis there a good data validator on clj?
09:44ohpauleezthat said, I much rather just use the JVM straight
09:44ro_stwingy: two. valip and validateur. valip is clj/s thanks to cemerick. validateur is clj only
09:44wingyspitting out error messages so i can create the html if the form is invalid?
09:44wingyok
09:45cemerickro_st: that fork of valip is definitely experimental. Now that I have a handle on cljx, it'll be a lot easier in a lot of ways.
09:45ohpauleezif you need more convincing you can "handle the load" look at Ring+Jetty's benchmark numbers. If you want to ease the development CLJ+CLJS is mind-blowing
09:46ro_stcemerick: you're using cljx? how are you finding that?
09:46cemerickro_st: pretty good so far, especially once I wrote an nREPL middleware for it.
09:46wingyi might go over to clj
09:46wingyi just dont believe in js
09:46ohpauleezcemerick: I'm going to shoot you an email about cljx re: kibit shortcomings. I meant to get around to it this weekend
09:46ro_sti've been using cljsbuild's crossovers (which work wonderfully)
09:47cemerick(which I'll be releasing once I have a good name for it)
09:47ro_stwingy: js ain't going away
09:47cemerickCrossovers are good too. I use both.
09:47wingyro_st: yeah thats the sad news
09:47ro_stah, so why cljx then? what does it do for you that co's don't?
09:47wingyro_st: but im not doing much js on frontend
09:47pjstadigcemerick: thanks for the support :)
09:48cemerickohpauleez: shoot away. FWIW, Jonas is on clojure-tools too. Hopefully I can get Kevin on there so we'll have a quorum.
09:48cemerickpjstadig: np :-)
09:48cemerickNow it wants a patch. Whack away, I guess. :-P
09:49ohpauleezahh I'm going to climb with Kevin later today, I'll mention it to him
09:49cemerickohpauleez: Excellent. I just submitted my first PR for cljx, so we'll see how that goes. ;-)
09:49ohpauleezro_st: With cljx, you can conditionally load things
09:49ohpauleezlike the difference in string operations, etc
09:50ro_sti got around that by (essentially) reimplementing clj and cljs versions using the same namespaces
09:50wingyis anyone here using datomic for production?
09:50cemerickro_st: sorry, didn't see your message. The biggest win from cljx is that you can intermix cljs and clj code, and have one be transformed into the other.
09:50augustlare there any logging libraries for clojure where I can create my own instance of a logger somehow? Really disliking the magic log4j.properties stuff. A namespace called myapp.logger that defines "error", "warning" etc would have been nice. Suggestions?
09:50ro_stand each side looks in different places for that ns
09:51ro_staugustl: we're using logback
09:51cemericke.g. (try (foo) (catch IllegalArgumentException e (bar e))) can be turned into (try (foo) (catch js/Error e (bar e)))
09:51augustlro_st: looking it up, thanks
09:51ro_stcemerick: that's really handy. i'll have to spelunk in c2's code to see it in action, i guess
09:51ro_stwingy: we are
09:51ro_stusing datomic in production, that is
09:52ro_stit's awesome
09:52wingyro_st: advantages/disadvantages?
09:52ro_sttransforming existing data is a bit of a pain
09:52ro_styou can't alter schema on existing data
09:53wingyi c
09:53ro_stlet me correct that; we intend to use it in production. we aren't live yet. we're using it in closed- beta right now, where we can happily delete and rebuild databases
09:53ro_stwhich is what we do
09:54augustlro_st: my biggest hurdle was groking datalog and how to "model" various situations. Ended up not using it (short on time etc)
09:54ro_stbut the querying stuff is just sublime
09:55ro_staugustl: i know. it's a big unlearning. we're still decomposing some of the first queries we wrote due to the in-process nature of the peer
09:55ro_stno need to glom everything together any more
09:55ro_sttruly refreshing!
09:56wingyclj is the most popular lisp i guess
09:56ro_sti don't understand why people would want to use anything else.
09:57ro_stand i've used everything else.
09:57wingy:)
09:57wingyeg?
09:57clojurebotHaha! The survey mentioned in the comments to Yegge's last post has a "favorite language" question, but Clojure is not an option.
09:57ro_stphp js actionscript c# python ruby obj-c
09:58ro_stand the tiniest bit of java
09:58wingyhtml template engine allowing me to write HTML?
09:59ro_stenlive for clj, enfocus for cljs (a clone of enlive tailored to being in a live dom)
09:59ro_stboth support plain html templates
09:59ro_stalthough we've quickly realised that hiccup has it's uses too. especially for crudmin stuff
10:00ro_stits*
10:01wingyits good that im not that new to clj … will speed up the conversion
10:01ro_sti can understand having to continue to work on existing codebases. we all have legacy code. but for new stuff? i wouldn't choose anything else.
10:02wingyim building something new and its getting larger .. js is a pain
10:03ro_staye
10:04wingythats the reason why everyone else is making abstrations like coffee and livescript!
10:04wingybecause js is just too ugly
10:05ro_stif you're going to go through all that effort, might as well go all the way :-)
10:05wingyyeah
10:05wingylet me share a thought i have btw
10:06augustlwingy: Google Closure Tools, do it!
10:06augustlref js is a pain
10:07ro_stref js?
10:08jrajavjavascript might be ugly on the outside, but coffeescript is ugly on the inside
10:09wingyso in the beginning it was clear to me that putting all the heavy stuff on the browsers was the way to go (sproutcore, extjs, emberjs etc). that would mean a lot of JS since probably 90 percent of the app would be on the clients .. but now im using jQuery Mobile and noticed that it is far better for performance/development to put most of the stuff back in the servers since it can make fast calculations and render the finnished html and jus
10:09wingyserve it to the browsers .. even the worse performance mobile phone can use my app since it just has to make an ajax request and display the HTML .. this makes me writing 90% of the code on the server why im thinking about clojure
10:09augustlro_st: "referring to"
10:09augustlwingy: html doesn't have to perform better than JavaScript. As with everything, it depends.
10:10augustlwingy: what does the browser do when it receives HTML? First it has to parse it, then it creates DOM elements. With a JavaScript app, you don't have to parse HTML, you just create the DOM elements.
10:10bhenryhave i lost my mind or did github recently change the clojure source code highlighter colors?
10:10wingyif we have thin cients/thick servers architecture it means that the future devices could be cheap and we dont have to upgrade them every year since we can just add more performance to the backend and the app would perform better .. rather than having 1 billion people buying new devices
10:11jrajavaugustl: So parsing and interpreting JS is a no-cost operation suddenly?
10:11wingyeg. a device would be merely a screen .. the screen shot is sent to the device (aka monitor) if we assume the internet is blazing fast
10:12paultag(not like the startup time on cpython or java)
10:12wingythe server is the performance hardware .. the devices is just a portal .. you get this vision?
10:12augustljrajav: ouch ;)
10:13wingyeven when we play game it would be like this .. the device just put the rendered screenshots on screen .. like VNC
10:14wingyany thoughts?
10:14augustlwho pays for the servers? ;)
10:14wingyyeah but of course they would pay for my app :)
10:14wingyin someway
10:14jrajavOh god don't push server-side rendering for games please
10:15ohpauleezwingy: I'd spend more time looking at your quality attributes, functional and nonfunctional requirements, and the components/connectors/styles that get you those things. Then dig through reference architectures, compose accordingly and build up. - It sounds more like you're just choosing technology and seeing what sticks. You would be better served for seeking out value and realizing it with technology
10:15jrajavAs a speedrunner and high-action game enthusiast I will never forgive you
10:15wingy:)
10:16wingyi just feel that this whole browser/js thing going on isn't ideal .. a spec is released .. then wait 5 years before it gets to all browsers .. even then they are all not the same so you need abstractions
10:17augustlwingy: what I like about the web is that it worked on an iPad from day 1
10:17wingyor .. I could just render html in servers and throw them out to clients .. i upgrade the servers .. they all benefit from it
10:17wingyaugustl: it will still do
10:18wingysome focuses on thick clients .. some on thin clients .. im starting to rethink why not the latter
10:18wingyseems solving a lot of problems
10:18wingycompatibility issues..performance issues
10:18wingythen you cache the html and you have no cost operations!
10:19ohpauleezAlso, the power of any network is at the edge. The ability to have powerful computation on the client (especially the portables) opens up a world of possibilities for cooperative/peer/ubiquitous computing. Additionally - JS Tracing JITs (as found in V8) out perform most other scripting languages (excluding LuaJIT) including PyPy, Python, Ruby, etc
10:19wingyjquery mobile is good for the latter .. the js part is just for basic displaying stuff (I dont have to write)
10:19ohpauleezthat said, you need to do whatever is right for your application, again, my previous point.
10:20wingyof course
10:23wingyi want simple
10:23wingynot easy!
10:23wingyTHAT i know
10:23ro_stwingy, ultimately you need a mix of the two. medium server, medium client
10:23wingyok lets imagine
10:25wingyinternet speed is instant .. that means your server could be the only brain for all devices that act like portals only .. if internet speed is instant that would mean huge benefits like you upgrade the server and 1B people get increased performance
10:25wingythis means that internet speed is the vital factor here
10:25wingythe only one, what do you think?
10:25casionit's also a factor that's completely out of your control
10:26wingycasion: why i said imagine
10:26ohpauleezwingy, this thought experiment is an exercise pushing you in the wrong direction
10:26casionwingy: imagining irrelevant things does not make them relevant
10:26casionnow it's irrelevant AND imaginary
10:27wingyuhm .. well, we always start somewhere :)
10:27wingyro_st: would you agree in the scenario you would only need thin clients since all the hardwork is done on the servers
10:28ohpauleezwingy: That is *also* a thought experiment in the wrong direction
10:28casionwingy: what you descrcibe already exists, it's called a 'display'
10:29wingycasion: clearly i aint talking about displays here :)
10:29ro_stwingy: yes. but i prefer to work with the geography, not the map
10:29casionit seems like you clearly are to me
10:29cemerickwingy: AFAICT, everything you've talked about is entirely divorced from a concrete job to be done
10:30casionsince all this imaginary thin client does is display things generated by the server
10:30cemerickThis makes it nigh impossible to reason about tradeoffs between solutions.
10:30ohpauleezWhat are you trying to build? To what degree does it need to do those things? What other problems exist? How can I pull those problems apart to their core pieces? Now - what am I trying to build and to what degree?
10:30ohpauleezcemerick: Thank you!
10:30ro_stit goes back to what ohpauleez said. what are *your* particular constraints?
10:31wingyyou guys are cool .. just that i think we are seing things from different perspective .. this has to do with concrete stuff .. like i just discovered that for my app its better to have most of the logic on server side
10:32wingyit has impact on how my app will be formed .. put it on server or client? just that one is crucial
10:32ohpauleezlet's talk about your constraints, trade-offs, quality attributes you need to it, functional requirements you need to hit, architecture styles that work in those areas, components and connectors that compose to achieve your quality attributes, and start digging through reference architectures to see what we come up with. Then we can analyze trade-offs again, find what we're missing, pull the remaining problems apart, and build u
10:32ohpauleezsolution.
10:33wingyyepp
10:33ohpauleezneed to have*
10:33TimMcohpauleez: "and build u"
10:34wingyneed every client to perform well .. i realized this would boil down to less JS on client .. heavy calculations on server
10:34casionI almost envy you guys who even have the option of server or client sided processing
10:34wingyclients just like portals displaying the rendered html
10:35ohpauleezand build up a solution**
10:35ohpauleezwingy: What does "perform well
10:35ohpauleezmean
10:36wingyfor each product in my app i need to create the form elements
10:36ohpauleez(thanks TimMc )
10:37wingyputting this parsing/building on clients made them take some secs before being able to display the form
10:37ro_stohpauleez: you need to tell him what your hourly rate is before you start, so there are no surprises later -grin-
10:37casionwingy: so you have a client that takes a set of server-generated data that is interpreted and displayed
10:37ohpauleezro_st: haha
10:38casionpretty sure that's simple a display :|
10:38wingycasion: so i took it one step further
10:38cemerickwingy: If all you're doing is shipping around form data, then it doesn't matter where the "work" is done. There's not much work there to begin with.
10:38wingyhaving it rendered the html with the form
10:38wingyand the client just put it on dom
10:38casionyou could even take this mythic beast and beam a wireless signal to it and have entertainment streamed to people's homes
10:39casionwouldn't that be amazing
10:39ro_stcasion: i'm not sure, but are you being sarcastic right now? -grin-
10:40casionme!? never
10:40ohpauleezwingy: Here's a better idea -
10:41ohpauleezyou put all your HTML snippets on a CDN, you stream data (in Clojure/EDN) to your client, your client build out the dom swaps with the snippets and BAM, you're done. The JS (from CLJS) that does this is also on a CDN.
10:41ohpauleezthe first render is done server side
10:41ohpauleezwhich is also optimized for the most important traffic
10:42ohpauleez(we'll say… SEO purposes)
10:42ro_stand mobile.
10:42abaloneprofiling some code... using java VisualVM ... i just ran something at the repl and it says Sunday.rmi.transport.tcp.TCPTransport$connectionHandler.run() is taking 77% of the time. what is it doing? all my code is doing is processing a string inefficiently...
10:42ohpauleezboom, and boom
10:42abalones/Sunday/sun
10:45ohpauleezI'm going to call it - cooperative partial renders (because everything needs a good name). You can steal the idea :)
10:45abaloneum. 77% of the time but only 4 invocations.
10:45abaloneerm. it's still running. I think it's going to explode.
10:46ohpauleezabalone: I'm not sure, but usually run() calls are for threads. So it could just be sitting idle in thread. What has the most CPU time?
10:47abaloneaccording to "self time" run() has over 2 minutes of time now
10:47abaloneit's melting!
10:47casionabalone: there's a few SO posts about that
10:48casionmost of them seem resovled
10:51wingycould someone point me to a good guide for setting up my clj server?
10:55ttimvisherhi all
10:56ttimvisheranything inteligient i can do to debug why lein1 can't find an artifact in central that's there according to the site?
10:56ttimvisherspecifically jackson-core-asl 1.8 and up
10:56ttimvisher?
11:01cemerickttimvisher: Central has been having issues around some artifacts for days now. :-(
11:02ttimvishercemerick: thanks
11:02marcel23I keep getting a "Check :dependencies and :repositories for typos." error... is that what you guys were just talking about?
11:02marcel23
11:02cemerickmarcel23: Yes; there's a thread on the Clojure ML about it, too.
11:03marcel23oh thanks!
11:06wingywhat IDE/editor are you using?
11:06wingyfor clj
11:06wingyah
11:06wingyemacs
11:08ohpauleezwingy: There is support for nearly every editor
11:09casionnot that you'd want to use most editors
11:09unic0rnnot that emacs can be called an editor. it's just pain in the ...
11:10casionemacs is the best!
11:10unic0rnvim ftw
11:10wingywhat do you think about light table?
11:10unic0rn:P
11:10casionunic0rn: outside of #clojure… sure
11:10TimMcunic0rn: Vim works too. You're not going to get an editor war started in here easily.
11:10unic0rnTimMc: not even trying to. just throwing in a little bit of humour, that's all
11:11TimMcOK.
11:11casionI'm trying
11:11casionunic0rn stop being uncooperative
11:11unic0rnyou fail
11:11unic0rn:P
11:12ohpauleez"Clojure - the language that ended all editor wars"
11:12casionI use emacs. vim, textwrangler and eclipes
11:12casionobviously none of them very well since I can't fucking type
11:13abalone(inc casion) ; http://stackoverflow.com/questions/7205612/does-filtering-classes-for-cpu-profiling-work-in-java-visualvm
11:13lazybot⇒ 0
11:13zoldarcasion: nevethless, you're insisting on a otaku keyboard layout ;)
11:13wingywow simple to install lein
11:13wingywget https://raw.github.com/technomancy/leiningen/preview/bin/lein && chmod 766 ./lein && lein
11:14casionzoldar: eh?
11:14wingyanother thing why clojure is also i know i will get top programmers
11:14casionzoldar: I have 3 layouts printed on my caps :)
11:14zoldarcasion: http://elitekeyboards.com/products.php?sub=leopold,tenkeyless&pid=fc200rtabn
11:14casionzoldar: I'm aware, I'm typing on a filco at, with a leopold about 2 feet from me
11:14casion;)
11:14unic0rnbtw, since we're at editors, http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released
11:14unic0rnpretty nice thing
11:15nDuffwingy: As a counterpoint -- you could find yourself stuck between getting great people who are too expensive, vs affordable hobbyists who are thrilled to have a chance to learn on the job but _are_ learning on the job.
11:15casionit'd be neat to see sublime get reasonable clojure support
11:15zoldarcasion: eheh, sorry then, dodgy attempt to make fun
11:16casionzoldar: ah, I just didn't get what you were trying to say initially :)
11:16zoldarcasion: I've got a filco brown btw
11:16casionzoldar: majestouch II with blues for me
11:16casionI collect mechs :D have around 40 of them atm
11:16zoldarok, enough keybaord porn
11:16casionI collect switches in general actually
11:17wingynDuff: sure
11:17wingyare clj programmers always expensive?
11:17zoldarcasion: 40.. nice, I barely afforded to buy one
11:18wingybut i would love to have one expensive dev than 2 mediocre
11:18casionzoldar: everyone has their obsessions I guess, mine just happen to be relatively.. uhh, weird
11:18voland62_2Hi. If I have this: (def my-num (atom 23)) how can I swap! it to new value (100 for ex.)?
11:18zoldarand still, it was a second-hand (albeit in mint condition) grabbed on geekhack
11:18casionzoldar: that's actually where I got my main filco from
11:20casionthen i replaced all the switches to the mx1a-e1nw and changed all the springs to much higher force
11:20casionredrilled the pcb on it as well
11:22zoldarsounds serious, I just bought it to see what all the fuss is about - unfortunately I don't type much on it recently. Doing most of my work in front of laptop. Either way, I've tried to use it one late evening and woke up wife. She wasn't amused...
11:26casionzoldar: hehe, we have a closed door rule. If you're typing, there's at least 1 closed door between you and anyone else in the house
11:27casionat home I use model M, with tactile leafs on it, so it's the king of loud and obnoxious
11:27unic0rnso noone can see that in free time you're coding in perl, because they would call you a pervert? :P
11:27zoldarcasion: I imagine
11:28jcromartiethis is kind of weird
11:28casionunic0rn: the 2 programmers in my family just make fun of me for using clojure :(
11:28jcromartiecasion: aww
11:28jcromartie,(clojure.set/subset? #{1} #{1})
11:28clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.set>
11:28jcromartieoh right
11:28unic0rnno programmers in my family, luckily
11:28jcromartie,(do (require 'clojure.set) (clojure.set/subset? #{1} #{1}))
11:28clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.set>
11:28jcromartieyeah OK
11:29jcromartieanyway, #{1} is not a subset of #{1}, which is I guess correct strictly speaking
11:29jcromartiebut is surprising when it comes up in your running code
11:29casionunic0rn: my brother does, and an uncle in law who I see very often… both use java primarily
11:29jcromartiecasion: what do they use? make fun of them for that
11:29jcromartieah there we go
11:30casionit's a bit of the ignorant 'If you're going to use java, just use java' nonsens
11:31gfredericksjcromartie: #{1} is a subset of #{1} according to the standard mathematical definition
11:31jcromartieoh then
11:31ttimvisherpeople having maven problems might want to check into mirrors: http://maven.apache.org/guides/mini/guide-mirror-settings.html
11:31unic0rnpick a simple task to get coded in java in 2-4 hours, challenge them, finish it in half an hour, problem solved
11:31jcromartiegfredericks: then clojure.set/subset? is wrong
11:31gfredericksjcromartie: well as long as the docs say exactly what it does
11:31gfredericks,(doc clojure.set/subset?)
11:31clojurebotCool story bro.
11:31gfredericks&(doc clojure.set/subset?)
11:31lazybot⇒ "([set1 set2]); Is set1 a subset of set2?"
11:31jcromartie:P
11:32gfredericks&(clojure.set/subset? #{1} #{1})
11:32lazybot⇒ true
11:32jcromartieweird
11:32gfredericksjcromartie: looks right
11:32arrdemyay! clojure is sane!
11:32gfredericks(inc clojure)
11:32lazybot⇒ 9
11:32jcromartiewhat the heck… oh I see
11:32jcromartie&(clojure.set/subset? [1] [1])
11:32lazybot⇒ false
11:32jcromartie&(clojure.set/subset? [1] [1 2])
11:32lazybot⇒ true
11:33gfredericksI'm not sure the behavior for vectors is defined
11:33jcromartie:P maybe it would help if I were using sets
11:33gfredericksI'm rather surprised it even does something
11:36zoldarwell, in general it uses length comparison and (every? v1 v2)
11:36gfredericksah ha
11:36gfredericksso it oughta crash on lists
11:36gfredericks&(clojure.set/subset? '(1) '(1 2))
11:36lazybot⇒ false
11:38wingywhy is hiccup from this user [org.clojars.pntblnk/hiccup "2.0.0-alpha1"] and not from the https://github.com/weavejester/hiccup
11:40gfrederickswingy: is that the only hiccup?
11:40cemerickThere are many forks, only one is canonical.
11:40gfrederickspeople push their own versions of libs to clojars all the time
11:40wingyok
11:40gfredericksI don't have breakfast in the morning until I've forked a clojure lib and pushed it to clojars
11:40gfrederickskeeps me alert
11:41wingyit was the first hit
11:41wingyhttps://clojars.org/hiccup
11:41cemerickclojars does not sort is search results
11:43gfredericksI thought it sorted by most recent push
11:43gfrederickswhich means heavily forked libs will usually show not-the-canonical-one
11:43cemericks/results/results in a useful way
11:43gfredericksfiguring out what's canonical wouldn't be a trivial thing
11:44zoldarthat sometimes annoying, when I have to hunt the canonical version an a forking timeline... or I'm just crap at using github right
11:44cemerickUsage is a good bet. See ClojureSphere.
11:44arrdemyeah... especially because some things like fnparse the accursed are abandonware with several forks of varying quality
11:49wingyso good to be back on clj
11:51zoldargfredericks: my wrong. I was looking at source here: https://github.com/richhickey/clojure/blob/f769f5650edc782245089ac021d39d0acbcd490d/src/clj/clojure/set.clj#L142 , when the relevant line in a recent source looks like here: (every? #(contains? set2 %) set1)
11:55cemerickI thought lazybot was warning on any linkage to richhickey github URLs?
11:58marcel23so I'm using a mirror for central for in my project clj and set LEIN_SNAPSHOTS_IN_RELEASE=1 but I still can't get my project to run. anyone have any ideas or links or anything? sorry i'm a complete noob at this dependency management stuff.
11:59zoldarmystery solved: https://github.com/clojure/clojure/commit/3acb6ee7ec5c295ae14de861d03a5efd115a5968
12:01uvtcwingy , zoldar : I keep a list of links to the canonical Clojars pages for given projects at http://www.unexpected-vortices.com/clojure/dining-car.html .
12:02uvtcWell, for some small number of projects anyway.
12:04zoldaruvtc: nice, I've seen a couple stuch lists, like http://www.clojure-toolbox.com/
12:05wingyuvtc: thx
12:05uvtcwingy: y/w
12:06uvtczoldar: right. The other 2 that I know of are the toolbox and clojuresphere.
12:14dnolenJS compile target space is heating up http://www.typescriptlang.org, Microsoft offering
12:15wingyso if you use compojure you dont need to use ring directly right?
12:15wingyno need for [ring "1.1.6"] in project.clj?
12:17scriptordnolen: doesn't seem to be giving me any type errors
12:25wingyhttps://github.com/weavejester/compojure/wiki/Getting-Started
12:25jcromartiewingy: Compojure will import Ring itself
12:25wingyjcromartie: yeah
12:28jcromartiewingy: but I import ring itself for other purposes
12:28wingyokay
12:34dnolenTypeScript is actually pretty interesting - gradual typing goes mainstream? TypeScript lets you declare types for any JS lib.
12:37ohpauleezdnolen: Definitely seems interesting - it's fascinating to watch the work being done in gradual typing
12:45wingyhttp://www.zdnet.com/microsoft-takes-the-wraps-off-typescript-a-superset-of-javascript-7000004993/
13:03wingydoes this mean we all go over to M$?
13:04unic0rnwho sane codes in javascript anyway?
13:09cemerickreplaca: we need pprint in cljs, stat! ;-)
13:11wingyhow is session handled in compojure/ring?
13:11marcel123im really sorry to not shut up about this but does anyone know how to fix the dependency artifact problems im having? I've tried using mirrors, removing dependencies, everything, and I can't get this to work :( here's my project.clj and profiles.clj: https://www.refheap.com/paste/5411
13:11wingyhttps://github.com/weavejester/compojure/wiki/Sessions
13:11marcel123it's just really depressing waking up and not being able to get my project to run when i was fine yesturday
13:13cemerickmarcel123: I'll bet lein deps works just fine if you pull out the clj-aws-s3 dep?
13:13cemerick(get rid of all the mirrors, etc)
13:14wingyis there a lib for using redis as session storage https://github.com/ring-clojure/ring/wiki/Sessions
13:14marcel123cemerick: wow you're right, thanks so much! I thought I tried removing everything one by one but I guess not.
13:15cemerickmarcel123: it's an ongoing issue with Maven central.
13:16cemerickSee http://groups.google.com/group/leiningen/browse_thread/thread/e484d2d52ed30b12 and http://groups.google.com/group/leiningen/browse_thread/thread/d71eebbb152c627b
13:17marcel123cemerick: ok great, glad it's not just me, thanks for those
13:23emezeskeAnyone know the $command to do a google search in this channel?
13:24scriptor$google clojure
13:24lazybot[Clojure - home] http://clojure.org/
13:27emezeskescriptor: thanks!
13:27emezeskeI guess I might have tried that... :)
13:43wingydata manipulation is far more better in clj than js
13:47wingycould somebody tell me how to use session https://github.com/ring-clojure/ring/wiki/Sessions in compojure app?
13:49wingythis is my current app https://www.refheap.com/paste/5412
13:53abaloneis this correct: creating and accessing *many* small maps will be slower than creating and accessing the same number of vectors ?
13:53scriptorhow small?
13:54emezeske$google ring session redis
13:54lazybot[wuzhe/clj-redis-session · GitHub] https://github.com/wuzhe/clj-redis-session
13:54emezeskewingy: ^
13:55abalonescriptor: maps of four elements
13:55wingyemezeske: thx!
13:56wingyemezeske: which clj-redis should i use?
13:59amalloyabalone: i don't think there's enough information to answer the question
13:59emezeskewingy: Is there more than one project named clj-redis?
13:59wingyemezeske: https://clojars.org/search?q=clj-redis
13:59abaloneamalloy: what other information is needed?
14:00emezeskewingy: The canonical version of a JAR is the one where the group ID matches the name, e.g. clj-redis/clj-redis
14:00amalloycemerick: iirc he only warns about richhickey.github.com, not github.com/richhickey
14:00emezeskewingy: That's usually abbreviated to just clj-redis
14:00emezeskewingy: So, the one at the bottom (by mmcgrana) is the canonical one
14:00wingyemezeske: ok thx
14:01wingya little bit outdated
14:01wingyhope it didnt need bug fixes
14:01amalloyabalone: well, what it means to "create and access" them, and how the maps and vectors are similar and different. but really, i think the difference will be small enough you should choose whichever makes more semantic sense in your problem
14:02emezeskewingy: Well, I don't know that the canonical version is the most up to date
14:03emezeskewingy: You can always check http://www.clojuresphere.com/?query=clj-redis
14:03abaloneamalloy: oh. there's no sharing between these little maps and they're all created "from scratch" like {:a 1 :b \2 :c 3 :d -4}
14:03emezeskewingy: Looks like mmcgrana's version is the most widely used, FWIW
14:03wingyemezeske: ok
14:04abaloneamalloy: and this is in cljs (not clj)
14:04cemerickamalloy: surely someone knows how to fix that?
14:04abaloneamalloy: maybe i should also ask if there are performance gotchas in cljs that are different from clj
14:05amalloycemerick: sure, i wrote the regex myself, back in the day
14:05wingywhat is the simplest way doing layouting using hiccup .. that is having a layout (head scripts) and then render different body documents inside of it
14:05abaloneamalloy: like keywords become strings and then whoops you're suddenly comparing strings in js
14:05cemerickamalloy: oh, it's a plugin? I figured it was just a command to set up a new watch pattern or something.
14:06emezeskewingy: That might be a job for a middleware.
14:06amalloycemerick: i wrote it pretty brittle-ly, i'm afraid
14:06amalloyhis config file has a map of regexes to replacements/responses
14:08TimMcThat's why god invented |.
14:10emezeskeTimMc: God invented the one-eyed expressionless emoticon?
14:11TimMcNo, the alternation operator.
14:11cemerickI thought it was cyclops.
14:11cemerickBetter known as |•
14:12TimMcrichhickey[.]github[.]com|github[.]com/richhickey
14:12wingythe worse part comparing to node.js is lack of doc
14:12casionthe worst part of what?
14:13amalloyTimMc: it's brittle because it's in a config file, not because it's using regexes :P
14:14amalloyactual current map-entry: [#".*(https?://)richhickey(.github.com/\S*).*" "Nooooo, that's so out of date! Please see instead $1clojure$2 and try to stop linking to rich's repo."]
14:14TimMcOh right, it does replacement.
14:14amalloyi would happily accept a change if someone can find a way to get that to also chide you for linking to contrib; currently he just points to the clojure/clojure-contrib repo as if that were useful
14:15amalloyalso, haha, i seem to have assumed rich would never write anything but clojure; if someone links to his datomic repo i bet lazybot gets up in arms
14:16cemerickI thought the same thing about edn, bu it looks like he doesn't have any active repos himself anymore.
14:17pandeirocemerick: do you know what would be the most efficient way to enter an attachment that is a javax.mail.internet.MimeBodyPart into CouchDB with clutch?
14:18amalloyoh right, datomic isn't on github because it's not open
14:20cemerickpandeiro: if you can find a byte array or inputstream, that'd be it
14:20pandeirocemerick: i can get those, but for some reason clutch just hangs when i try with input-stream... i can see data has entered the database by its size in futon but no attachments appear in the doc
14:21pandeiroi am wondering if the .getSize method doesn't correspond with the :data-length param clutch/put-attachment is expecting?
14:26jcromartiestink bugs must die
14:28Hodappjcromartie: why?
14:31jcromartieHodapp: you obviously don't live the mid-Eastern US
14:31jcromartiethey are crawling all over my walls and desk and computer
14:31jcromartiein my cables and bags, printer, etc.
14:33TimMcjcromartie: Brown Marmorated Stink Bug?
14:33jcromartiethe one and only
14:33TimMcGotta find a recipe for those.
14:33jcromartietacos!
14:34TimMcMy dad is helping some company evaluate phermomone traps for BMSBs.
14:35Hodappjcromartie: I'm in Cinci...
14:36jcromartieTimMc: I wish them the best of luck
14:36Hodappjcromartie: so I still see them around plenty.
14:37jcromartieif by "plenty" you mean hundreds a day in your home
14:37jcromartiethen I can sympathize :)
14:37jcromartieotherwise you guys still have it easy
14:38HodappIf hundreds a day are making it into the home I have to wonder about the construction quality...
14:38callenbest clojure book, go:
14:38scriptorfor what level?
14:39callen(for someone who knows some Lisp, and no Java, and can only tinker in Clojure (~50 solutions in 4Clojure))
14:39casionfor what background?
14:39callenCommon Lisper
14:39casionjoy of clojure probably then
14:39callenI know a fair chunk of Python too.
14:39Raynescallen: Programming Clojure
14:39scriptorcallen: you can read the first chapter of Programming Clojure and see if it's not too basic for you
14:39callenRaynes: incidentally, I already own Halloway's book
14:39jcromartiehttp://www.mediabistro.com/fishbowldc/gasp-u-s-newss-bedard-has-what_b21462
14:39scriptor*first chapter for free
14:39callenscriptor: it was. I got bored, haha.
14:39casionprogramming clojure is also awesome
14:39Raynescallen: I meant Clojure Programming.
14:40scriptorah, then definitely joy of clojure
14:40jcromartieI have been browsing Clojure Programming, it's good
14:40callenI'll get Clojure Programming on my kindle account then.
14:40callenI'll see about Joy of Clojure too, that one sounds like it explains more of what's actually different/unique.
14:40callenThank you all!
14:41callenRaynes: btw, loved your comments on that grove.io thread, although you got eviscerated for it.
14:41scriptorcallen: whoops, I meant you can read Clojure Programming's first chapter online for free
14:41Raynescallen: By only one guy.
14:41callenRaynes: I actually got hellbanned from HN in that thread for disagreeing with pbiggar (the guy who went after you)
14:41Raynescallen: I got backed up by countless others.
14:41HodappHN?
14:41callenHodapp: Hacker News
14:41Hodappahhhh
14:42RaynesYeah, I replied just once to him and realized he was off his rocker, callen. Let everyone else call him stupid.
14:42callenRaynes: except he took my 2,000 karma account with him :(
14:42callenRaynes: but yes, you're right.
14:43callenLessoned learned though, don't argue with a YC founder on HN.
14:43callenLesson*
14:43TimMcWhat did you do, insult his mother?
14:43SgeoBanned for what?
14:44callenTimMc: I said he was shilling on behalf of founder unaccountability.
14:44TimMcThat's a little more than disagreeing.
14:44callenHe was pretty transparent about it.
14:44dnolenhmm, a good idea for a new contrib - a pure Clojure reader that can move at it's own pace separate from Clojure's \cc ibdknox
14:44Raynescallen: I feel kinda sorry for his users. Not sure I'd want to use anything written by such a hostile fellow.
14:45callenRaynes: well lesson learned, don't use CircleCI
14:45technomancydnolen: what about sjacket?
14:46RaynesTimMc: Well, all I said was that Leah Culver was beginning to appear from the outside to be a bit unreliable (seeing as how every nearly every single project she has ever worked on has been shut down after n months or acquired and shut down in the same timeframe), and the fellow called me more derogatory names than I knew existed.
14:46callenRaynes: I saw that shake library recently, is your conch more flexible?
14:46dnolentechnomancy: yeah I was thinking that, does it already have line+column support?
14:46technomancydnolen: I think so; not sure
14:48jcromartieRaynes: you're just trying to keep women out of tech! :)
14:48Raynescallen: I've actually written my own port of the Python sh library inside of conch (see the sh branch) that I'll be releasing as soon as I work the kinks out. Shake seems like a quick release prototype thing and does some pretty silly stuff.
14:48Raynesjcromartie: Yeah, man, that's gotta be it.
14:48TimMcRaynes: Yours had better not look like (xargs -0).
14:49callenRaynes: I'll keep an eye on it, thank you.
14:49Raynescallen: Also, conch has conch.core which is lower-level than anything else on the market. Once the sh thing is done, it'll probably be the best thing around all around for shelling out.
14:49technomancyRaynes: it's always fun to watch when HN's veneer of objectivity breaks down
14:49jcromartielol @ -0
14:50callentechnomancy: they're not interested in objectivity, they're interested in HUSTLE and PIVOTING and MICROPRENEURSHIP!
14:50TimMcjcromartie: Yeah, I left a comment on the blog post announcing Shake, but I didn't get a reply.
14:50technomancycallen: https://twitter.com/mattknox/statuses/197781664179560449
14:50jcromartieShake was doomed from the start
14:50RaynesTimMc: I stopped reading when I saw "indexes the PATH"
14:50callentechnomancy: perfection. that's hilarious.
14:51HodappI have an urge to play buzzword bingo now.
14:51RaynesTimMc: https://www.refheap.com/paste/f0954d5a3f0bfb49d719e7bf5 is a simple example I've got handy.
14:51RaynesTimMc: There are also lexical versions of 'programs'.
14:51RaynesThis is a piping example, btw.
14:52jcromartiewow this is an awesome logo https://boundary.com/
14:52jcromartiehttps://twitter.com/shit_hn_says
14:53RaynesTimMc: It just occurred to me that it isn't parallel right this second, which is probably the last thing I need to tie up before releasing it.
14:53TimMcjcromartie: Immediately reminded me of last.fm's logo.
14:53casionTimMc: soundcloud you mean?
14:54TimMccasion: No, last.fm.
14:55TimMcRaynes: I like the general idea of sh, anyway.
14:55casionAh, I thought that little cloud thing was their logo
14:55TimMcOh, hah.
14:55TimMcRaynes: One (big) step closer to Clojure Shell.
14:55casionI didn't even realize that scribble in the upper left was supposed to be a word
14:56TimMccasion: It teeters on the brink of illegibility.
14:56casionTimMc: it has all the hallmarks of being a successful startup, the only qualifier left is collapsing in 3 months
15:00wingywhere is the doc on how to add a middleware in compojure?
15:02callenjcromartie: This twitter account is a goldmine: "You can't do concurrency with threads."
15:20wingy:@
15:20wingybefore im going to kill myself
15:20wingyi need to know how to add a middleware to a compojure app
15:22dnolenwingy: look at how compojure works - there's hardly any code - https://github.com/weavejester/compojure/blob/master/src/compojure/handler.clj#L16
15:23jcromartiewingy: I'm happy to discuss middleware :) I am a big fan
15:23wingyjcromartie: dicuss what?
15:23jcromartiemiddleware
15:24wingywhat is there to discuss?
15:24jcromartiewere you not just saying "i need to know how to add a middleware to a compojure app"
15:25wingyjcromartie: yeah
15:25cemerickclassic
15:26wingydnolen: thx for the link it helped a lot
15:26cemerickdnolen: sjacket mostly makes it so you don't have to care about line and column numbers
15:26wingybest doc is still reading the source code
15:27xeqiwingy: (def app-with-middleware (-> app middleware1 middleware2); ie: (-> app compojure.handler/site) or (-> app wrap-keyword-params wrap-params etc)
15:27cemerickoutrageously bleeding edge, tho
15:27dnolencemerick: yeah I don't really think it doesn't what I want. I want a community supported version of the Clojure reader that provides extension points to support both Clojure & ClojureScript.
15:27jcromartieO_o
15:27dnolencemerick: it seems less and less likely that rhickey will be convinced to add column support to the Clojure reader.
15:27SgeoWhy community supported?
15:28SgeoWhy not just ... do something to handle the use case that #+ and #- does in CL?
15:28Sgeocolumn support?
15:28cemerickdnolen: is this for source maps?
15:29dnolencemerick: any tool that needs it, Light Table uses a patched version of Clojure which is sad.
15:30dnolencemerick: but yes
15:31dnolencemerick: this actually something Eric Thorsen wanted for Enclojure ages ago as well.
15:31cemerickyeah, I remember
15:31TimMcSgeo: Notice the lack of :col ##(keys (meta #'+))
15:31lazybot⇒ (:ns :name :file :line :arglists :added :inline-arities :inline :doc)
15:32TimMcbut the presence of :line
15:32SgeoAh. And this is of particular interest for Clojurescript?
15:32SgeoOr just a general want?
15:32cemerickdnolen: sjacket does have a `column` fn, so you could probably parse, walk the zipper adding that value as :column meta to each list, and output to sexprs.
15:32amalloySgeo: for any tools that manipulate source code
15:32SgeoAh
15:33SgeoAnd I still don't see a good reason for arglists to be on the var
15:33dnolencemerick: sjacket just does too much. super fast reader that does exactly what Clojure's reader does with extension points. No other stuff.
15:33SgeoRather than on the fn
15:33cemerickfair
15:34cemerickdnolen: Although, I'd settle for a super-fast reader *without* column numbers at this point. :-P
15:34TimMcSgeo: You know how Java compiler errors say -----------------^ ? That's a good use of column info.
15:34dnolencemerick: heh, you mean for CLJS
15:34cemerickdnolen: Don't scare me, I haven't benched that yet. Clojure's is pokey enough.
15:35dnolencemerick: huh, I guess you've used it on particularly large jobs?
15:35amalloySgeo: functions are noticeably more lightweight without a slot for metadata, is one thing
15:36amalloypersonally i'd love functions to contain arglists in their meta, but the other decision seems reasonable too
15:36cemerickdnolen: yeah, it falls down pretty badly compared to just about any other serialization mechanism.
15:36SgeoUntil you want to know the arglists of an anonymous fn
15:36SgeoOr use the arglists in a HOF for stuff
15:38SgeoHmm, is Compojure just about routing, or is there more to it than that?
15:39jcromartieSgeo: pretty much, and the api/site middleware
15:40cemerickSgeo: Mostly that, and some good default middleware stacks for api services and front-end apps.
15:40jcromartie*jinx*
15:41jcromartieI really like Ring (which Compojure, and any other Clojure web lbi builds on)
15:41jcromartielib
15:41jcromartieit's like Rack, but fast
15:41jcromartieand functional
15:41SgeoAnd what is Noir? Mutation-inducing macros to make things slightly more convenient?
15:42jcromartieyou got it
15:43SgeoAlthough I guess compojure's defroutes technically induces mutation, but I don't have a problem with that
15:43jcromartieno, not really
15:43jcromartiedefroutes gives you a var in your namespace
15:43jcromartiedefpage does not
15:44jcromartieand defroutes leaves it up to you to use that var
15:44jcromartiedefpage does not
15:44SgeoIs making a var not a mutation?
15:44jcromartieno
15:44emezeskedefpage actually mutates the value contained in an atom each time it appears
15:44emezeskedefroutes just creates a new var, it doesn't mutate an existing one
15:44jcromartiewell you could call establishing a var mutating the namespace, perhaps
15:44jcromartiebut defpage wires it up in the background
15:44SgeoI did say "technically"
15:44jcromartie:)
15:45jcromartiebut you don't have to use that
15:45jcromartieI don't… I just say (def foo (routes …))
15:45jcromartieI usually have a var for my plain routes and another var with all of the middlware attached
15:46SgeoI believe Yesod (a Haskell web framework) actually takes a textual description of the routes and compiles it?
15:46amalloyjcromartie: that seems oddly specific. surely you have routes with different middlewares
15:47jcromartieamalloy: sometimes
15:47jcromartieamalloy: e.g., I'll have "api-routes", and "api" with middleware
15:49dnolencemerick: sounds like you're enjoying CLJS :)
15:49jcromartieit just keeps the route definition simple
15:50cemerickdnolen: The core, definitely. Things get wobblier the further out you go. ;-)
15:50cemerickI have an nREPL middleware finished that applies the same cljx transforms to code loaded through the REPL as are performed via the plugin, and that's made a world of difference.
15:51cemerickStill need a name for that one. :-P
15:51emezeske"ClojureScript: Things get wobblier the further out you go." -- cemerick
15:51emezeskeI'm using that.
15:51cemericklol
15:52SgeoWith destructuring, I keep forgetting that it's variable first, then key
15:52SgeoUnless doing something like :keys
15:52cemerickI'm sure being so tied to a REPL-based workflow made things more painful in the beginning than if I were still used to e.g. python or ruby, but a lot of the rough edges are sanded off.
15:54cemerickNow I'm down to annoyances around e.g. no real environment, protocol/interface name mismatches, satisfies?/instance? in the same area, and then the DOM misery.
15:54cemerickOver which cljs has no control, of course.
15:55amalloySgeo: if you think about it though, that's the only way it could work
15:55Sgeoamalloy, because of things like :keys?
15:56amalloynah, you could survive with {[a b c] :keys} if the order were swapped
15:56SgeoOh, good point
15:57amalloyit's because (let [{foo :k, bar :k} m]) makes sense, but (let [{:k foo, :k bar} m]) isn't a legal form
15:58SgeoAh
16:01SgeoOh hey, Ring sessions allow for storing session data encrypted as a cookie but doesn't enforce it
16:04dnolencemerick: protocol/interfaces yeah, though the interfaces in Clojure drive me crazy now after CLJS. satisfies?/instance? probably worth seeing if making them work similarly doesn't degrade perf too much.
16:04dnolencemerick: and yes CLJS REPL dev could use a *lot* more love.
16:04cemerickBetween crossovers and cljx, I can work around the protocol stuffs.
16:05ohpauleezinc on all of those
16:05cemerickdnolen: I think the REPL story is pretty well ironed out, given piggieback.
16:05cemerickAnyone that disagrees, I'm happy to take feature requests. :-)
16:06ohpauleezcemerick: I really need to get piggyback well integrated (adding it to my TODO list right now)
16:06cemerickohpauleez: should be two lines in your project.clj and any nREPL client.
16:06ohpauleezperfect
16:07cemerickEspecially now that Brenton fixed the REPL environment issue, all is mostly well with the world.
16:07dnolencemerick: yeah I still haven't played with nREPL yet.
16:08dnolencemerick: I meant REPL details like auto analyzing files when starting up so the REPL has relevant info - fixing the various edge cases where JS errors takes brower REPL session, etc.
16:10cemerickah
16:10cemerickdnolen: I mostly have no idea what you just said. :-P
16:11hiredmancemerick: analyze files at startup to provide doc for cljs files in the repl
16:11cemerickThe next biggest win across the board will be a completion/introspection middleware, so that the same requests from clients will work with a cljs flavour of the same.
16:11dnolencemerick: I just mean that CLJS repl holds a lot of information normally held in metadata on vars, I'd like to see CLJS repls take advantage of that.
16:11clojurebotthen its perfect. but of course, there are a lot of other parts too that changes. so after I make assoc :show, is there a problem I make again (def data (assoc data :list ...)
16:11cemerickah, ok
16:12dnolencemerick: and sorry I don't mean CLJS REPL - cljs.analyzer/namespaces atom rather
16:12cemerickwell, it all hangs together from a user standpoint
16:13dnolencemerick: debugging macros in CLJS is pure punishment
16:13dnolenstuff like that
16:14cemerickYeah, I've gotten a taste of that already.
16:15jjidoclojurebot can talk?
16:15cemerickThere should be a "do we not suck yet?" page that is all qualitative :-P
16:18gfredericksclojurebot: can you talk???
16:18lazybotgfredericks: How could that be wrong?
16:18clojurebotHuh?
16:26TimMc,(symbol (apply str (map char (repeat 2 2r111111))))
16:26clojurebot??
16:26lazybotclojurebot: What are you, crazy? Of course not!
16:26clojurebotRickInGA: of course :-) *everything* is in Clojure
16:26TimMc\o/
16:27ivan,"??"
16:27clojurebot"??"
16:27TimMcI win.
16:27TimMc3-bot volley.
16:27ivanhah
16:28TimMcclojurebot: of course not is <reply> are you sure??
16:28lazybotTimMc: Uh, no. Why would you even ask?
16:28clojurebotRickInGA: of course :-) *everything* is in Clojure
16:29SgeoUh
16:29SgeoIs clojurebot replying to someone who isn't here?
16:29TimMcNot exactly, no.
16:30SgeoSo what's with RickInGA?
16:30TimMcThe random annoyance^Wfactoid engine picked up "of course" and decided it referred to a factoid that it accidentally picked up earlier.
16:31SgeoAh
16:31TimMcThe damn bot is set to think that one in every X messages is directed to it.
16:31Sgeoliteral clojurebot: What are you, crazy? Of course not!
16:31TimMcSgeo: clojurebot != bucket
16:33jjidoclojurebot: then its perfect. but of course, there are a lot of other parts too that changes. so after I make assoc :show, is there a problem I make again
16:33clojurebotRoger.
16:34jjidothat was not a bot was it?
16:35amalloyTimMc: Sgeo has been told that but doesn't seem to have internalized it yet
16:35SgeoI could have sworn that literal worked once, though
16:35amalloyif so, it was a coincidence
16:39emezeskednolen: I added auto reloading of macro namespaces in lein-cljsbuild. That demoted the punishment of debugging macros from "cat o' nine tails" to "wooden paddle" or so, at least for me.
16:39dnolenemezeske: haha
16:47FrozenlockI found a little article about clojure and the system tray, but I was wondering if there was something new since then (2008?!) http://briancarper.net/blog/398/qt4-in-lisp
16:47FrozenlockI just want to add a system tray icon to a seesaw application.
16:48SgeoSeesaw uses Swing, doesn't it?
16:48scottjdnolen: was your core.logic unsession talk (showed up on youtube today I think) a repeat of a previous talk?
16:48SgeoMight be better to look for a Swing way to do a system tray icon
16:48dnolenscottj: nope, first time I've given that one.
16:48scottjdnolen: awesome! I'll enjoy watching it
16:49FrozenlockSgeo: It does indeed. I'll check it, thanks!
16:49dnolenscottj: it's less about using than explaining how the whole thing actually works
16:51thorbjornDXis there a difference in using (for [a blah :let [foo bar]]) over (for [a blah] (let [foo bar]))?
16:51TimMcjjido: That is a bot repeating back something it heard in the channel for no good reason.
16:51TimMcjjido: And you just made it learn a new factoid, unfortunately.
16:52SgeothorbjornDX, you can put stuff after for's :let while still in the for form
16:53Sgeo,(for [a (range 2) :let [b (inc a)] c (range b) [a b c])
16:53clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
16:53Sgeo,(for [a (range 2) :let [b (inc a)] c (range b)] [a b c])
16:53clojurebot([0 1 0] [1 2 0] [1 2 1])
16:53Sgeoerm, hmm?
16:54thorbjornDXSgeo: I didn't think the for's :let would actually do a for-like binding
16:54thorbjornDX,(for [a (range 2) b (range a) c (range b)] [a b c])
16:54clojurebot()
16:55SgeoEven when a is 1, (range 1) can only be 0, and range 0 is empty
16:55SgeoSo I understand what's going on
16:55thorbjornDX,(for [a (range 2) b (range (inc a)) c (range b)] [a b c])
16:55clojurebot([1 1 0])
16:56mpanoh that's a pretty cool shorthand
16:56SgeoThe equivalent to my prior :let should be
16:56Sgeo,(for [a (range 2) c (range (inc a))] [a (inc a) c])
16:56clojurebot([0 1 0] [1 2 0] [1 2 1])
16:57thorbjornDXSgeo: so that would be the same as doing a let binding within after the for binding: (let [b (inc a)]), correct? b, has no effect on the looping itself
16:58SgeothorbjornDX, right, except with :let you can refer to the bound variables later on within the for's whatchamacallit, whereas you can't do that with let
16:59thorbjornDXSgeo: okay, so I should use :let when I want to make my for-loop more clear, and use another let binding when I don't need access to those seqs in the for
17:06thorbjornDXoh, I found a handy way to use maps and vector destructuring (idk how common this is): ##(let [k :a] (let [[a b c] (k {:a ['foo 'bar 'baz] :b [2 3 4]})] [a b c]))
17:06lazybot⇒ [foo bar baz]
17:08brainproxyif the body of doseq involves forms that will return futures, are those futures guaranteed to finish their computations before doseq returns?
17:09hiredmanbrainproxy: of course not
17:09hiredmana doseq doesn't return anything
17:10jjidohiredman: what it returns is not really the issue is it?
17:11brainproxyhiredman: okay, just a sanity check :)
17:11hiredmanjjido: brainproxy says "if the body of doseq involves forms that will return futures"
17:12jjidogood point
17:13jjidorather confused statement
17:14brainproxyokay, i meant i have a case where the body in my doseq would return a future when considered in itself
17:14brainproxybut I understand doseq itself doesn't return those things
17:14TimMcbrainproxy: You're saying you want to join on all those futures, then?
17:15brainproxyno, i just need to make sure they all finish their computations before moving on, so I can alter the body so that the part that returns the future is prefixed with @
17:15hiredmanbrainproxy: that is pretty silly
17:16jcromartie(time (doseq [_ (range 10)] (future (Thread/sleep 100))))
17:16jcromartie&(time (doseq [_ (range 10)] (future (Thread/sleep 100))))
17:16lazybotjava.lang.SecurityException: You tripped the alarm! future-call is bad!
17:16jcromartieoh
17:16jcromartie,(time (doseq [_ (range 10)] (future (Thread/sleep 100))))
17:16clojurebot#<SecurityException java.lang.SecurityException: no threads please>
17:16jcromartiebah
17:16hiredmanyou will serially step through a seq, spinning computations off on another thread, but blocking the main thread until it completes
17:16jcromartieanyway, in my local repl that takes 1ms
17:17brainproxyyeah, okay, maybe there is a better way... i was borrowing a helper func from the day-of-datomic samples
17:17brainproxyand was looking to adapt it in a simple way to get me what I wanted
17:19jcromartiebrainproxy: what about pmap
17:19jcromartiei.e. (doall (pmap some-fn some-seq))
17:19jcromartieif it's for side effects
17:20brainproxycool
17:23jcromartiewhat's that HOF that is like ((_ f g) x) and returns [(f x) (g x)]
17:23raekjcromartie: juxt
17:23jcromartiethanks
17:27jcromartie*usually* totally not worth it: parallel filter
17:27jcromartiein fact, every time I add a "p" to my program it gets slower :P
17:28jcromartieis this totally stupid? https://gist.github.com/3814519
17:28jcromartieoh duh
17:28jcromartienever mind
17:30muhooheh
17:40UrthwhyteIs there a good writeup on the changes records have gone through from 1.2->1.4?
17:40UrthwhyteI suppose the mailing lists would have a good history?
17:47hammeris anyone putting reports from clojure unit tests in a maven site?
17:47jcromartieI am really really pleased with the performance of this Clojure JSON API just running on Jetty
17:47jcromartie1000 requests per second
17:47jcromartiedoing various filtering
17:48jcromartie3K/sec for methods return aggregates over the model that the API exposes
17:48jcromartie(i.e. less I/O)
17:50jcromartieit's not astronomical or anything but compared to what I'm used to :P
17:53FrozenlockUh that weird.. "new TrayIcon(createImage("images/bulb.gif", "tray icon"))" I would have guessed becomes something like: "(java.awt.TrayIcon. (createImage. "images/bulb.gif") "tray icon")" But obviously 'createImage' isn't a method I can apply directly to a string. How does it translate in clojure?
17:53SgeoI don't understand https://github.com/clojure-liberator/liberator
17:53SgeoThe Routing web requests example
17:53brainproxySgeo: yeah, it's a little weird at first
17:53SgeoHow is it using the ANY macro without it being named in the ns form?
17:55Apage43Frozenlock: "createImage" is not a constructor there
17:55Apage43it's a method on whatever the enclosing class is
17:55brainproxySgeo: hmm, could be a typo, or maybe w/in the body of routes the ANY symbol is bound
17:57brainproxySgeo: seems like a mistake
17:57Apage43Frozenlock: this what you're porting? http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/uiswing/examples/misc/TrayIconDemoProject/src/misc/TrayIconDemo.java
17:57Apage43The createImage method is at the bottom
17:57FrozenlockYes
17:57brainproxySgeo: the author should have indicated ANY in the :use
17:57FrozenlockAhh I see
17:58FrozenlockI was looking at the API of TrayIcon and wondering what was up. Thanks!
17:58Sgeobrainproxy, how do you edit Clojure code?
17:58SgeoEmacs, or what?
17:58brainproxyemacs ftw :)
17:59Apage43(defn createimage [path description] (javax.swing.ImageIcon. (resource path) description))
17:59SgeonREPL.el?
17:59clojurebotnrepl.el is srsbsns
17:59Apage43er, where resource is in clojure.java.io
17:59Apage43http://clojuredocs.org/clojure_core/clojure.java.io/resource
17:59brainproxySgeo: still using lein-swank
17:59brainproxybut will switch over to nrepl eventually i suppose
18:00brainproxybut currently lein-swank is working fine for me
18:00SgeoI just wish nrepl.el and paredit provided menus
18:00SgeoHelp transition in to using the things
18:01brainproxyparedit cheat sheet helps.. some
18:01brainproxyas in ruby rack?
18:02SgeoYes
18:02FrozenlockApage43: Will make good use of it, thanks a lot :)
18:05zoldaram I missing something obvious or does this function completely ignore some of its' arguments, like "uniqueness" ? https://github.com/michaelklishin/neocons/blob/master/src/clojure/clojurewerkz/neocons/rest/paths.clj#L64
18:07Sgeozoldar, uniqueness is used
18:08SgeoLook at the let [request-body
18:09SgeoHmm
18:09zoldarSgeo: not in "shortest-between". Or I am blind...
18:09Sgeo,(let [{:as map} [[:a 1] [:b 2]]] map)
18:09clojurebot[[:a 1] [:b 2]]
18:10jcromartiewhy does clojure.xml/parse seem to fail miserably on a 11K document
18:11Sgeozoldar, looks like copy/paste :/
18:11jcromartieI'll use jsoup
18:20SgeoSuppose I want to do long-polling in a Compojure application
18:20SgeoOne route will presumably be for the request that the browser makes
18:20jcromartieis "lein search" broken
18:20SgeoHow do I communicate with ... hmm
18:21SgeoHow do I communicate between that request and whatever will fulfill it (say, a different request0
18:21weavejesterSgeo: You could block a response on a promise.
18:22weavejesterSgeo: But you might want to use a server designed for asynchronous I/O, like Aleph
18:22wingylight table is the best thing after sliced bread
18:22SgeoI guess my question is largely because I recently tried to do something similar in PHP, and ended up using a file
18:22SgeoAlthough a socket might be a better way to go in the PHP case?
18:28weavejesterSgeo: It really depends on how many users you're expecting...
18:29SgeoProbably not very many, but... I wish design decisions didn't always come down to that
18:29weavejesterSgeo: For a small number of users, you could use a BlockingQueue
18:29weavejesterSgeo: http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html
18:29emezeskeSgeo: You wish design decisions didn't come down to the real world? :P
18:30SgeoIs this sort of thing the use case for Immutant?
18:30SgeoApparently it offers a messaging thing?
18:30weavejesterSgeo: Well, you really just need something like (defonce queue (LinkedBlockingQueue.))
18:31weavejesterSgeo: And then (.poll queue 60 TimeUnit/SECONDS)
18:31weavejesterSgeo: In your "listener" route
18:32SgeoI guess I'm too used to thinking in PHP terms
18:32weavejesterSgeo: And (.add queue "message") in your "sender" route
18:33SgeoWhere a file is executed once and then the environment is discarded, no global sharing. If I understand PHP correctly
18:33weavejesterSgeo: That'll use up 1 thread per user, which is not too efficient, but will scale to a few hundred simultaneous users (or however big your thread pool is)
18:33weavejesterSgeo: In Clojure the environment sticks around
18:33weavejesterSgeo: Though if you have a load-balanced environment obviously you'd have to rethink things
18:34zoldarIf I'm going to make a pull request on github for a bugfix, should I file an issue first?
18:35zoldar(sorry for off-topic
18:35weavejesterzoldar: Not necessarily, but it depends on the scope of the pull request.
18:35weavejesterzoldar: If it's a simple bug fix, then IMO there's not usually a huge point in having a separate issue
18:35zoldarweavejester: that's a minor fix of what seems to be a copy/paste error
18:35weavejesterzoldar: If, however, you're adding in a new feature, you might want to talk to the repo owner first through an issue
18:36weavejesterzoldar: Just send a pull request then
18:36zoldarthanks
18:36weavejesterThe only time it matters, IMO, is if you're going to create a large feature without talking to the repo owner first.
18:36hiredmanif it is for clojure or a clojure contrib project, they do not accept pull requests
18:37zoldarit's for neocons
18:37weavejesterGood point, hiredman
18:38hiredmanhttps://github.com/clojure/clojure/pull/6
18:40amalloyhah, i haven't looked at that one since he followed up
18:42SgeoIs Noir useful without defpage? Would Noir fans dislike the notion of not using defpage?
18:44FrozenlockWould there be something to replace it?
18:44emezeskeSgeo: IMHO if you are thinking about using Noir without defpage, you should just use raw Compojure.
18:46Sgeohttp://en.wikibooks.org/wiki/Compojure/Getting_Started looks obsolete, no Lein?
18:47emezeskeSgeo: Much more up to date: https://github.com/weavejester/compojure/wiki/Getting-Started
18:47brehautSgeo: how about going to the horses mouth: https://github.com/weavejester/compojure/wiki/Getting-Started
18:47brehautoh. lol
18:49SgeoWhy is Hiccup's html a macro?
18:49SgeoAnd not a function?
18:50emezeskeSgeo: It does a bunch of precompiling to make things fast
18:51SgeoIf I do (def some-vector [:html [:head [:title "Blah]] [:body "Hi"]]) (html some-vector)
18:51SgeoWill it emit based on the vector, or do something weird?
18:51SgeoOh, I forgot a ]
18:51SgeoNo I didn't
18:52SgeoI wish I could quickload in the REPL
18:52FrozenlockYou can't live without a REPL
18:52zoldardoes that look like a correct pull request? https://github.com/michaelklishin/neocons/pull/10
18:53weavejesterSgeo: The html macro pre-compiles the code
18:54weavejesterSgeo: So, for instance (html [:a {:href x} x]) gets turned into (str "<a href=\" x "\">" x "</a>")
18:55amalloyweavejester: that second instance of x should be (html x), shouldn't it?
18:56weavejesteramalloy: Oh yep, true
18:58Sgeo,(let [{:as map} [:a 1 :b 2]] map)
18:59clojurebot[:a 1 :b 2]
18:59Sgeo,(let [{:keys [a b]} [:a 1 :b 2]] [b a])
18:59clojurebot[nil nil]
18:59SgeoSo how exactly does & {:keys [...]} in an fn arglist work?
19:00amalloy~def destructure
19:01amalloyin particular https://github.com/clojure/clojure/blob/f128af9d36dfcb268b6e9ea63676cf254c0f1c40/src/clj/clojure/core.clj#L3434
19:04Apage43Incidentally you can macroexpand destructured things
19:04FrozenlockSgeo: You might want to use [&[:keys [a b]]], so you will be able to pass a map directly.
19:04Frozenlock er [&[{:keys [a b]}]]
19:04Apage43,(macroexpand '(let [{:keys [a b]} somemap] [a b]))
19:04clojurebot(let* [map__84 somemap map__84 (if (clojure.core/seq? map__84) (clojure.core/apply clojure.core/hash-map map__84) map__84) b ...] [a b])
19:05pqnelsonOK, I have a quick stupid question :(
19:05pqnelsonWhen would one use #'stuff?
19:05amalloyApage43: easier to just call destructure, really
19:05amalloy&(destructure '[{:keys [a b]} somemap])
19:05lazybot⇒ [map__56095 somemap map__56095 (if (clojure.core/seq? map__56095) (clojure.core/apply clojure.core/hash-map map__56095) map__56095) b (clojure.core/get map__56095 :b) a (clojure.core/get map__56095 :a)]
19:06pqnelsonWhen referring to a function in the ambient namespace, right?
19:06pqnelsonRight.
19:08SgeoHow does defpage work with middleware?
19:11zoldarI have external dependency from github which I want to use using 'checkouts' directory. However, the same version library is available from clojars and it seems to take precedence. Is there any way to make it use the version from checkouts?
19:13SgeoLearning Compojure seems to require learning Ring
19:13clojurebotcompojure is a concise web framework inspired by Sinatra
19:13weavejesterSgeo: Right. Compojure is just a routing library for Ring
19:13emezeskeSgeo: Doing web development in Clojure requires learning Ring.
19:14SgeoDoesn't Aleph do something that is almost like Ring but not quite?
19:14weavejesterAleph can act like a Ring handler, but can also do more things.
19:14weavejesterSo it's effectively superset of Ring.
19:14SgeoHm
19:15casionwhat is ring?
19:16weavejestercasion: A way of representing a web application in Clojure using maps and functions.
19:16xeqicasion: https://github.com/ring-clojure/ring
19:16casionxeqi: I'm there, but that doesn't really explain it very well to someone who has very little knowledge of web dev
19:17xeqiah, then think representing http in clojure
19:17casionperhaps my question is over my own head in that case?
19:17casionahh
19:18casionok, thanks weavejester and xeqi :)
19:18weavejestercasion: A web server is something that takes in a HTTP request, and returns a HTTP response, right?
19:18casionweavejester: that'd be my understanding, yes
19:18weavejestercasion: In Ring the request and response are represented by maps, and the server that turns a request into a response is a function.
19:19weavejestercasion: At it's simplest: (fn [request] {:status 200, :headers {}, :body "Hello World"})
19:19xeqipqnelson: I use #' when wanting to work around private, or when I want to be able to reload a file defing that var and have it change the usage immediately
19:19casionthat is remarkably logical
19:20weavejesterIsn't it? :)
19:20casionweavejester: that was a wonderful explanation
19:21weavejesterIt's a very simple abstraction, but very very powerful
19:21casionthat is just ridiculously simple
19:22casionI would have never avoided web dev so much if I knew of something like this years ago
19:22FrozenlockClojure wasn't there years ago :P
19:23FrozenlockWell not 'that' many years ago.
19:23SgeoWhy don't compojure.handler/api and compojure.handler/site use wrap-head?
19:23pqnelsonxeqi: really, it'll cause a file to reload immediately? Nifty,
19:23pqnelsonthanks :)
19:23xeqipqnelson: no
19:23SgeoIt seems like wrap-head is generally a good idea, how can you call yourself an HTTP server without it?
19:23weavejesterSgeo: Because GET routes already account for HEAD.
19:23SgeoOh
19:24pqnelsonxeqi: I misread, my error :S Thanks again :)
19:24weavejesterSgeo: https://github.com/weavejester/compojure/blob/master/src/compojure/core.clj#L25
19:25weavejesterSgeo: Although that logic could probably be completely moved into wrap-head...
19:25thorbjornDXthere has to be a cleaner way to do this, suggestions?: ##(map #(apply (fn [a & b] (if b [a (first b)] [(dec a) a])) %) (partition-all 2 (range 1 16)))
19:25lazybot⇒ ([1 2] [3 4] [5 6] [7 8] [9 10] [11 12] [13 14] [14 15])
19:25weavejesterSgeo: But wrap-head post-dates it.
19:25xeqipqnelson: an example of what I meant is a web server using #'routes, then if the var is changed, by say reloading the file, then new requests use the new binding
19:27Frozenlock#(for [i (range 1 16) :let [y (+ i 1)]] [i y])
19:27Frozenlock&(for [i (range 1 16) :let [y (+ i 1)]] [i y])
19:27lazybot⇒ ([1 2] [2 3] [3 4] [4 5] [5 6] [6 7] [7 8] [8 9] [9 10] [10 11] [11 12] [12 13] [13 14] [14 15] [15 16])
19:27FrozenlockOh crap
19:27Frozenlock&(for [i (range 1 16 2) :let [y (+ i 1)]] [i y])
19:27lazybot⇒ ([1 2] [3 4] [5 6] [7 8] [9 10] [11 12] [13 14] [15 16])
19:27pqnelsonxeqi: oh, I think I Understand. That's actually relevant to my
19:27pqnelsonproblem, thanks :D
19:28thorbjornDXFrozenlock: what if I don't want the 16 on the end? I would only like to use values in (range 1 16), and I am OK if there is overlap, but I want to minimize it. Which is why I don't use #(partition 2 2 %)
19:29TimMcpartition
19:29hiredman~partition
19:29clojurebotpartition is probably not what you want; see partition-all.
19:29TimMc&(partition-all 2 (range 1 16))
19:29lazybot⇒ ((1 2) (3 4) (5 6) (7 8) (9 10) (11 12) (13 14) (15))
19:30TimMcstupid enter key
19:31thorbjornDXTimMc: can I do this? ##(partition 2 2 [(second (reverse (range 1 16)))] (range 1 16))
19:31lazybot⇒ ((1 2) (3 4) (5 6) (7 8) (9 10) (11 12) (13 14) (15 14))
19:32TimMcOh, now I see the overlap thing.
19:32SgeoWhat's wrong with partition?
19:33thorbjornDXSgeo: it's close, but I'm trying to get the last element correct
19:33SgeoI mean, in general, that the bot says "partition is probably not what you want"
19:34TimMcSgeo: I disagree with whoever wrote that factoid.
19:34amalloy&(partition 2 [1 2 3])
19:34lazybot⇒ ((1 2))
19:34TimMcthorbjornDX: So, you want 1..4 to produce [[1 2] [3 4]], and 1..5 to produce [[1 2] [3 4] [4 5]]?
19:34thorbjornDXTimMc: correct, thanks for clarifying it, haha
19:34Sgeo&(partition-all 2 [1 2 3])
19:34lazybot⇒ ((1 2) (3))
19:35TimMcI sense an if statement in your future.
19:35thorbjornDXTimMc: roger that. Should I write a function and pass it to partition-by?
19:35thorbjornDXor I guess I can map/apply it to the sequence
19:36TimMcNothing so complicated.
19:36TimMcOh! These aren't just going to be numbers, you have some input seq?
19:37thorbjornDXTimMc: they will be numbers. I'm literally using range :)
19:37thorbjornDXI'm probably over-complicating things, though.
19:38TimMc(fn weird-shit [n] (if (even? n) (partition 2 (range 1 (inc n))) (concat (weird-shit (dec n)) [(dec n) n])))
19:39thorbjornDXwill give it a shot, sorry for weird questions :)
19:39TimMcOops, almost.
19:39TimMc,((fn weird-shit [n] (if (even? n) (partition 2 (range 1 (inc n))) (concat (weird-shit (dec n)) [[(dec n) n]]))) 15)
19:39clojurebot((1 2) (3 4) (5 6) (7 8) (9 10) ...)
19:39TimMc&((fn weird-shit [n] (if (even? n) (partition 2 (range 1 (inc n))) (concat (weird-shit (dec n)) [[(dec n) n]]))) 15) ;; lazybot is better with this
19:39lazybot⇒ ((1 2) (3 4) (5 6) (7 8) (9 10) (11 12) (13 14) [14 15])
19:39TimMc&((fn weird-shit [n] (if (even? n) (partition 2 (range 1 (inc n))) (concat (weird-shit (dec n)) [[(dec n) n]]))) 16)
19:39lazybot⇒ ((1 2) (3 4) (5 6) (7 8) (9 10) (11 12) (13 14) (15 16))
19:40thorbjornDXTimMc: awesome, thanks for the code
19:41TimMcSo, WTF are you doing with that?
19:42thorbjornDXTimMc: exercising hardware
19:42thorbjornDXTimMc: er, s/exercising/testing
19:42thorbjornDXTimMc: s/hardware/ICs
19:46nightfly_How can I get string representation of a symbol (ie 'example -> "example")
19:48stain,(name 'example)
19:48clojurebot"example"
19:49stainstr would also work :)
19:49thorbjornDX,(name :key) ; is a bit different though
19:49clojurebot"key"
19:49thorbjornDX,(str :key)
19:49clojurebot":key"
19:49stainyeah.. so good to remember the (name)
19:50xeqi,(name 'clojure.string/join)
19:50clojurebot"join"
19:51Sgeoo.O
19:51nightfly_stain: Cool, thank you
19:51Sgeovars that hold fns can be used as an fn
19:53wingycould we have a vote .. midje or clojure.test?
19:54stainnever tried midje.. is it good? It means 'waist' in my mother tongue..
19:55emezeskeI use both. Midje is harder to learn, but can be very concise. (In some cases, of course, being too concise can be a drawback...)
19:55xeqiI use clojure.test cause its builtin
19:56technomancyclojure.test is pretty good
19:57wingyemezeske: if you were about to choose one of them which one would you use?
19:58hiredmanI wouldn't call it good, but is the bare minimum, which is all you want
20:00technomancywell I guess the thrown? implementation is kind of the canonical "how to go overboard with macros" example
20:00technomancybut compared to midje...
20:01emezeskewingy: Personally I would use midje if I was going to do tons of mocking and stuff.
20:01emezeskewingy: Nobody seems to agree with me though, so you might want to ignore me. :P
20:01hiredmanyou can just fill a file up with asserts
20:01hiredmanrun it by loading the file and looking for exceptions
20:03xeqitest.generative is fun if you can think of properties
20:03stainI am in love with Midje already, just reading the tutorial
20:03hiredman=> is just silly
20:05wingyquite cool actually
20:06emezeskewingy: I think the warning about midje that maybe isn't broadcast loudly enough is that inside a (fact), you are not really writing Clojure code anymore
20:06emezeskewingy: You are writing midje code
20:06emezeskewingy: And that should at least terrify you a little bit
20:06wingyhttps://gist.github.com/3100734
20:06stainit comes with the checkers like (roughly 52) and "irrelevant"
20:06wingywhich one is to prefer?
20:06wingyi think midje wins there
20:08wingydont you think?
20:08amalloyemezeske: i don't care for midje myself, but what you just said is a valid complaint about any macro
20:08stainyeah, being able to test partial facts about collections are often large parts of my unit tests. But I can see the problem - what if I now want to check that the content type just include the string "json" ignoring case?
20:08arohneramalloy: sure, but some macros abuse things far far more than normal
20:09wingyyeah shouldn't macros be used for cases like this?
20:09wingymaking approripate DSLs to help out dev
20:09stainright - unit testing should be a good case for making a DSL
20:10stainbut both approaches do that - it's just that Midje has taken some additional freedoms and rethought how to do it rather than go the junit style
20:11TimMcthorbjornDX: I guess that's allowed. :-)
20:11sexpGirlwhich unit testing "thing" can I use if I want to run some unit tests written in Clojure, testing Clojure code, from inside Emacs / nrepl.el ? Is there some integration at all ? (like failing tests showing in red or something)
20:11technomancysexpGirl: clojure-test-mode works with slime but hasn't been ported to nrepl.el yet
20:11hiredmanswank-clojure and clojure.test would do that
20:12wingyill just stick with clojure.test for now
20:13emezeskeamalloy: That's true. I guess it's just a matter of degree -- more of the forms you pass to midje are munged by the macro than, say, defn.
20:14sexpGirltechnomancy: oh I see... Have you any plan of porting it to nrepl.el? (is it something people are even asking for?)
20:14technomancysexpGirl: it's on my list
20:14technomancybut my list is ... long.
20:14sexpGirltechnomancy: eh eh ; )
20:15xeqisexpGirl: I've been using test-ns or test-var in the repl w/ nrepl.el
20:16xeqihoping someone gets to clojure-test-mode
20:16hiredmannrepl.el still seems to have lots of very rough edges
20:16technomancyyeah I had to fall back to slime last week to use the inspector
20:17xeqican't wait to see http://clojure-conj.org/speakers/duncan.html
20:17hiredmanI have issues with reader literals
20:18hiredmanwhere if x is a form that can be read, but then the printed representation cannot be read, it all explodes
20:18hiredmanso there is some of double reading going on
20:19sexpGirlWhat is a stack frame compared to a stack trace?
20:19emezeskesexpGirl: A stack trace is a list of stack frames
20:19wingythere is a good link for beginners explaining the difference between collections and sequences .. anyone knows which one i mean?
20:20sexpGirlemezeske: ah gotcha, thanks.
20:33thorbjornDXTimMc: if only hardware were functionally pure
20:35emezeskethorbjornDX: I have a space heater. Does that count as functionally pure? :D
20:39holojust a random comment: lein exec wont run lein deps beforehand if there are new dependencies
20:39thorbjornDXemezeske: close enough for me
20:40XPheriorCan anyone show me an example of reading lines from stdin until nil is received?
20:40thorbjornDXemezeske: a space heater isn't stateless though
20:42emezeskethorbjornDX: Who knows? The processor (heating coil) takes no input and produces no output. It just converts energy to heat. :)
20:42mpanxpherior: get a reader, get the line-seq of the reader, take-while the seq
20:43XPheriormpan: Okay. I had a feeling it was something around that. Thanks. :)
20:43mpanwhat do you mean by nil, though?
20:43XPheriorYou know how in like a Ruby program, you can read from the console while there's more values (C-d hasn't been hit)?
20:44mpanpretty sure an EOF would just end the seq
20:44mpannot give nil
20:44XPheriorEOF from the console is what I mean, rather. Thanks.
20:44XPheriorYeah, that's just as well
20:44mpantry just going over the whole line-seq
20:44mpanpretty sure it just ends on EOF
20:44mpanso you may not even need the take-while
20:45XPheriorLemme have a go.
20:46XPheriorWhenever I type something from the console and hit return, nothing happens
20:47XPheriorLike it wants to keep reading from the seq, even when I Ctl-D
20:47mpanwait, are you using lein?
20:47XPheriorYeah
20:47mpanwasn't there something about lein not cooperating with stdin?
20:47XPheriorDah crap, they didnt fix that yet?
20:47mpanI have no idea; let me check
20:47XPheriorYeeeeah, I read that and filtered it out
20:47XPherior:)
20:48mpanhttps://github.com/technomancy/leiningen/issues/169 suggests it wasn't fixed
20:48technomancyit's a bug in the JVM
20:48mpantry lein trampoline
20:48mpanidk if that will help but it does take lein out of the equation, right?
20:48XPheriorAh, technomancy. What do you think of the JVM in general? Was mounting Clojure on it a good idea?
20:49XPheriorYeah, mpan. It didn't work, but good try. :)
20:49technomancythe JVM is an amazing mix of excellent engineering and stupidity
20:49technomancyluckily you can mostly route around the damage
20:49Hodapphah
20:49XPheriorHaha.
20:49technomancycf. java.util.Date, the java command-line launcher, and the subprocess API
20:50technomancyalthough now java.util.Date has infected clojure via reader literals =(
20:50technomancyyou can work around it, but you're hosed by default
20:50XPheriorFantasic. :/
20:50XPheriorHave you ever met Rich?
20:51technomancysure
20:51technomancyI tried to talk him out of making the reader return j.u.Date
20:51technomancybut apparently Datomic couldn't wait for jdk8
20:51XPheriorThat's pretty cool. I'd like to meet him someday.
20:51XPheriorCertainly going to be a while for that, yeah.
20:52mpanwait, how do you make the reader return a date?
20:52emezeskeXPherior: Just show up to a clojure conference. Rich is very approachable (if a bit busy) :)
20:52technomancympan: #inst I believe. I try not to think too much about it.
20:53XPherioremezeske: Yeah, I hope it make it to one soon. Just finishing school. Conferences are kind of expensive.
20:53technomancymy theory is that j.u.Date was the part of the JVM that they had the interns write
20:54XPheriorInterns working on the JVM. Eeek.
20:54technomancythe other explanation was that it was implemented by professionals, which is even more depressing
20:54emezeskeXPherior: True. I think they usually offer a student discount, at least. :)
20:54XPheriorI should catch it before this May then. :)
20:55FrozenlockWhat's wrong with util.date?
20:55Frozenlock(I've never used it)
20:55XPheriorClojure has made me really marketable for places that care about code quality.
20:55mpanxpherior: well I got it to work in the repl
20:56mpanand the mailing list said the repl was where the bug didn't show up
20:56mpanso that makes me think trampoline should work, too?
20:56XPheriormpan: Yeah I just did too. Maybe I derped.
20:56mpanI'm really not sure
20:56XPheriorOkay, yeah I did something really dumb. It works now.
20:56XPheriorThanks for sanity checking that.
20:56mpanso for future reference
20:56mpanwhen I need stdin
20:57XPheriorTrampoline that bad boy.
20:57mpanwould the repl inside ccw inside eclipse work?
20:57mpanthat's just nrepl with a fancy wrapper, right?
20:57XPheriorI've no idea.
21:06mpanis there a nice solution for when the most obvious name for a function is too many words long?
21:07emezeskempan how many words is too long?
21:07mpan"make weighted exponential ranked generation strategy function" :(
21:07casionmpan: intitialism and docstring!
21:08mpancasion: initialism how?
21:08casionthe good ole mwergsfunc
21:08mpan:(
21:08mpanI was hoping not to lose meaning
21:08casionyou don't know mwergs?
21:08emezeskempan: Well, off the bat, I'd say that strategy and function are kind of superfluous
21:09mpanI mean, I've abbreviated it, but that doesn't help enough
21:09casionmpan: in my experience as long as you follow language convention and be consistent, you can get away with al ot
21:09emezeskempan: If a W.E.R.G. is a common term in your domain, it's a reasonable thing to abbreviate IMO
21:10mpansadly, I'm the one who has to maintain this codebase for the next 30 hours
21:10mpanand no, I'm making this up as I go along
21:10mpanbecause that's what the assignment wants
21:10casionmpan: my approach would be to abbreviate nouns, and intitialize adjectives usually
21:11casionwithin convention
21:11mpanall right
21:11mpanthanks
21:11mpanI suppose it's no big deal if my identifiers suck
21:11mpanjust need to get it working
21:11casiondo you have a similar function that's not weighted?
21:11mpanI could
21:12casionof so, then you can just use W to differentiate between the 2
21:12casionand that becomes obvious
21:12mpanI just happen to know this is a good strategy function from trial and error from last assignment
21:12casionis there a non-exponential version?
21:12casionif not, then exponential is redundant to mention
21:13casionhaving the word 'generation' in a function name is usually redundant as well
21:14mpansorry, generation here means generations (noun) of a population
21:14mpanalso, I should fix redundant inputs
21:15casionI would think most of the overtly descriptive aspects could be contained in the docstring
21:15casionbut I don't know how far people usually take that in clojure
21:20devthgiven [[1 2] [3 4]] and ["a" "b"], how could i obtain [[1 2 "a"] [3 4 "b"]]?
21:20mpanconj them
21:21mpanor rather, conj the elems of the 2nd vec into the elems of the 1st vec
21:21gfredericks,(map conj [[1 2] [3 4]] ["a" "b"])
21:21clojurebot([1 2 "a"] [3 4 "b"])
21:21devthah, nice. thank you.
21:22devthfirst time i've used map with multiple colls. i was trying to solve this with into and merge.
21:23casionhmm
21:23casion,(map into [[1 2] [3 4]] ["a" "b"])
21:23clojurebot([1 2 \a] [3 4 \b])
21:23casiondoesn't into use conj?
21:24casionwhy is it giving characters instead of strings?
21:24gfredericksit treats the "a" like a collection
21:24casionah
21:24gfredericksso you get ##(reduce into [1 2] "a")
21:24lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Character
21:24gfredericksor not
21:24casionI get it
21:24casionI keep getting tricked by that behaviour
21:25metellus,(map into [[1 2] [3 4]] "ab")
21:25clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Character>
21:25metellus,(map into [[1 2] [3 4]] ["ab"])
21:25clojurebot([1 2 \a \b])
21:25amalloygfredericks: you get (into [1 2] "a")
21:25amalloyor (reduce conj [1 2] "a")
21:26gfredericks&(into [1 2] "a")
21:26lazybot⇒ [1 2 \a]
21:26gfredericksdoes what I'd expect
21:26amalloyright. but not what you asked for in your reduce
21:26gfredericksah ha right
21:26amalloyyou asked for (reduce into {1 2] "a"). obviously (reduce f init coll) is not the same as (f init coll)
21:27gfredericksamalloy: thanks for sorting me out as always
21:28casionassuming the second collection wasn't a string in this case, would into or conj be more preferred?
21:28casionwow
21:28casionok, I'm going to go sit down and turn off my brain for a bit then.
21:28gfredericks&(sort-by amalloy [:gfredericks :casion])
21:28lazybotjava.lang.RuntimeException: Unable to resolve symbol: amalloy in this context
21:30casionI can't even fathom why I thought that was a reasonable question :|
21:32dgrnbrghello clojurians!
21:33dgrnbrgi am having a strange issue: I have added leinjacker as a dependency to a plugin project i'm working on, but when I use the plugin, I get a compilation error in the project that there is no such var for the leinjacker function I'm trying to use
21:33cemerickEvery date implementation is bugged. Some are just more bugged than others.
21:34dgrnbrgare there are issues or difficulties I should be aware of when using plugin libraries in other plugins?
21:36amalloycemerick: once we get all humans everywhere to agree that the nanosecond is the only useful unit of time it will all be much easier
21:40cemerickamalloy: and then you meet someone doing time dilation experiments or something
21:47technomancyUTC for life bros
21:50dgrnbrgtechnomancy: any idea why, if I am developing a plugin that depends on a library in its dependencies, and then I do a "lein install" of that plugin, that when I try to use the plugin, leiningen dies with the error that a var from the depended-on library can't be found?
21:51emezeske_dgrnbrg: Maybe another of your plugins depends on a newer version of that library that doesn't have said var?
21:51dgrnbrgI'm depending on the newest version of the library :/
21:51technomancydgrnbrg: maybe a version range is interfering? try lein-pedantic?
21:52cemerickI hope lein-pedantic is on deck for inclusion in lein. ;-)
21:52technomancydefinitely
21:52technomancywhat about inclusion in pomegranate? =)
21:53dgrnbrgtechnomancy: I installed lein-pedantic, but got no warnings
21:54dgrnbrgis there a plugin to visualize the transitive closure of the plugin dependencies?
21:54cemericktechnomancy: I would, but pomegranate needs to be use-case agnostic. pedantic is opinionated (in a good way IMO), but I don't want to cut off others applying other policies, completely different strategies, etc.
21:55technomancycemerick: yeah, it wouldn't make sense to turn off by default; I just mean being able to implement it without resorting to hooks would be nice
21:55technomancy*turn on by default
21:56dgrnbrgnow, when I try to run "lein vimclojure", I'm seeing leiningen die with "No value supplied for key: [:add-classpath? true]"
21:56dgrnbrgwhat does that mean? I assume that I have an uneven list->map somewhere?
21:57aperiodiclooks like a kwargs fn whose args aren't being sufficiently flattened
21:57dgrnbrgis there a way to get leiningen to show me a stack trace instead of just the error msg?
21:58dgrnbrgah, i see
21:59technomancydgrnbrg: running from master or using DEBUG=y on preview10 will get you a trace
22:01mpanI have maps with different structure within my tree, but zippers don't care, right?
22:01mpanas long as I satisfy the required behavior?
22:01jimdueyFor those interested in monads and/or core.logic. I just put up some branches on my core.logic fork that shows miniKanren implemented with different monads.
22:01mpanand I can replace nonterminals with terminals and vice-versa?
22:01jimdueyhttps://github.com/jduey/core.logic
22:02jimdueyThe branches are: sequence-monad, cont-m, lazy-cont and fork-join
22:02jimdueyIt's interesting to look at the diffs between the branches to see what had to change.
22:04dgrnbrgThis is just crazy: my leiningen plugin A lists B in its :dependencies. When I try to run A, it says that there is no var B/foo. When I add B to the :plugins of the project from which I'm running A, then everything works
22:04dgrnbrgBut B is a dependency of A, so it should already be available!
22:05technomancydgrnbrg: try temporarily moving :plugins to :dependencies and running `lein deps :tree`
22:06dgrnbrgtechnomancy: it says that plugin A has library B as a dependency!
22:06dgrnbrgwhich is not what happens when I actually run it :(
22:06amalloyit gets an old version probably
22:07dgrnbrgall the versions are up-to-date
22:08technomancydon't know what to say. the jar in ~/.m2/repository claiming to be version X of library B does not have the var you're looking for.
22:09dgrnbrgI know…it's driving me insane :)
22:09technomancytry opening the jar in emacs?
22:09technomancyor your editor of choice
22:09dgrnbrgI'm going back through every step of the process
22:09dgrnbrgto confirm what's going on
22:09mindbender1how can I access clojure queues?
22:12dgrnbrgtechnomancy: I see something strange--library B is leinjacker, and I depend on 0.3.0. When I move all the plugins into dependencies and run lein deps :tree, I only see leinjacker 0.3.0. But when I delete leinjacker from my m2 and run my plugin again, I see leinjacker 0.2.0 gets downloaded, even though none of my dependencies use it
22:12dgrnbrgand leinjacker 0.2.0 is missing the thing I need; but I don't understand who's forcing the downgrade
22:16dgrnbrgoh man, that's weird… I set a fixed version on my plugin, and then lein pedantic triggered an error on a clojure version conflict between the test project and a different dependency (none of which were my actual conflicting library), and then when I fixed that, the issue with the missing var dissappeared
22:16dgrnbrgwat
22:18dgrnbrgthat's definitely the issue--somehow it's deciding to use an old version of leinjacker, even though I can't find any plugins that require the older version…unless they're in my profiles.clj!
22:19dgrnbrghow am I supposed to debug this kind of thing in the future? Or how can I help others not get stuck into this trap?
22:19dgrnbrgor should I just start using version ranges like "[1.0.2,)" instead of "1.0.2"?
22:23mpanis there a convenient way to bind x to a and y to b, or vice versa, depending on the truth value of c?
22:25dgrnbrgmpan: (let [[a b] (if c [x y] [y x])] ...)
22:25mpandgrnbrg: oh cool! thanks!
22:26mindbender1"PersistentQueue is indeed one of Clojure's more closely guarded secrets." - Michal Marczyk
22:29jcromartiesomething just occurred to me: websites are absolutely not hierarchical
22:30jcromartie(writing a crawler)
22:30mpanthey can be made to be, though
22:31mpanif you define implicit "distance" according to first encounter and kill all the "backward" links
22:36xeqidgrnbrg: so you ran lein-pedantic on your plugin project and it gave an error, and fixing that fixed your issue with lein-jacker?
22:36amalloympan: that's just acyclic, not hierarchical
22:36dgrnbrgxeqi: unfortunately, no
22:36dgrnbrgI added lein-pedantic to my profile and it gave me no warnings
22:36dgrnbrgI randomly decided to try using a minimum version range rather than a soft version range
22:37dgrnbrgthen lein pendadatic found a conflict with clojure versions in another set of unrelated libs
22:37xeqiheh, thats weird
22:37dgrnbrgthat fixed the original issue
22:38dgrnbrgdoes lein pedantic also run on plugins?
22:38dgrnbrgbecause that's where my error was
22:38mpanwait, have I got the wrong definition? is there more to hierarchical than just being able to get "levels"?
22:38xeqino, being a plugin itself, lein has to setup and grab the plugins before it hooks in
22:39mpanamalloy: well, I suppose there's potentially a ton of incomparable stuff :/ and maybe it's not a good idea to just call those "the same level as the origin node"
22:40dgrnbrgxeqi: perhaps there could be an associated task like "lein pedantic-plugins", to help debug this kind of issue?
22:40dgrnbrgit could just replace the dependencies with the plugins (given the enabled profiles), and then do its thing
22:41dgrnbrgI think
22:41xeqihmm, thats not a bad idea to explore
22:43xeqias for how to help prevent this for others, I don't think theres any good recommendations, plugin dev is still kinda open ended
22:43xeqimaking an issue on lein-pedantic for the check plugins stuff to play with later
22:54dgrnbrgxeqi: I am working on this command, but I can't find pedantic 0.0.2 in clojars
22:57xeqidgrnbrg: https://clojars.org/repo/pedantic/pedantic/0.0.2/ - hmm, its there. are you getting this as part of a fork of lein-pedantic?
22:57dgrnbrgxeqi: I think i am just ruining my clojure config on my laptop tonight
22:57xeqihaha
22:57dgrnbrgi will send you a pull request to have a stored discussion
22:59dgrnbrgalright, I've sent you a pull request
23:04jcromartiewhenever I'm stuck with a function or algorithm: off to the REPL!
23:10xeqidgrnbrg: had to move it a bit to be a task, but looks like it works from some quick testing
23:10dgrnbrgwtf…I am eval-in-project with my project map that has a new dependency added to it, but then i get a class not found error as if the dependency was just ignored
23:11dgrnbrgxeqi: cool, i couldn't figure that out, and i am full of pain and suffering due to today's plugin woes
23:11dgrnbrgi can't wait to apply it to my config
23:11dgrnbrgand see all the awfulness i've made
23:21xeqidgrnbrg, technomancy: hmm, I'm tempted to make this a higher order task thing; lein plugins-deps deps :tree seems useful too
23:21dgrnbrgthat would be so awesome!
23:21dgrnbrgmaybe call it plugins->deps?
23:23xeqisure, was a quick one off typing
23:26xeqi,(ns some->ns)
23:26clojurebotnil
23:26xeqi... is that a legal namespace name?
23:33dgrnbrghmm, maybe not...
23:33dgrnbrg:(
23:41xeqidgrnbrg: well, it wouldn't work for a cli anyways
23:41xeqialways pipeing out somewhere