#clojure logs

2016-01-24

00:26tsantosI recently had to upgrade all sorts of things in my project.clj (like clojure version, clojurescript version, etc.). I even upgraded to lein 2.5.3 and bower 0.5.1. Now lein-bower fails with an error I can’t even track down:
00:26tsantosclojure.lang.Compiler$CompilerException: java.lang.IllegalAccessError: with-json-file does not exist, compiling:(leiningen/bower.clj:1:1)
00:27justin_smithtsantos: did you run "lein clean" after all your updates?
00:27tsantosSearching the net is getting me nowhere, of course which makes me suspect some sort of local problem but both my osx and linux dev boxes fail.
00:27tsantosyep
00:28justin_smithtsantos: could be an incompatibility in versions. an error reported on line 1 is almost always an error in a namespace required by the ns in question
00:28justin_smith(a compile time error, of course)
00:28tolstoymaybe "lein deps :tree"
00:28tsantosYeah, I thought about such incompatibilities but I really can’t figure out the debug process to get them re-aligned
00:29justin_smithso leiningen.bower is requiring an ns that is now broken, in that it calls with-json-file that is no longer present
00:30justin_smithwith-json-file is part of clojure.data.json
00:32tsantosis clojure 1.8.0 trouble?
00:32justin_smithwait, maybe it isn't in clojure.data.json
00:32justin_smithtsantos: not in my experience, it was a very smooth upgrade
00:32justin_smithtsantos: maybe it would help to back up and upgrade one thing at a time?
00:33tsantosI wish I could… I ended up needing something that had me doing a giant update (which of course never goes smoothly)
00:33justin_smithtsantos: weird, I'm not finding google results for any project or namespace that defines "with-json-file" right now (there was a false positive for clojure.data.json, but I can't find it anywhere - maybe it only exists in old versions?)
00:35tsantosmaybe… could it be that I need an older version of leiningen since it’s in leiningen/bower.clj
00:36justin_smithtsantos: source reading ftw http://i.imgur.com/7Q72p9Y.jpg
00:36justin_smitherr
00:36justin_smithlol mispaste
00:36tsantoshehe
00:36justin_smithtsantos: I mean, source reading ftw https://github.com/chlorinejs/lein-bower/blob/master/src/leiningen/bower.clj#L5
00:36justin_smithit thinks that leiningen.npm has something called with-json-file
00:37justin_smithso you need to override your leiningen.npm version to get a version that has that, or fix lein-bower to no longer use this function which has been remopved from leiningen.npm
00:38tsantosI saw that same line but missed the .npm part of the namespace.
00:41tsantosAwesome, I backed out a lein-npm version update and it’s working! Thank you much for walking me through that.
00:42justin_smithnp, glad it was that simple
00:52makynHello I am having trouble with lein new [template_that_isn't_locally_available]
00:52makynwhen I run for example lein new chestnut <project>
00:53makynFailed to resolve
00:53makyndoes anybody know what could be happening?
00:53justin_smithmakyn: works locally, can you share the exact error?
00:54makynyes
00:55makynFailed to resolve version for chestnut:lein-template:jar:RELEASE: Could not find metadata chestnut:lein-template/maven-metadata.xml in local (/home/user/.m2/repository)
00:55makynThis could be due to a typo in :dependencies or network issues.
00:55makynIf you are behind a proxy, try setting the 'http_proxy' environment variable.
00:56justin_smithmakyn: weird, it should be looking in more places than just local - can you share a paste of your ~/.lein/profiles.clj ?
00:56makynyes
00:56makyndon't have one
00:56justin_smithlein version?
00:57makynI just installed
00:57makynit must be the latest one
00:57justin_smithdoes a regular "lein new project-name" work?
00:57makynLeiningen 2.5.3 on Java 1.8.0_66-internal OpenJDK 64-Bit Server VM
00:57justin_smithmakyn: well, that can depend on how you installed it
00:58makynyes a regular new works
00:58makyndoes lein work with openjdk 8?
00:58justin_smithweird, I tried "lein new chestnut deleteme" just now, and it worked
00:58justin_smithyes, definitely
00:58justin_smithI'm on 1.8.0_05
00:59makynI'm definitely not behind any proxy
00:59justin_smithyeah, I mean it should have mentioned actual repos it looked in, but it just listed your local cache, as if it wasn't checking any of the actual repos
01:00makyndo you have the same version as me? maybe I should try with an older version
01:00justin_smith2.5.3
01:01tolstoyrm -rf ~/.m2?
01:01makynI did already 2 times
01:01justin_smithtolstoy: in my experience that never actually helps
01:01tolstoyOh. Missed that. ;)
01:02makyntolstoy: no, I just did it earlier today, it:s not in the chat
01:02makynthe only think I can think of is that somehow zsh or prezto has messed up with the installation or with lein
01:03makynI'm going to try in vanilla bash session
01:03justin_smithyeah, considering you don't even have a profiles.clj I don't see what the issue would be here
01:03justin_smithunless clojars.org has you on a blacklist or something I don't know
01:04makynclojars.org is not down, is it?
01:04makynthe repo I mean
01:04justin_smithno
01:05justin_smithmakyn: I would not have been able to create a chestnut project if clojars was down, they host their template on clojars
01:05tolstoylein new chestnut works fine for me. I know that's soooo helpful. ;)
01:05makynjustin_smith: unless you already had it cached in your .m2
01:05makynno?
01:05clojurebotno is tufflax: there was a question somewhere in there, the answer
01:05justin_smithmakyn: no, it downloaded
01:05makynright
01:05justin_smith"Retrieving chestnut/lein-template/0.8.1/lein-template-0.8.1.jar from clojars"
01:06justin_smithmakyn: can you ping clojars.org? see their site?
01:07makynping works but has 2000ms latency
01:07makynnot normal right?
01:08justin_smithweird
01:08makynby the way I just did a clean install in bash and had the same problem
01:09justin_smithiirc even leiningen bootstraps its own standalone jar from clojars
01:09tolstoyclojars.org is 90ms for me.
01:10makynI have ping of 50ms to google.com
01:10makynso it is not my network
01:10makynanyway, I'll try later and see
01:10makynthank you guys for your help
01:11justin_smithmakyn: another option, try to replicate your setup on a vps
01:11justin_smithif you think it's worth a buck or two spinning up a box for an experiment at least
01:11makynThank you, yes maybe it's worth
01:11highclassholeI don't seem to be having an issue with clojars
01:11makynI'll wait a while first just in case
01:12makynby the way, I'm in Japan
01:12highclassholeoh no idea then
01:12justin_smithmakyn: I know that clojars was ddos'd recently, and maybe some rule that got set up to limit the ddos traffic is affecting you?
01:12makyncould be
01:13makynI had a 4k ms respone time now
01:13makynto ping
01:13tolstoyHm. You have 'chestnut:lein-template/maven-metadata.xml' and I have 'lein-template/maven-metadata-clojars.xml'.
01:14tolstoyI wonder if you should delete ~/.m2/respository/chestnut. Then again, if removing the whole cache didn't fix it (recognizing justin_smith's caveat).
01:15makyntolstoy: yes I deleted .m2 and .lein before doing a clean install
01:15justin_smithalso, you can just do mv ~/.m2 ~/m2-backup and save a lot of silly downloading
01:15justin_smith(and move it back after your experiment if it didn't fix anything)
01:15makynyes, it was empty anyway as it is a clean install
01:18pilne,(= true 1)
01:18clojurebotfalse
01:19pilne,(if 1 "truthy" "falsey")
01:19clojurebot"truthy"
01:19pilneO.o
01:19pilnewhat the fuck
01:19justin_smithpilne: only nil and false are falsey
01:19pilnebut....
01:19pilne,(= true 1)
01:19clojurebotfalse
01:19justin_smithpilne: thus all other things are truthy
01:20justin_smithtruthy doesn't mean equal to true, it means treated as non-false by if
01:20pilneO.o
01:20pilne,(= false 1)
01:20clojurebotfalse
01:20pilneis it saying it can't/won't compare or coerece so it is false?
01:20justin_smithpilne: what's your obsession with the number 1 here?
01:21justin_smithpilne: what?
01:21justin_smith1 isn't true!
01:21justin_smiththey are two different values
01:21justin_smith,(if Double/NaN :yes :no)
01:21clojurebot:yes
01:22justin_smitheven NaN is truthy
01:22justin_smithand it's not equal to anything
01:22justin_smith,(= Double/NaN Double/NaN)
01:22clojurebotfalse
01:22pilneok
01:22pilnei think i get it
01:30pilnety
01:33tolstoyIs there a way to create a new instance of a record (via defrecord) without using the literal symbol?
01:34tolstoy(new (lookup-type ...) "param")?
01:34justin_smith(into (empty instance) map)
01:34justin_smithif you have an instance
01:36tolstoyIt works in ClojureScript, interestingly.
01:38justin_smithcorrection, you can use into, but not empty
01:38justin_smithI misremembered
01:40tolstoyYes, the into worked. Seems hacky, though. In other words, not super appropriate for this.
01:41tolstoyRight now, my client sends messages as [:topic data], so I just have a case statement based on the topic. Works.
01:41tolstoyBut if I want those messages to be typed, I'd have to share definitions between client and server.
01:42tolstoyEh.
02:21justin_smithtolstoy: so maybe the answer has to do with what the message is supposed to mean
02:21justin_smithis it a data object used by the other side? is it used to pick an implementation / behavior?
02:22justin_smithit might be simpler to just have a router logic, where one key decides which handler gets the message and the handler uses the rest of the data
02:33tolstoyjustin_smith: That's what I actually do. [topic data] and I route based on the topic.
02:33justin_smith aha, like sente
02:33justin_smith(or how I use it at least)
02:33tolstoyYeah.
02:33justin_smithbut where would you need to use a specific record type in this?
02:34tolstoyIt might work well if you're sending messages around a single app (not across the wire).
02:34tolstoyEach "message type" would implement various protocols.
02:35justin_smithhmm, to me message implies generic data, something that wouldn't carry behaviors
02:35tolstoyThen the thing that receives the message could just (when (satisfies? protocol msg) (invoke! msg state p1 p2))
02:35tolstoyThat kind of thing.
02:35tolstoyYeah, there was a debate about it awhile ago on the mailing list.
02:37tolstoyIn a CLJS app, for instance, you can have protocols that return a new state, or that do something with history ... I don't know.
02:37justin_smithto me message dispatch and multimethods and protocols and case statements are all variations of the same effective act (picking an action or data transform among alternatives given the data that came in), and you shouldn't need a protocol on objects in messages any more than you need a case statement based on your args in a multimethod...
02:37justin_smithbut maybe there's something I'm missing
02:39tolstoyI don't know if you're missing anything. Sometimes I try things just to see if some bit of intuition will teach me something.
02:39tolstoyYou could imagine a react-app like thing where clicking on something generates an event message.
02:39tolstoySome times the event message signals a state update.
02:40tolstoyMaybe another time it signals a send down the socket.
02:40justin_smithsure, I absolutely do these things
02:40tolstoyYou could, say, have a "state-update" namespace where you "extend-protocol" all the message types that update state.
02:40tolstoyKeeping that logic together, but not mixed in with all the socket stuff.
02:41justin_smithright but then you need a rich set of types in order to keep the two ends in sync, and really only one end cares about the type and so you've gained nothing over a simple keyword based router
02:41tolstoyYou can then "query" the messages to find out how to dispatch them. (Not that you couldn't by convention and multimethods.)
02:42tolstoyNo, no, doing it over the network is diminising returns in about 2 seconds. ;)
02:42justin_smithOK
02:43tolstoyStatic-typing the data center: that's for those people who think ProtoBuf is a good idea.
02:48tolstoySeems like it might be an interesting way to create domain-specific events in a ClojureScript application.
05:12favetelinguisanyone knows if it is possible to go back and change the content of commited files in git? realised i have commited sensetive configs :s
05:14amalloytry #git
05:51oracle123I am going to download web via a sock5 proxy. What's the best solution library to use? I checked the jsoup for clojure, but can't find the doc about how to set the proxy.
05:52ridcullyoracle123: http://docs.oracle.com/javase/7/docs/technotes/guides/net/proxies.html
05:53ridcullymost likely some sysprop to set
05:55oracle123But I don't want to set it systematically, only some code needs such proxy.
06:31oracle123anybody used clj-http? I use the "get" function to return the page, it took 7 second, while use curl it only took 4 seconds. why is clj-http much slower then curl?
07:36lxsameerhi, I'm using zookeeper with clojure, is it logical to use a var to store the current leader ?
08:30engblomI have a problem with deref for atoms: It is too slow. Is there a faster way to read an atom?
08:31engblomI am storing all output streams in an atom. When adding and removing, swap! is good as I can be sure no stream got lost. But when using those streams, I would need a faster way than just deref.
08:42adictoI would like to define an other arity function for the core "keys" function. I would like to define: (defn [& maps] (mapcat keys maps)). What is best practice for"monkey patching" a core function
08:43adicto(defn keys...*
09:02gfredericksadicto: you want a function that takes multiple maps and returns all their keys?
09:02gfredericks(and what makes you think monkey-patching is the best way to solve the problem?)
09:06favetelinguiswhen i use a websocket library sente how does the client know the adress of the server? I newer specify it in cljs?
09:09Howlingfavetelinguis: Maybe it runs it on localhost by default
09:25engblomPlease, any have a look at this: http://pastebin.com/DV6PTEGa . In this case bench1 is 6500 times faster than bench2. I would want to know where the bottleneck is?
09:28engblomI would expect bench2 to be a bit slower as it does a bit more (looking up from a vector, having an 'if' etc) but not 6500 times slower.
09:56adictogfredericks: yes that is what I want. A keys function that takes multiple maps as argument
09:56adictogfredericks: I could write a seperate function for that or I could monkey patch the existing one.
11:02gfredericksadicto: monkey-patching is considered a pretty extreme tactic, so generally writing your own function is better when possible
11:32kwladykaWhat is the best method to check if org.postgresql.util.PSQLException exist to avoid CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context ?
11:33kwladyka(resolve 'org.postgresql.util.PSQLException) throw exception too
11:34kwladykamaybe something with find-ns?
11:37kwladykai can try call org.postgresql.util.PSQLException and check if it throws exception heh.... but it is not the way how i would to that
11:43kwladykaha i found a solution!
11:43kwladyka(clojure.reflect/resolve-class (.getContextClassLoader (Thread/currentThread)) 'org.postgresql.util.PSQLException)
12:34justin_smith,(Class/forName "String")
12:34clojurebot#error {\n :cause "String"\n :via\n [{:type java.lang.ClassNotFoundException\n :message "String"\n :at [java.net.URLClassLoader$1 run "URLClassLoader.java" 366]}]\n :trace\n [[java.net.URLClassLoader$1 run "URLClassLoader.java" 366]\n [java.net.URLClassLoader$1 run "URLClassLoader.java" 355]\n [java.security.AccessController doPrivileged "AccessController.java" -2]\n [java.net.URLClassLoade...
13:32TimMcThere is no best practice for monkey patching, since monkey patching is a bad practice...
13:32TimMc(Which is not to say one should never, ever do it, just that it's a solution of *last* resort.)
13:33justin_smithalso I would totally do (distinct (mapcat keys maps)) instead
13:33justin_smithand not call it keys
13:43justin_smith,(into #{} (mapcat keys) [{:a 0 :b 1} {:b 2 :c 3}]) ; final answer
13:44clojurebot#{:c :b :a}
14:17pilnei found my happiness!
14:17pilne,(= (boolean 1) true)
14:17clojurebottrue
14:17pilnebazanga!
14:20justin_smithhaha
14:20justin_smith,(= (boolean 0) true)
14:20clojurebottrue
14:20justin_smith,(= (boolean Double/NaN) true)
14:20clojurebottrue
14:21justin_smith,(= (boolean ()) true)
14:21clojurebottrue
14:21justin_smith,(= (boolean nil) true)
14:21clojurebotfalse
14:27highclasshole,(= (boolean nil) false)
14:27clojurebottrue
14:38J_ArcaneMagic.
14:43csd_Can anyone recommend a free platform for deploying small Clojure webapps?
14:44highclassholefree teir AWS I guess not totally free
14:45csd_i had a bad experience with AWS :-/ not even sure they would let me be a customer
14:45highclassholedigitalocean 5/mo is lowest price
14:45highclassholethats pretty cheap
14:45highclassholeserver space usually ain't free ya kno
14:46csd_yeah i know but im not going to make any money on this so *shrug*
14:46justin_smithheroku has a free tier
14:46highclassholeah cool then do that
14:46csd_justin_smith: but your app cant be up for more than i think 18 hours per day?
14:46justin_smith,(= (boolean nil) true)
14:46clojurebotfalse
14:47justin_smithcsd_: not sure (the above was a mistake)
14:48csd_the thing with heroku is that they kill the app when it's idle, and it takes forever to spin back up
14:48highclassholeyeah 18 hours a day
14:48csd_you used to be able to just periodically ping your site to get around it, but then they overtly limited how long it could be up period
14:48csd_used to be 24 hrs
14:48highclasshole7$ a month for unlimited
14:49highclassholeso digitalocean 5 dollars heroku 7 dollars
14:49csd_do you have any experience with google app engine
14:49highclassholei don't think you will do a lot better unless you have a friend with server space
14:49csd_it says it's free but it's sketchy when i go to their signup page
14:49highclassholeI've not used it personally
14:52highclassholecsd_: from what I can tell its free only if you use under the allowed bandwidth and instance hours
14:53highclassholelooks like u might be able to leave it up all day tho maybe
14:53highclassholehttps://cloud.google.com/appengine/docs/quotas?hl=en
14:54csd_at one point i signed up with AWS on a free trial. i played around with it for a day and forgot about it. next think i know im being billed for hundreds of dollars
14:54highclassholeyou gotta use the free teir not a free trial
14:55csd_i forget which i used
14:55csd_thankfully they didnt refer it to collections AFAIK
14:55highclassholeec2 free tier is only for 750hours per month
14:56highclassholeso you have to spin down spin up
14:56csd_i wonder whether 512 Mb ram on digital ocean's free plan is enough
14:57highclassholeer nevermind you can keep 1 instance up for 1 whole month aws free tier, but its only for 12 months I see
14:57justin_smithcsd_: if you're careful I think you could make it fit
14:57elvis4526What would be the typical use for metadatas ?
14:58csd_because i would need a database instance too
14:58highclassholewell it sounds like you want a lot for free heh
14:59csd_i guess
14:59csd_heroku used to do it
14:59csd_(look how that ended up though)
15:00LucidTortoiseClojure For the Brave and True has literally the best introduction, and convincing motivation. To learn Emacs.
15:00LucidTortoiseTwo days ago I never even touched it. Now I use emacs for everything.
15:02winkLucidTortoise: irc as well? :P
15:03LucidTortoiseNope, I have done IRC for longer. For #Godot and #Pharo
15:03highclassholeHe means are you using IRC in emacs
15:03LucidTortoiseI keep trying to gain competence in Smalltalk, but the pull of functional languages is strong.
15:03highclassholeemacs has an IRC plugin
15:04LucidTortoiseOh, hah. Not yet. I don't know how to do that yet. I am on Textual for OS X
15:04highclassholeits in the package manager forget the name
15:04LucidTortoiseLet me see if I can get that running.
15:05winkdidn't want to give you funny ideas. but you said "everything" ;)
15:05LucidTortoiseHaha. Emacs is simply my favorite place to type.
15:05highclassholehaha yea I'm good on IRC in emacs
15:06highclassholeI can't get into emacs maybe I need to try evil or something
15:06LucidTortoiseWhen you all say Clojure Web apps, that is basically just a website written in Clojure, as opposed to an amalgamation of tech like HTML, CSS, etc?
15:07highclassholecould be either
15:07LucidTortoiseI want to create a website, and at first I was considering Seaside using Pharo, but now I am curious what I can use to build a website with Clojure.
15:07justin_smithLucidTortoise: I use clojurescript on the frontend too, in my webapp
15:08LucidTortoiseI have already more knowledge with Clojure in a two days than I do with Smalltalk after... ten days? I am really new to both/
15:09LucidTortoisejustin_smith There is no syntactical difference between Clojure and Clojurescript right?
15:09justin_smithvery minor ones - the difference is host interop, different hosts
15:10justin_smithand some of the interop has slightly different syntax allowed
15:10LucidTortoiseI was a bit confused when I say Light Table uses ClojureScript, but now I understand better why.
15:11highclassholeLucidTortoise: you could look into Luminus it is a curated set up libraries and a set of templates to get you writing webapp pretty quick in clojure
15:11LucidTortoiseI see. Then it seems I don't have to peek out of Clojure to write a webapp, or do you still need to use HTML/CSS? Oh, or do you just use some flavor of markdown and avoid it all?
15:11highclassholeyou can do whatever you want
15:12LucidTortoiseFound it. Looks simple enough. Thanks highclasshole.
15:17J_ArcaneLucidTortoise: I do my web apps entirely in CLJ/CLJS. Compojure/-api on the backend, reagent on the front end, which takes hiccup syntax, so no need for raw HTML. On my last project even the CSS was mostly Bootstrap with some in-house customizations.
15:19LucidTortoiseNeat. J_Arcane I have never actually built a website, though I have followed to the end of a few tutorials, but have forgotten it all. I am going to start out with something simple, but I am glad I can mostly stay inside the language.
15:19J_ArcaneI'm soon writing a tutorial series on building a full-stack app under my employer's sponsorship.
15:19kwladykaLucidTortoise the best in Clojure is... you don't need any framework.
15:19LucidTortoiseI will look up all of that.
15:19kwladykaLucidTortoise just use tools which you need
15:19LucidTortoiseThe data is the framework?
15:19J_ArcaneLucidTortoise: Ahh, if you're rusty on HTML/CSS itself, which you'll need to know a jot of, then a bit of freshening up might help there.
15:20J_ArcaneI used to recommend Codecademy for the basics, but they've started paywalling all the project exercises.
15:20kwladykaLuminus is framework.
15:21LucidTortoiseYeah, I'll either redo the Codecademy tuts... or not. I'll probably go through the W3C(??) official tutorial.
15:21LucidTortoiseGuh, I have a Safari Books account. I am sure there is something brilliant and thorough on there.
15:22justin_smithw3c has tutorials?
15:22justin_smithoh, they do
15:22highclassholeLiminus is a framework but really they just wrap a lot of the libraries you would use
15:22LucidTortoiseWell, they have the reference. Anyways, Pragmatic Bookshelf has a book on Clojure Web Dev, so I will read through that.
15:22highclassholebeen a good intro into getting my feet wet with it
15:23LucidTortoiseJ_Arcane I am very curious to see your tutorial. Please let me know when it is complete!
15:24LucidTortoisehighclasshole Yeah, Liminus seems to have everything I need to get started.
15:24highclassholeLuminus I meant to say heh
15:25J_Arcaneyeah, the tricky bit with Clojure web dev is that it seems to move so quickly. A lot of the stuff I found when I was getting started just baffled me, it wasn't until I got employed that I got pointed to the stack I default to now.
15:25J_ArcaneEven my tutorial series is being delayed slightly because compojure-api has a new version coming very soon and I want to make sure it's up to date.
15:26J_ArcaneHoplon is another option if you want an all-in-one framework in a more "reactive programming" style, though I am not a fan of their custom build system. https://hoplon.io/
15:29MacTortoiseNice. Now I never need to leave emacs!
15:30MacTortoiseYeah. Let me preach to the choir for only a second. Not only is Emacs super powerful and flexible, it give me thhat pseudo-nostalgic feeling of working on an ancient machine... from a galaxy far, far away.
15:32highclassholeTake it to the next level http://www.informatimago.com/linux/emacs-on-user-mode-linux.html
15:33MacTortoiseThat is hilarious. I might actually do that on a Raspberry Pi.
15:35J_ArcaneAt "work" I still basically use a slightly tweaked version of the Brave Clojure Emacs config.
15:36MacTortoiseYeah, the author really did make a solid configuration.
15:38csd_what is the easiest way to run a .clj as a one-off script? like, if i want to have a bootstrap.clj within a larger project
15:39justin_smithcsd_: java -jar clojure.jar script.clj
15:39justin_smithif you need deps you can make your own uberjar (and still make clojure.main your main)
15:40csd_hrm i'm surprised it's so difficult
15:40justin_smithbecause there's a whole four items on the command line?
15:46highclassholeI don't think I'd consider that difficult
15:48csd_*shrug* i have a dependency in mine and i'm at a loss for how to deal with it
15:50highclassholeI would build it into a jar then
15:50highclassholean uberjar
15:52highclassholecsd_: are you just trying to setup your database or something?
15:53csd_yeah
15:54csd_can i use leiningen to create that other uberjar? it seems like it only acts on the main project.
15:54csd_i imagine my relative inexperience with java is part of why i'm not getting this
15:54highclassholemay wanna look at https://github.com/yogthos/migratus
15:54justin_smithcsd_: you can run "java -cp some.jar clojure.main" to get a repl from any clojure uberjar
15:55justin_smithcsd_: even just a normal uberjar from your project
15:55justin_smithit will run clojure.main instead of your -main
15:58highclassholeor just build the bootstrap into your project and add an arg that would trigger it
15:58highclassholejava -jar myproject.jar bootstrap
15:58justin_smithsure, yeah, an arg to main that migrates
16:02neoncontrailsRemind me... what's the functional way to count the number of 'true' elements of a vector?
16:03justin_smith(count (filter pred v))
16:03neoncontrailsBrilliant. Thanks
16:05justin_smith, (transduce (comp (filter true?) (map (constantly 1))) + 0 [false true false false true]) ; fancy pants way
16:05clojurebot2
16:05MacTortoise,(+ 1 1)
16:05clojurebot2
16:05MacTortoiseHah
16:07MacTortoiseBots are the best... As long as they are topical and not some hijacking by a new member who just learned how to maker their own bots...
16:07MacTortoiseThat got annoying quick.
16:21MacTortoiseI didn't realize how quickly Clojure develops. A book about Clojure published in Dec 2015 only coverse version 1.6!
16:21csd_if i choose uberjar :aot :all in lein, must each file have its own -main defined?
16:22justin_smithnot at all, you don't even need a -main
16:22justin_smith(you can use clojure.main to launch one of your functions)
16:23csd_hrm, i'm getting a class not found exception when compiling
16:23csd_it happened after i enabled aot all
16:23J_ArcaneMacTortoise: Well, in fairness, 1.6 was the standard for quite a while. 1.7 and 1.8 came along *very* quickly and recently.
16:23justin_smithodd
16:23justin_smithcsd_: also, you can just not aot, and skip all of this for sorting out another time
16:24csd_yes i need to stop wasting time on this
16:25justin_smithnot using aot ends up working like - java -cp my-uber.jar clojure.main -m my.ns
16:25justin_smithand that invokes my.ns/-main with any other args from the command line
16:26csd_maybe me doing lein ring uberjar is screwing something up
16:27justin_smithI can see using ring to generate an uberwar, but for uberjar I would just use lein uberjar
16:27MacTortoiseJ-Arcane I didn't know that. I suppose the language itself is super stable. It must be everything else that uses it that can become quickly out of date.
16:28justin_smithif you don't have a -main that can launch the web server already, well that's very simple and a good thing to have anyway
16:28MacTortoiseI guess I can't trust a book to learn web stuff? Hah, that probably is wrong/
16:28J_ArcaneMacTortoise: Yeah. When it comes to web libraries it seems like there's a bit more churn, at least on the front end.
16:29justin_smithMacTortoise: clojure is very good about backward compatibility. You can run code written for 1.6 in 1.8 clojure, it's just that 1.8 has new features too (or bug fixes / performance enhancements, etc.)
16:29Surgospeaking of compatibility, I have a question about the new direct linking in 1.8. I don't entirely understand if it will break compatibility or not
16:29justin_smithwith a large codebase, typical consequences of upgrading clojure versions are maybe having to rename some functions to make error messages go away
16:30justin_smiths/error/warning
16:30justin_smithSurgo: do you call def inside functions?
16:30SurgoLet's say I redefine functions to hook them, like with the robert-hooke library or just on my own (pretty straightforward to do). Let's say my code redefines a core library function
16:30justin_smithSurgo: if so, yes, direct linking will break that code
16:30Surgobecause the core library comes compiled with direct-linking, would this hook stop working?
16:31justin_smithyes, and you should feel bad for redefining things in core
16:32Surgoit's a perfectly valid pattern to hook a function if you need to provide some sort of functionality around it :(
16:32Surgono need to feel bad about doing so
16:33justin_smiththe problem with redefining things in core, is you are messing with everyone's code - even if it's just changing the performance
16:34Surgosure but if I'm writing a program and not a library that's not really a concern
16:34Surgoand that's what I'm asking about (I realize now that's ambiguous); libraries can't depend on the behavior anymore, but can end programs?
16:35justin_smithsure, that's true - is there a non-direct-linked version of the jar available?
16:35SurgoThat's what I'm trying to find out :) the jar in this case is the clojure core library
16:36justin_smithright, clojure.jar
16:37SurgoI've read the following: "Code compiled with direct linking actually retains both the direct and dynamic call paths so this is always a compile-time decision." I'm not entirely sure I understand what that means -- I get to choose at compile time for clojure.jar whether I use the direct-linking path or the dynamic path?
16:37justin_smithSurgo: at compile time for your code
16:38justin_smiththere's a command line that turns direct linking on or off, and that's interesting that they can apply it retroactive at the compiler stage
16:38justin_smithbut very cool
16:38SurgoOkay. So when I compile my end program, I can choose to use clojure.jar with dynamism instead of direct linking, so the hooking behavior will work as normal
16:38SurgoIs that correct?
16:38justin_smithright, and the arg is not provided by default
16:38justin_smithso you have to explicitly ask for direct linking
16:39SurgoI think it might be the other way around that I have to ask for it not to be direct linked
16:40justin_smithno, that's not the case
16:40SurgoGah! This is confusing. I think it's that I can choose at compile time whether my code uses the dynamic/direct linking path, but the choice has already been made for clojure core, so function calls within clojure.core are already direct and can't be overridden
16:40justin_smiththere's no "don't direct link" command line
16:40Surgoat least, that's what I'm getting from this quote in the changelog: "With this change, clojure.core itself is compiled with direct linking and therefore other namespaces cannot redefine core fns and have those redefinitions seen by core code."
16:40justin_smithhmm
16:41KamuelaWhere is the repository found for the dependencies I use?
16:42Surgoif you mean the source code repo, could be anywhere on the internet
16:42Surgoif you mean the jar, usually clojars
16:42justin_smithSurgo: I have clojure 1.8 open right here in a repl, I used alter-var-root to change a clojure.core function and it worked
16:42justin_smithSurgo: though I guess I did not test any clojure.core code that called my changed function...
16:43Surgojustin, what worked? An inter-core function call?
16:43Surgoah
16:43KamuelaI mean when I simply add something to project.clj dependencies, where is it coming from?
16:43SurgoHave to run and eat -- I'll find an inter-core function call and see if that sees the change or not
16:43SurgoKamuela: clojars
16:43KamuelaThat's an online repository?
16:43justin_smithKamuela: also maven central, and many people use sonatype too (iirc it is not there by default though)
16:43justin_smithKamuela: yes, these are all maven repositories
16:44KamuelaThank you both
16:44kwladykaHow can i use exactly this namespace https://github.com/metaphor/lein-flyway/blob/master/src/flyway/flyway.clj from this dependencies? There is a namespace with functions which i exactly need.
16:44kwladykaI consider copy & paste or make from this depndency
16:44justin_smithkwladyka: why not just declare lein-flyway as a dep and use it?
16:44KamuelaSo things on maven I can use by just adding to project.clj dependencies without any alteration?
16:44justin_smithI guess that requires pulling all of lein into your project though
16:45kwladykajustin_smith i want use it inside code, not in lein
16:45justin_smithkwladyka: that doesn't matter
16:45justin_smithyou can use lein code
16:45justin_smithjust put it in deps and not plugins
16:45justin_smiththe drawback is pulling in the lein deps of course
16:46kwladykammm and how to exactly use it form code?
16:46kwladyka*from
16:46justin_smithby requiring the namespace and calling the function
16:46justin_smithjust like any other ns
16:47kwladykaoh it works like that.... so simple...
16:47kwladykai didn't expect it is so simple :)
16:47kwladykathank you :)
16:48neoncontrailskwladyka: lein is unexpectedly awesome like that :-)
16:48kwladykai was trying to do it in more complex way :)
16:54neoncontrailsTrying to figure something out. If I launch "lein repl" from command line, it has no problem loading the namespace declared in project.clj under " :main ^:skip-aot". But if I run (in-ns 'myapp.models.mymodel), it creates a brand new namespace object. Doesn't load the one defined in my dir structure. Why?
16:55justin_smithneoncontrails: because in-ns doesn't load code
16:55neoncontrailsjustin_smith: is there an alternative method that does?
16:55justin_smithyou want to use require first (doto 'myapp.models.mymodel require in-ns)
16:55KamuelaI wonder if there's such a thing as a Clojure junior position
16:56justin_smithKamuela: my company had some junior clojure devs until recently
16:57neoncontrailsjustin_smith: (!!) thanks, that does exactly the trick
16:57kaylindriswhat happened to them? they learned and became >junior?
16:57arcatani was a junior clojure dev in 2013
17:07justin_smithkaylindris: sadly we had some layoffs, but we might be hiring more in the future again
17:08justin_smithpart of it was about balance really, like we had too much backend expertise and not much frontend...
17:10highclassholeim not really a jr dev, but ik learning clojure on the job; i decided to rip out and replace stuff writtwn in java and groovy with clojure
17:11autogen_nn
17:14neoncontrailsIs there an easy way to refactor a namespace so defs are evaluated in a normal order? (i.e. if (def baz (foo 'bar)) comes before (defn foo [x] (str x)), then evaluate foo's definition before baz's)
17:15neoncontrailsOr maybe not refactor, but simply change the evaluation strategy
17:16pilnethe book "seven languages in seven weeks" (not working through it, just giving it a read, really helped to convince me that clojure was the language for me (and also a better understanding of scheme and common lisp).
17:16justin_smithneoncontrails: clojure reads forms start to end, so that using a file will act the same as using a repl
17:16pilnehrm... clojure + actors = pseudo OO with lispy goodness?
17:16justin_smithneoncontrails: you can use declare and declare all the defs at the top, if you really want things in an arbitrary order
17:22neoncontrailsjustin_smith: oh cool. That works, in a way. Is there maybe an IDE tool to help you reorder your defs in the static file itself?
17:22pilnei think though... for my enigma machine coding project, i'm going to have to start really simple again (i.e. everything hardcoded, even if i want to implement options down the road)
17:22justin_smithneoncontrails: not sure... maybe this is something slamhound can do though?
17:24neoncontrailsjustin_smith: great suggestion, I'll give this a whirl
17:27neoncontrailspilne: if I recall correctly the actor model actually arises organically in lisp, as a consequence of treating functions as first-class citizens
17:33pilnei can see that (: lisps are too much fun... i just wish the "smug lisp weeneis" would stop getting all riled up when people talk about clojure being "a" lisp lol.
17:34pilnewithout my exposure to clojure, i would never have even wanted to touch lisp/scheme tbh lol.
17:34pilnethe parens scared me, but with clojure using all sorts of brackets, it made it less scary
17:37J_ArcaneI genuinely do not understand that. but then I grew up with BASIC.
17:37J_Arcaneso I was looked down on by all the smug weenies of every language. ;)
17:39pilnelmao, so many that i run into are like "it can't be "a" lisp unless it is common lisp" and i want to be like... "i really doubt mccarthy would agree with you"
17:40pilnehell, i've seen some go full plaid nerdrage over the idea that scheme is a lisp!
17:56neoncontrailspilne: in re: your earlier suggestion about lispy OO... you might find this interesting: http://www.kurtm.net/archive/2002-Summer-cs61a-public_html/labs/lab5.1.pdf
17:59neoncontrailspilne: that HW assignment really blew my mind. It's Scheme syntax, but you should be able to follow along. It's basically how you would go about implementing objects as functions, using only lazy evaluation and apply statements
18:09loophole_pilne: i like cl but clojure is way more useful imo
18:11pilnei like anything that works like a lisp, this guy has a bitbucket with a lot of transpilers for langauges that lets you use them with a lispy syntax at the least (and often macros and such too).
18:11pilneand thank you neoncontrails
18:12loophole_heh I hacked a connection pool with a ref. seems to work just fine. the trick is to use delays and promises
18:19loophole_pilne: you find a nice idea how to implement OO in CL in grahams book "On lisp" http://www.paulgraham.com/onlisp.html
18:19loophole_pilne: this book is a nice read
18:19neoncontrails^great book
18:20jeyinteresting/neat that it's still well-regarded
18:20princeso,(let [x 1] (eval '(+ x 1)))
18:20clojurebot#error {\n :cause "Unable to resolve symbol: x in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: x in this context"\n ...
18:20loophole_neoncontrails: yep his book aboout macros is quite nice too
18:22loophole_princeso: (let [x 1] (eval `(+ ~x 1)))
18:26justin_smithprinceso: eval does not see your local environment
18:26pilnei like my copy indeed (: lisp is an incredible basis for langauge design
18:26loophole_has somebody experience with orientdb?
18:29loophole_the clojure driver seems to be out of date and I'm not sure if the database is stable enough to put some work into a updated/new one. the features seem nice but I read also a lot of negative opinions
18:29neoncontrailspilne: heh. It blew my mind when it hit me that a Lisp program is essentially just a domain-specific language
18:29pilneit reminds me of forth in that regard
18:30loophole_pilne: forth is on my list of languages to learn
18:31loophole_pilne: afaik sun had a forth interpreter on their hardware controlers so one could configure the hw with forth
18:31pilnei'm actually toying around with prolog too
18:31neoncontrailspilne: have you looked into SICP? You'd love it
18:31pilnei have a copy of that too neoncontrails (:
18:32pilnei tend to reccomend "how to design programs" alongside "dr racket" for people who aren't as comfy with a computer, but want a similar "experience"
18:32princesoloophole_ my bad, this is the "real thing" i want do do (let [x 1] (eval '(let [y 1] (+ x y))))
18:33loophole_pilne: I add "land of lisp" for fun :)
18:33pilneheh, i point people to his "casting spels in clojure" tutorial for a quick and dirty repl intro
18:34neoncontrailspilne: the 5th chapter of SICP has you implement a FORTH-like imperative language, which is essentially just a register machine program
18:34princesojustin_smith: How do macros get the &env map?
18:34pilnei <3 lisps, i love a lot of "things" about haskell, but i'm not a haskeller, i know my limits (:
18:34loophole_princeso: why eval? it is especially slow in clojure
18:35loophole_pilne: erlang is nice too
18:35pilnehave you seen "lisp flavored erlang" loophole_?
18:36princesoloophole_ is to generate functions, that thing is done just once
18:36loophole_pilne: nope
18:36pilnehttp://docs.lfe.io/
18:37pilnelisp metaprogramming combined with the power of the beam vm kinda scares me :p
18:37loophole_pilne: nice
18:38loophole_pilne: erlang is a platform for distributed computing that happens to have a programming language included ;)
18:40loophole_pilne: what i mean by that is, that erlang is much more yhan just a programming language
18:44pilnei haven't had the chance to really dig into erlang much, what i've gleaned has intrigued me
18:45loophole_pilne: unfortunately one has to almost to learn the language twice. for once the programming language and then the OTP gen_server/supervisor/ stuff
18:47loophole_pilne: the otp stuff hides much of the erlang primitives and introduces new concepts
18:47pilneahhh
18:47loophole_pilne: once you have learned them it's great
18:49loophole_pilne: the otp library implements many patterns to build reliable programs and has many good habits already included.
18:49pilnealways a plus (:
18:51loophole_pilne but you don't send messages around but write callbacks. the otp library doe the message sending. because of that erlang programs feel different when you write them in OTP style, if that makes any sense
18:53pilneit does
18:58arpunkpilne: loophole_ is right, Erlang is more than just the language. But LFE is very nice and fun to work with. As with Elixir, LFE is not tied to vanilla Erlang
19:00pilnehmmm, maybe after i've somewhat mastered clojure and the jvm for my evil whims, i'll set my eyes on the beam vm (although i'm curretly planning on really digging into haskell, common lisp, and possibly "lux" (i spend way too much time at work googling and reading up on interesting niche things....
19:00loophole_pilne today I had this funny idea to write a connection pool and manage the connections in a ref. maybe the idea is silly but it works. when you request a connection you get a delay, when yoe derefernce it the connection gets started. if you request a connection thats above the max-connections threshold you get a promise that gets delivered as soon as a connection is given back
19:01pilneand how do you end a connection?
19:01loophole_pilne: that way the ref deals not with side-effects but with dealy/promise objects
19:03loophole_pilne i have to call a function that closes the connection and creates a new delay in the pool
19:04pilnesweet
19:04pilnevery simple and robust (:
19:04loophole_pilne: you get either a delay or a promise but since you dereference both it makes no difference
19:05loophole_pilne: about 60 lines of code + tests
19:09pilnesometimes i think my life would be very different if instead of having c++98 and java 1.2 shoved down my throat academically, i had gotten pascal and then SICP >.<
19:10pilnewhich is what *should* have happened if my teachers had not ben OO-kool-aid gung-ho >.<
19:11loophole_pilne: c++ templates are just a very ugly implementation of lisp macros :D
19:11pilneyeup
19:14loophole_pilne: this is interesting but will make your eyes bleed :) http://www.amazon.com/Modern-Design-Generic-Programming-Patterns/dp/0201704315
19:14TMApilne: even starting with pascal, lisp was a revelation. another revelation was prolog
19:17pilnei started with (poorly taught) c++98 and then java after just dabbling around with basic, scripts, and some python, then java was forced down my gullet, i sadly didn't learn about the fun things until very recently
19:19loophole_pilne: I found my way to functional programming via perl. I did lots of stuff in perl at that time. a colleague pointed me to http://hop.perl.plover.com/.
19:20loophole_pilne: after that book i started with CL
19:20pilnenice
19:21pilnei'm so very hooked on lisps, i appreciate what haskell is, and I want to have a good understanding of it, but i see haskell as a hobby, and lisps as my way back into useful programming (:
19:22loophole_pilne: a friend of mine hacked a cobol interpreter in haskell.
19:23pilneO.o
19:23loophole_pilne: exactly
19:23loophole_:)
19:23pilnei've heard haskell is absolutely fantastic for parsing and lexing though
19:25loophole_pilne: I heard that also. unfortunately I never get past the basics. I started learning several times but it doesn't stick
19:25pilnesame, i do good through calculus, but all this other stuff just takes a while for my old brain to grasp
19:27loophole_pilne: http://www.cs.yale.edu/publications/techreports/tr1049.pdf
19:29loophole_pilne: page 8 for the results
19:29loophole_pilne: page 8/9
19:33loophole_pilne: task was to program a weapons system 85 lines of haskell vs 1105 lines of c++
19:34loophole_pilne: lisp was not to bad either 274 lines of code and the shortest development time
19:35pilnei've seen that before (:
19:35pilnehaskell is very powerful, but the learning curve is sharp, i feel like i'll always be learning something with lisps, but it will be a more gradual curve
19:36loophole_pilne on my list is scala and ocaml
19:37pilnethe pragmatist in me says scala (or maybe kotlin)... but >.<
19:39loophole pilne scala looks nice. I just don't know how many scala programmers really write functional code.
19:40loopholepilne: afaik scala is not strictly functional. If java programmers use it as java with a nicer syntax, then this code is no fun
19:41loopholepilne: but I'm talking out of my ass here, since I have no proof of my guesses :)
19:42xenoloophole: well, that's theoretical, since they don't... they try to use scala as a better java, figures out that it's quicker to write java in java and never look at scala again
19:43loopholexeno: nice ;)
19:43xenonot really :/
19:43xenoalthough admittedly, scala has some issues :/
19:46loopholexeno: example?
19:52neoncontrailsTrying to quickly test whether a table exists before initializing it. Is there a way to rewrite the line "(format "select 1 from %s" (sqlize table-key))" in this function to eliminate the "sqlize" dependency? https://github.com/xsc/ritual/blob/master/src/ritual/table.clj
19:52neoncontrails*rewrite the sexpr, to be more precise
19:56loopholeneoncontrails: what is your goal? or why do you want that? I don't understand the problem (I'm stupid)
20:00neoncontrailsloophole: I need my initialize function to check if a table exists before trying to create it. The problem I'm running up against is jdbc/sql-query errors if you try to query a table that doesn't exist; it doesn't return 'nil' or an empty list
20:04pilnewhat does it return?
20:07rageris there a problem with lein search right now?
20:07ragerwhen I try to use it, it hangs after this: "Downloading https://clojars.org/repo/.index/nexus-maven-repository-index.properties&quot;
20:07neoncontrailsloophole: to be more specific though, I'm mostly curious what that line is doing in the context of that threading macro, and how I could rewrite it without that line. I don't need to format the string I'm checking against the db-spec, it's already sqlizable
20:08ragerI saw some chatter about the problem 2-3yrs ago, but nothing that acctually pointed towards a fix
20:08ragerI've left it overnight, and it still doesn't complete, but the link downloads fine
20:09loopholeneoncontrails: your specific question:
20:09loophole(defn create-select [sqlizer-fn table-key] (format "select 1 from %s" (sqlizer table-key)))
20:10loophole(defn sqlizer [k] (name k))
20:10loophole(partial create-select sqlizer)
20:10loophole((partial create-select sqlizer) :da_key
20:10loophole)
20:10loopholeneoncontrails: dont know if that helpes makes sense
20:11loopholeresult is "select 1 from da_key"
20:12loopholeneoncontrails: of course create-select is just a replecement for your function
20:14loopholeneoncontrails: this handles your sqlizer fun as a parameter, but doesn't help with the jdbc problem
20:15neoncontrailsloophole: that works! Thanks, I've never been completely sure how to use partial in situations like these
20:15loopholecool :)
20:19loopholeneoncontrails: I made an error but I guess you found it already
20:19loopholewrong: (defn create-select [sqlizer-fn table-key] (format "select 1 from %s" (sqlizer table-key)))
20:19loopholeright: (defn create-select [sqlizer-fn table-key] (format "select 1 from %s" (sqlizer-fn table-key)))
20:21neoncontrailsloophole: yeah I figured that was just a typo :-)
20:21loopholeneoncontrails: k
20:22loopholebbl
20:33loopholeneoncontrails: before I go to bed. partial is not very complicated. example
20:33loophole:
20:33loopholeneoncontrails: (defn three-params [a b c] [a b c])
20:34loophole(defn naive-partial [f a] (fn [b c] (f a b c)))
20:34loophole(let [f (naive-partial three-params :a)] (f :b :c))
20:37loopholeneoncontrails: partial is more generic but that is basically what it does.
20:38loopholeresult is of course [:a :b :c]
20:38loopholei'm gone now
21:42nathanichi, can anyone explains what this error is? Only [lib.ns :only (names)] specs supported in :use / :use-macros; offending spec: [loom.graph]
21:43nathanici have a (:use [loom.graph]) in a cljc file, not sure what this message means or why that sets it off
21:43justin_smithnathanic: it's saying you can't use it unqualified
21:43justin_smithyou need to use the :only key to specify which things to import
21:44nathanicjustin_smith: oh, okay. i just couldn't get a meaning out of that wording
21:44nathanicjustin_smith: thanks!
21:45nathanicso is this a general clojurescript thing? no import *?
21:46nathanici normally use :require and :refer but i was working off an example for loom that relies on unqualified imports
21:47justin_smithnathanic: funny enough, our version of import doesn't allow *
21:47justin_smithbut that has nothing to do with require / use
21:48justin_smithnathanic: I wasn't aware of cljs not allowing unqualified use, because I never try to do that
21:48justin_smithnathanic: in my experience use is common in examples in readmes, and very rare in actual code :P
21:48nathanicI wonder if that was a technical limitation or an Opinion? (An Opionin I generally share)
21:49nathanicbut if you're working off an unfamiliar example, and it doesn't make clear which symbols come from which ns's, it's annoying to go back and explicitize the refs
21:52justin_smithit's true
22:31amalloyit's an opinion, i'm sure. it wouldn't be hard to look up all classes in a package and import them
23:05domokatoi've got a problem you guys might find fun
23:08MONODAMy emacs session with cider crashed and now when I try to refresh my code into my repl session I get "CompilerException java.lang.RuntimeException: No such var: user/reset"
23:09domokatoi have a list of ranges i.e. ([0 1] [-2 3] [5 14] [-25 -5] [2 4]) and a function (ranges-overlap? range-a range-b) and I want to merge any overlapping ranges recursively and end up with i.e. ([-2 4] [5 14] [-25 -5])
23:09MONODAAny ideas? I feel like i've tried everything
23:09domokatohow should i go about it?
23:11justin_smithdomokato: something like (reduce (fn [ranges r] (merge r ranges)) [] ranges)
23:11justin_smithdomokato: s/merge/range-merge
23:13domokatojustin_smith: merge? like for maps?
23:14justin_smiththen range-merge is something like (fn [r ranges] (map (fn [rng] (if (ranges-overlap? r rng) [(apply min (concat r rng)) (apply max (concat r rng))] rng)) ranges)
23:14justin_smithwhere it expands ones that overlap, but leaves the rest alone
23:14justin_smithdomokato: very rough sketch
23:18MONODAI've double checked my dependencies and everything seems fine
23:19justin_smithMONODA: so after restarting your repl and restarting CIDER, code reloading is not working?
23:19MONODAYes
23:21MONODAAny ideas why
23:22justin_smithany messages when cider connects, about middleware or cider versions or anything?
23:24LucidTortoiseMONODA Try running the repl in the command line. Does it load?
23:24MONODAthe repl runs fine
23:25MONODAi can run (-main) as well from the repl
23:25domokatojustin_smith: after you merge two ranges, don't you have to recheck the other ranges? let's say [0 2] skips merging with [3 5] but later merges with [1 4] to make [0 4]. [3 5] should be checked again because it might overlap now
23:25MONODAThe only message I get is: "CompilerException java.lang.RuntimeException: No such var: user/reset"
23:25MONODAwhich I assume is a namespace issue or dependency issue but I can't seem to find anything wrong with what I have
23:26justin_smithdomokato: first you would check [0 2] against every other range, then check [3 5] against every other, etc.
23:26MONODAhttp://pastebin.com/0HsFstft
23:26justin_smithdomokato: you would find all the overlaps, even with merges
23:26MONODAmy project.clj
23:27LucidTortoiseSorry MONODA I really don't know enough about Emacs and Clojure (yet) to help.
23:27justin_smithMONODA: typically cider-nrepl would be in profiles and not in the project file (though if you are doing this as a solo project this likely doesn't matter much)
23:28MONODARight. Also, when I try: (require '[clojure.tools.namespace.repl :refer [refresh]])
23:28MONODAI get "FileNotFoundException Could not locate clojure/tools/namespace/repl__init.class or clojure/tools/namespace/repl.clj on classpath. clojure.lang.RT.load (RT.java:456)"
23:29justin_smithMONODA: well, I doubt that the clojure.tools.namespace project, when loaded as a plugin, adds itself to your classpath in the process
23:29justin_smithMONODA: I think it's meant to be used as a dependency, not a plugin
23:29justin_smiththen again, cider-nrepl should be pulling it in itself
23:31MONODAThat's what I was thinking
23:32MONODASeems to be a cider issue.
23:32MONODAI was require c.t.n.r/refresh if I list it under dependencies
23:32MONODAand then I can run (refresh)
23:33MONODAbut cider still won't run (refresh) when I run cider-refresh
23:33justin_smithsounds like they have namespace / scope issues?
23:36domokatojustin_smith: but if the processed ranges so far are ([0 2] [3 5]) and the next range is [1 4] then you'll end up with ([0 4] [1 5]) which now overlap, but you'll never know?
23:37justin_smithdomokato: that's why I did a reduce
23:38justin_smithyou would know because you reduce, and take the new range, and merge it with any applicable, and merge that merged one with any others too
23:39justin_smithso you start with [[0 2] [3 5] [1 4]] - first you do [0 2] - at the last step it merges with [1 4]
23:39justin_smithso next you have [[3 5] [0 4]] and you repeat the process
23:40justin_smithdomokato: I know what I shared before wasn't exactly right, but this logic is doable if you do a reduce and update all ranges at each step of the reduce
23:43domokatojustin_smith: okay i'll figure it out. thanks!