#clojure logs

2015-05-28

00:00auxcharYeah, I think that'd be cheating.
00:00justin_smithdelays and promises being like reference types, but only bindable once
00:01justin_smithauxchar: technically the def exists before its body is evaluated (to allow recursive functions) but I wouldn't count on correctness
00:01justin_smithit's not an intended usage
00:01justin_smith,(def l (list 1 2 l))
00:01clojurebot#'sandbox/l
00:01justin_smithl
00:01justin_smith,l
00:01clojurebot(1 2 #object[clojure.lang.Var$Unbound 0x7a27d8b4 "Unbound: #'sandbox/l"])
00:01justin_smithyeah
00:02justin_smithso l exists, but it got caught at the wrong time
00:02auxcharExcept the list isn't holding itself, it's holding the var containing itself.
00:02justin_smithauxchar: in clojure we don't really do the "tying the knot" thing you can do in haskell thanks to their pervasively lazy evaluation
00:03justin_smithauxchar: yes, that's in fact the only option
00:04auxcharIt would work with a LazySeq, I would imagine.
00:04justin_smitheven then it would be a hack
00:04auxcharOtherwise a mutable list would be needed.
00:04justin_smith,(def l (cons 1 (lazy-seq l)))
00:04clojurebot#'sandbox/l
00:04justin_smith,l
00:04clojurebot(1 1 1 1 1 ...)
00:05justin_smithI'd still consider that a hack, though it works
00:05auxcharYeah.
00:07auxcharDoes its behaviour change if l is defined before some part of it's fully evaluated?
00:07auxcharErr, redefined.
00:08justin_smithwell, that's what happened the second time I evaluated (def l ...) just now - it had a previous value that was not used at all
00:08justin_smithdef creates the var (or changes it to unbound) before the body is run
00:10auxcharBut if you partially evaluated l, passed its value to somewhere else, and redfined l, would it change it's behaviour in the other place?
00:10justin_smithit depends, sometimes not unless you passed the var somewhere else
00:11justin_smithsometimes the other code would just seamlessly see the new l
00:11justin_smithby passed the var I mean passed #'l instead of l
00:11justin_smith(as an arg)
00:12justin_smithanyway, I'm out for the night
00:12auxcharAlright, good night.
00:12auxcharI wanna play with this some more.
00:15auxchar(def l (list 1 (lazy-seq l)))
00:15auxchar,(def l (list 1 (lazy-seq l)))
00:15clojurebot#'sandbox/l
00:15auxchar,(l)
00:15clojurebot#error {\n :cause "clojure.lang.PersistentList cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.PersistentList cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval49 invoke "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval49 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang.Compiler eval "Compiler.java" 6792]\n [clojure.lang.Compiler eval "...
00:15auxchar,l
00:15clojurebot(1 (1 (1 (1 (1 (1 (1 (1 (1 (1 #))))))))))
00:19auxchar,(do (def l (cons 1 (lazy-seq l))) (take 3 l) (def m l) m)
00:19clojurebot(1 1 1 1 1 ...)
00:19auxcharOk, so that does work.
00:20auxcharCool.
00:20auxcharWait.
00:20auxchar,(do (def l (cons 1 (lazy-seq l))) (take 3 l) (def m l) (def l nil) m)
00:20clojurebot(1)
00:20auxcharNope, it's not what I'm looking for.
00:21auxchar,(do (def l (cons 1 (lazy-seq l))) (take 3 l) (def m l) (def l 4) m)
00:21clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
00:22auxcharOk, I think I get what's going on.
00:37url-is source for clojurebot online somewhere?
00:40tolstoyIs it this one? https://github.com/Raynes/lazybot or this one? https://github.com/hiredman/clojurebot ?
00:41tolstoy,(+ 2 3)
00:41clojurebot5
00:41tolstoy.(+ 2 3)
00:48auxchar,((fn [f n] (f f n)) (fn [f n] (f (+ n 1))))
00:48clojurebot#error {\n :cause "Wrong number of args (1) passed to: sandbox/eval49/fn--50"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (1) passed to: sandbox/eval49/fn--50"\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" 32]\n [sandbox$eval49 invoke "NO_SOURCE_FILE" 0]\n ...
00:48auxchar,((fn [f n] (f f n)) (fn [f n] (f (+ n 1))) 1)
00:48clojurebot#error {\n :cause "Wrong number of args (1) passed to: sandbox/eval77/fn--80"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (1) passed to: sandbox/eval77/fn--80"\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" 32]\n [sandbox$eval77$fn__80 invoke "NO_SOURCE_FILE"...
00:49auxchar,((fn [f n] (f f n)) (fn [f n] (f f (+ n 1))) 1)
00:49clojurebot#error {\n :cause nil\n :via\n [{:type java.lang.StackOverflowError\n :message nil\n :at [clojure.lang.Numbers$LongOps opsWith "Numbers.java" 423]}]\n :trace\n [[clojure.lang.Numbers$LongOps opsWith "Numbers.java" 423]\n [clojure.lang.Numbers$LongOps combine "Numbers.java" 419]\n [clojure.lang.Numbers add "Numbers.java" 128]\n [clojure.lang.Numbers add "Numbers.java" 3644]\n [sandbox$eval1...
00:49auxcharYay.
00:53auxchar(#(%1 %1 %2) #(%1 %1 (+ %2 1)) 1)
00:54auxchar,(#(%1 %1 %2) #(%1 %1 (+ %2 1)) 1)
00:54clojurebot#error {\n :cause nil\n :via\n [{:type java.lang.StackOverflowError\n :message nil\n :at [clojure.lang.Numbers$LongOps opsWith "Numbers.java" 423]}]\n :trace\n [[clojure.lang.Numbers$LongOps opsWith "Numbers.java" 423]\n [clojure.lang.Numbers$LongOps combine "Numbers.java" 419]\n [clojure.lang.Numbers add "Numbers.java" 128]\n [clojure.lang.Numbers add "Numbers.java" 3644]\n [sandbox$eval2...
00:55auxcharThat ought to make for some interesting production code. ^_^
00:58TEttingerauxchar, I'm surprised that even can run
01:05WickedShelldoes anyone know when the estimated release for the next version of core.async is? I saw that poll! was avalible when reading the documentation, which is exactly what I need, only to find out that it isn't in the released version
01:18tolstoyseancorfield: Lots of commits on clojure/tools.clj since the last release. Any idea when 0.3.2 might be cut? It's been about one year.
01:18tolstoyseancorfield: Yours was the last. ;)
03:26wei_came up with this function, nil-safe (defn nil-safe [f] (fn [x & args] (if x (apply f x args)))), kind of like fnil but when you just want the fn to return nil when the first input is nil
03:28tslockeIs there a core function like group-by but doesn’t group values - i.e. you get the original values from the collection, not a vector of them, as the map values
03:29wei_is there something like this in core? or is this unecessary? the use case that prompted it was casting values in a map, etc (update-in attrs [:wingspan] (nil-safe double))
03:29wei_tslocke: then it wouldn’t be a group would it? could you give an example
03:31justin_smith,(map #(update-in % [:wingspan] (fn [n] (some-> n (* 2)))) [{:wingspan 1} {}])
03:31clojurebot({:wingspan 2} {:wingspan nil})
03:31tslockeno it wouldn’t be a group, i.e. you have a vector of maps where each has a unique key e.g. :name, and you want a map from the names to the original maps
03:32tslockeI realise it’s a one-liner but just wondered if there is a canonical solution
03:36justin_smithtslocke: it's an easy thing to derive from group-by, and no it is not built in
03:37justin_smith,(into {} (for [m [{:a 0} {:a 1} {:a 2}]] [(:a m) m]))
03:37clojurebot{0 {:a 0}, 1 {:a 1}, 2 {:a 2}}
03:38justin_smithno need for group-by actually, now that I think about it
03:38tslockeright
03:38tslockethanks
04:11otfrommorning
04:24dstocktonmorning
05:00studentrobI'm stuck. I need a clojure punching bag. "LazySeq cannot be cast to java.lang.String" http://pastebin.com/WBHD4Gz0
05:03studentrobnm got it i think
05:31luxbockstudentrob: I'd use a cond to get rid of the nested if's in dist
05:32studentrobluxbock: ok thx
05:53studentrobAre there any IDEs that let you step through clojure code? I'm using Light Table , which is handy, but it seems to only show values from the last loop iteration
05:59luxbockstudentrob: Cursive has a Clojure debugger
05:59studentrobok.. trying to figure out how to download that
05:59luxbockso does Emacs with CIDER these days, though you'll have to use the snapshot version
06:00cflemingstudentrob: https://cursiveclojure.com/userguide/ has the details
06:05studentrobThanks, got it
07:27DerGuteMoritzhello everybody, I was wondering whether there is a reason other than "nobody got around to it, yet" for the compiler to not to do arity checks on direct calls?
08:00TimMcPerhaps because vars can change? :-/
08:02BronsaDerGuteMoritz: eastwood does that
08:04TimMcclojurebot: there's |an| eastwood for that
08:04clojurebotOk.
08:10crocketI'm close to the end of braveclojure.com
08:10crocketbraveclojure is a good material for a beginner, but it leaves me as a starter.
08:31justin_smithcrocket: have you tried http://4clojure.com at all?
08:33crocketjustin_smith, yes
09:55DerGuteMoritzTimMc: ah, mutability strikes again ... that would probably explain it
09:55DerGuteMoritzBronsa: thanks, good tip
10:16zerokarmaleftcrocket: if I were you, I'd think about building a very small project from scratch
10:41kwladykai want use selmer and i want have templates in directory resources/view, i have to use something like (parser/set-resource-path! (clojure.java.io/resource "view")), but how can i add this change of path to work with lein ring server?
10:42kwladykacrocket, watch Clojure Inside Out, really :) i am also beginner and this video helped me more then anything else
10:43kwladykacrocket, after that do http://www.4clojure.com/problems - first i ignored it but later i found it is very usefull
10:43justin_smithkwladyka: a) how would lein ring server make this different? b) consider not using lein ring server unless you are deploying to a container like beanstalk
10:46kwladykajustin_smith, a) just i have to run this code to change the path, it is obviously how to do that with lein run in main function, but i don't know where to put this code when using lein ring server. b) so do you recommend use main and main-dev function and in main-dev function add middleware for ring to reaload code in each reload page instead of lein ring server?
10:47justin_smithkwladyka: I'd recommend using the setup with makes things most seamless to transition to production.
10:47kwladykajustin_smith, because the main reason why i use lein ring server is reloading sources during development
10:47justin_smithif you are not deploying to a container, better to use -main (launched from inside a repl) during development
10:47justin_smithwrap-reload is easy to add
15:44sdegutisI'm just really surprised at the lack of anyone ever admitting or agreeing to admit that Clojure has some really dumb decisions.
15:45xemdetiasdegutis, I think part of that is because it's a lisp
15:45TimMcandyf_: And if serenity fails, there's always alter-var-root.
15:45andyf_I've heard a few times that there are design decisions the core team has regretted, but don't have any links to examples. I don't know whether the name of contains? is one of them.
15:46justin_smithI think most of the big disappointments in clojure that people mention are disagreements on the efficiency/intuition balance, where almost always clojure is doing the more efficient or simpler to implement thing, and people are asking for the more intuitive thing
15:47andyf_sdegutis: Wait, being on #clojure for more than a week, you _must_ see examples of people complaining about Clojure quirks all of the time. How can you say that?
15:47justin_smithandyf_: clearly he wants to see more complaining
15:48xemdetiaplease add complain quota to topic
15:49sdegutisandyf_: those are newcomers -- I'm talking about experienced Clojurians
15:49andyf_sdegutis: amalloy, Bronsa, cemerick, hiredman, technomancy, how many examples do you want?
15:49sdegutisandyf_: I'm just surprised old-timers actually *defend* dumb decisions in Clojure as much as they do.
15:50sdegutisI haven't once seen any of them admit that something in Clojure is dumb.
15:50chouserwell, hang on. There's a difference between defending and explaining, though I can see they could be easily confused.
15:50andyf_sdegutis: I don't know if they have used the word "dumb", but they have plenty of criticism for aspects of Clojure
15:50sdegutisthat may be fair
15:51amalloysdegutis: i think someone on andyf_'s list complains about something in clojure like once a day
15:51chousersdegutis: "What sucks about Clojure" -- an accepted talk by cemerick at Clojure/West 2012
15:51justin_smithandyf_: I'd add ambrosebs to that list too, he has some very good criticisms. arrdem has some similarly motivated ones.
15:51chouser...though his list was pretty different from what mine would have been.
15:52andyf_justin_smith: I knew I was not being exhaustive. That just spurted out without my having to think about it :)
15:52sdegutismaybe I'm just on IRC at all the wrong times
15:52justin_smithandyf_: not correcting you, just wanted to mention some other notables
15:52Bronsasdegutis: I don't defend decisions at all. you'll often see me complaining about stuff i don't like about clojure
15:52justin_smithsdegutis: a bunch of this is happening on twitter, technomancy isn't even in this channel any more
15:53andyf_sdegutis: Complaining about what you don't like only gets you so far (and it isn't very far).
15:54justin_smithsdegutis: there's a difference between accepting that "contains?" ends up being misleading, and the expectation that "contains?" would ever change. This is a language that values backward compatibility very highly.
15:54andyf_I'll agree, contains? is a name that misleads many people, and in hindsight, if I had designed Clojure, I would have picked a different name. But inside that statement I intentionally put a very misleading suggestion: I could _not_ have designed Clojure anywhere near as well as it was.
15:55andyf_And I like it so well in spite of any criticisms, that it is my preferred language for hobby programming.
15:56sdegutisjustin_smith: I guess that makes sense. Though it would make way more sense if clojure.core was released separately from the Clojure compiler.
15:56justin_smithsdegutis: explain?
15:57sdegutisThen the core lib wouldn't have to worry so much about backwards compatibility. People could upgrade to Clojure 1.8 and it would have so many cool new compiler thingies, but still be on clojure.core 1.5 because they can't upgrade to 1.6 or anything.
15:57ToxicFrogandyf_: what would you have named contains?
15:57justin_smithI would name it has-key?
15:58justin_smithsince it only applies to associative lookup
15:58sdegutishas-key? is so intuitive
15:58sdegutisyes, very yes.
15:58sdegutiscontains? would then be for any kind of collection loojup
15:58sdegutisoh man, I vote justin_smith as new BDFL
15:58justin_smithlol, you would regret that
15:58sdegutisnevar
15:58andyf_ToxicFrog: OK, you caught me in a second misleading suggestion in my statement, which I did not intend when I wrote it. I actually don't have any preferred name for contains? I've heard has-key? suggested
15:58ToxicFrogHeh.
15:59andyf_(I've heard it suggested before justin_smith's statement above -- I wasn't reading while typing my last line :)
16:01justin_smithandyf_: I often have no idea whether I am remembering something, vs. making something up, vs. simply being totally wrong
16:01andyf_justin_smith: Welcome :)
16:03andyf_Anyone can be BDFL of their own language, even one very much like Clojure (as long as they release it under Clojure's EPL license if they rely on its code, and as long as they call it something besides Clojure)
16:03andyf_For very reasonable reasons, that doesn't happen all that often.
16:03sdegutislol "reasonable reasons"
16:03justin_smithreminds me of andylisp - which was in many ways not very reasonable
16:03sdegutisoh English, go home, you're drunk
16:04sdegutisI once wrote a Lisp in C. It was not very fun. C is not very good.
16:04puredangerI'm happy to admit that there are many things I find to be annoying or unfortunate in Clojure
16:04sdegutisI would rewrite it but I can't think of a decent language to rewrite it in.
16:04ChaunceyWriting a scheme in haskell is a lot of fun though :)
16:04puredangerBut I have found that to be true of every lang I've ever
16:04puredangerused
16:05Chaunceypuredanger: yes, I feel the same way. Clojure's ups far outweigh the downs though
16:05sdegutisChauncey: no, the whole experience from beginning to end would be embittered with the sober realization that there are always going to be much smarter ways of writing it than you (general you) currently are
16:05puredangerI once told Rich that Clojure was the least worst language Id ever used and he took it as the compliment it was
16:06Chaunceysdegutis: haha, that is very true
16:06Chaunceypuredanger: well put ;)
16:06sdegutisI'm starting to think I may be disillusioned.
16:07justin_smithsdegutis: you're always looking for the shortcut that will fix all your code problems
16:07justin_smitha decent amount of that is good - you don't get trapped with bad tools
16:07andyf_I am reminded of Weird Al Yankovic's song "Close, but No Cigar". I still chuckle every time I listen to that song.
16:07sdegutisjustin_smith: haha you sure? I'm using a testing framework whose auto-rerun feature is so broken that even though I still use it, I have to restart the process every time I make a change
16:08sdegutiswhich reminds me
16:08sdegutisWhat are the modern testing framework choices? Have they changed at all since 2013?
16:08sdegutis(or have the existing choices improved significantly?)
16:08hellofunk near beginning of Joy of Clojure, it is said that Om is inspired by ideas of Brett Victor and Alan Kay. Does anyone know more specifically what ideas?
16:08andyf_clojure.test Midje expectations are the main ones I know about. I've only used clojure.test
16:08sdegutishellofunk: there's a video of a talk by brett victor, watch that
16:09sdegutisandyf_: ok
16:09andyf_random generation of test cases via test.check may be new since 2013 in Clojure
16:10hellofunksdegutis: i've seen that famous video but am not convinced it is the idea mentioned in the text
16:10justin_smithsdegutis: see, your attempt to contradict my point reinforced it. It's not a criticism, I just notice this theme in your questions here.
16:10andyf_oh, and it isn't really so much the random generation that is cool there, but the automatic shrinking to find smaller failing test cases after it finds a big one. But that was originated in Haskell. Definitely worth reimplementing in every language, though.
16:14sdegutisjustin_smith: right on
16:15sdegutisjustin_smith: the main cause of that theme is probably that I'm pretty much convinced at this point that Haskell solves most problems I have with Clojure, but my job is a Clojure app so I'm kind of left in a weird situation
16:15justin_smithcue clojure the infomercial - sdegutis fumbles with his keyboard, looks imploringly at the camera "there has to be a better way!"
16:15sdegutishahah
16:15justin_smithhaha, maybe haskell the infomercial then
16:16sdegutisBut I also have no plan to start trying to convince everyone else that Clojure sucks and that we should all be using Haskell -- that won't get me any closer to using Haskell at work.
16:16sdegutisSo I'm just sort of.. in this weird middle place.
16:17justin_smithsdegutis: but that would get you invited to the bitemyapp social club
16:17jtmarmonin a tangentially related vein: does dealing with s-expressions get less annoying over time or is it always kind of a pain in the ass
16:17sdegutisjustin_smith: there's no reason to bring up He Who Shall Not Be Named
16:18justin_smithjtmarmon: for me they just disappeared eventually (I mean of course I still interact with them, but they are not the main thing I see in the code)
16:18andyf_bitemyapp is another nick for callen, I think, for whom the rule of 'no proselytizing Haskell except from hours X to Y' was in the #clojure IRC banner for months?
16:18j-pbjtmarmon: the quote is "once you don't see the parenthesis anymore you have attained the true enlightenement of lisp"
16:18jtmarmoni don't find them distracting in terms of reading, but in terms of fluidity of editing i still find it quite distracting
16:18brainproxyjtmarmon: an editor w/ proper s-expressions support should take most of the pain away
16:19justin_smithandyf_: yeah
16:19sdegutisMy only hope is to eventually demo a web app to our CTO with some convincing Haskell coolities.
16:19justin_smithjtmarmon: paredit (or some workalike) helps a lot with that
16:19brainproxyjtmarmon: for emacs, that means enabling paredit or smartparens
16:19sdegutisBut Haskell is way hard to learn. I haven't mastered more than just the maybe monad yet. (All puns intended.)
16:19brainproxyor something similar
16:19j-pbsdegutis justin_smith: clojure the infomertial would be the erlang video, but the guys are in hammocks
16:19jtmarmoni just forced myself to switch to intellij from vim because of the clojure support
16:19jtmarmonso now it's doubly unnatural -_-
16:19hellofunkjtmarmon: the parenthesis actually make editing much easier once you have an editor with something like emacs. you can move through blocks of code, shift large code segments around easily, because the parenthesis dictate the structure
16:20hellofunk*paredit i meant, not *emacs
16:20jtmarmonyeah cursive has great paredit support i just need to get used to it
16:20jtmarmonsoon^(TM)
16:20brainproxyjtmarmon: looks like the Cursive Clojure plugin for IntelliJ supports paredit-like editing: https://cursiveclojure.com/userguide/paredit.html
16:20jtmarmon^^
16:20sdegutisim using emacs + paredit -- it gets the job done
16:21brainproxyokay nvm :)
16:21jtmarmon;)
16:21jtmarmonit definitely feels nice being on intellij after dealing w/ firelpace
16:21jtmarmonfireplace just feels so haphazard
16:21hellofunkjtmarmon: i actually use paredit 90% for code navigation, and only 10% for actual parenthesis *editing*. it's great to move through code one form at a time, cut and paste adjacent forms, etc
16:22brainproxydoes anyone keep a list of their favorite, recorded presentations on Clojure; I'll be doing one this September, would like to do a really great job, need inpsiration
16:23jtmarmonfavorite in what sense? some are just entertaining
16:23jtmarmonlike the chickens one
16:23brainproxyyeah, I should have been more specific
16:23thedoodPLdo you prefer cursive over la clojure?
16:23jtmarmonthedoodPL: haven't tried la clojure. not actually sure what the differences are? how do you like la clojure?
16:23brainproxyin this case, I'll be doing a bit of a deep dive into a topic, related to transducers
16:24brainproxyso it would be good to take some inspiration from presentations that do a good job in that vein
16:25brainproxythat is, a deep dive into Clojure code, without the slides and live-coding turning into a hot mess of ideas
16:26jtmarmongreat code focused explanation of debugging in cursive: https://www.youtube.com/watch?v=ql77RwhcCK0 | awesome walk through of generative testing by pivotal https://www.youtube.com/watch?v=HXGpBrmR70U | prismatic's API framework talk https://www.youtube.com/watch?v=VEDLSvSSMSk | not so deep divey but good: https://www.youtube.com/watch?v=vLlbEZt-3j0 |
16:26brainproxyjtmarmon: thank you!
16:27jtmarmonnp :) looking for another few
16:38sdegutishi
16:38sdegutismy test suite is restarting
16:38sdegutisfigured id stop by and see whats up while all my tests run again
16:38sdegutisbrb tests finished running
16:39sdegutisok back
16:39justin_smithsdegutis: have you tried using clojure.tools.namspace.repl/refresh in between test runs?
16:39sdegutisso whats your favorite new Clojure feature?
16:39sdegutisjustin_smith: I don't think Speclj has a place to inject that
16:39justin_smithsdegutis: well, it would likely involve running the tests from a repl, but this should be possible
16:40sdegutisah not a bad idea
16:41justin_smithsdegutis: my favorite innovation test wise lately was making a handler for my app under /test that would reload all relevant namespaces, run all backend tests and put the results in the page body, and run all frontend tests and put their results in the js console.
16:41justin_smithall triggered by page hit / browser refresh
16:41sdegutisjustin_smith: oh nice
16:41justin_smithI need to make that into a lib
16:41sdegutisyes plez
17:15arohnerI'm seeing `javax.net.ssl.SSLException: Received fatal alert: internal_error`. I remember java SSL generally being weak, is there like a better library I can use or something?
17:15justin_smitharohner: weak, or just a total pain in the ass to use?
17:16arohnertrue, take your pick
17:16justin_smitharohner: I know a lot of people prefer to use nginx ssl, reverse proxying in front of their java server
17:16arohnerthis is http client side
17:16justin_smithoh, sorry
17:16arohnerrequesting a page on the internet, I have no idea how their SSL is configured, but I can't connect to it
17:17arohnerI should have been more clear
17:17arohnermost sites work, but I don't know what is wrong with this one
17:18justin_smitharohner: maybe try a verbose curl to the same url, see if there is anything odd in the output?
17:18cflemingjtmarmon thedoodPL: La Clojure is semi-officially deprecated now in favour of Cursive - it's not actively developed
17:18jtmarmonah got it
17:18jtmarmonwoot cursive
17:18arohnerjustin_smith: good idea. interesting: curl: (35) Cannot communicate securely with peer: no common encryption algorithm(s).
17:19arohnerI'm happy to write them off as broken
17:21sdegutisanyone else stuck on a hard clojure problem?
17:21sdegutisthats why im here fo sho
17:22amalloycfleming: semi-officially, in that their competitor officially deprecates it, eh?
17:23andyf_sdegutis: Wait, you mean you will write difficult Clojure code for us? Without charging us? I've got a to-do list here somewhere :-)
17:23sdegutishahahaha
17:23sdegutisbut yes.
17:23oddcullycfleming: grats! but i have not lived to see the day la clojure working
17:30andyf_sdegutis: So I'm trying to convince the Clojure maintainers to commit patches for some JIRA tickets ...
17:30sdegutisandyf_: hahahhaha
17:31sdegutisandyf_: wait i dont get it
17:31amalloyit was a good joke
17:31andyf_I would classify that as a hard Clojure problem...
17:31sdegutisoooh
17:31sdegutisandyf_: hahahahahhahahaha
17:32sdegutiswhy dont they just use github issues like normal humans?
17:32andyf_So far, the only solution I've found is patience, which is easier if I work on other things.
17:32andyf_Workflow preference.
17:32sdegutisthat seems pretty counterproductive
17:33sdegutisalso the requiring signatures from *all contributors* part
17:33andyf_Last question on this page, come up many times before: http://dev.clojure.org/display/community/Contributing+FAQ
17:33andyf_Whoever starts an open source project gets to pick the work flow. I deal with it.
17:33sdegutis"To protect Clojure from future legal challenges that might discourage businesses from adopting it." - does Ruby or Rails have a similar CA?
17:33sdegutisserious question
17:34sdegutis"To enable Clojure to be relicensed under a different open-source license if that would be advantageous." -- more advantageous to all of us would probably be making it easier for anyone to contribute
17:34sdegutisthis whole thing just feels too pretentious
17:35sdegutisbut whatever, rich's choice
17:36prosei created a little p ython util which took the clojure logo + clojure logo and made htis image (which I think is kind of cool)
17:36prosehttp://i.imgur.com/o1IxPjV.jpg
17:36prosehere is the util itse3lf if anyone wants it
17:36prosehttps://github.com/aaron-lebo/prosterize
17:40justin_smithsdegutis: I've definitely seen issues where older open source projects are caught in a bind because the community wants to change license or offer a modified license to a commercial user, but they legally cannot do so unless and until they chase down every historical contributor and get their sign off
17:40justin_smithsdegutis: so this isn't an imaginary problem
17:41justin_smithwhen contributors do an official assignment of copyright, then the core team has more freedom
17:53sdegutismeh
17:57jfacorrohi all, I have a very basic question ClojureScript question, maybe someone here can help me out
17:57jfacorroI created a new project using the mies lein template
17:57wasamasaif not, head over to #clojurescript
17:58jfacorrowasamasa: good idea :P
18:01andyf_sdegutis: A few dozen projects that have contributor agreements: http://en.wikipedia.org/wiki/Contributor_License_Agreement
18:04andyf_Ones on that list I've heard of: Python, Django, Chef, FSF, OpenStack, Puppet Labs
18:06andyf_sdegutis: Ruby Contributor Agreement: https://github.com/SciRuby/sciruby/wiki/Contributor-Agreement Google did not help me find one for Rails, if one exists.
18:08andyf_Whoops, that was the SciRuby project, not Ruby the language itself. I don't see that there is on for Ruby the language implementation.
18:08sdegutisyay
18:27davidhqhttp://functionalslack.com → Functional Programming Slack Community with focus on Clojure, Elixir and Haskell
18:34sdegutisso tru
19:01sdegutishey does defmulti's dispatcher-fn only work on the first param?
19:04schmirsdegutis: no
19:04sdegutisgreat
19:05sdegutisthe docstring of defmulti is completely silent about dispatch-fn
19:06sdegutisi guess its /just that intuitive/
19:08justin_smithjust general enough that there are not many constraints to describe
19:09thedoodPLare there any "must read" clojure books like effective java and concurrency in practice in case of java?
19:09amalloyjustin_smith: proposed new defmulti doc: "the dispatch function is a function. it can do things that functions do. this includes having arguments, performing logic, and returning a single value based on those things"
19:11justin_smithheh
19:12justin_smith(inc amalloy)
19:12lazybot⇒ 275
19:19hiredmandocstrings should be able to enforce a pause
19:20hiredman(doc defmulti) => "the dispatch function is a function" prints, the repl pauses for 10 minutes to make sure you read and think through the implications, then the rest of the docstring prints
19:20clojurebot"([name docstring? attr-map? dispatch-fn & ...]); Creates a new multimethod with the associated dispatch function. The docstring and attr-map are optional. Options are key-value pairs and may be one of: :default The default dispatch value, defaults to :default :hierarchy The value used for hierarchical dispatch (e.g. ::square is-a ::shape) Hierarchies are type-like relationships that do not depend upon type inheritance. By default Clo
19:41travisrodmanis anyone aware of a function or library in clojure that would allow the consolidation, into a single form, of a chained call of function expressions?
19:44amalloytravisrodman: that sounds like a single form already
19:44travisrodmani.e, (fn1 ... (fn2 ... (fn3 ...))) => (fnew ...)
19:45amalloyokay, so far that's ->>
19:45lumaficomp?
19:45clojurebotuse comp for a point free, pointless style
19:45travisrodmanamalloy: more as a macro woould expand to final code, on source code...
19:45travisrodmannot at execution time, I am looking for something as a refactoring tool
19:46amalloyi think cursive will do that, and clj-refactor or whatever it was used to do that in slime
19:46travisrodmanso instead of a daisy-chain of many functions, the source would be read and consolidated into a single function
19:46travisrodmangreat, thanks, I will check them out.
19:46amalloytravisrodman: i don't understand your goal. it seems weird
19:46amalloyi just mean that cursive would convert (f x (g y)) into (->> y (g) (f x)) for you
19:47amalloy"consolidated into a single function" doens't make sense to me in this context
19:47travisrodmanamalloy: I have code, written by someone else that has a top-level pmap that is instantiating clojail sandboxes for every thread generated by pmap.
19:48travisrodmanamalloy: what I would like to do is invert this code-calling structure and pass the data, in it's entirety, into the sandbox to optimize the calls
19:49travisrodmanamalloy: there are ~4 transformations to the arguments from the initial call to the final sandboxing call, and if I could consolidate the logic via function definition replacement up the call chain to the top level call
19:49travisrodmanamalloy: i can refactor that code more easily
19:50travisrodmanamalloy: i was hoping there was a more automated tool for that instead of doing it by hand
19:51travisrodmanamalloy: good 'ol sicp style function replacement to ease refactoring
19:51travisrodmanamalloy: any thoughts?
19:52amalloyno, i still don't udnerstand what you are saying. "consolidate via function definition replacement" is mysterious
19:52amalloylike give an example of a simple version of what you want, done by hand
19:52amalloyand then maybe what you wish this tool will do would be clear
19:53travisrodmanamalloy: yeah, hang on a second, I will mock something up...
19:53travisrodmankj
19:53travisrodmanoops, sorry wrong screen... vim commands
19:53it0a:)
19:53amalloykj is a pretty useless vim command!
19:53it0aprobably his escape
19:54travisrodmanit lets me know where my cursor is, when I have 6 buffers open at the same time
19:58gfredericksit's easier than my useless emacs command, C-p C-n
19:59travisrodmangfredericks: right...
19:59travisrodmanamalloy: (defn add [v1 v2] (+ v1 v2))
19:59travisrodman(defn sub [v1 v2] (- v1 v2))
19:59travisrodman(defn gen [ ] (rand-int 30))
19:59travisrodman(add (sub 1 (gen)) (add (gen) 2)) => (+ (- 1 (rand-int 30)) (+ (rand-int 30) 2))
19:59travisrodmanamalloy: so something like that...
20:00travisrodmanamalloy: even in writing that, i could see that one of the requirements would be to only transform functions in my local code, not say, rand-int
20:00amalloyso you are looking for a button to inline function calls
20:00travisrodmanamalloy: the idea being, i can now refactor the top-level function as a single form
20:00travisrodmanyeah, basically
20:01travisrodmani would like to be able to pass it the form, and have them 'shallowed' so to speak.
20:01amalloyi don't think that exists. i bet bronsa or ambrosebs could write it with tools.analyzer but it is not a trivial thing to do
20:02travisrodmanright... okay... I wrote an s-expression parser, perhaps I will sick it on that...
20:03travisrodmani could see it being a useful refactoring tool... reducing symbol trasformations and allowing easier restructuring...
20:03travisrodmanthanks for the info.
20:06travisrodmanamalloy: in conjunction with slamhound, would be a pretty nice refactor setup
20:06travisrodmanamalloy: anyway... cheers man, thanks for the response.
20:06travisrodmanit0a: i spot another vim user ;)
20:09it0atravisrodman: hell yeah
20:09travisrodmanit0a: sweet!!
20:10it0atravisrodman: i use emacs/evil for clojure though :P
20:10travisrodmanit0a: its alright... I won't hold it against you... ;)
20:26yediso whats up with this om next thing
21:29jtmarmonwhy can't you flatten a set?
21:33gfredericks~flatten
21:33clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
21:33gfredericksit should also mention tree-seq for the cases where you really do want general recursion
21:38jtmarmongfredericks: I just went with (->> data (map first) (into #{})). why is flatten rarely the right answer? because it has to realize the whole sequence/
21:38jtmarmon?*
22:17TEttingerjtmarmon:
22:17TEttinger~flatten
22:17clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
22:17TEttingerthe main thing is it kills nesting
22:18jtmarmonisn't killing nesting the point of flatten?
22:18TEttingeryou often don't want to kill all nesting
22:19jtmarmonbut isn't mapcat going to do the same thing
22:19TEttingerno
22:20TEttinger,(let [coll [1 2 3 [10 20] 4] ] (mapcat #(vector % %) coll))
22:20clojurebot(1 1 2 2 3 ...)
22:20TEttinger&(let [coll [1 2 3 [10 20] 4] ] (mapcat #(vector % %) coll))
22:20TEttingerlazybot dead!
22:20jtmarmonRIP
22:20jtmarmoni see what you mean though, @TEttinger
22:20TEttinger,(clojure.string/join " " (let [coll [1 2 3 [10 20] 4] ] (mapcat #(vector % %) coll)) )
22:20clojurebot"1 1 2 2 3 3 [10 20] [10 20] 4 4"
22:21jtmarmonright, got it.
22:21jtmarmonty
22:21TEttinger,(clojure.string/join " " (let [coll [1 2 3 [10 20] 4] ] (map #(vector % %) (flatten coll))) )
22:21clojurebot"[1 1] [2 2] [3 3] [10 10] [20 20] [4 4]"
22:21TEttingersorry had to finish it
22:21TEttingeror!
22:21jtmarmonfatal error: clojurebot has missed a heartbaet
22:21TEttinger,(clojure.string/join " " (let [coll [1 2 3 [10 20] 4] ] (flatten (map #(vector % %) coll))) )
22:21clojurebot"1 1 2 2 3 3 10 20 10 20 4 4"
22:21jtmarmonflatten is never the answer kids
22:22jtmarmondon't do flatten.
22:22TEttingerhehe
22:22TEttingerit sometimes is!
22:22TEttingergolf benefits from it
22:22TEttingercode golf!
22:22jtmarmonand pancakes
23:34rvxihi
23:46escherizehey rxvi
23:46escherizeSo I had a weekend project that I've finished
23:46escherizewell, finished for now.. http://hiccup.space
23:47escherizeI'd love to get some feedback (it takes a while to load.)
23:51dumptruckmanhello
23:51randomcharhereprints <h1>Welcome to hiccup.space</h1> to the left?
23:52randomcharhereeeerrr right :P
23:53dumptruckmani'm trying to comprehend how to manage state in a game
23:53dumptruckmanit kinda seems like i'm gonna have one big super object that i pass around to all my functions and return a modified version of
23:54dumptruckmannot object
23:54dumptruckmana map or w/e
23:54dumptruckmanit feels like not the right way to do things but i can't really think of a better way
23:55dumptruckmanthat map being basically the entire game state
23:56dumptruckmanany advice?
23:59randomcharherestill learning clojure :P seems like no ones awake ?