#clojure logs

2015-07-10

02:13elvis4526I'm sure someone here is using emacs & cider to run tests, right ?
02:14elvis4526I can't get cider to detect my tests :|
02:19Reefersleep(ince justin_smith)
02:19Reefersleep(inc justin_smith)
02:19lazybot⇒ 274
02:19Reefersleep(inc oddcully)
02:19lazybot⇒ 12
02:19Reefersleep(inc oddcully)
02:19lazybot⇒ 13
02:19ReefersleepDidn’t know what this meant until just now, figure I owe some :)
02:19Reefersleep(inc oddcully)
02:19lazybot⇒ 14
02:22ddellacostaelvis4526: what do you mean by "can't get cider to detect my tests?"
02:22ddellacostaalso, you may have luck in #clojure-emacs too, check it out
02:25elvis4526ddellacosta: Well, the typical functions to run tests from cider "C-c ," for example always returned "0 tests - 0 errors - 0 failures [...]"
02:25ddellacostaelvis4526: oh, I see...yeah, I'm always running them manually in the cider repl
02:26elvis4526but then I noticed that I had (?) multiple repl open, so I think cider was connected to an old and dirty repl
02:26ddellacostaah, that would make sense
02:26ddellacostaif the ns wasn't loaded up properly there
02:26elvis4526yep, now its working
02:26elvis4526yeah exactly
04:07DeranderHi all! I'm trying to track down why my project is importing cider-nrepl 0.8.2 instead of 0.9.1. Attached is the output of `lein deps-tree`, along with profiles.clj and project.clj. https://gist.github.com/AndyMoreland/b1f5a3bf055fd14f4edc
04:08DeranderWhen I execute cider-jack-in in emacs I see https://gist.github.com/AndyMoreland/36c4362ce5ffa3d77d00 .
04:10H4nsDerander: i had that problem on monday but i was so aggravated when i finally solved it that i forgot the solution. you've certainly checked your ~/.lein/profiles.clj already?
04:11DeranderH4ns: yar -- it's in that gist if it's interesting. Changing the version number of the cider-nrepl plugin in it doesn't seem to be having an effect though
04:11DeranderI've noticed that if I kill my maven cache it'll download both the correct version and, unfortunately, 0.8.2. `lein repl` *seems* to be using 0.8.2 but I'm not sure how to verify this aside from the cider error message.
04:12H4nsDerander: found it: it was a bad tools.nrepl dependency that caused the issue
04:12DeranderH4ns: `:dependencies [[org.clojure/tools.nrepl "0.2.7"]]` that guy?
04:12H4nsDerander: I added ":dependencies ^:replace [[org.clojure/tools.nrepl "0.2.10"]]" to get rid of it.
04:12H4nsDerander: right
04:13DeranderI'll try the metadata
04:13Deranderhadn't used ^:replace
04:15DeranderH4ns: well, I'm getting a whole new world of errors now so I'll explore these. Thanks for helping me make progress :-)
04:15H4nsDerander: "enjoy"
06:21dstocktonis running custom code inside a query still possible when running a peer as a separate process and using the REST api?
06:22dstockton(datomic)
06:43jonathanj_if i have a situation where i create a connection (an irc connection) and i want to send messages over that when i get some HTTP request (via a ring handler), what's an idiomatic way of doing that?
06:44jonathanj_obviously i could (def connection ...) in some namespace and just use that, but that doesn't seem particularly idiomatic to me
06:44dstocktonjonathanj_: sounds like a use case for component
06:45jonathanj_dstockton: what's component?
06:45dstocktonhttps://github.com/stuartsierra/component
06:45dstocktonit can help you avoid defining globals or singletons
06:47jonathanj_thanks, that looks interesting, i'll take a look
06:48jonathanj_although, let's say without the help of a library providing some kind of protocol, what would another possible approach be?
06:55dstocktondefing it globally is a possible approach
06:56dstocktoncomponent is a pretty small library
06:56dstocktonyou could do something similar yourself should you wish
07:23wombawombaSo clojurescript is supposed to have pprint now: http://dev.clojure.org/jira/browse/CLJS-710
07:23wombawombaHowever, requiring clojure.pprint from cljs gives me "No such namespace: clojure.pprint, could not locate clojure/pprint.cljs..."
07:23wombawombaWhat am I doing wrong?
07:24tahmidThis code is taken from sente example. https://gist.github.com/tahmidsadik112/d70d15284bedea82f07f
07:24Bronsawombawomba: apparently the ns is cls.pprint
07:24Bronsacljs*
07:24tahmidI am having a hard time trying to understand what is happening in the function parameter.
07:24wombawombaah, okay
07:24wombawombathanks
07:25tahmidCan anyone explain, please
07:53chomwitt,(pr-str [\u2620])
07:53clojurebot"[\\☠]"
07:53chomwittis that logical?
07:54chomwittthe string representation of a vector with one character is a vector with 3 characters??
07:54lazybotchomwitt: What are you, crazy? Of course not!
07:55chomwittlazybot: ?
07:55hyPiRionchomwitt: lazybot is a bot, just replies to things that ends with ??? or ??. Isn't that right??
07:55lazybothyPiRion: Definitely not.
07:56chomwitt:-)
07:56chomwittcool ??
07:56lazybotchomwitt: Definitely not.
07:57chomwittso is that logical?
07:57oddcullyhavent you asked that yesterday?
07:57oddcullyor some mutation?
07:58chomwittoddcully: yep!
07:58chomwittoddcully: about str, now i ask about pr-str
08:55hellofunkchomwitt: why do you need to know that ??
08:55lazybothellofunk: What are you, crazy? Of course not!
09:03noncomchomwitt: yes, an interesting issue. i'd like to know too.
09:08hyPiRion"By default, pr and prn print in a way that objects can be read by the reader"
09:08hyPiRion,(pr [\u2620])
09:08clojurebot[\☠]
09:09hyPiRion,(let [v [\u2620]] (= (read-string (pr-str v)) v))
09:09clojurebottrue
09:10hyPiRionWhich means that pr-str (when possible) prints something that the reader can read back in.
09:15noncomi see...
09:16oddcully,(pr-str (java.util.Date.))
09:16clojurebot"#inst \"2015-07-10T13:16:25.827-00:00\""
09:20dnolenBronsa: cljs.tools.reader is now only 1.5X slower than clojure.tools.reader in Safari, Chrome & Firefox :)
09:38namrahm is there a clojure autocomplete plugin for vim?
09:39oddcullynamra: vim-fireplace
09:41namrahm than im missing something, whats the shortcut?
09:41varaindemianCan anyone help me fix this syntax?
09:41varaindemianhttp://pastebin.com/k1ckYRZX
09:45dstocktonnot sure if vim-fireplace has autocomplete
09:45dstocktonvim-clojure-static does
09:45namraoddcully: thanks, connecting to repl and then ctrl-x followed by ctrl-o works
09:46dstocktonfair enough
09:46dstocktonaha https://github.com/tpope/vim-fireplace#omnicomplete
09:48namradstockton: thanks
09:49dstocktonno info there namra, just confirming to myself that it has it
09:49dstocktoni use YouCompleteMe so im not familiar with the shortcuts
09:49varaindemiannobody? :(
09:54justin_smithvaraindemian: it's kind of hard to tell what you are trying to do there
09:54justin_smithvaraindemian: x=y is a valid parameter name, but it isn't a binding syntax
09:55justin_smith,(def x=y true)
09:55clojurebot#'sandbox/x=y
09:55justin_smith,x=y
09:55clojurebottrue
09:56justin_smithvaraindemian: the second or third argument to defn must be the parameter binding vector
09:56justin_smithvaraindemian: what are those if calls supposed to be doing?
09:59varaindemianjustin_smith: My friend asked me to take a look, but I have no guess about lisp/clojure. Thouht in this place I can get help
10:00justin_smithvaraindemian: OK, there's enough problems in that code that it's hard to tell what the programmer is actually trying to do
10:02dstocktonthere's enough problems in that code, i thought you were trolling
10:02varaindemianjustin_smith: trying to make a prisoners dilema code
10:03varaindemianjustin_smith: thnak you anyway
10:06justin_smithmaybe something like ... (defn strategy [x] (let [p1 (RandomMove) p2 (RandomMove)] ...) as a start
10:06justin_smithI'm not sure what's supposed to be happening, but that might be the first few lines
10:11csd_Does anyone know if Avout is a dead project? And if so what might be an actively developed successor?
10:11chomwitt,(rest (pr-str [\k]))
10:12clojurebot(\\ \k \])
10:12chomwittdoes that make sense?
10:18oddcully,(seq (pr-str [\k]))
10:18clojurebot(\[ \\ \k \])
10:23justin_smithcsd_: the issue with avout is that watches are pretty much totally broken
10:23justin_smithcsd_: I don't know if anyone plans on working on it
10:23clojurebotI don't understand.
10:34jhnhere's some scala: def b(n: Int) = (1 to n) flatMap (1 to _)
10:34jhnb(5) => Vector(1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5)
10:34jhnhere's the clojure i came up with
10:35justin_smith,(defn b [x] (map #(range 1 %) (range 1 x)))
10:35clojurebot#'sandbox/b
10:35jhn(defn a [n] (mapcat #(range 1 %) (range 1 (+ 2 n))))
10:35justin_smithahh, the mapcat part
10:35jhnnah, that does not produce the same
10:35jhnyou have to add 2
10:36jhnso I'm wondering if there's a more elegant way to do this in clojure?
10:36justin_smithand I think you need (inc %)
10:36justin_smithjhn: I doubt it
11:04csd_justin_smith: is there an actively developed library for handling distributed consensus?
11:04csd_ops, kick bioogir for spamming
11:10Bronsacsd_: is it spamming in private messages?
11:11Bronsaoh yeah, there he goes. puredanger please kickban bioogir
11:26chouserI don't see the spam. Where is it?
11:26xemdetiathe spam is an illusion
11:26chouserah. I don't know if I can do anything about that.
11:26xemdetiamaybe there is a netsplit going
11:28chouseroh, I guess if the spammer isn't in here, won't know who to privately spam. I'll try.
11:30csd_chouser: for me it was on channel join
11:31Bronsachouser bioogir spams users in private message when they talk/join
11:32@chouseryeah, I figured that out. looks like my attempt to use the ban feature is incorrect.
11:32Bronsachouser you just need to kick him
11:33Bronsacool, thanks
11:33oddcullywoohoo
11:33Bronsa(inc chouser)
11:33lazybot⇒ 22
11:33@chouseryay. happy to help.
11:37justin_smithcsd_: just got to work. if the distributed consensus stuff is all you need, avout should be good, or you could directly use zookeeper
11:37justin_smithcsd_: it's just the watcher abstraction in avout is broken
12:05mmeixwould this be considered ok style or not:
12:06mmeix,(filter :draw [{:note 1 :draw true} {:note 2 :draw false} {:note 3 :draw true}])
12:06clojurebot({:note 1, :draw true} {:note 3, :draw true})
12:06mmeix?
12:07mmeix(instead of: (filter #(:draw %) ...) )
12:11justin_smithmmeix: definitely use :draw instead of #(:draw %)
12:11mmeixI guess yes than ...
12:11mmeixthanks
12:11justin_smithbut you still might want #(:draw % :default) sometimes
12:11mmeix*then
12:11justin_smithmmeix: yeah, I'd consider #(:draw %) bad style
12:12mmeixaha, defaults would be a case, yes
12:12mmeixOTOH I think defaults should maybe taken care of more upstrem
12:12mmeixupstream
12:12hellofunk#((get get get get) % :draw) is another option mmeix justin_smith
12:12justin_smithmmeix: you wouldn't want :default in a filter anyway :)
12:13justin_smithhellofunk: lol
12:13hellofunkhey if it works, why change it?
12:13mmeixand not (get get get ...)
12:14justin_smith,(((get get get get) (get get get get) (get get get get) (get get get get)) nil get)
12:14clojurebotnil
12:14mmeixurx
12:14justin_smithwait
12:14justin_smith,(((get get get get) (get get get get) (get get get get) (get get get get)) nil nil get)
12:14clojurebot#object[clojure.core$get 0x9ca2636 "clojure.core$get@9ca2636"]
12:14justin_smiththere we go!
12:14hellofunki almost did that one myself but i didn't want to get banned
12:14justin_smithhahaq
12:14justin_smithhellofunk: I don't think anyone would get banned for stupid clojure tricks
12:15justin_smithunless they are really spammy or something
12:15mmeixfor multiple gets I would consider a macro then ... :)
12:15justin_smithmmeix: it's just one get
12:15justin_smithit's just a really awkward (stupid) way to do it
12:15mmeixyeah understood that ...
12:16justin_smith,(= (get get get get) get)
12:16clojurebottrue
12:17mmeixI changed from leiningen to boot BTW, and so far it has been a pleasure
12:18mmeixwith a little help from martinklepsch/tenzing
12:18justin_smithinteresting
12:18justin_smithI might have to try it one of these days
12:18mmeixI like the fact, that all of live-reload etc is now under one single umbrella
12:19tmtwdis it feasible to use clojure with a java textbook?
12:19clojurebotNo entiendo
12:19mmeixfeels right to this beginner's mind :)
12:19mmeixwhy a JAVA textbook?
12:20mmeixI would prefer a clojure text book
12:20tmtwdtheres not a clojure textbook that is as comprehensive as this one?
12:20tmtwdmost clojure books are general programming books
12:20mmeixThe Joy of Clojure
12:21mmeixthere are some cookbooks
12:21oddcullyclojure applied is finished
12:21justin_smithtmtwd: I think a big problem with using a java textbook would be how much of the book is going to be about things like inheritance or mutable fields, which even when we do them in clojure it's awkward to do them java style and we have our own version...
12:22tmtwdyes, that is certainly true
12:22justin_smithtmtwd: you'd have better luck with eg. SICP (a scheme textbook)
12:22tmtwdalready reading scheme
12:22mmeix(I do like my safaribooksonline plan ...)
12:23tmtwddoes joy of clojure have programming exercises?
12:23edwHey folks, if you live in the NYC area and are looking for a Clojure/Unix or Devops engineering position, please check out the jobs section of <http://actionx.com/&gt;; I'm hiring for three positions. Feel free to private message me or email me at my personal e-mail <edw@poseur.com> if you have questions.
12:24mmeixhttp://www.4clojure.com is a well known source of programming exercises
12:24mmeixand http://clojurekoans.com
12:27{blake}Welp, after over a year of no problems with lein, I can no longer install it. That's a pretty good run.
12:27{blake}And the problem is github.com's SSL certificate?
12:28mmeixtmtwd also "Living Clojure" by Carin Meier is friendly, and with exercises
12:29tmtwddoes living clojure have web stuff (ie cljs)?
12:30mmeixa bit
12:30mmeixone chapter, IIRC
12:31mmeixbut there is really nearly no difference between clojure and clojurescript, learningwise
12:32mmeix(if this word exists in English ;)
12:32TEttinger{blake}: I had the same issue, oddly
12:32TEttingerit was a quick fix
12:33{blake}TEttinger: I'm on tenterhooks...
12:33{blake}(You don't see a lot of tenterhooks these days.)
12:33mmeixtmtwd another tip: http://www.braveclojure.com
12:33TEttingerheh
12:33TEttingermy computer is slow as molasses right now
12:34{blake}That's fine. It heightens the suspense.
12:35{blake}TEttinger: (You are gonna clue me in, right? This isn't another of life's cruel jokes...)
12:36tmtwdoh yeah, brave clojure is awesome
12:37TEttingerare you using wget, {blake}?
12:38TEttingerline 146 of lein.bat , I needed to find it in there
12:38TEttingerit can use wget, curl, or one other
12:38TEttinger call wget --no-check-certificate -O %1 %2
12:38TEttingerthat is what should replace line 146 in what I believe is the newest lein.bat (it did change at some point)
12:38{blake}Oh! Okay, yeah, I was looking at that. Let me give that a shot.
12:39{blake}TEttinger: AH! Thank you! That seems to have...
12:39TEttingerwoo!
12:39TEttingerI think!
12:39{blake}...done it!
12:39TEttingerhuzzah
12:39{blake}(Just adding to the suspense.)
12:40{blake}(inc TEttinger)
12:40lazybot⇒ 58
12:40{blake}(inc TEttinger)
12:40lazybot⇒ 59
12:40{blake}'cause why not.
12:40TEttingeryay
12:40TEttingerI hope that gets fixed soon, it's going to be annoying for new users
12:41{blake}I wonder what the deal is with that. Yeah, no kidding, I always hype how easy Clojure is to install and how great lein is.
12:41TEttingeris hyPiRion the current maintainer?
12:42TEttinger$google leiningen
12:42lazybot[Leiningen] http://leiningen.org/
12:42TEttingerthere's an existing bug report for it, that's where I found that people fixed it by doing that. they didn't say what lineto change...
12:43TEttingerI'll add that now
12:43{blake}I don't know vis a vis hyPiRion
12:43{blake}I thought I'd seen his name attached but I can't find it now.
12:43TimMcThere are a number of folks with commit access but I don't know who does releases.
12:44TimMcmaybe ato
12:44{blake}Looks like he has the most.
12:45TimMcTEttinger, {blake}: What's wrong with github's ssl cert?
12:45{blake}TimMc: "ERROR: cannot verify github.com's certificate, issued by `/C=US/O=DigiCert Inc/O
12:45{blake}U=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA':
12:45{blake} Unable to locally verify the issuer's authority."
12:46TEttingerthere's an error on github's issues
12:46TEttingerwget errors out on windows, I think is the name
12:46TimMcAre yo uon an old Windows with an old SSL truststore?
12:47{blake}I'm currently running Windows 7 in a controlled corporate environment. I haven't checked my Linux boot yet.
12:48TEttingerTimMc: Windows 7, no idea what my truststore is
12:48TEttingerit's worked fine until I needed to update java
12:49TEttinger(I was using like jdk 1.7_025)
12:51{blake}TEttinger: Oh, me, too, for lein.
13:02TEttingerhm, what does this mean in lein's CONTRIBUTING file?
13:02TEttingerPlease use topic branches when sending pull requests rather than committing directly to master in order to minimize unnecessary merge commit clutter. Direct pull requests towards the master branch, not the stable branch.
13:02TEttingerthis is a one-line change
13:04TimMcSize of the changeset isn't really important.
13:04TEttingerwhat is a topic branch?
13:05TEttingerthe two sentences there conflict for me
13:07TEttingerTimMc?
13:07clojurebotTimMc is the other gfredericks
13:07TEttingerI see
13:07TEttingergfredericks?
13:07clojurebotgfredericks is gfredricks
13:07TEttingerheh
13:09hyPiRionTEttinger: On your own fork, do git checkout -b my-pr, then when you issue a PR, direct it towards the master branch.
13:10TEttingeryep, that would have been nice to know before I made the commit.
13:11gfredericksme?
13:11clojurebotme is greek to it
13:11gfredericksoh that's how I came up
13:12TimMcTEttinger: Create a branch where you are now, then reset master to origin/master or whatever.
13:12TimMcactually no, tht's not really necessary if you're working from a fork
13:15TEttingerok, it appears to be working
13:16TEttingerhyPiRion: is this configured correctly and sound for contributing? https://github.com/technomancy/leiningen/pull/1931
13:22hyPiRionTEttinger: It looks fine, but we don't want to skip certificate checks for Windows; https://github.com/technomancy/leiningen/issues/1800#issuecomment-70041223
13:23hyPiRionThe fix for #1800 ships with 2.5.2, which has been in limbo for far longer than I'd like to
13:23TEttingerok
13:23TEttingerthanks
13:24TEttingerclose whenever or I can
13:24hyPiRionNp, and sorry for not responding immediately to those issues. I've been a bit busy, and will be until next week is over =/
13:25{blake}OK, I'm chaining a bunch of assocs. (-> (assoc :whatever "whatever") -> (assoc :more "more"))
13:25hyPiRionirl can be a bit shitty with you sometimes
13:27{blake}But now I want to conditionally assoc, like... (-> (if cond (assoc :thing "thing") (assoc :other "other")))
13:28{blake}But I can't, of course, 'cause the if breaks the threading...
13:28hyPiRion{blake}: (-> foo (cond-> cond (assoc :thing "thing")) (assoc :other "other"))
13:29{blake}hyPiRion: Thanks! Back to reviewing the std functions again, I guess...
13:29{blake}(inc hyPiRion)
13:29lazybot⇒ 76
13:34{blake}hyPiRion: Well, almost. "Other" gets evaluated every time. =P But I can figure it out from there, I think.
13:35hyPiRionoh, right
13:35{blake}I don't suppose there's an "if->"?
13:36hyPiRionThere's as->. You can do (as-> val x (assoc x foo bar) (if cond (assoc x :a "a") (assoc x :b "b")))
13:45{blake}hyPiRion: Yes! That's the ticket.
14:16tmtwdwhere do I put the js directory in a compojure project?
14:20arrdem{blake}: I have an if-> implementation kicking around but it is just an as-> shorthand like amalloy said
14:20arrdemoops hyPiRion not amalloy
14:24danielpcoxdoes anyone here have any experience with Scala/Clojure interop? I get "Exception Incompatible return types" when I do (proxy [SomeScalaAbstractClass] []), but not when I do, e.g., (proxy [java.io.InputStream] [])
14:31tmtwdwhich clojure book would be the best for web dev?
14:32tmtwdjoy of clojure?
14:35katratxotmtwd: the joy of clojure tries to explain the "why?" ... "clojure programming" the o'reilly one has some chapter on web development
14:36katratxoi don't have an opinion on this one, but the name suggests that is focused on web development https://pragprog.com/book/dswdcloj/web-development-with-clojure
14:39scgilardifair witness
14:40tmtwdthe latest one is 2012....
14:41tmtwdI feel things have changed a lot since then
14:53TEttingerdanielpcox: how would you extend or implement SomeScalaAbstractClass in Java, and is it different from how you would java.io.InputStream? I have no experience with scala anything interop, though I have written some scala and a lot of clojure
14:54csd_I'm trying to use sorted-set-by to sort hashmaps that have a :time element. But, sorted-set doesn't include maps with identical times but which are different values otherwise. Is there an alternative implementation for sorted set / an easy way around this?
14:54tmtwdfor tcp sockets, you just use the java core library sockets?
14:54csd_i know i could sort on secondary keys but i just don't care where they go at that point
14:54TEttingercsd_: ##(doc sort-by)
14:54lazybot⇒ "([keyfn coll] [keyfn comp coll]); Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item). If no comparator is supplied, uses compare. comparator must implement java.util.Comparator. If coll is a Java array, it w... https://www.refheap.com/105958
14:55Bronsacsd_: just never return 0 on the comparator
14:55justin_smithcsd_: (juxt :time identity)
14:55Bronsacsd_: if they're equal and you don't care which one comes first, return 1 or -1 rather than 0 on =
14:55justin_smithcsd_: that way the :time value is the primary sort, but it also compares the entire object
14:56csd_ah thank you
14:56katratxotmtwd: try https://github.com/ztellman/aleph
14:59justin_smithis there a pattern and/or lib for stuartsierra/component that simplifies starting a subset of a system? for example "start my app, but don't start the http server" - it seems like this should be a thing I can do, but it seems like it would involve a lot of messy conditionals or repeating myself...
14:59gfredericksjustin_smith: dissoc?
15:00justin_smithgfredericks: OK, but what about the nested stuff in system-using?
15:01justin_smithmaybe it just won't care and the nested keys that don't exist will be ignored (have not tried it that way yet)
15:02{blake}arrdem: I mostly thought of it in terms of symmetry. "as->" is fine for now.
15:03gfredericksjustin_smith: you want to turn off the http server but still have things running that depend on it?
15:03justin_smithgfredericks: luckily the http server is a "top of the stack" element
15:04justin_smithI would also manually dissoc other things if they depended on it, but automating that would be nice too
15:04noogaI just wrote a fn that takes a string and returns all used characters formatted neatly inside a rectangle and then fed its source to itself: https://goo.gl/GOZ1uh
15:04gfredericksjustin_smith: seems like something that's best left manual imo
15:04justin_smithso like a (system-without system-parts :http-server) is what I want
15:05justin_smithgfredericks: hmm, yeah, but a way to specify it without a lot of repeating myself would still be nice (expressing it as a simple dissoc / tree prune)
15:09tmtwdhttp://pastebin.com/3bU9PYhb How would I do this java code in clojure
15:09tmtwdie, how do I override a class from java and implement methods in it?
15:09csd_If I use this as a comparator function to two maps, without the tick before the vector at the end, I get a ClassCastException with a missing stack trace. (apply compare (map (juxt :time identity) '[a b]))
15:09csd_weird
15:10chrisfjonestmtwd: https://clojuredocs.org/clojure.core/extend should get you there
15:11tmtwdchrisfjones, thanks
15:12chrisfjonestmtwd: actually, I just looked at your pastebin extend may not be what you want
15:14chrisfjonestmtwd: you'll more likely want to go through the whole gen-class dance: https://clojuredocs.org/clojure.core/gen-class
15:19gfredericksjustin_smith: I guess I just have a hard time imagining the scenario where you want to do anything besides remove a top-level thing
15:26justin_smithgfredericks: start up a repl where I can access the db config and manually use my db code, but don't start any servers listening for connections
15:27justin_smithI guess those servers are all top-level things, come to think of it, maybe I a over-generalizing my need here
15:29justin_smithgfredericks: does that thing in cheshire still need debugging?
15:46dasikHello, is anyone willing to answer some basic questions about clojurescript?
15:47justin_smithdasik: you might have better luck on #clojurescript, but the general rule is you don't have to ask to ask, you can just ask
15:47dasikThanks, I'll check there.
15:48bjacan component destructure dependencies yet?
15:48bjaerr, com.stuartsierra.component/using
15:48gfredericksjustin_smith: sure does
15:51justin_smithgfredericks: cool, taking a look
15:52bjaI want to say something like {:postgres (new-pg-pool) :foo (component/using (new-foo) {{:keys [foo-service-uri] :settings :db :postgres}}
15:54gfredericksjustin_smith: I'm 80% sure it has something to do with "wholeness", whatever that is
16:24xemdetiajustin_smith, I wonder for your late start http server it would be worth seeing if modeling your http server as a delay would work
16:24xemdetiaIt wouldn't work as defined in component right now though
16:25justin_smithxemdetia: it's not about late-start, but rather only creating a subsystem
16:25xemdetiaah
16:25justin_smithxemdetia: for dev purposes
16:26justin_smithI figured out a way to do it, by first filtering all keys that are not present in the initial system map, or referring to deps not present in the initial map
16:26justin_smiththen coming back again and removing from the system map those keys that were already pruned from the deps (because they depended on things now removed)
16:26justin_smithso now I can specify a set of keys to be removed, and they and everything that used them will not be present in the started system
16:26justin_smithwhich works pretty well for me
16:28justin_smithso a tree-prune of the final dep tree basically
16:30devni tried the clojurians Slack
16:30devnbut I miss you all too much
16:30bucketh3adI have :aot :all set in my lein project. Is there a way to recompile the code from inside the repl or do I need to start a new repl?
16:30Bronsa<3
16:35xemdetiaah that makes sense
16:46justin_smithbucketh3ad: (require 'some.ns :reload) or (require 'some.ns :reload-all) should reload, and recompile as apropriate
16:47Bronsajustin_smith: only if you set *compile-files* IIRC
16:47justin_smithBronsa: oh, interesting
16:48justin_smithBronsa: oh yeah, I assumed he meant effectively recompile for the repl, but if you also need it to compile to disk you would need *compile-files* too right?
16:48arrdemdevn: it is possible to lurk both :P
16:49Bronsajustin_smith: yeah, he talked about :aot so I assume he was indeed talking about compiling to disk
16:53bucketh3adWhat's that about *compile-files* ? How do I use that?
16:56arrdembucketh3ad: Compiler.java only writes generated classes to disk if *compile-files* is truthy
16:56Bronsa$doc *compile-files*
16:57Bronsauhm
16:57arrdembucketh3ad: if you read the source for clojure.core/compile all it does is load (which runs Compiler.java over a file) with *compile-files* bound to true
16:57Bronsa&doc *compile-files*
16:57lazybotjava.lang.RuntimeException: Can't take value of a macro: #'sandbox6330/doc
16:57arrdem,(doc *compile-files*)
16:57clojureboteval service is offline
16:57arrdemBronsa: ^
16:57Bronsa(╯°□°)╯︵ ┻━┻
16:57Bronsaarrdem: I'm pretty sure clojurebot had a command
16:57arrdembecause hiredman is a dick I can't do it myself
16:57Bronsa,(doc *compile-files*)
16:57arrdem$grim clj::clojure.core/*compile-files*
16:57clojurebot"; Set to true when compiling files, false otherwise."
16:57Bronsaah, lazybot is offline.
16:57Bronsa*sigh*
16:57arrdemwell lazybot still doesn't have my grim plugin months later
16:58arrdemin addition to being dead
16:58Bronsalazybot: $ping
16:58BronsaI apparentely forgot how lazybot works
16:59bucketh3adBronsa: Oh, I see. So how would I set that to true in the REPL?
16:59bucketh3adjust def over it?
16:59Bronsabucketh3ad: (binding [*compile-files* true] (require ..))
16:59arrdemor set!
16:59bucketh3adbinding. Haven't used that before. cool.
16:59Bronsadon't think set! will work
16:59Bronsaarrdem: yeah it's not bound in the repl
16:59arrdemI mean binding is the right answer and what clojure.core/compile does..
17:00arrdemweird
17:20justin_smitharrdem: (intern 'clojure.core '>>>>>>> (lazy-seq (cons (throw (Exception. "you fucked up the merge, dumbass")) nil)))
17:20arrdemjustin_smith: ahaha
17:21nooga:D
17:21justin_smithputting it in clojure.core so it goes off no matter what file it's in, of course
17:21arrdemI'd vote for something similar on jira :P
17:21justin_smithit's a terrible abuse of lazy-seqs, but it works!
17:22justin_smitherr wait, sometimes it doesn't work
17:22justin_smitharrdem: maybe there's a way to abuse thinks directly, so that even checking the value blows up
17:24arrdemjustin_smith: can you def that to be the deref of something that will explode when touched?
17:24arrdemno that'll be eagerly evaluated...
17:24jefelantehi -- silly beginner's question. I'm trying to work on testing a web app with clj-webdriver & need to define a list of elements (100+) along with their CSS selector in a central place to reference for every function. What's the suggested way to do this? One giant map in an EDN file? Namespaces with vars?
17:24justin_smithjefelante: yeah, I would put it in an edn file
17:25jefelantecool, thanks.
17:29noogamanifold, oh manifold, how do I manifold :F
18:00gcganleywhen I evalualte something in cider repl it prints exactly 20 newlines. Its insanely annoying
18:20gcganleyis everyone dead
18:24hellofun`gcganley: some people are
18:27magnarsabout 50% of people are dead
18:27gcganleydoes anyone know what could be wrong
18:28arrdemdepends on your definition of people and the time domain that definition covers...
18:28magnarsin that case, I define it in such a way that my statement is correct
18:28arrdemNo. I'd try the #clojure-emacs channel
18:28arrdemBozhidar and the other cider guys lurk over there a little more actively
18:29magnarsgcganley: the quickest way to the cider people is https://gitter.im/clojure-emacs/cider
18:29gcganleyarrdem: thank you love
18:29arrdemIf you're on the clojurians slack, the #cider channel there is really really active
18:30gcganleyI'm moving back to clojure from Haskell for funsies and I've forgotn everything
18:30magnarsthey have a slack too? such channels
18:31arrdemthe clojurians slack is pretty poppin' in general but IRC has its advantages
18:34gcganleyslack?\
18:35atomislack blows, don't use it
18:35gcganleywhat is it though
18:35atomiwannabe irc
18:35atomiexcept ran by one company for profit
18:35hellofun`now come on atomi... cut it some slack
18:35gcganleyHA
18:35atomiyeah
18:36gcganleypuns of damage
18:37arrdemSlack has its advantages too... a decent web interface, support for attachments, emojis, embeds, rich formatting..
18:38atomi"decent"
18:38atomihaha
18:38arrdemcompared to existing web IRC clients it's more than decent
18:39atomiarrdem: enjoy your emojis
18:40atomiyeah
18:41Epicheroslack is a phenomena, the use case is usually different than irc though
18:41arrdemI mean.. I run a slack for my fraternity. the meme and emoji density beggars belief
18:41arrdemneither of which would be reasonably conveyed on IRC even if our members were willing to deal with IRC
18:41arrdemanyway
18:42atomiyeah we get it. it's a private for profit company running your chat server with emojis and embedded images/files all on someone elses computer
18:42Epicheroi mean if for profit means bathe in VC money then yes
18:43arrdemand this is evil/bad how
18:43Epicherootherwise, idek how they think it's going to monetize
18:43gcganleywhats wrong with for-profit
18:43atomigcganley: nothing is wrong with making money off your customers
18:44atomiyeah
18:44Epicherothey provide plenty for free though as well
18:44atomiwell yeah I bet
19:22tmtwdcompared to rails, supposing it uses postgrel, what would I use for clojure?
19:23tmtwdcould I use something like Datomic for example?
19:28chrisfjonesdatomic and clojure go to gather beautifully imo ;)
19:29chrisfjonesqueries are expressed directly as clojure data, results are clojure data
19:29chrisfjonesthe (significant) design thinking behind both is consistent
19:52zactsthe joyful joy that is that super happy clojure
20:26justin_smithzacts: super happy immutable persistent fun times
20:33zactsindeed
20:33zactsmy sentence has never been said on irc before in history
20:33zacts:-D
20:34zactsjustin_smith: we are making history
20:34TEttingerI'm having a really nice time writing java for things that are specifically highly mutable, and clojure for things that don't need mutable performance but do not persistence for purposes of tracking history versions
20:35TEttinger*but do need persistence
20:35TEttingerbeing able to interop so easily is nice.
20:36subtle_bugsmic checl
20:37arrdemchannel's open
21:54justin_smithhttps://i.imgur.com/bdx88D9.jpg
22:31elvis4526What's the reader macro to do a lambda ?
22:31justin_smith#()
22:32justin_smith,(#())
22:32clojurebot()
22:32justin_smith,(#(* % % % %) 2)
22:32clojurebot16
22:33elvis4526can you have args with it ?
22:34justin_smithelvis4526: yes, % or %1, and %2 %3 %4 etc.
22:34justin_smithor %& for varargs
22:40elvis4526,(#(%1 %2) "l" "l")
22:40clojurebot#error {\n :cause "java.lang.String cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.String cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval80$fn__81 invoke "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval80$fn__81 invoke "NO_SOURCE_FILE" 0]\n [sandbox$eval80 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang.Compiler eval "Compiler.java" ...
22:40elvis4526i'm not sure I understand
22:40elvis4526Why it doesn't return "l" "l" ?
22:41amalloyelvis4526: what should ("l" "l") return?
22:42elvis4526it's evaluated as ("l" "l") ? That's confusing
22:42amalloywhy is that confusing?
22:43elvis4526I'm trying understand the reasoning behind it compared to (fn [param1 param2] (blabla))
22:43amalloyelvis4526: what would ((fn [a b] (a b)) "l" "l") return?
22:44elvis4526I would expect the error I got below
22:45elvis4526I don't see why the args are between parenthese when using the reader macro
22:45Wild_Catelvis4526: they're not.
22:45Wild_Catelvis4526: perhaps you're looking for #([%1 %2]) ?
22:46Wild_Catelvis4526: in the reader macro the arguments are defined implicitly. #(%1 %2) is a function that takes 2 arguments, and calls its first argument with the second as its argument.
22:46Wild_CatIOW, it's *exactly* the function amalloy posted
22:47amalloyWild_Cat: the thing you said elvis4526 might be looking for will never work
22:47amalloyfor exactly the reasons you are explaining to him
22:47Wild_Cat,(#([%1 %2]) "a" "b")
22:47clojurebot#error {\n :cause "Wrong number of args (0) passed to: PersistentVector"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (0) passed to: PersistentVector"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 28]\n [sandbox$eval27$fn__28 invoke "NO_SOURCE_FILE" 0]\n [sa...
22:48Wild_CatOK, looks like I'm misunderstanding it too.
22:50Wild_Catwhat would an actual anonymous function that takes 2 args and returns a vector of [%1 %2] look like?
22:50Wild_Cat(except for the obvious one called "vec" :p )
22:51elvis4526,(macroexpand '#([%1 %2]))
22:51clojurebot(fn* [p1__53# p2__54#] ([p1__53# p2__54#]))
22:51elvis4526what i don't understand is why the vector is getting called ?
22:51amalloythere is a ( right before the vector
22:51amalloy( means call as function
22:51Wild_Cat,(#[%1 %2] "a" "b")
22:51clojurebot#<RuntimeException java.lang.RuntimeException: Reader tag must be a symbol>
22:52amalloy#(f x %) always calls f as a function, which is not surprising to you
22:52amalloy#([f] x %) calls [f] as a function
22:52amalloy#([x]) calls [x] as a function
22:52Wild_Catoh.
22:52elvis4526the parentheses after the hashbang isn't to delimit the body of the lambda ?
22:52Wild_Catof course.
22:53Wild_Cat...so really, the only solution is ,(#(vec %1 %2) "a" "b")
22:53Wild_Cat(pointless though it is :p )
22:53Wild_Cat,(#(vec %1 %2) "a" "b")
22:53clojurebot#error {\n :cause "Wrong number of args (2) passed to: core/vec"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (2) passed to: core/vec"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 36]\n [sandbox$eval103$fn__104 invoke "NO_SOURCE_FILE" 0]\n [sandbox$eval103 ...
22:54Wild_Catoh, so I *really* suck at this.
22:54amalloyWild_Cat: you mean vector
22:54Wild_CatI do.
22:54Wild_Cat,(#(vector %1 %2) "a" "b")
22:54clojurebot["a" "b"]
22:55Wild_Catvec takes one collection, right?
22:55amalloyyes
23:09TEttinger,(#(vec %&) "a" "b")
23:09clojurebot["a" "b"]
23:09TEttingeraw wildcat left
23:53gcganleycould anyone help me with a CIDER issue? whenever I eval something in the repl 20 newlines appear above the output. its not breaking anything its just really annoying