#clojure logs

2016-02-05

02:12macrolicioushow/can I access clojure language documentation inside emacs? ex. for 'recur' ?
02:12justin_smith,(doc recur)
02:13clojurebotexcusez-moi
02:13justin_smithmacrolicious: anyway, there is a function clojure.repl/doc that is often helpful
02:13justin_smiththere's some mode that makes it pop up automatically as part of cider
02:14macroliciousok, thx
02:43scottjmacrolicious: C-c C-d d when on a function name, if using cider. recur is a special form, so may not work like most functions/macros.
02:43macroliciousoh man, bam!
02:43macroliciousthanks, that's sweet.
02:44macroliciousevery day, learning emacs is like finding something cool you didn't know you owned
02:45ridcully_the same is true for vi, but there you discover it by typos
02:48macroliciousto be honest, I've found a few things by typos so far in emacs, too ;-)
02:49macroliciouswell, key bindos
04:11kungiAnyone else experiencing problems when trying to connect to nrepl after updating to version 0.2.12?
04:11kungiI get the following error: SocketException The transport's socket appears to have lost its connection to the nREPL server
04:13adam____I am using 0.2.12 and it seems to be working fine
04:14adam____are you using cider?
04:15kungiadam____: I tried using cider and lein repl :connect
04:15adam____yeah im not going to lie, the setup is a bit painful the first time
04:15adam____do you have a .lein/profiles.clj
04:15adam____{:repl {:plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]]
04:15adam____ :dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}
04:16adam____those two version generally work for me
04:16kungiadam____: Ok wait a second. Let me clarify the problem a bit more. I have a working development setup. In my app I am using (nrepl/start-server) to start an nrepl server.
04:17kungiThis one I cannot connect to any more
04:17adam____hmm, sorry I don't know
04:18adam____maybe check the github page and see if somebody had a similar issue?
04:18kungiadam____: tools.nrepl does not use github issues as far as I see
04:19adam____http://stackoverflow.com/questions/20088908/problems-connecting-to-a-clojure-nrepl-with-ring-compojure
05:01kungiDowngrading the tools.nrepl version from 0.2.12 to 0.2.6 solved the problem. I will try to find the most recent working version.
05:11CaptainLexI am trying figwheel on a fresh lein install on the flappy bird demo and running "lein figwheel" hangs after dependencies are met
05:11CaptainLexWell, I don't know about hags, but it doesn't output anything
05:13CaptainLexScratch that, lein is just misbehaving inside repos
05:20CaptainLexThis is bonkers:
05:20CaptainLex'$ time lein version'
05:21CaptainLex'Leiningen 2.6.0 on Java 1.8.0_72-internal OpenJDK Zero VM'
05:21CaptainLex'real 0m23.441s'
05:21CaptainLexIt takes 23 seconds just to output version
05:21CaptainLexWhat could possibly be causing lein to be so slow?
05:21ridcully_-SNAPSHOT plugins?
05:21MJB47_takes 4 seconds for me
05:21MJB47_which while not as extreme, is still odd
05:22jeayereal0m2.064s
05:22MJB47_is there a hidden progress bar we can disable?
05:22CaptainLexI can see why I would interpret this as hanging for anything more complex
05:22CaptainLexI'm going to try...restarting, I guess?
05:22CaptainLexBe right back
05:27CaptainLex_Well, restarting definitely did not help
05:27MJB47_out of interest, what hardware are you running?
05:28MJB47_lets say cpu ram ssd/hdd to keep it short
05:29CaptainLex_MJB47_: Nothing super respectable- it's a Chromebook. ARM processor, 2 gigs of RAM, 16 gigs of SSD
05:31CaptainLex_MJB47_: Just running up Clojure's JAR on Java doesn't take hardly any time at all, for what that's worth
05:32MJB47_thats to be expected
05:33MJB47_i was just wondering why it took you 20 something and me 4 seconds
05:33MJB47_i have a laptop i7, which might explain it
05:33MJB47_but why it would take so long is rather odd
05:34CaptainLex_MJB47_: Yeah, 36 seconds to run lein help is more than one can reasonably chalk up to hardware issues, at least to my mind
05:34MJB47_indeed
05:35CaptainLex_My guess is that something in the environment is out of date, but I grabbed lein from the website and it should be pulling in everything it needs except Java itself
05:35CaptainLex_And I think Java's a good version: 'openjdk version "1.8.0_72-internal"'
05:38MJB47_im using Java 1.8.0_25 Java HotSpot(TM) 64-Bit Server VM
05:39CaptainLex_Wow, it just took it 10 seconds to tell me "fighwheel" was not a task. It is probably too much to hope that I can get anything done under these circumstances. What's the best way to go about reinstalling lein and its dependencies?
05:45CaptainLex_Oh look, the figwheeling has picked up! I guess for the purposes of the project I need to do I can just be patient
05:45CaptainLex_and just not worry too hard about doing any real dev until I get home to my real computer
06:16gfdhjfbad uncle is inserting his penis into 10 year old girl's vagina causing her to moan in agony because they both are niggers
07:01hyPiRionamalloy_: ping
07:12bcoburnI have a project with three namespaces, call them A, B, and C. A requires B and C. I have a single that I want to have available in all 3 namespaces. What's the easiest way to accomplish this?
07:13hyPiRionbcoburn: a single what?
07:14bcoburnph
07:14bcoburnfunction
07:15bcoburntyping is hard
07:16hyPiRionThe easiest way to solve that is to make a new namespace D (usually it's called utils) and require that in all the namespaces.
07:16hyPiRionBut you can also pass the function in as a parameter if that's suitable for your use case.
07:18bcoburnI think I'll do the new namespace plan, just sad at having to make another file etc for ~4 lines of code
07:20hyPiRionyeah, it feels painful at first. It'll be better if/when you end up having more utility functions though
08:49python476hi there
08:52python476cider github page mention C-c C-i to inspect value, I believe they meant C-c M-i (using cider 0.10.2, maybe the main page document a previous version though)
08:53shiranaihitowhat's this about: "IllegalArgumentException: interface c2d.struct.IJavaize is not a protocol" -- "IJavaize" is very much a protocol.. i'm trying to extend it to a Record in another namespace
08:54python476maybe I should "complain" on github ~_~
08:55hyPiRionpython476: yeah, I guess that's just a typo
08:55python476aight
08:55python476it's not an life critical feature, but as any documentation typo, it makes you question your sanity
09:03hyPiRionheh
09:14dysfunso has anyone tried using emscripten with clojurescript?
09:14dysfun(to use a c library from clojurescript)
09:59dysfunjustin_smith: i've changed several projects to using group.package instead of package.core . are you happy now, free-speech-hater? ;)
11:03kwladyka_justin_smith ha i understand loggers! thank you for you help and patient. Anyway what do you think about https://github.com/ptaoussanis/timbre to use for logs?
11:50python476hi again
11:51python476any idea why lein check would hangs at `Compiling namespace ...` ?
11:51python476the codebase is two tiny files
11:53python476almost no cpu usage, no io ~_~;;
11:55dysfunhow long has it been hung?
11:55python476forgot some effectul network code.. I noobed
11:55python476dysfun: minutes
11:55dysfunwell that's not supposed to happen, obviously
11:55dysfunbut if you know your code did it... :)
11:56python476the price of free lisp code, I tested a few stuff on the go, and forgot to comment / delete http requests...
12:02blackbird_hi, maybe i'm screwing up my thinking here, but if i've def'd a map, and then call a macro with that def'd map, how do i get that map in the macro? is that possible?
12:02python476no more idl-ing but still a good minute, odd
12:04blackbird_here is an example: https://www.refheap.com/114516
12:17amalloyhyPiRion: ?
12:28rhg135blackbird_: macros run at compile-time and thus only gets a symbol instead of the map
12:31blackbird_rhg135: so is it impossible to get the value of a symbol in a macro? shouldn't something that is def'd be there at compile time?
12:34rhg135For eagerly using it with the unquote, no. But if you return a form that operates over the value at runtime, that would work
12:36blackbird_rhg135: ok, thanks for the info!
12:37rhg135,(do (def x 1) (defmacro y [i] `(do ~(inc i) nil)) (y x))
12:37clojurebot#error {\n :cause "clojure.lang.Symbol cannot be cast to java.lang.Number"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.Symbol cannot be cast to java.lang.Number"\n :at [clojure.lang.Numbers inc "Numbers.java" 112]}]\n :trace\n [[clojure.lang.Numbers inc "Numbers.java" 112]\n [sandbox$y invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$y invoke "NO_SOURCE_FILE" 0]\n [clo...
12:38rhg135,(do (def x 1) (defmacro y [i] `(do (inc ~i) nil)) (y x))
12:38clojurebotnil
12:40blackbird_rhg135: ahh, i can see how that works, still unclear as to why x the value of x there isn't known at compile time, guess i need to read up on what happens when.
12:44rhg135It might be known, but the macro gets a symbol. You can do resolve, or other such things, to look it up manually. But that probably is frowned upon.
12:47blackbird_rhg135: ok thanks
13:00WorldsEndlessIs my suspicion correct that {:keys} can't be used twice in the same let statement?
13:00justin_smithWorldsEndless: no
13:00WorldsEndlesshmm... I guess I need to continue debugging
13:01hiredmanhttp://clojure.org/reference/special_forms#binding-forms
13:01justin_smith,(let [{:keys [a b c] {:keys [e f g]} :d} {:a 0 :b 1 :c 2 :d {:e 3 :f 4 :g 5}}] [a b c e f g])
13:02clojurebot[0 1 2 3 4 ...]
13:03WorldsEndlessDoh! yet another case of an upload coming through ring that appears to be a map, but is actually a string
13:03justin_smithWorldsEndless: sounds like you need a wrap-json middleware or something
13:04WorldsEndlessTransit is what I'm going for...
13:57KevinCorcoranIs EuroClojure going to happen this year?
14:11arcatanI'd assume so
14:11python476so, I learned about (shutdown-agents)... that's what was blocking lein check
14:11python476also (prn ...) isn't threadsafe
14:12justin_smithpython476: OK, nothing in your namespace should make shutdown-agents neccessary
14:12LucidTortoiseAnyone here uses Light Table as their primary editor?
14:12justin_smithdef shouldn't have side-effects
14:12python476justin_smith: toying with (future ...)
14:12hiredmanpython476: that means you are launching new threads (agents or futures) as a side effect of code loading, that is generally a bad practice
14:12justin_smithpython476: yeah, that should be inside your -main or an init of some sort
14:13python476sure, but I just I put everything inside functions, and only -main is running them
14:13justin_smithpython476: then why would you need shutdown-agents in order for lein check to return?
14:13justin_smithlein check doesn't run -main
14:13hiredmanpython476: either you didn't do that, or some library you are using didn't
14:14python476right sorry, previously, these expressions weren't in (defn...), and blocking lein check
14:14justin_smithOK, that makes more sense
14:14hiredmanah
14:14python476I thought it was a bad timer variable or something but now I see that was normal behavior for (future...) without (shutdown-agents). right ?
14:14justin_smithright
14:15python476cool
14:15hiredmanprn, println, print, etc don't do any synchronization on anything
14:15python476I put side effects into my source code. I'm down to php3 level
14:15python476hiredman: thanks, I assumed they were, scrambled output is a rare thing to witness :)
14:16justin_smithpython476: (def outcome (launch-missiles))
14:18python476yum
14:23python476ha, concurrency is so fun http://stackoverflow.com/questions/5181367/is-defn-thread-safe
14:56binjuredis there a simple/idiomatic way to chain-filter a collection into different groups? for instance, i have a collection where certain predicates need to come before others and filter out values that would have matched later predicates but belong in the former group, if that makes any sense. it's like sifting, maybe?
15:06irctcCan I read in a file using clojurescript?
15:11dnolenirctc: ClojureScript has not I/O facilities you have to rely on whatever the JS environment you're targeting provides
15:11dnolenside note there is a #clojurescript specific channel
15:11dnolens/not/no
15:16ridcully_there is noe there ?!
15:20rhg135any reason why my `lein repl` would time out on a slow fs if target is on a fast one (it doesn't write elsewhere afaik).
15:21rhg135as an aside launching a clojure.main repl with that classpath loads really fast. so I assume lein is loading something.
15:21ridcully_network?
15:21rhg135yes, sshfs
15:21rhg135target is symlinked to my home dir
15:26rhg135hmm, apparently if I require seesaw.cor., a dep, java segfaults
15:29python476wasn't there a lein plugin to avoid clojure bootstrapping time ?
15:30rhg135no, but there is LEIN_FAST_TRAMPOLINE
15:30python476I don't wanna be a circus employee
15:31justin_smithpython476: you can not use lein, then you'll notice that most of that "clojure bootstrapping time" was actually lein startup
15:31ridcully_python476: are you anti circi?
15:32rhg135and ragequit life when trying to gater dependencies by hand
15:32python476ridcully_: I'm somehow noobish on clojure (especially the ecosystem)
15:33python476justin_smith: that's also possible indeed, let's go standalone
15:33rhg135hey, trampoline repl starts. justin_smith, I'm fairly certain the splash is a lie
15:33justin_smithpython476: there's a middle ground, where you let lein calculate deps once, then you reuse those deps without running the whole lein thing again
15:33rhg135nrepl timesout normally
15:34justin_smithpython476: that is what that FAST_TRAMPOLINE option mentioned above does
15:34rhg135mhm
15:34justin_smith~faster
15:34clojurebotfaster is https://github.com/technomancy/leiningen/wiki/Faster
15:34justin_smithsee above for elaborate documentation of these issues ^
15:35rhg135idk why it's not the default
15:35python476justin_smith: thanks, also, any reference doc about clojure dev without lein (should I dig clojure's website ?)
15:35justin_smithrhg135: there's subtle issues, for example I've seen "lein trampoline repl" eat stack traces that are shown with "lein repl" on startup
15:35rhg135if you do want to excise lein for production, you'd make a uberjar
15:36justin_smithpython476: "java -jar clojure.jar" will give you a repl, "rlwrap java -jar clojure.jar" gives you a nicer repl
15:36justin_smithclojure.jar can be found via maven, or the clojure.org site
15:37python476justin_smith: this part I knew, I meant running namespaced -main(s), tests
15:37python476(sorry, I sounded impatient)
15:37rhg135or lein trampoline repl lying about nrepl
15:37python476I'm actually reusing lein .m2 cache
15:38justin_smithpython476: java -cp clojure.jar:src clojure.main -m my.ns; java -cp clojure.jar:src:test clojure.main -m my.ns.test
15:38python476ha, -m
15:38python476of course u_u
15:38justin_smithyeah, the output of lein cp can be cached and provided to the -cp arg
15:39python476it's indeed a tad more reactive
15:40python476I can reuse emacs+make to wrap things up and run with a shortcut
15:40python476rhg135: I'll take a loop at that a bit later
15:41justin_smithpython476: this is really what trampoline with lein does, when you have the LEIN_FAST_TRAMPOLINE env var
15:41rhg135^
15:42rhg135I just set it in my .zshenv
15:43rhg135I can just unset it if I ever need the default
15:43python476no value attached to LEIN_FAST_TRAMPOLINE, just its existence is enough ?
15:43justin_smithpython476: the value doesn't matter, but I think it needs to be non-empty
15:44python476LEIN_FAST_TRAMPOLINE='#golang'
15:44justin_smithlol
15:44rhg135heh, that works
15:46python476well, it's not uber faster
15:46python476but I've learned a few things
15:46phorseis compojure-api meant to be a standalone server sort of deal, or is it typically grafted onto a regular application server?
15:46python476gonna replenish electrolytes, my scales are all cracky
15:47rhg135lein trampoline run -m clojure.main
15:48justin_smithpython476: trampoline is faster after the second time
15:48justin_smithpython476: the first time it's still caching
15:48python476justin_smith: I'm not that noobish
15:48justin_smithphorse: the great thing is it doesn't care
15:48python476I did run it a few time, it's a cache thing
15:48python476I'll forgive you, here https://pbs.twimg.com/media/CZLC9yPW0AArfnl.png
15:48justin_smithit can be standalone (a few different embedded server options), or it can run in a container
15:48clojurebotNo entiendo
15:49python476(Super No entiendo)
15:53koshmaris the clojure a good lang for scientific computing - solving PDE in parallel. are numerical libraries mature? if so, what is the best tutorial to start picking numerical oriented clojure? (I have no experience with java or lisp, however I do know haskell if it helps)
15:55justin_smithkoshmar: core.matrix has a protocol for numeric stuff, with a few implementations you could check out
15:55justin_smithkoshmar: honestly clojure can be tricky because of auto-boxing issues, but core.matrix can help with that
15:55justin_smith*good numeric performance in clojure
15:57koshmarwhat about maturity of core.matrix?
15:58koshmarcould I start learn core.matrix skipping clojure tutorials, or at least learning very basik clojure
16:01rhg135why is '(try (clojure.core/require (quote nil)) (catch java.lang.Exception t__11836__auto__))' in the init script lein makes??
16:06justin_smithkoshmar: I think so, seeing as you have haskell experience
16:07justin_smithkoshmar: some of the exercises on 4clojure.com might help you figure out what's what
16:07justin_smithkoshmar: core.matrix has been around a while, at the least it's the most mature clojure option for numerics
16:08justin_smiththe implementations are not all the same - there's tradeoffs for performance vs. safety, but it should be easy enough to swap them out
16:34algalHello, chaps.
16:34algalI've got a possibly dumb question.
16:34algalIf I want to trigger some side-effect only when a swap! succeeds in modifying the value of an atom, what's the recommended way to do that?
16:34algalShould I put the side-effecting code inside the update function I am passing to swap? Or should I add a watch to the atom?
16:35algalActually, now that I think on it, a watch would not work, because the parameter for the side-effecting function also depends on the call to swap. Hmm.
16:36hiredmanswap! always succeeds
16:36algalSo this suggests I should put the side-effecting fn call inside the update fn which I pass to swap!, but that seems odd, because I think of that function as something that should be pure as the driven snow.
16:36hiredmanin that swap! retries the function you give it until the compare and swap succeeds
16:36algalRight, sorry. I meant that I am passing an update function to swap that sometimes returns a modified value and sometimes returns an unmodified value
16:37algalAnd I only want to call the side-effect when that update function is returning a modified value.
16:43justin_smith(let [a @v b (swap! v f)] (if (= a b) ... ...)) ?
16:43python476is 6 seconds normal for LEIN_FAST_TRAMPOLINE ?
16:43justin_smithpython476: what task
16:44python476lein run, still that same small clj script
16:44justin_smithrepl booting to user? way too long, repl booting to your ns? depends on what your deps are
16:44justin_smithlein run, depends what you code is doing of course
16:44python476a tiny 10 iteration loop + prn
16:45python476and no, i'm not running on a 386 :)
16:45justin_smithyeah, 6 seconds is way too long there
16:45justin_smithpython476: how are you running it?
16:45python476sad trampoline
16:45justin_smith"lein trampoline run" ?
16:45python476ha ffsssss
16:45justin_smith?
16:46python476down to 1s
16:46python476I'm facepalming hard
16:46justin_smithoh did you forget the part where you actually trampoline?
16:46python476I thought the env var was enough for lein to trigger the rest
16:46python476I hope you appreciate fixing noobs typing before they understand things
16:47python476while we're at that, what's your favorite(s) book / tutorial (on any part of clojure)
16:47justin_smithclojure applied is great
16:48python476real problems no 'yet another language reference' ?
16:49justin_smithit gets a little deeper into how to do clojure right than most books I've seen
16:49python476very nice
16:49python47625$ e-book
16:50justin_smithpython476: and while still learning, http://conj.io is a great thing to leave open at all times while developing
16:50justin_smithand to skim occasionally so you don't forget the awesome stuff in core
16:51python476yeah, even if 'tiny' it's still large in some way
16:52phorseI'm trying to use compojure.api.sweet, but none of the symbols defined in that library are being recognized by the compiler. I've got the correct dependency in my project.clj and in my namespace declaration, is there anywhere else I should check?
16:52algaljustin_smith: So the thing about that idea << (let [a @v b (swap! v f)] (if (= a b) ... ...)) ? >>, is that there could be changes in v in between the binding (a @v) and the binding (b (swap! v f)] (if (= a b) ... ...)) . Right?
16:52justin_smithpython476: even now I sometimes accidentally re-implement some function from core just because I forget it's there
16:52justin_smithalgal: yes, this is unavoidable
16:53justin_smithperhaps you want a ref
16:53justin_smithrefs can do coordinated changes, and this sounds like something you would need coordination to be sure of
16:53algalBut I am not trying to produce coordinate updates. I'm trying to produce a side-effect if there is a certain kind of udpate. I'm only updating the one atom.
16:54python476justin_smith: that's how fun clojure is
16:54algalhmm..
16:54justin_smithalgal: but you need coordination in order to know whether your swap! actually changed the object or not
16:55algalWell, the update function which I pass to the swap knows if it changes its arguments, so it knows. So that was why I was wondering about sticking the side-effecting call in there. But that seemed odd..
16:55justin_smithalgal: (dosync (let [a @v b (alter v f)] (= a b))
16:56justin_smiththat actually allows you to know if the altering function changed the value
16:56justin_smiththere's no equivalent with an atom (or at least nothing simple)
17:03amalloywatchers?
17:04aztakg'd evening all.
17:04amalloyseems like exactly what algal wants, not refs
17:04justin_smithamalloy: oh, yeah, I guess a watcher could do that, since it gets the before and after
17:04amalloyyou can also do it by hand on an atom, by changing what the atom stores: instead of just storing the current value, you can make it store both the previous and current value in a tuple
17:05amalloythat means you have to change all readers and writers, but it can be done without the coordination of a ref
17:05justin_smithamalloy: "I hate the other people who use this value anyway"
17:05aztakanyone "going to" clojure-remote next week?
17:05justin_smithoh, right
17:05amalloy(honestly you can do a surprising amount with atoms if you make them into tuples)
17:06justin_smithsimplifying update logic, at the cost of an extra lookup with every usage
17:06justin_smith(every non-update usage)
17:07algalamalloy: ah, interesting.
17:08amalloybut if your goal is to just sometimes do a side effect based on what happened in the swap, that's exactly the case watchers were designed for
17:10algalamalloy: So I need the parameters I pass to my side-effecting function to be different for different calls to swap! So that makes it harder to use a watcher.
17:10justin_smithalgal: why would that matter?
17:10algalBut I guess I can (again) pass more information into the atom, like a tuple, just to expose that extra piece of info to the watcher.
17:10sdegutisjustin_smith: What's your favorite Clojure HTTP library?
17:10justin_smithalgal: the extra parameters change how the side effect should happen?
17:11phorseWhen I use (dir compojure.api.sweet) I get a list of 18 functions. When I check the api docs for compojure.api.sweet, they list 21 functions with only some overlap between the two. Is the documentation out of date?
17:11justin_smithsdegutis: I kind of hate all of them right now sorry, I'll let you know if I start liking one
17:11algalyes. But the extra parameters are not strictly needed to compute the change in the atom's state.
17:11sdegutis:D
17:11sdegutisjustin_smith: Any reason?
17:12justin_smithsdegutis: my app needs to suck up the internet and the internet is terrible
17:13sdegutis:D
17:13sdegutisI just need to interface with MailChimp so I'm gonna stick with clj-http.
17:17amalloyjustin_smith: re the internet being terrible: today at lunch my company had joel spolsky come give us a talk entitled "how to have nice things" (in contrast to the usual "this is why we can't have nice things")
17:17justin_smithamalloy: interesting
17:18justin_smithI've learned that scraping data for urls and trying to check those urls en mass can lead to lots of stupid stuff (who would have guessed, right?)
17:19amalloyno kidding. even if they are all valid urls to sites with actual data
17:19amalloywhy do you want to slurp up the whole web, again?
17:19justin_smithamalloy: we do social analytics, our client wants to know what's happening regarding a certain topic, finding and following rss and blogs from social media is part of this
17:20justin_smitheg. figuring out the hot content, and part of that is figuring out two people were talkign about the same content even if via two different clickbait sources...
17:21justin_smithamalloy: and then some guys' gonna be lick "this is my rss feed" and it's actually like an xml bomb or something
17:22amalloyyep
17:22lockdownamalloy: material things?
17:22lockdownyou guys are not giving in to slack? ;)
17:23justin_smith~slack
17:23amalloythe talk was about why creating sustainable internet communities is hard, and what kind of stuff you should expect to have to do if you want to try it
17:23clojurebotIt's greek to me.
17:23amalloyi think slack is great. it's a way to trick people without neckbeards into using an irc-like
17:24aztakThis is good: https://drive.google.com/file/d/0B8ZX1RoWHuiJSnZHZFJqOERqaDg/view
17:26rhg135I didn't know I had a neckbeard
17:27aztakwhere's the largest Clojure community then, on IRC or on Slack? (They are obviously not exclusive)
17:28rhg135I've never been on slack, but it seems to be quite active
17:29justin_smithaztak: 4859 signed into clj slack, usually about 800 here
17:29aztakjustin_smith: so metrics says "Slack" then? :)
17:29aztaktoo bad, I've just learnt so configure ERC in Emacs :(
17:30justin_smithalso too bad because I don't trust slack, and prefer irc
17:30lockdownjustin_smith: of those 4859 normally less than 500 are online
17:31lockdownso this channel is bigger!
17:31justin_smithlockdown: oh, where's that number?
17:31rhg135and 'hipsters'
17:31aztakhehe
17:32lockdownjustin_smith: click in the number
17:32lockdownslack is so laggy, don't know if it is because I use firefox instead of chrome
17:32rhg135probably
17:33Bronsacan we just stop talking about slack? :)
17:33rhg135it's horribad on some js
17:34lockdownBronsa: be we feel slighted
17:34lockdown:P
17:35aztakeither way - it's great that there is a big and diverse Clojure community.
17:35aztakFor neckbeards *and* for hipsters!
17:35aztak:)
17:36rhg135yay neckbeards :)
17:36rhg135s/neckbeards/clojure/
17:37lockdownwhen you do in-ns in a repl to switch to an existing ns, the ns macro of that ns is not parsed right? you have to use ns functions in the repl to replicate the ns macro?
17:37lockdownjustin_smith: so yeah, at any given time there are more users here
17:37rhg135nope, the repl just switches to it
17:37rhg135doesn't even have to exist
17:37justin_smithlockdown: the ns macro is a wrapper for in-ns
17:38justin_smithlockdown: you probably want to make sure you have required your ns before doing the in-ns
17:38justin_smithor use ns, yes
17:38amalloy(ns foo) is no better than (in-ns 'foo)
17:38justin_smithlockdown: also, solution to a common problem (clojure.core/refer-clojure)
17:39justin_smithsaves you from the situation of having switched to an empty ns that doesn't even have access to clojure.core
17:39rhg135I just stay in user and alias it
17:39lockdownok thanks
17:39rhg135keeps dev utils handy that way
17:40lockdownyeah, looks staying in user and using require seems the way to go
17:41lockdownso if you require a ns from user, all the ns macro of the namespace is loaded?
17:41rhg135I wish CIDER had a better way to do that than typing it manually in the repl
17:41rhg135yes
17:41lockdownand attached to the repl?
17:41lockdownok
17:42justin_smithrhg135: doesn't cider have a "load this file" keystroke?
17:42rhg135I may as well use inf-clj if not for the debugger
17:43amalloyrhg135: of doing what?
17:43rhg135yeah, justin_smith, I meant to send '(alias <something> <ns name>)
17:43justin_smithahh
17:43lockdownjustin_smith: yeah, I hit that problem already (the refer-clojure) ;), the repl only loads clojure.core for user
17:44rhg135when the ns name is 50 chars long it gets tedious
17:44amalloyrhg135: i don't understand what tedious task you're doing that you can't fix with ten seconds of elisp
17:44amalloyor by using require :as instead of require + alias
17:44lockdownjustin_smith: makes sense since user is only for trying things out
17:45amalloy,(macroexpand-1 '(ns foo))
17:45rhg135I'm new to emacs though, amalloy, and elisp is greek to me
17:45clojurebot(do (clojure.core/in-ns (quote foo)) (clojure.core/with-loading-context (clojure.core/refer (quote clojure.core))) (if (.equals (quote foo) (quote clojure.core)) nil (do (clojure.core/dosync (clojure.core/commute (clojure.core/deref (var clojure.core/*loaded-libs*)) clojure.core/conj (quote foo))) nil)))
17:45amalloyit's nothing to do with the user ns
17:45amalloy(ns) expands to code that calls (refer-clojure)
17:45lockdown~emacs
17:45clojurebotemacs is an out-moded belief system
17:45lockdown~cursive
17:45clojurebotcursive is that thing what colin wrote
17:46justin_smith~ed
17:46clojureboted is the standard editor!
17:46rhg135when cursive doesn't require X call me
17:46lockdownamalloy: yeah, ns does the refer-clojure implicitly
17:46justin_smithrhg135: it'll run without X on osx or windows no problem :P
17:47rhg135a real masochist uses a steady hand and a needle, justin_smith
17:47rhg135not ed ;)
17:48rhg135justin_smith: true heh
17:48lockdown~vim
17:48clojurebotGesundheit!
17:48lockdown~atom
17:48clojurebotI don't understand.
17:48rhg135~editor
17:48clojurebotHuh?
17:48tolstoyUgh. Having the worst lock with eastwood.
17:49amalloyi just realized: do they have something like clojurebot in the slack channel?
17:49lockdowntolstoy: clint is a tough guy
17:49justin_smithamalloy: yup
17:49justin_smithand on slack you don't even need one liners
17:49tolstoylein eastwood: Caused by: java.lang.ClassNotFoundException: leiningen.core.project$reduce_dep_step
17:49amalloyrequiring one-liners is a feature, to stop people pasting giant essays
17:49justin_smithtolstoy: oh man, clearly reduce-dubstep was a terrible idea
17:50lockdownamalloy: yeah, you normally see walls of code there
17:50rhg135I have a char limit on mine
17:51rhg135and if you trip the alarm you get kicked/banned
17:51tolstoyjustin_smith: Yeah. What's even calling it? Oy. ;)
17:55tolstoyEastwood is broken using Lein 2.6.0? Oy. I don't even care anymore. If my code doesn't bomb, it's perfect!
17:55rhg1352.6.0 is out??
17:56tolstoyYep.
17:57tolstoyhttps://groups.google.com/forum/#!topic/clojure/XlROLH76yNg
17:57justin_smithtolstoy: "lein upgrade 2.5.3" is also an option
17:57justin_smith2.6.0 also broke lein-ring
17:57tolstoyOr downgrade?
17:58tolstoyYeah, but I was having issues with eastwood anyway (a protocol with two many methods?). And there are 62 issues. I'll come back next year.
17:58justin_smithtolstoy: the command is "upgrade", ¯\_(ツ)_/¯.
17:59tolstoyEven when the announcement says, "As usual, for those who manually installed, `lein upgrade` will pull in
17:59tolstoythe latest. `lein downgrade 2.5.3` will back it down to the previous
17:59tolstoyversion if you run into any issues."
17:59justin_smithoh, well why remember two commands when one command works
17:59sdegutisHi.
18:04tolstoyIndeed!
18:06SomelauwI'm a bit of a beginner. When using Emacs, I get the following warnings on start-up https://pastee.org/xn98p telling me nREPL is outdated. How do I get this up to date?
18:06justin_smithSomelauw: https://github.com/clojure-emacs/cider-nrepl
18:07justin_smiththat has comprehensive instructions for making sure you have the right version
18:07lockdownSomelauw: make sure cider and nrepl-cider versions are in sync
18:08lockdownSomelauw: also, use the latest version of leiningen, which pulls nrepl 0.2.12
18:08lockdownso cider doesn't complain
18:08justin_smithlockdown: as a plugin, cider overrides nrepl version anyway
18:09Somelauwso might just updating lein be enough?
18:09justin_smiththat won't fix your cider-nrepl version, no
18:09rhg135can someone explain the advantage of nrepl middleware over just sending code to eval?
18:09lockdownjustin_smith: yeah, that's another way to do it
18:09Somelauwrhg135: probably autocompletion
18:10rhg135you can def. autocomplete without it.
18:10lockdownSomelauw: if you installed cider from melpa you also need nrepl-repl master branch
18:10rhg135afaik, neither cursive nor fireplace need middleware
18:10justin_smithrhg135: how would you get the auto-complete results without nrepl?
18:11lockdownerrr nrepl-cider I mean
18:11justin_smiththe idea is to get the data from clojure itself, and nrepl lets you separate that request from the data going to your repl window
18:11rhg135I don't mean no nrepl, although you can, I mean without custom middleware
18:11justin_smithOK
18:13SomelauwInstead of hard-coding the version number as "0.10.2" would it be wise to use something like :latest?
18:14justin_smithSomelauw: then it will break when it's newer than your cider version
18:14justin_smith(or might)
18:14rhg135justin_smith: https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L634
18:14justin_smithbetter to leave it explicit so you can upgrade the two halves together
18:15justin_smithrhg135: yeah, I had misunderstood what you were saying, I just meant nrepl was useful for sending completions to elisp while having a separate repl not full of those things
18:15rhg135ah, indeed.
18:16rhg135maybe the tools.nrepl readme would help
18:17SomelauwMy cider version is even 0.11.0-snapshot
18:18seangroveHey all, what's the clojure equivalent of `jse = (JavascriptExecutor)wd;` ?
18:18seangroveNot sure about the (...) casting part
18:19rhg135the only thing I can think of is bandwith
18:19justin_smithseangrove: since our bindings are not typed, we don't need casts
18:20seangrovejustin_smith: That's what I thought, but this object is missing a method, thought that might be related
18:20seangroveProbably just an outdated dep though - thanks
18:20justin_smithseangrove: how would telling the compilar "treat x as a y" make a method show up on x?
18:21amalloyjustin_smith: well, that *is* a thing you sometimes need to do, and there is a way to do it
18:21justin_smithamalloy: oh?
18:21amalloythe usual place this comes up is when trying to submit a function to an executorservice
18:21amalloywhich is overloaded to take either a Callable or a Runnable, and functions implement both
18:21justin_smithahh, and you would handle that with a hint, right?
18:21amalloyright
18:23rhg135what is clojure.core/cast for then
18:23justin_smithrhg135: read the doc
18:23justin_smithit's a silly function
18:23justin_smith,(doc clojure.core/cast)
18:23clojurebot"([c x]); Throws a ClassCastException if x is not a c, else returns x."
18:24justin_smithrhg135: I mean maybe that's what you want, but most times when people ask how to cast something in clojure that is not the functionality they are asking for
18:26rhg135so, it's more of a specialized assertion (not actually an assertion)
18:27rhg135basically says x is a c or die
18:27justin_smithright
18:28rhg135cool, that's good for defensive code
18:32justin_smithyeah, an assertion would throw an error (no way to stop things, app dies now), but it throws an exception (something might be catching class casts and dealing with them I guess)
18:32lockdownSomelauw: then you need 0.11.0-snapshot for nrepl-cider
18:32Somelauwlockdown: I put a new version of cider-nrepl in profiles.clj. Now it complains that my refactor-nrepl is still out of date.
18:33amalloyjustin_smith: assertions are perfectly catchable too, if you want
18:33amalloyjust catch AssertionError
18:33amalloyit's just...a pretty bad idea
18:33rhg135I just throw WorldIsDoomedBecauseValueIsNotRightError
18:33Somelauwlockdown: https://pastee.org/bgsy2
18:33justin_smithfair enough, but error family vs. exception family carry different implications
18:34rhg135then I watch it all burn to the ground, metaphorically of course
18:35amalloyi think if you catch Error you deserve to have it non-metaphorical
18:35lockdownSomelauw: I haven't use refactor-nrepl but looks like you have sync isssue again, between refactor-nrepl and clj-refactor
18:36rhg135it doesn't even subclass Error, it's Throwable
18:37SomelauwI not sure if I need refactorings, but autocomplete doesn't work either or not as I expect (which is just pressing tab)
18:37lockdownSomelauw: if you are just learning can you do without the refactor package?
18:37lockdownremove it so you don't get the warning
18:38rhg135but for real, code with catch Throwable is terrifying
18:38SomelauwI can ignore the warning. My priority is figuring out how autocompletion works.
18:38lockdownSomelauw: did you read the auto-completion docs for cider?
18:39justin_smithrhg135: the classy thing would be (throw (Throwable. "Updog"))
18:41lockdownclojure doesn't need autocomplete, you should keep your modules and in your head ;P
18:41rhg135justin_smith: hopefully that's not from your code base
18:41justin_smithrhg135: heh, I just made it up
18:41rhg135good, good
18:42Somelauwa bit hacky, but I manually ran company-mode, and it worked after the second launch
18:42lockdownerr your modules small I mean
18:42justin_smithlockdown: auto-complete can save you manually typing (dir some-stupid-ns) or going and opening the source file
18:43rhg135,(doc dir)
18:43clojurebot"([nsname]); Prints a sorted directory of public vars in a namespace"
18:43rhg135I didn't know that one
18:44justin_smithdir+doc+apropos are a nice combo
18:45justin_smith,(apropos #"^ns")
18:45clojurebot(clojure.core/ns clojure.core/ns-aliases clojure.core/ns-imports clojure.core/ns-interns clojure.core/ns-map ...)
18:45Somelauwthe docs say (global-set-key (kbd "TAB") #'company-indent-or-complete-common), but I think I would only want this in clojure-mode or something, so I can bind tab differently in other filetypes.
18:47amalloySomelauw: you can "globally" add it to the keymap for a particular mode. or you can, in the hook for a particular mode, use local-set-key instead
18:48amalloysee https://github.com/amalloy/dotfiles/blob/master/.emacs.d/init.el#L40-L55 for an example of the latter
18:50amalloy(define-key slime-repl-mode-map (kbd "<C-return>") nil) ;; is an example of the former
18:50justin_smithhaha, amalloy's a slimer
18:50amalloyi unbound C-RET for some reason or other
18:50justin_smithwhich is a term I just made up for people who still use slime, I hope it sticks
18:51amalloynever upgrade. never surrender
18:52Somelauwamalloy: thanks
18:52lockdownjustin_smith: sometimes I think we just obsess to much with tooling
18:53justin_smithlockdown: it's an evolutionary thing, our ancestors who did not obsess about tooling never compiled and shipped
18:54amalloythat's what a public dotfiles repo is for. although i'm surprised my default-frame-alist is the thing you'd want to steal
18:54amalloylike pls, i wish more people would steal my rebinding of C-x C-c
18:54lockdownjustin_smith: I bet amalloy would be just as productive with slime as with cider
18:55lockdownamalloy: was using spectacle (an osx window resize thing) for setting the size of emacs
18:55lockdownamalloy: do you code on a laptop? 42 seems low
18:55justin_smithlockdown: I was making a bad evo-psych joke
18:56amalloyi have vision problems
18:56amalloyso the font size is jacked way up, and the resolution way down
18:56lockdownjustin_smith: oh ;)
18:56amalloyi'm going to an Evo Psych concert this weekend
18:56lockdownamalloy: I see
18:57justin_smithlockdown: I gave up on cider myself, and just use clojure in a repl, sometimes lein repl and sometimes a jar launched with java
18:57amalloyyou and hiredman should start a club
18:57justin_smithso beleive me I have plenty of skepticism about tooling
18:57hiredmanhmmm?
18:57justin_smithamalloy: I totally would but he has had me on ignore for years
18:58amalloypeople who advocate use of clojure from a repl rather than editor integration
18:58lockdownjustin_smith: yeah, if the buil-in repl had readline support I wouldn't even use lein sometimes
18:58amalloylockdown: rlwrap
18:59justin_smith~rlwrap
18:59clojurebotexcusez-moi
18:59justin_smith~rlwrap is good enough sometimes.
18:59clojurebotOk.
18:59lockdowninteresting
19:00justin_smithrlwrap is great for making any unixy thing that expects lines of text more usable
19:00justin_smithrlwrap ed is like 1% of the way to being vim
19:01lockdownheh
19:02lockdownjustin_smith: inf-clojure hits a sweet spot I guess
19:03justin_smithI might try it one of these days
19:12arrdemI should get a CIDER tatoo
19:12justin_smitharrdem: tattoo upgrades suck, wait until it goes stable
19:14arrdemnah man -SNAPSHOT for lyfe
19:14arrdemwhat's the point of living if you aren't on the bleeding edge
19:15amalloyhaha, i was jsut playing around with gist.el, and M-x gist-list breaks because i apparently have too many gists
19:15amalloyif: Variable binding depth exceeds max-specpdl-size
19:16arrdemhah
19:19amalloyi tried tracking it down, but the implementation is apparently a maze of generic functions or something and i'm no good at elisp
19:21justin_smithand elisp is no good at generic functions
19:21justin_smithso there we go
19:27tolstoyIf a component only appears once in a system map, is there some reason Component would call start twice?
19:28justin_smithtolstoy: if you had your system in an atom and used swap! to start it and the calls overlapped
19:29tolstoyNo, not doing that. Very weird. Starts two instances.
19:30justin_smithtolstoy: I don't see how it would do that
19:32tolstoyWeird. The component recvs messages on a topic, and, sure enough, it's doing it twice. So it's not a spurious log thing.
19:32justin_smithtolstoy: what if your whole system got started up twice?
19:33tolstoyWhy wouldn't the other recv comps duplicate? Hm.
19:33tolstoyHeh. Just checked to see if I didn't name two records the same thing.... nope.
19:34justin_smithwhat about copy/paste error giving two names to instances of the same record?
19:34Somelauwi got emacs to freeze
19:35tolstoyThat's what I just checked for. If so, can't find it.
19:35justin_smiththere's a few ways to do that, a bunch of them involve very long lines
19:35tolstoylein clean, etc.
19:40justin_smithtolstoy: can you share a paste of the system map?
19:40justin_smithor, rather the system/using call etc.
19:41tolstoyhttps://gist.github.com/zentrope/72820037e77062607f44
19:45justin_smithI'm more familiar with system/using rather than inline component/using calls, but if component/using works like I expect that looks fine
19:46tolstoySeems to have worked in lots of place.
19:47justin_smithtolstoy: what about writing your component such that starting the same one twice won't do anything? you could put a key in the system map that marks whether it's started
19:47tolstoyI'll give that a shot. I've just removed a bunch of deps to see if somehow that affects it, but, no....
19:47justin_smith(start [component] (if (:this-started component) component (do .... (assoc component :this-started))))
19:48justin_smithsomething like that
19:49justin_smithnext step if that doesn't help is a delay or promise outside start that ensures the component is a singleton I guess
19:49tolstoyYeah. I wonder _why_ the problem is there. I guess I'll have to try to repro with a minimum case, if I'm up for some madness.
19:49justin_smithmaybe even throw an exception if starting after already started, and then see from the stack trace who is fucking up
19:50justin_smith(def started (promise)) (start [component] (assert (not (realized? started))) ... (deliver started true) (assoc component ...)))
19:51tolstoyInteresting. Setting a :starting? prop, it actually gets set twice.
19:59tolstoyHeh. Renamed the file "foo.clj": solved.
19:59justin_smithwat
20:00SomelauwI'm getting nuts if some "Unmatched bracket or quote" error
20:01tolstoySlowly renaming things back to see what's what.
20:02Somelauwfound it, I had an unmatched ] instead
20:03tolstoyInteresting. If my component is in health.clj, or the ns ends with .health (my-app.component.health) I see the prob.
20:03justin_smithSomelauw: many editors have tools that make this much easier to find and fix
20:04justin_smithtolstoy: that's weird and bad
20:04tolstoyYep.
20:04justin_smithsomething clashing on the classpath?
20:05tolstoyI don't see how. Moving the health.clj file to another part of the tree.
20:06Somelauwjustin_smith: I was told emacs is the most potent editor for clojure. I do have rainbow-coloring and such. I was looking for a round bracket and all my round brackets matched, it was a square bracket missing.
20:06SomelauwSorry for using bracket and parenthesis interchangeably.
20:08justin_smithSomelauw: if you use highlight parens your mismatching parens would be a distracting / obvious color. Even with rainbow parens they should have been.
20:09justin_smithdelimiters, I like the word delimiters (which I forgot to use just now)
20:11tolstoyjustin_smith: Okay, we can restore our faith. It's because I inadvertantly had two loggers (myapp.component and myapp.component.health) defined in logback.
20:11justin_smithhahaha
20:11justin_smithso it was only starting once, but logging too much
20:11tolstoyjustin_smith: Given that, it "seemed" as if I was processing dual copies of the message.
20:11tolstoyRight.
20:11justin_smith(dec loggers)
20:11tolstoyThat's why the :started? scheme didn't work.
20:12SomelauwOk, red isn't yet distracting for me
20:12justin_smithSomelauw: yeah, maybe you can change the color
20:12justin_smithmaybe set a fast blink on the face :P
20:40Somelauwemacs + cider freeze yet again :-(
20:41justin_smithSomelauw: what makes it happen?
20:42Somelauwjustin_smith: I'm not sure. I think "Mark set" is the last thing I read in the minibuffer.
20:42justin_smithSomelauw: what happens if you hit Control-g a bunch of times?
20:43justin_smith(while it's locked that is)
20:43SomelauwI've already killed it. I'll try next time.
20:44justin_smithSomelauw: anyway, in the future you could try turning on debug-on-error and then using Control-g when it locks up and the debugger should give an idea of what emacs was trying to do, and at least the cider folks could do something with that info maybe
20:53scottjjustin_smith: Somelauw: I think you want M-x toggle-debug-on-quit (not error) for C-g to bring up debugger.
20:55justin_smithscottj: I assumed that after the quit an error would be exposed
20:55justin_smithscottj: but yes, that is more direct I guess
20:56justin_smithscottj: I find debug-on-quit annoying because I often quit from things...
21:52KamuelaClojure becomes so easy on the eyes after a while
22:06rhg135Most lisps do
22:10stardivinerI want to update CIDER-nrepl dependency version. (Try new feature cider-enlighten-mode). How to update it?