2015-05-28
| 00:00 | auxchar | Yeah, I think that'd be cheating. |
| 00:00 | justin_smith | delays and promises being like reference types, but only bindable once |
| 00:01 | justin_smith | auxchar: technically the def exists before its body is evaluated (to allow recursive functions) but I wouldn't count on correctness |
| 00:01 | justin_smith | it's not an intended usage |
| 00:01 | justin_smith | ,(def l (list 1 2 l)) |
| 00:01 | clojurebot | #'sandbox/l |
| 00:01 | justin_smith | l |
| 00:01 | justin_smith | ,l |
| 00:01 | clojurebot | (1 2 #object[clojure.lang.Var$Unbound 0x7a27d8b4 "Unbound: #'sandbox/l"]) |
| 00:01 | justin_smith | yeah |
| 00:02 | justin_smith | so l exists, but it got caught at the wrong time |
| 00:02 | auxchar | Except the list isn't holding itself, it's holding the var containing itself. |
| 00:02 | justin_smith | auxchar: in clojure we don't really do the "tying the knot" thing you can do in haskell thanks to their pervasively lazy evaluation |
| 00:03 | justin_smith | auxchar: yes, that's in fact the only option |
| 00:04 | auxchar | It would work with a LazySeq, I would imagine. |
| 00:04 | justin_smith | even then it would be a hack |
| 00:04 | auxchar | Otherwise a mutable list would be needed. |
| 00:04 | justin_smith | ,(def l (cons 1 (lazy-seq l))) |
| 00:04 | clojurebot | #'sandbox/l |
| 00:04 | justin_smith | ,l |
| 00:04 | clojurebot | (1 1 1 1 1 ...) |
| 00:05 | justin_smith | I'd still consider that a hack, though it works |
| 00:05 | auxchar | Yeah. |
| 00:07 | auxchar | Does its behaviour change if l is defined before some part of it's fully evaluated? |
| 00:07 | auxchar | Err, redefined. |
| 00:08 | justin_smith | well, 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:08 | justin_smith | def creates the var (or changes it to unbound) before the body is run |
| 00:10 | auxchar | But 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:10 | justin_smith | it depends, sometimes not unless you passed the var somewhere else |
| 00:11 | justin_smith | sometimes the other code would just seamlessly see the new l |
| 00:11 | justin_smith | by passed the var I mean passed #'l instead of l |
| 00:11 | justin_smith | (as an arg) |
| 00:12 | justin_smith | anyway, I'm out for the night |
| 00:12 | auxchar | Alright, good night. |
| 00:12 | auxchar | I wanna play with this some more. |
| 00:15 | auxchar | (def l (list 1 (lazy-seq l))) |
| 00:15 | auxchar | ,(def l (list 1 (lazy-seq l))) |
| 00:15 | clojurebot | #'sandbox/l |
| 00:15 | auxchar | ,(l) |
| 00:15 | clojurebot | #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:15 | auxchar | ,l |
| 00:15 | clojurebot | (1 (1 (1 (1 (1 (1 (1 (1 (1 (1 #)))))))))) |
| 00:19 | auxchar | ,(do (def l (cons 1 (lazy-seq l))) (take 3 l) (def m l) m) |
| 00:19 | clojurebot | (1 1 1 1 1 ...) |
| 00:19 | auxchar | Ok, so that does work. |
| 00:20 | auxchar | Cool. |
| 00:20 | auxchar | Wait. |
| 00:20 | auxchar | ,(do (def l (cons 1 (lazy-seq l))) (take 3 l) (def m l) (def l nil) m) |
| 00:20 | clojurebot | (1) |
| 00:20 | auxchar | Nope, it's not what I'm looking for. |
| 00:21 | auxchar | ,(do (def l (cons 1 (lazy-seq l))) (take 3 l) (def m l) (def l 4) m) |
| 00:21 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long> |
| 00:22 | auxchar | Ok, I think I get what's going on. |
| 00:37 | url- | is source for clojurebot online somewhere? |
| 00:40 | tolstoy | Is it this one? https://github.com/Raynes/lazybot or this one? https://github.com/hiredman/clojurebot ? |
| 00:41 | tolstoy | ,(+ 2 3) |
| 00:41 | clojurebot | 5 |
| 00:41 | tolstoy | .(+ 2 3) |
| 00:48 | auxchar | ,((fn [f n] (f f n)) (fn [f n] (f (+ n 1)))) |
| 00:48 | clojurebot | #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:48 | auxchar | ,((fn [f n] (f f n)) (fn [f n] (f (+ n 1))) 1) |
| 00:48 | clojurebot | #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:49 | auxchar | ,((fn [f n] (f f n)) (fn [f n] (f f (+ n 1))) 1) |
| 00:49 | clojurebot | #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:49 | auxchar | Yay. |
| 00:53 | auxchar | (#(%1 %1 %2) #(%1 %1 (+ %2 1)) 1) |
| 00:54 | auxchar | ,(#(%1 %1 %2) #(%1 %1 (+ %2 1)) 1) |
| 00:54 | clojurebot | #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:55 | auxchar | That ought to make for some interesting production code. ^_^ |
| 00:58 | TEttinger | auxchar, I'm surprised that even can run |
| 01:05 | WickedShell | does 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:18 | tolstoy | seancorfield: 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:18 | tolstoy | seancorfield: Yours was the last. ;) |
| 03:26 | wei_ | 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:28 | tslocke | Is 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:29 | wei_ | 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:29 | wei_ | tslocke: then it wouldn’t be a group would it? could you give an example |
| 03:31 | justin_smith | ,(map #(update-in % [:wingspan] (fn [n] (some-> n (* 2)))) [{:wingspan 1} {}]) |
| 03:31 | clojurebot | ({:wingspan 2} {:wingspan nil}) |
| 03:31 | tslocke | no 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:32 | tslocke | I realise it’s a one-liner but just wondered if there is a canonical solution |
| 03:36 | justin_smith | tslocke: it's an easy thing to derive from group-by, and no it is not built in |
| 03:37 | justin_smith | ,(into {} (for [m [{:a 0} {:a 1} {:a 2}]] [(:a m) m])) |
| 03:37 | clojurebot | {0 {:a 0}, 1 {:a 1}, 2 {:a 2}} |
| 03:38 | justin_smith | no need for group-by actually, now that I think about it |
| 03:38 | tslocke | right |
| 03:38 | tslocke | thanks |
| 04:11 | otfrom | morning |
| 04:24 | dstockton | morning |
| 05:00 | studentrob | I'm stuck. I need a clojure punching bag. "LazySeq cannot be cast to java.lang.String" http://pastebin.com/WBHD4Gz0 |
| 05:03 | studentrob | nm got it i think |
| 05:31 | luxbock | studentrob: I'd use a cond to get rid of the nested if's in dist |
| 05:32 | studentrob | luxbock: ok thx |
| 05:53 | studentrob | Are 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:59 | luxbock | studentrob: Cursive has a Clojure debugger |
| 05:59 | studentrob | ok.. trying to figure out how to download that |
| 05:59 | luxbock | so does Emacs with CIDER these days, though you'll have to use the snapshot version |
| 06:00 | cfleming | studentrob: https://cursiveclojure.com/userguide/ has the details |
| 06:05 | studentrob | Thanks, got it |
| 07:27 | DerGuteMoritz | hello 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:00 | TimMc | Perhaps because vars can change? :-/ |
| 08:02 | Bronsa | DerGuteMoritz: eastwood does that |
| 08:04 | TimMc | clojurebot: there's |an| eastwood for that |
| 08:04 | clojurebot | Ok. |
| 08:10 | crocket | I'm close to the end of braveclojure.com |
| 08:10 | crocket | braveclojure is a good material for a beginner, but it leaves me as a starter. |
| 08:31 | justin_smith | crocket: have you tried http://4clojure.com at all? |
| 08:33 | crocket | justin_smith, yes |
| 09:55 | DerGuteMoritz | TimMc: ah, mutability strikes again ... that would probably explain it |
| 09:55 | DerGuteMoritz | Bronsa: thanks, good tip |
| 10:16 | zerokarmaleft | crocket: if I were you, I'd think about building a very small project from scratch |
| 10:41 | kwladyka | i 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:42 | kwladyka | crocket, watch Clojure Inside Out, really :) i am also beginner and this video helped me more then anything else |
| 10:43 | kwladyka | crocket, after that do http://www.4clojure.com/problems - first i ignored it but later i found it is very usefull |
| 10:43 | justin_smith | kwladyka: 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:46 | kwladyka | justin_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:47 | justin_smith | kwladyka: I'd recommend using the setup with makes things most seamless to transition to production. |
| 10:47 | kwladyka | justin_smith, because the main reason why i use lein ring server is reloading sources during development |
| 10:47 | justin_smith | if you are not deploying to a container, better to use -main (launched from inside a repl) during development |
| 10:47 | justin_smith | wrap-reload is easy to add |
| 15:44 | sdegutis | I'm just really surprised at the lack of anyone ever admitting or agreeing to admit that Clojure has some really dumb decisions. |
| 15:45 | xemdetia | sdegutis, I think part of that is because it's a lisp |
| 15:45 | TimMc | andyf_: And if serenity fails, there's always alter-var-root. |
| 15:45 | andyf_ | 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:46 | justin_smith | I 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:47 | andyf_ | 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:47 | justin_smith | andyf_: clearly he wants to see more complaining |
| 15:48 | xemdetia | please add complain quota to topic |
| 15:49 | sdegutis | andyf_: those are newcomers -- I'm talking about experienced Clojurians |
| 15:49 | andyf_ | sdegutis: amalloy, Bronsa, cemerick, hiredman, technomancy, how many examples do you want? |
| 15:49 | sdegutis | andyf_: I'm just surprised old-timers actually *defend* dumb decisions in Clojure as much as they do. |
| 15:50 | sdegutis | I haven't once seen any of them admit that something in Clojure is dumb. |
| 15:50 | chouser | well, hang on. There's a difference between defending and explaining, though I can see they could be easily confused. |
| 15:50 | andyf_ | sdegutis: I don't know if they have used the word "dumb", but they have plenty of criticism for aspects of Clojure |
| 15:50 | sdegutis | that may be fair |
| 15:51 | amalloy | sdegutis: i think someone on andyf_'s list complains about something in clojure like once a day |
| 15:51 | chouser | sdegutis: "What sucks about Clojure" -- an accepted talk by cemerick at Clojure/West 2012 |
| 15:51 | justin_smith | andyf_: I'd add ambrosebs to that list too, he has some very good criticisms. arrdem has some similarly motivated ones. |
| 15:51 | chouser | ...though his list was pretty different from what mine would have been. |
| 15:52 | andyf_ | justin_smith: I knew I was not being exhaustive. That just spurted out without my having to think about it :) |
| 15:52 | sdegutis | maybe I'm just on IRC at all the wrong times |
| 15:52 | justin_smith | andyf_: not correcting you, just wanted to mention some other notables |
| 15:52 | Bronsa | sdegutis: I don't defend decisions at all. you'll often see me complaining about stuff i don't like about clojure |
| 15:52 | justin_smith | sdegutis: a bunch of this is happening on twitter, technomancy isn't even in this channel any more |
| 15:53 | andyf_ | sdegutis: Complaining about what you don't like only gets you so far (and it isn't very far). |
| 15:54 | justin_smith | sdegutis: 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:54 | andyf_ | 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:55 | andyf_ | And I like it so well in spite of any criticisms, that it is my preferred language for hobby programming. |
| 15:56 | sdegutis | justin_smith: I guess that makes sense. Though it would make way more sense if clojure.core was released separately from the Clojure compiler. |
| 15:56 | justin_smith | sdegutis: explain? |
| 15:57 | sdegutis | Then 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:57 | ToxicFrog | andyf_: what would you have named contains? |
| 15:57 | justin_smith | I would name it has-key? |
| 15:58 | justin_smith | since it only applies to associative lookup |
| 15:58 | sdegutis | has-key? is so intuitive |
| 15:58 | sdegutis | yes, very yes. |
| 15:58 | sdegutis | contains? would then be for any kind of collection loojup |
| 15:58 | sdegutis | oh man, I vote justin_smith as new BDFL |
| 15:58 | justin_smith | lol, you would regret that |
| 15:58 | sdegutis | nevar |
| 15:58 | andyf_ | 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:58 | ToxicFrog | Heh. |
| 15:59 | andyf_ | (I've heard it suggested before justin_smith's statement above -- I wasn't reading while typing my last line :) |
| 16:01 | justin_smith | andyf_: I often have no idea whether I am remembering something, vs. making something up, vs. simply being totally wrong |
| 16:01 | andyf_ | justin_smith: Welcome :) |
| 16:03 | andyf_ | 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:03 | andyf_ | For very reasonable reasons, that doesn't happen all that often. |
| 16:03 | sdegutis | lol "reasonable reasons" |
| 16:03 | justin_smith | reminds me of andylisp - which was in many ways not very reasonable |
| 16:03 | sdegutis | oh English, go home, you're drunk |
| 16:04 | sdegutis | I once wrote a Lisp in C. It was not very fun. C is not very good. |
| 16:04 | puredanger | I'm happy to admit that there are many things I find to be annoying or unfortunate in Clojure |
| 16:04 | sdegutis | I would rewrite it but I can't think of a decent language to rewrite it in. |
| 16:04 | Chauncey | Writing a scheme in haskell is a lot of fun though :) |
| 16:04 | puredanger | But I have found that to be true of every lang I've ever |
| 16:04 | puredanger | used |
| 16:05 | Chauncey | puredanger: yes, I feel the same way. Clojure's ups far outweigh the downs though |
| 16:05 | sdegutis | Chauncey: 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:05 | puredanger | I once told Rich that Clojure was the least worst language Id ever used and he took it as the compliment it was |
| 16:06 | Chauncey | sdegutis: haha, that is very true |
| 16:06 | Chauncey | puredanger: well put ;) |
| 16:06 | sdegutis | I'm starting to think I may be disillusioned. |
| 16:07 | justin_smith | sdegutis: you're always looking for the shortcut that will fix all your code problems |
| 16:07 | justin_smith | a decent amount of that is good - you don't get trapped with bad tools |
| 16:07 | andyf_ | I am reminded of Weird Al Yankovic's song "Close, but No Cigar". I still chuckle every time I listen to that song. |
| 16:07 | sdegutis | justin_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:08 | sdegutis | which reminds me |
| 16:08 | sdegutis | What are the modern testing framework choices? Have they changed at all since 2013? |
| 16:08 | sdegutis | (or have the existing choices improved significantly?) |
| 16:08 | hellofunk | 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:08 | andyf_ | clojure.test Midje expectations are the main ones I know about. I've only used clojure.test |
| 16:08 | sdegutis | hellofunk: there's a video of a talk by brett victor, watch that |
| 16:09 | sdegutis | andyf_: ok |
| 16:09 | andyf_ | random generation of test cases via test.check may be new since 2013 in Clojure |
| 16:10 | hellofunk | sdegutis: i've seen that famous video but am not convinced it is the idea mentioned in the text |
| 16:10 | justin_smith | sdegutis: see, your attempt to contradict my point reinforced it. It's not a criticism, I just notice this theme in your questions here. |
| 16:10 | andyf_ | 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:14 | sdegutis | justin_smith: right on |
| 16:15 | sdegutis | justin_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:15 | justin_smith | cue clojure the infomercial - sdegutis fumbles with his keyboard, looks imploringly at the camera "there has to be a better way!" |
| 16:15 | sdegutis | hahah |
| 16:15 | justin_smith | haha, maybe haskell the infomercial then |
| 16:16 | sdegutis | But 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:16 | sdegutis | So I'm just sort of.. in this weird middle place. |
| 16:17 | justin_smith | sdegutis: but that would get you invited to the bitemyapp social club |
| 16:17 | jtmarmon | in 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:17 | sdegutis | justin_smith: there's no reason to bring up He Who Shall Not Be Named |
| 16:18 | justin_smith | jtmarmon: 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:18 | andyf_ | 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:18 | j-pb | jtmarmon: the quote is "once you don't see the parenthesis anymore you have attained the true enlightenement of lisp" |
| 16:18 | jtmarmon | i don't find them distracting in terms of reading, but in terms of fluidity of editing i still find it quite distracting |
| 16:18 | brainproxy | jtmarmon: an editor w/ proper s-expressions support should take most of the pain away |
| 16:19 | justin_smith | andyf_: yeah |
| 16:19 | sdegutis | My only hope is to eventually demo a web app to our CTO with some convincing Haskell coolities. |
| 16:19 | justin_smith | jtmarmon: paredit (or some workalike) helps a lot with that |
| 16:19 | brainproxy | jtmarmon: for emacs, that means enabling paredit or smartparens |
| 16:19 | sdegutis | But Haskell is way hard to learn. I haven't mastered more than just the maybe monad yet. (All puns intended.) |
| 16:19 | brainproxy | or something similar |
| 16:19 | j-pb | sdegutis justin_smith: clojure the infomertial would be the erlang video, but the guys are in hammocks |
| 16:19 | jtmarmon | i just forced myself to switch to intellij from vim because of the clojure support |
| 16:19 | jtmarmon | so now it's doubly unnatural -_- |
| 16:19 | hellofunk | jtmarmon: 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:20 | hellofunk | *paredit i meant, not *emacs |
| 16:20 | jtmarmon | yeah cursive has great paredit support i just need to get used to it |
| 16:20 | jtmarmon | soon^(TM) |
| 16:20 | brainproxy | jtmarmon: looks like the Cursive Clojure plugin for IntelliJ supports paredit-like editing: https://cursiveclojure.com/userguide/paredit.html |
| 16:20 | jtmarmon | ^^ |
| 16:20 | sdegutis | im using emacs + paredit -- it gets the job done |
| 16:21 | brainproxy | okay nvm :) |
| 16:21 | jtmarmon | ;) |
| 16:21 | jtmarmon | it definitely feels nice being on intellij after dealing w/ firelpace |
| 16:21 | jtmarmon | fireplace just feels so haphazard |
| 16:21 | hellofunk | jtmarmon: 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:22 | brainproxy | does 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:23 | jtmarmon | favorite in what sense? some are just entertaining |
| 16:23 | jtmarmon | like the chickens one |
| 16:23 | brainproxy | yeah, I should have been more specific |
| 16:23 | thedoodPL | do you prefer cursive over la clojure? |
| 16:23 | jtmarmon | thedoodPL: haven't tried la clojure. not actually sure what the differences are? how do you like la clojure? |
| 16:23 | brainproxy | in this case, I'll be doing a bit of a deep dive into a topic, related to transducers |
| 16:24 | brainproxy | so it would be good to take some inspiration from presentations that do a good job in that vein |
| 16:25 | brainproxy | that is, a deep dive into Clojure code, without the slides and live-coding turning into a hot mess of ideas |
| 16:26 | jtmarmon | great 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:26 | brainproxy | jtmarmon: thank you! |
| 16:27 | jtmarmon | np :) looking for another few |
| 16:38 | sdegutis | hi |
| 16:38 | sdegutis | my test suite is restarting |
| 16:38 | sdegutis | figured id stop by and see whats up while all my tests run again |
| 16:38 | sdegutis | brb tests finished running |
| 16:39 | sdegutis | ok back |
| 16:39 | justin_smith | sdegutis: have you tried using clojure.tools.namspace.repl/refresh in between test runs? |
| 16:39 | sdegutis | so whats your favorite new Clojure feature? |
| 16:39 | sdegutis | justin_smith: I don't think Speclj has a place to inject that |
| 16:39 | justin_smith | sdegutis: well, it would likely involve running the tests from a repl, but this should be possible |
| 16:40 | sdegutis | ah not a bad idea |
| 16:41 | justin_smith | sdegutis: 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:41 | justin_smith | all triggered by page hit / browser refresh |
| 16:41 | sdegutis | justin_smith: oh nice |
| 16:41 | justin_smith | I need to make that into a lib |
| 16:41 | sdegutis | yes plez |
| 17:15 | arohner | I'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:15 | justin_smith | arohner: weak, or just a total pain in the ass to use? |
| 17:16 | arohner | true, take your pick |
| 17:16 | justin_smith | arohner: I know a lot of people prefer to use nginx ssl, reverse proxying in front of their java server |
| 17:16 | arohner | this is http client side |
| 17:16 | justin_smith | oh, sorry |
| 17:16 | arohner | requesting a page on the internet, I have no idea how their SSL is configured, but I can't connect to it |
| 17:17 | arohner | I should have been more clear |
| 17:17 | arohner | most sites work, but I don't know what is wrong with this one |
| 17:18 | justin_smith | arohner: maybe try a verbose curl to the same url, see if there is anything odd in the output? |
| 17:18 | cfleming | jtmarmon thedoodPL: La Clojure is semi-officially deprecated now in favour of Cursive - it's not actively developed |
| 17:18 | jtmarmon | ah got it |
| 17:18 | jtmarmon | woot cursive |
| 17:18 | arohner | justin_smith: good idea. interesting: curl: (35) Cannot communicate securely with peer: no common encryption algorithm(s). |
| 17:19 | arohner | I'm happy to write them off as broken |
| 17:21 | sdegutis | anyone else stuck on a hard clojure problem? |
| 17:21 | sdegutis | thats why im here fo sho |
| 17:22 | amalloy | cfleming: semi-officially, in that their competitor officially deprecates it, eh? |
| 17:23 | andyf_ | 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:23 | sdegutis | hahahaha |
| 17:23 | sdegutis | but yes. |
| 17:23 | oddcully | cfleming: grats! but i have not lived to see the day la clojure working |
| 17:30 | andyf_ | sdegutis: So I'm trying to convince the Clojure maintainers to commit patches for some JIRA tickets ... |
| 17:30 | sdegutis | andyf_: hahahhaha |
| 17:31 | sdegutis | andyf_: wait i dont get it |
| 17:31 | amalloy | it was a good joke |
| 17:31 | andyf_ | I would classify that as a hard Clojure problem... |
| 17:31 | sdegutis | oooh |
| 17:31 | sdegutis | andyf_: hahahahahhahahaha |
| 17:32 | sdegutis | why dont they just use github issues like normal humans? |
| 17:32 | andyf_ | So far, the only solution I've found is patience, which is easier if I work on other things. |
| 17:32 | andyf_ | Workflow preference. |
| 17:32 | sdegutis | that seems pretty counterproductive |
| 17:33 | sdegutis | also the requiring signatures from *all contributors* part |
| 17:33 | andyf_ | Last question on this page, come up many times before: http://dev.clojure.org/display/community/Contributing+FAQ |
| 17:33 | andyf_ | Whoever starts an open source project gets to pick the work flow. I deal with it. |
| 17:33 | sdegutis | "To protect Clojure from future legal challenges that might discourage businesses from adopting it." - does Ruby or Rails have a similar CA? |
| 17:33 | sdegutis | serious question |
| 17:34 | sdegutis | "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:34 | sdegutis | this whole thing just feels too pretentious |
| 17:35 | sdegutis | but whatever, rich's choice |
| 17:36 | prose | i 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:36 | prose | http://i.imgur.com/o1IxPjV.jpg |
| 17:36 | prose | here is the util itse3lf if anyone wants it |
| 17:36 | prose | https://github.com/aaron-lebo/prosterize |
| 17:40 | justin_smith | sdegutis: 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:40 | justin_smith | sdegutis: so this isn't an imaginary problem |
| 17:41 | justin_smith | when contributors do an official assignment of copyright, then the core team has more freedom |
| 17:53 | sdegutis | meh |
| 17:57 | jfacorro | hi all, I have a very basic question ClojureScript question, maybe someone here can help me out |
| 17:57 | jfacorro | I created a new project using the mies lein template |
| 17:57 | wasamasa | if not, head over to #clojurescript |
| 17:58 | jfacorro | wasamasa: good idea :P |
| 18:01 | andyf_ | sdegutis: A few dozen projects that have contributor agreements: http://en.wikipedia.org/wiki/Contributor_License_Agreement |
| 18:04 | andyf_ | Ones on that list I've heard of: Python, Django, Chef, FSF, OpenStack, Puppet Labs |
| 18:06 | andyf_ | 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:08 | andyf_ | 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:08 | sdegutis | yay |
| 18:27 | davidhq | http://functionalslack.com → Functional Programming Slack Community with focus on Clojure, Elixir and Haskell |
| 18:34 | sdegutis | so tru |
| 19:01 | sdegutis | hey does defmulti's dispatcher-fn only work on the first param? |
| 19:04 | schmir | sdegutis: no |
| 19:04 | sdegutis | great |
| 19:05 | sdegutis | the docstring of defmulti is completely silent about dispatch-fn |
| 19:06 | sdegutis | i guess its /just that intuitive/ |
| 19:08 | justin_smith | just general enough that there are not many constraints to describe |
| 19:09 | thedoodPL | are there any "must read" clojure books like effective java and concurrency in practice in case of java? |
| 19:09 | amalloy | justin_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:11 | justin_smith | heh |
| 19:12 | justin_smith | (inc amalloy) |
| 19:12 | lazybot | ⇒ 275 |
| 19:19 | hiredman | docstrings should be able to enforce a pause |
| 19:20 | hiredman | (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:20 | clojurebot | "([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:41 | travisrodman | is 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:44 | amalloy | travisrodman: that sounds like a single form already |
| 19:44 | travisrodman | i.e, (fn1 ... (fn2 ... (fn3 ...))) => (fnew ...) |
| 19:45 | amalloy | okay, so far that's ->> |
| 19:45 | lumafi | comp? |
| 19:45 | clojurebot | use comp for a point free, pointless style |
| 19:45 | travisrodman | amalloy: more as a macro woould expand to final code, on source code... |
| 19:45 | travisrodman | not at execution time, I am looking for something as a refactoring tool |
| 19:46 | amalloy | i think cursive will do that, and clj-refactor or whatever it was used to do that in slime |
| 19:46 | travisrodman | so instead of a daisy-chain of many functions, the source would be read and consolidated into a single function |
| 19:46 | travisrodman | great, thanks, I will check them out. |
| 19:46 | amalloy | travisrodman: i don't understand your goal. it seems weird |
| 19:46 | amalloy | i just mean that cursive would convert (f x (g y)) into (->> y (g) (f x)) for you |
| 19:47 | amalloy | "consolidated into a single function" doens't make sense to me in this context |
| 19:47 | travisrodman | amalloy: 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:48 | travisrodman | amalloy: 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:49 | travisrodman | amalloy: 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:49 | travisrodman | amalloy: i can refactor that code more easily |
| 19:50 | travisrodman | amalloy: i was hoping there was a more automated tool for that instead of doing it by hand |
| 19:51 | travisrodman | amalloy: good 'ol sicp style function replacement to ease refactoring |
| 19:51 | travisrodman | amalloy: any thoughts? |
| 19:52 | amalloy | no, i still don't udnerstand what you are saying. "consolidate via function definition replacement" is mysterious |
| 19:52 | amalloy | like give an example of a simple version of what you want, done by hand |
| 19:52 | amalloy | and then maybe what you wish this tool will do would be clear |
| 19:53 | travisrodman | amalloy: yeah, hang on a second, I will mock something up... |
| 19:53 | travisrodman | kj |
| 19:53 | travisrodman | oops, sorry wrong screen... vim commands |
| 19:53 | it0a | :) |
| 19:53 | amalloy | kj is a pretty useless vim command! |
| 19:53 | it0a | probably his escape |
| 19:54 | travisrodman | it lets me know where my cursor is, when I have 6 buffers open at the same time |
| 19:58 | gfredericks | it's easier than my useless emacs command, C-p C-n |
| 19:59 | travisrodman | gfredericks: right... |
| 19:59 | travisrodman | amalloy: (defn add [v1 v2] (+ v1 v2)) |
| 19:59 | travisrodman | (defn sub [v1 v2] (- v1 v2)) |
| 19:59 | travisrodman | (defn gen [ ] (rand-int 30)) |
| 19:59 | travisrodman | (add (sub 1 (gen)) (add (gen) 2)) => (+ (- 1 (rand-int 30)) (+ (rand-int 30) 2)) |
| 19:59 | travisrodman | amalloy: so something like that... |
| 20:00 | travisrodman | amalloy: 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:00 | amalloy | so you are looking for a button to inline function calls |
| 20:00 | travisrodman | amalloy: the idea being, i can now refactor the top-level function as a single form |
| 20:00 | travisrodman | yeah, basically |
| 20:01 | travisrodman | i would like to be able to pass it the form, and have them 'shallowed' so to speak. |
| 20:01 | amalloy | i 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:02 | travisrodman | right... okay... I wrote an s-expression parser, perhaps I will sick it on that... |
| 20:03 | travisrodman | i could see it being a useful refactoring tool... reducing symbol trasformations and allowing easier restructuring... |
| 20:03 | travisrodman | thanks for the info. |
| 20:06 | travisrodman | amalloy: in conjunction with slamhound, would be a pretty nice refactor setup |
| 20:06 | travisrodman | amalloy: anyway... cheers man, thanks for the response. |
| 20:06 | travisrodman | it0a: i spot another vim user ;) |
| 20:09 | it0a | travisrodman: hell yeah |
| 20:09 | travisrodman | it0a: sweet!! |
| 20:10 | it0a | travisrodman: i use emacs/evil for clojure though :P |
| 20:10 | travisrodman | it0a: its alright... I won't hold it against you... ;) |
| 20:26 | yedi | so whats up with this om next thing |
| 21:29 | jtmarmon | why can't you flatten a set? |
| 21:33 | gfredericks | ~flatten |
| 21:33 | clojurebot | flatten 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:33 | gfredericks | it should also mention tree-seq for the cases where you really do want general recursion |
| 21:38 | jtmarmon | gfredericks: I just went with (->> data (map first) (into #{})). why is flatten rarely the right answer? because it has to realize the whole sequence/ |
| 21:38 | jtmarmon | ?* |
| 22:17 | TEttinger | jtmarmon: |
| 22:17 | TEttinger | ~flatten |
| 22:17 | clojurebot | flatten 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:17 | TEttinger | the main thing is it kills nesting |
| 22:18 | jtmarmon | isn't killing nesting the point of flatten? |
| 22:18 | TEttinger | you often don't want to kill all nesting |
| 22:19 | jtmarmon | but isn't mapcat going to do the same thing |
| 22:19 | TEttinger | no |
| 22:20 | TEttinger | ,(let [coll [1 2 3 [10 20] 4] ] (mapcat #(vector % %) coll)) |
| 22:20 | clojurebot | (1 1 2 2 3 ...) |
| 22:20 | TEttinger | &(let [coll [1 2 3 [10 20] 4] ] (mapcat #(vector % %) coll)) |
| 22:20 | TEttinger | lazybot dead! |
| 22:20 | jtmarmon | RIP |
| 22:20 | jtmarmon | i see what you mean though, @TEttinger |
| 22:20 | TEttinger | ,(clojure.string/join " " (let [coll [1 2 3 [10 20] 4] ] (mapcat #(vector % %) coll)) ) |
| 22:20 | clojurebot | "1 1 2 2 3 3 [10 20] [10 20] 4 4" |
| 22:21 | jtmarmon | right, got it. |
| 22:21 | jtmarmon | ty |
| 22:21 | TEttinger | ,(clojure.string/join " " (let [coll [1 2 3 [10 20] 4] ] (map #(vector % %) (flatten coll))) ) |
| 22:21 | clojurebot | "[1 1] [2 2] [3 3] [10 10] [20 20] [4 4]" |
| 22:21 | TEttinger | sorry had to finish it |
| 22:21 | TEttinger | or! |
| 22:21 | jtmarmon | fatal error: clojurebot has missed a heartbaet |
| 22:21 | TEttinger | ,(clojure.string/join " " (let [coll [1 2 3 [10 20] 4] ] (flatten (map #(vector % %) coll))) ) |
| 22:21 | clojurebot | "1 1 2 2 3 3 10 20 10 20 4 4" |
| 22:21 | jtmarmon | flatten is never the answer kids |
| 22:22 | jtmarmon | don't do flatten. |
| 22:22 | TEttinger | hehe |
| 22:22 | TEttinger | it sometimes is! |
| 22:22 | TEttinger | golf benefits from it |
| 22:22 | TEttinger | code golf! |
| 22:22 | jtmarmon | and pancakes |
| 23:34 | rvxi | hi |
| 23:46 | escherize | hey rxvi |
| 23:46 | escherize | So I had a weekend project that I've finished |
| 23:46 | escherize | well, finished for now.. http://hiccup.space |
| 23:47 | escherize | I'd love to get some feedback (it takes a while to load.) |
| 23:51 | dumptruckman | hello |
| 23:51 | randomcharhere | prints <h1>Welcome to hiccup.space</h1> to the left? |
| 23:52 | randomcharhere | eeerrr right :P |
| 23:53 | dumptruckman | i'm trying to comprehend how to manage state in a game |
| 23:53 | dumptruckman | it 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:54 | dumptruckman | not object |
| 23:54 | dumptruckman | a map or w/e |
| 23:54 | dumptruckman | it feels like not the right way to do things but i can't really think of a better way |
| 23:55 | dumptruckman | that map being basically the entire game state |
| 23:56 | dumptruckman | any advice? |
| 23:59 | randomcharhere | still learning clojure :P seems like no ones awake ? |