#clojure logs

2015-04-11

00:15TimMcLewix: "Speed" is not a well-defined measure for programming languages.
00:21scottjLewix: there's https://www.techempower.com/benchmarks/ but don't take them too seriously, who wrote each test, what libraries they use, etc can all make a huge difference.
00:21Lewixis it still valid http://martinsprogrammingblog.blogspot.ca/2012/02/why-is-clojure-so-slow.html
02:20ShayanjmWhat's the easiest way to debug & figure out why lein uberjar is hanging?
02:21aduShayanjm: some kind of jvm profiler?
02:25amalloyShayanjm: it's almost certainly hanging because you are doing something side-effectful at the top level of a namespace, such as starting up a webserver
02:26Shayanjmamalloy: it's hanging on a file which only serves as a place where functions that interface with outside APIs are defined
02:26Shayanjmi.e: "get-twitter-data"
02:42netrobyCan you try strace -f -v -t -p 6565 ? strace will dump the syscall for any running program, it will show some very detail calling.
03:25sveriHi, I have a dependency declared in :plugins of the leiningen build. Now, my dependency needs some other dependency in the classpath ([com.h2database/h2 "1.4.185"]), which I have also declared in the :dependency section. But now, when I run lein my-plugin doit it's telling me it misses [com.h2database/h2 "1.4.185"]. Does plugin execution recognize :dependency declarations?
03:29TEttingersveri, you may need a :dev-dependency
03:29TEttingerbut if that plugin has a dep, it should download it as a transitive dependency, you don't specify it
03:30TEttingerI'm not sure quite how the problem is happening
03:32sveriTEttinger it's a bit hard to explain. Plugin A provides some database thingy and as usual I don't want to include all database drivers like h2, mysql and whatnot, but instead, the application B that uses plugin A should provide the dependency. So I put the h2 into the :dependency section of application B and the reference to the plugin A into :plugins section
03:39sveriAdding h2 to the dev-dependencies section of application B does not work either
03:45TEttingersveri, I think the problem is Plugin A can't see what dependencies Application B has declared, so if the plugin itself needs a dependency that isn't being satisfied by what Plugin A can see with its own project.clj, it will encounter an error. I haven't worked much with plugins though
03:45TEttingerPlugin A is something you're writing?
04:19sveriTEttinger, yea, I have both in my hands
06:19arav93How does clojure.repl/demunge work? I read the doc, but I did not really understand much.
06:21Bronsa,(clojure.repl/demunge "foo$bar_baz")
06:21clojurebot"foo/bar-baz"
06:22arav93OK, thanks! :) Bronsa
08:03sobelso...which emacs for os x?
08:04sobelthere are so damn many
08:07justin_smithsobel: this is the one I used when I used osx - http://emacsformacosx.com/
08:07justin_smith"No Extras! No Nonsense!"
08:08justin_smithI remember the other ones being terrible
08:08justin_smithbecause they used OSX conventions instead of default emacs behaviors
08:38fakedrakehello
08:38netrobyInstall homebrew first, then brew install emacs
08:39sobelnetroby: why is that better than emacsformacosx' distribution?
08:39fakedrakeI am trying to install cider/cider-nrepl, I put the line the docs tell m in ~/.lein/project.clj and then I go to a random project and `lein repl` I just get a repl. Nothing seems to get installed.
08:40justin_smithfakedrake: it's profiles.clj
08:41justin_smithfakedrake: and to get the cider experience you would connect via cider-jack-in from emacs
08:41fakedrakejustin_smith: oooh right, thanx!
08:42fakedrakejustin_smith: how come jack-in is not done automatically like jedi does in python?
08:43justin_smithI guess because clojure processes don't come cheap like python ones do
08:44fakedrakeok
08:45sobelthere's more to it than just perf, but that's fair too
08:46justin_smithsobel: I don't mean perf, I mean, like the amount of ram each repl uses, startup time, etc.
08:48sobeltrue, true, but even more broadly those are all runtime performance characteristics aren't they? :)
08:50sobeli like repls because of interactivity. like, i'm mulling adding cider to a java project just so i can hop in the running app and prototype at runtime
08:55sobelhm, emacs seems to be having a hard time updating packages :(
09:03justin_smithsobel: as in, things break?
09:09fakedrakehmm, it's a bit strange that an empty string evaluates to true, especially for a lisp
09:12ticking_fakedrake: how so? empty string is not nil or false
09:12ticking_everything else is true
09:12ticking_even empty list
09:12ticking_,(boolean '())
09:12clojurebottrue
09:12fakedraketicking_: well I assumed an empty list would be nil
09:13ticking_fakedrake: yeah it's a bit confusing when comming from another lisp)
09:13ticking_:)
09:13fakedraketicking_: like in elisp and i IIRC scheme
09:14ticking_fakedrake: yeah, it's probably because clojure doesn't really revolve all around cons cells
09:15ticking_but it actually makes some if checks easier :)
09:15fakedrakeoh well.. I ll get used to it I guess
09:18ticking_fakedrake: thats the spirit ;)
09:20vpmfakedrake: anyway the empty string isn't nil in elisp nor in common lisp
09:21fakedrakevpm: hmm... (eq '() nil) => t
09:21vpmfakedrake: sure. But you were talking about string earlier :-)
09:22fakedrakevpm: ah indeed my brain got stuck
09:23fakedrakesorry
09:57fakedrakeI am trying to run a standalone clojure file with 'clj file.clj < input' and I am getting "cannot open <namespace< as an InputStream" (I use (slurp *in*) if it has anything to do with anything)
10:45justin_smithfakedrake: can you give a paste of the actual command line and the actual output in the shell?
10:49fakedrakejustin_smith: sorry i was typing *ns* instead of *in*
10:52justin_smithoh yeah, that would do that
10:52justin_smithhaha
11:20sobeljustin_smith: when it tries to update, it never returns from 'contacting host: elpa.gnu.org:80'
11:20justin_smithmaybe it was down? I see elpa right now
11:23sobeli see it too but emacs won't
11:31sobelor it returns and doesn't clear its display
11:31sobelcan't install cider though :/
12:09noncom|2are clojurebot and lazybot simply two different bots with 2 distinct areas of interest?
12:14Shayanjmjustin_smith: how do you debug why lein uberjar is hanging?
12:14Shayanjmit seems to be hanging on a file that I use to define functions to get data from APIs
12:14Shayanjmbut that file also doesn't def anything that requires immediate eval
12:15Shayanjmso not sure what's going on
12:25noncom|2Shayanjm: in such cases i usually put many things like (println "[A]") then (println "[B]") into the file between statements, so that i get the exact picture on where exactly does lein hang
12:26noncom|2you know, A, B, C, D... and so on
12:26ShayanjmRight
12:26noncom|2and then you see, did it finish reading the file, or did it stuck. if it finished the file - then there is something else somewhere
12:28noncom|2hmmm, i wonder, is it possible to write a macro, that takes the whole file body except the ns clause and interleaves it with such statements..
12:30razum2umdo I need to close! explicit all go-loop created channels here: https://gist.github.com/razum2um/d3255595a481ceae5745
12:36Danbell,(+ 1 1)
12:36clojurebot2
12:51justin_smithnoncom|2: a bisect macro even
12:53noncom|2wow
12:53noncom|2i have a question on lazybot btw
12:53noncom|2i am testing my own instance
12:53justin_smithnoncom|2: OK
12:54noncom|2and when i ask "seen" it says "seen quitting" but instead of date and time, it says "Read error: Connection reset by peer 1 minute and 27 seconds ago."
12:54noncom|2and the time is counting up
12:54noncom|2idk what's that
12:54justin_smith$seen rhickey
12:54lazybotrhickey was last seen quittingQuit: rhickey 4 weeks and 4 days ago.
12:55noncom|2wow this man even comes here
12:55justin_smithnoncom|2: that looks normal to me - "connection reset by peer" is a normal disconnect reason
12:56noncom|2ok but why does not it show time
12:56noncom|2or is that time - the time?
12:56noncom|2ah
13:22engblomWith Android 5.x and the move away from Dalvik, how is the performance of Clojure on Android?
13:24xphillyxHi all. Two questions. I'm relatively new to clojure and find myself using a lot of lets and letfns, often together. Is it more idiomatic to only use lets in this scenario and define the value as (fn [whatever] (…)) ? Secondly, are there any good resources for learning to write more idiomatic clojure?
13:24mfikesengblom: Not an answer to your question, but an alternative to consider in the future is React Native on Android, using ClojureScript.
13:26noncom|2xphillyx: personally i would avoid doing much
13:26noncom|2* doung much letfns
13:26noncom|2i mean, defns are better
13:27xphillyxI'm working on 4clojure problems at the moment, so defn isn't an option in this particular case, but that's good to know for the future.
13:28nicferriermy clojure workflow seems to prevent me making lots of files in a module.
13:28nicferrierbecause each one needs a new repl.
13:28nicferrierthere must be a better way to do that.
13:28justin_smithwhy a repl per file?
13:29nicferrierjustin_smith: because it's annoying switching a repl between namespaces
13:29xphillyxnoncom|2: would a good rule of thumb be to make things a defn by default? Even if the functionality is only needed in the particular function it is located in?
13:29justin_smithnicferrier: (in-ns 'some-other-ns)
13:29nicferrierwhat I'd really like is if I could have multiple repl buffers but connected to the one clojure instance.
13:30justin_smithnicferrier: but usually I just use require with a short alias
13:30justin_smithnicferrier: yes, that's possible easily with nrepl
13:30nicferrierjustin_smith: I know... but don't you find even that tedious.
13:30noncom|2xphillyx: i think that except for simple predicates - yes.
13:30nicferrierjustin_smith: I'm not using nrepl.
13:30justin_smithnicferrier: I actually don't switch out of user usually
13:30noncom|2but again, that's my personal opinion
13:31justin_smithnicferrier: I require my namespaces with an alias
13:31nicferrierjustin_smith: ok. fair point.
13:32justin_smithnicferrier: oh now I remember, you don't use nrepl for security reasons. But why not use lein repl locally? it doesn't need to be a project dep.
13:32noncom|2xphillyx: to avoid exposition of ns-private functions, you can just postfix them with "-"
13:32noncom|2like private-fn-
13:32nicferrierjustin_smith: that's not why I don't use nrepl. I just found nrepl to be a bit tedious.
13:33xphillyxnoncom|2: Oh that's neat. I like that.
13:33nicferrierjustin_smith: I just start a repl and have emacs manage the process better.
13:34oakwisednolen: Does cljs.test not have a way to get the report summary map anymore? CLJS-988 appears to have removed that functionality and (run-tests) and (run-all-tests) always return nil now?
13:34nicferrierjustin_smith: but yeah. I think not selecting a namespace is actually quite a good idea.
13:34nicferrierjustin_smith: when you eval from a source buffer how do you do that?
13:35justin_smithnicferrier: I either use (require 'some.ns :reload) or I copy paste some small snippet for testing it out
13:39nicferrierjustin_smith: so let me understand this... with :reload... you have a buffer, you save it and then you require :reload in your repl and you get the new defn. you don't C-x C-e it?
13:39justin_smithright
13:39justin_smithI mean C-x C-e might work? I don't use it.
13:39nicferrierjustin_smith: it does with cider and with my lein stuff.
13:40justin_smithnicferrier: yeah, I ditched cider
13:40nicferrierit's trivial to implement, you just send the code to the process.
13:40clojurebotTitim gan éirí ort.
13:40justin_smithnicferrier: if you are using cider you are using nrepl
13:40justin_smithbtw
13:40nicferrierjustin_smith: I'm not.
13:40nicferrierjustin_smith: I just told you what I did :-)
13:40nicferriereither way though... C-x C-e is simple to implement.
13:41nicferrierbut it kinda requires that you have a "current" namespace
13:41justin_smiththere's always a current namespace
13:41nicferrierI guess I could associate a namespace with a buffer.
13:41justin_smithI just keep user
13:41nicferrierjustin_smith: sure. but other than user I mean.
13:42nicferriercider seems to promote the same thing as I do... which is to switch the ns.
13:42justin_smithlast I checked that's what cider did, it had some elisp code to find and parse the ns form
13:42justin_smithit doesn't change the ns of your repl, it just makes sure code from that buffer is loaded with that ns current
13:42nicferrierit can do that... it doesn't do that for C-x C-e.
13:43nicferrierjustin_smith: ah, really? I hadn't noticed that.
13:43nicferrierI could easily do that. but I quite like the idea of your reload.
13:44justin_smithnicferrier: easy enough to attach the reload to a smart elisp binding I bet
13:44nicferrierwhen I reload an ns presumably that reload causes all the other ns' importing that ns to see the new one?
13:44justin_smitha key combo that does a save / reload of current buffer
13:44justin_smithnicferrier: exactly
13:45nicferrierjustin_smith: or even on change. check for sexp-correctness or something.
13:45nicferrierthat would promote a sort of error noticing flow.
13:45justin_smithsure, that could easily be an option
13:45nicferrierlike a flymake
13:45justin_smithright
13:45nicferrierhmmm. good ideas. thanks mate. I'm going to go and get some milk and have a think.
13:49xphillyxBtw that whole conversation you all just had totally reaffirms my decision to learn a lisp, that's so powerful to be able to just modify your editor to work for your particular workflow in the language you're doing.
13:50justin_smithxphillyx: the drawback is that it is just easy enough to have a perfect workflow that I spend time that could be productive time perfecting my workflow instead :)
13:51xphillyxjustin_smith: Just have to be careful to only scratch itches to when you can't bear them anymore. Not like that line is extremely blurry or anything...
14:05noncom|2how to make lazybot remember and recall facts?
14:06justin_smithnoncom|2: addtopic
14:06justin_smithnoncom|2: requires permissions by default
14:07justin_smithwell addtopic to add the fact, and help to recall it
14:08noncom|2how to authorize with lazybot? (my local one)
14:08justin_smithit's /msg bot-name login your-password
14:08justin_smiththe password is setup in the config file
14:09noncom|2also, why does it answer my "google" request in private, but does not answer in a public chat?
14:09justin_smithsounds like a bug?
14:09justin_smith$google lazybot google
14:09lazybot[LazyBot - Android Apps on Google Play] https://play.google.com/store/apps/developer?id=LazyBot&amp;hl=en
14:23constlHello, when you define a high-order function that takes one arguement and it has inside an inner function which also takes one arguement. How do you pass the argument for the inside fn ?
14:24justin_smithconstl: ##((fn [f x] (f x x)) list 42)
14:24lazybot⇒ (42 42)
14:24justin_smith,((fn [f x] (f x x)) + 42)
14:24clojurebot84
14:25amalloyconstl: you don't (indeed can't) use #() for both of them
14:26justin_smithamalloy: oh yeah, that's likely what they meant
14:26constlCan i paste a link to the code I'm having trouble putting my head around ?
14:26justin_smithsure, just no multi line pastes into this channel itself of course
14:26constlhttps://www.refheap.com/62d20d45b8b29609e99261c79
14:27justin_smiththat looks cromulent
14:28justin_smiththough the definitions of "username" and "balance" could be replaced by :username and :balance
14:28constlIt's a snippet from "Clojure in action"
14:28justin_smithOK
14:28constlI don't get the sorter-using function
14:28constlI see it takes one argument
14:28justin_smithright
14:28justin_smithand what does it return?
14:28constland its inside function also takes an argument
14:28justin_smithindeed it does
14:29justin_smithbut what does it do with that inside function?
14:29justin_smithit doesn't call it
14:29justin_smithit returns it
14:30justin_smith,(defn adder [x] (fn [y] (+ x y)))
14:30clojurebot#'sandbox/adder
14:30constljustin_smith: You are a wizard! Got it
14:30justin_smith,(def f (adder 42))
14:30clojurebot#'sandbox/f
14:30justin_smith,(f 12)
14:30clojurebot54
14:30justin_smithconstl: this is a common functional programming idiom
14:31justin_smithto make a function whose purpose is to create a new function that you would assumedly use more than once
14:34constl,(doc adder)
14:34clojurebotIt's greek to me.
14:34justin_smithconstl: for doc to work I would have needed to add a doc string
14:35justin_smithconstl: or did you not notice I defined it just now?
14:35constlmissed yeah
14:37constl,((adder 12) 12)
14:37clojurebot#error{:cause "Unable to resolve symbol: adder in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: adder in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: adder in this context", :at [clo...
14:37justin_smithconstl: it clears definitions regularly
14:38justin_smith,(defn adder [x] (fn [y] (+ x y)))
14:38clojurebot#'sandbox/adder
14:38justin_smithnow try
14:38constl,((adder 12) 12)
14:38clojurebot24
14:38justin_smithconstl: we have a special function for this, call "partial"
14:38benjyz1hello - simple question. I'm trying to write a macro which contains "with-open"
14:38justin_smith,(def adder' (partial +))
14:38clojurebot#'sandbox/adder'
14:39justin_smith,((adder' 21) 21)
14:39clojurebot#error{:cause "java.lang.Long cannot be cast to clojure.lang.IFn", :via [{:type java.lang.ClassCastException, :message "java.lang.Long cannot be cast to clojure.lang.IFn", :at [sandbox$eval143 invoke "NO_SOURCE_FILE" -1]}], :trace [[sandbox$eval143 invoke "NO_SOURCE_FILE" -1] [clojure.lang.Compiler eval "Compiler.java" 6784] [clojure.lang.Compiler eval "Compiler.java" 6747] [clojure.core$eval invo...
14:39justin_smithoops!
14:39justin_smithhaha, of course, it would not work in this case
14:39justin_smith,(defn adder' [x] (partial + x))
14:39clojurebot#'sandbox/adder'
14:39justin_smith,((adder' 21) 21)
14:39clojurebot42
14:40benjyz1(with-open [x (opencontext)]
14:40benjyz1...
14:40justin_smithbenjyz1: is it complaining about that x inside ` and binding namespaced symbols?
14:41benjyz1sth like that, yes. I'm new to macros, so struggling a bit
14:41justin_smithbenjyz1: ` always fully qualifies symbols
14:41benjyz1I know something should be quoted
14:41constlThanks justin_smith, it's clear to me
14:41justin_smithbenjyz1: to create bindings, add # to the end of the binding name
14:42justin_smithso replace all instances of x in your macro with x#
14:42justin_smithwhat creates a special generated symbol
14:42justin_smitha "gensym" if you will
14:42benjyz1>> Unable to resolve symbol: ctx in this context
14:42justin_smithbenjyz1: can you paste your code?
14:42justin_smithto refheap.com I mean
14:43benjyz1(defmacro srv [exp]
14:43benjyz1 (with-open [ctx# (zmq/context 1)]
14:43benjyz1 exp))
14:43justin_smithoh, yeah, you need `
14:43justin_smithI thought you were using that already
14:44justin_smithalso, please don't paste multi-lines here, use refheap.com
14:44benjyz1ok, thx
14:44benjyz1now I get Can't let qualified name
14:45justin_smithctx# should have fixed that
14:45justin_smithbut exp will need to be ~exp
14:46benjyz1trying. I also read that is something like gensym
14:47justin_smithyes, it is actually exactly that
14:47benjyz1https://www.refheap.com/99511
14:48justin_smithbut if you expect exp to refer to ctx, 1) that's usually a bad idea to write code that way, and 2) it will actually require weird quoting
14:48benjyz1I see. I basically want to avoid needing with-open everywhere
14:48justin_smithbenjyz1: for that code to work, exp needs to become ~exp, and ctx# needs to be ~'ctx
14:53benjyz1no luck. I guess I have to read through more examples to understand what is going on
14:53benjyz1thx
14:53justin_smithbenjyz1: you can see what ` does from the repl, outside a macro
14:55justin_smith,(let [exp '(mainreq ctx)] `(with-open [~'ctx (zmq/context 1)] ~exp))
14:55clojurebot(clojure.core/with-open [ctx (zmq/context 1)] (mainreq ctx))
14:55justin_smithbenjyz1: ^ as you can see, that expands to exactly the form you want
14:57benjyz1very cool
15:00justin_smiththere's also macro-expand, but I find the "convert the macro to a let block" trick is often useful for quick experimentation
15:00justin_smithyou just fix the contents until the output is the code you want to run
15:01justin_smithwhich not coincidentally works nicely with how macros are designed
15:04benjyz1thx again. I don't understand ~'ctx is this not unquote and quote at the same time?
15:04justin_smiththe trick is that it gives you back ctx as a symbol
15:05justin_smithand not what ` would create
15:05justin_smith`(ctx)
15:05justin_smith,`(ctx)
15:05clojurebot(sandbox/ctx)
15:05justin_smithsee what it does there?
15:05justin_smith,`(~'ctx)
15:05clojurebot(ctx)
15:06justin_smithwhat we're doing with the weird quote / unquote is disabling the sanity mechanism of `
15:06Lewixdoesnt netflix use clojure in their backend
15:06justin_smithbenjyz1: which is why I was saying above that this wasn't actually a good idea usually. The problem is that you can end up with code where thanks to weird macros you have no idea where the bindings you refer to are coming from.
15:07justin_smithit's really bad for referential transperency
15:07benjyz1ok, I see. in this case context is strongly tied to a namespace
15:07justin_smithbenjyz1: for example, if you had a bigger code base and I saw (mainreq ctx) I would be like "what the hell, what is ctx and where did it come from?"
15:07justin_smithright
15:07justin_smithbut that's the general danger
15:08justin_smithwhen abused systematically it can lead to really hard to understand code
15:08justin_smithso the default is to namespace qualify things
15:08benjyz1ok. I will have to experiment quite a bit. clojure is pretty awesome even without macros
15:08xphillyxLewix: Netflix has a very microservice-ey architecture and so they let teams pick their own languages for various projects to fit the problem domain. Some teams use clojure and Netflix has some clojure open source libraries published to their GitHub page.
15:13Lewixxphillyx: i thought 90% of their back end and most their services were in clojure
15:15Lewixxphillyx: I read an article where they were moving all their java sercices to clojure
15:15xphillyxI don't work for them and so I can't comment on numbers, but I do know they have a lot of Java in their open source offerings, much less clojure. That may or may not be indicative of anything.
15:16xphillyxMy understanding of their engineering culture though is that language mandates wouldn't fly.
15:32nicferrierjustin_smith: I never really have a problem balancing my tooling from my making.
15:32nicferrierat least, I dont think so.
15:46sobelgah.. i wanna love nginx-clojure but the latest release expects me to slide back to jvm1.6 and clojure 1.5.1
15:47sobeli had it running with 1.8 / 1.6 on an older version of nginx-clojure. this new release makes negative sense.
15:52justin_smithhttp://www.developermemes.com/wp-content/uploads/2014/09/Web-Developer-With-A-Job-Web-Developer-Without-A-Job-Meme.jpg
16:03programistojjvia google i'm not finding exactly what i'm looking for
16:03programistois there a clojure library which runs a function upon file changes?
16:03programistoas in moinotring a direcotry for changes and running when that happens?
16:04justin_smithyeah, theres a lib for that, one moment I contributed to it but I forgot the name
16:04justin_smithprogramisto: https://github.com/ToBeReplaced/nio.file
16:05programistojustin_smith: perfect, thanks
16:13oddcullyprogramisto: i interoped to commons FileAlterationMonitor
16:20arohnerare there any libraries for dealing with outstanding futures?
16:21arohnerI have a Component that I'm starting & stopping during each test, and the test code uses futures that depend on the component. For test reliability, I'd like to deref all futures before the component stops
16:26justin_smitharohner: how does dereffing a future affect reliability?
16:26arohnerjustin_smith: because then the component won't stop while the future is in-progress
16:27justin_smithaha, you don't want to restart the component if a future isn't done yet, so you want to wait on your futures
16:27justin_smithmakes sense
16:53not-much-ioThere is nothing in the clojure style guide about aligning indentatons of lets. To me it seems this would help readability. Is there a reason to not do it? example: https://gist.github.com/not-much-io/f62b4cab7239c7a67ae4
16:56justin_smithnot-much-io: the style guide I am thinking of actually does mention that, and suggests not doing it
16:58justin_smithnot-much-io: oh, I must be misremembering, or it was changed
17:02not-much-iojustin_smith: I would think this should have been mentioned. I'll search the commits. But any idea why this would be discouraged? Due to less room for longer lines probably? Unless using a mix of indenting and not, which is probably not good.
17:06not-much-iojustin_smith: Here is the discussion https://github.com/bbatsov/clojure-style-guide/issues/10
17:11justin_smithahh, so I was remembering correctly, at least partly so
17:11cflemingnot-much-io: Diff noise is the main argument against that. That said, Cursive supports it (and aligning map values), and most people like it. I'm not sure it should be made a canonical recommendation though.
17:14not-much-iocfleming: Yes I see now, as discussed in the issue thread. I'll keep that in mind, while I use it.
17:15cflemingnot-much-io: As someone pointed out, a decent diff tool should allow you to hide the whitespace-only changes. You'll still get changed lines in git reports etc though.
17:17not-much-iocfleming: Noted. :)
18:12nicferrierI am writing a program that needs to talk to an artifact repository.
18:12nicferriercan I reuse code from lein that does the auth and stuff?
18:15nicferrierI guess boot would be ideal here.
18:40__chrishello
18:40__chrisi am in my first 20 minutes of clojure
18:41__chrisIm struggling with how I would do a rand-int within a range.
18:41__chrisIm guessing I can do (pseudo code) while < 1 rand-int 7
18:42__chriscan someone help me with this?
18:45Shayanjmjustin_smith: I think you mentioned using ssh -L to connect to a remote REPL which gets spun up inside of -main
18:45ShayanjmFor some reason, if I try running the jar file, I can't connect to the tunnel
18:45ShayanjmI can only connect if I run it with lein run (therefore can't nohup and persist outside of session)
18:45dnolen`,(rand-nth (range 1 7))
18:46clojurebot4
18:46ShayanjmIf I try connecting when running the jar, I get "channel 4: open failed: connect failed: Connection refused". Any ideas?
18:49Glenjaminsounds like your repl isn't actually listening
18:49ShayanjmGlenjamin: but I can connect when it's run via lein run
18:49ticking_dnolen`: say, is there a reason behind core.match not handling multiple inputs simply as a vector match?
18:50ShayanjmAm I supposed to do something special in my -main other than (defonce server (start-server :port 7888))?
18:50dnolen`ticking_: I don't know what you're asking
18:50ticking_dnolen`: I'd be interested in fixing it and making the behaviour more consistent but wonder if its intentionally
18:52ticking_sorry, (match [1 2] _ "hi") will fail with "Pattern rows must be wrapped in []", while (let [x [1 2]] (match x _ "hi")) returns "hi"
18:53ticking_dnolen`: I wonder if that's intentional
18:53dnolen`ticking_: the second is sugar, the vector is always implicit
18:53ShayanjmGlenjamin: What's weird is that it runs through the rest of the program
18:53Shayanjmbut i can't connect to the repl which is def'd at the very top of -main
18:53dnolen`ticking_: and no I'm not interested in this change, much higher
18:53dnolen`priority things that need fixing.
18:54ticking_dnolen`: well, seemed like an easy PR for getting familiar with the codebase :D
18:56ShayanjmBut I can connect to it fine if I use 'lein run' instead of 'java -jar <jarfile>'
19:09justin_smithShayanjm: the problem is that you have the repl defined at the top level in a def
19:09justin_smithShayanjm: you need to start the server inside -main
19:10justin_smithusing a def to create a server is a top level side effect, and that doesn't play nicely with distributed jars
19:11justin_smithShayanjm: oh wait, the defonce is inside -main?
19:12justin_smithdefonce inside a function is not a great idea (the var is created as soon as the function is compiled), but it should have worked if you did it that way
19:36cflemingnicferrier: You could use pomegranate, which is what lein uses under the hood
19:38cflemingnicferrier: You could also check out pallet/alembic which I think is similar - I'm not sure what distinguishes them
19:39cflemingnicferrier: Both use aether under the hood I believe
19:40cflemingAm I correct in thinking that the only way you can create a closure in Clojure (ba-doom *tschh*) is with fn or reify?
20:13Shayanjmjustin_smith: yeah defonce is in main
20:46justin_smithcfleming: let also make a closure
20:48cflemingjustin_smith: Really? How does that work?
20:48cflemingjustin_smith: let doesn't define a class
20:49justin_smithcfleming: it closes over the bindings so that any of them that escape scope can refer to one another
20:49justin_smithcfleming: maybe I'm not getting something here
20:50cflemingjustin_smith: Can you give me an example of what you mean?
21:00justin_smithcfleming: come to think of it, I guess you would need a function to escape the let block to access any of the values.
21:00justin_smithor equivalently a protocol method or defmethod etc.
21:00cflemingjustin_smith: Right, the let block itself doesn't create the closure
21:01justin_smithfor some reason I always thought of the let as being the thing that creates a closure, but of course you need a function of some sort to access it
21:01cflemingYeah, the let block itself isn't actually doing the capturing, just providing the locals to capture
23:13mindbender1Is there a way to remove a name from a namespace?
23:21mindbender1Got it. ns-unmap
23:21LaVidaPortlandExample: (ns-unmap *ns* 'foo)
23:21mindbender1thanks.