2013-05-21
| 00:16 | tomoj | wink: it's ok, ruby is not more lispy than clojure |
| 00:17 | tomoj | I guess I'm begging the question |
| 00:19 | ddellacosta | did someone suggest ruby was more lispy than clojure? |
| 00:19 | ddellacosta | it's not |
| 00:19 | ddellacosta | although it's more lispy than I realized in the past |
| 00:19 | tomoj | no, someone was comparing verbosity of pallet and chef |
| 00:20 | ddellacosta | ah |
| 00:20 | ddellacosta | can't speak to that. |
| 00:20 | ddellacosta | you can be verbose in either if you are determined enough. |
| 00:20 | tomoj | but I feel like if you're in a good lisp verbosity should hardly be a concern |
| 00:20 | ddellacosta | I would tend to agree. |
| 00:21 | ddellacosta | but ruby is comparatively pretty good. (comparing to something like Java, or whatnot) |
| 00:21 | tomoj | get it right and then if you want you can (defpackage curl) or whatever |
| 00:22 | tomoj | yeah the only reason I'm here is that I was taken in enough by ruby that I bought peepcode screencasts, then technomancy snuck a clojure one in there.. |
| 00:23 | ddellacosta | haha |
| 00:24 | ddellacosta | similar story here too…although not peep code related. more to do with matz's slideshow on emacs lisp. that opened my eyes a lot. |
| 00:25 | tomoj | cool, no video online? |
| 00:25 | ddellacosta | hmm, I dunno, I'm sure it had a lecture with it at some point, but I just saw the slide show |
| 00:25 | ddellacosta | gimme one se |
| 00:25 | ddellacosta | sec |
| 00:25 | ddellacosta | yeah, this one |
| 00:25 | ddellacosta | http://www.slideshare.net/yukihiro_matz/how-emacs-changed-my-life |
| 00:26 | tomoj | hah so we can blame emacs lisp for ruby syntax! |
| 00:27 | ddellacosta | yah, haha |
| 00:27 | tomoj | or maybe he means that he managed to succeed doing exactly what he wanted after a week of work |
| 00:27 | tomoj | I inferred that probably some of the syntax choices he made were influenced by what he could do in el |
| 00:27 | ddellacosta | I mean, it's illuminating though, 'cause it shows how foundational lisp was for ruby |
| 00:27 | ddellacosta | I always thought he was much more into smalltalk |
| 00:27 | ddellacosta | but after reading that slideshow I started to think it was actually lisp |
| 00:28 | ddellacosta | with smalltalk OO, and perl sprinkled on top |
| 00:28 | callen | Raynes: thought you might like it. |
| 00:28 | callen | Raynes: way better than coderwall, although still flawed. |
| 00:28 | ddellacosta | but yeah, emacs ruby-mode was key huh? |
| 00:28 | ddellacosta | ha |
| 00:28 | callen | ddellacosta: Matz knows his shit. |
| 00:29 | ddellacosta | callen: agreed. |
| 00:29 | ddellacosta | "Emacs changed my life forever. Thank you." |
| 00:30 | seangrove | ddellacosta: You should be aware that callen is an inveterate troll |
| 00:30 | seangrove | While I agree with his current sentiment, it's no indication that he's not generally insane :) |
| 00:30 | ddellacosta | seangrove: haha…I am an inveterate naive optimist, so we'll get along just fine. He'll play me like a fiddle, and I won't have a clue. |
| 00:32 | Raynes | I don't think callen is a troll. I think he has far too much energy in his fingers. |
| 00:33 | ddellacosta | anyways, I've talked to callen before now on IRC, and he strikes me as curmudgeonly more than trollish. |
| 00:33 | seangrove | Raynes: Judging from a blackbox perspective, it's hard to tell |
| 00:33 | callen | Raynes: the real explanation is that I don't need cocaine because I drink coffee. |
| 00:33 | amalloy | he would be a troll if he didn't believe what he said. i think he's just loud and angry |
| 00:33 | callen | ddellacosta understands me! |
| 00:33 | ddellacosta | haha |
| 00:33 | callen | ddellacosta: I am Diogenes of Sinope :) |
| 00:33 | ddellacosta | I try. |
| 00:33 | callen | amalloy is just mad because I got swag. |
| 00:33 | callen | and the very best in cynical heritage. |
| 00:34 | ddellacosta | ah, I see, I had to look up that reference. |
| 00:34 | ddellacosta | callen: a predecessor to the Stoics, then? |
| 00:34 | callen | ddellacosta: Something like that. |
| 00:35 | callen | ddellacosta: the cynic "school" (barely a thing) was its own mode of thought, stoics borrowed some stuff and then went deep into VIRTUUUUUUEEEE |
| 00:35 | callen | the cynic merely acknowledges that there are no virtuous men, so why not live simply? |
| 00:35 | ddellacosta | callen: ah…I'm only familiar with the common usage of cynic, less so the more philosophical concept. |
| 00:36 | ddellacosta | interesting |
| 00:36 | seangrove | callen: Fully agreed re: simplicity. Outsource non-core needs to those who do it well, like.... firebase |
| 00:36 | callen | ddellacosta: the actual cynic school of philosophy is great. |
| 00:36 | callen | seangrove: cynicism is not selling yourself into slavery/sharecropping. |
| 00:36 | callen | seangrove: there's a strong self ownership / individualist streak. |
| 00:36 | ddellacosta | callen: reading about it now. Seems cool. Thanks for the new info! |
| 00:37 | callen | ddellacosta: always! |
| 00:37 | seangrove | callen: Yes, that does seem to be inline with Diogenes' morales |
| 00:38 | callen | incidentally, there's a myth about Diogenes getting captured and sold as a slave |
| 00:38 | callen | he told the man he was being sold to that he was better than him and could raise his children better than him |
| 00:39 | ddellacosta | haha |
| 00:39 | callen | the buyer was instantly convinced and took him home ot run his household and educate his sons. |
| 00:39 | callen | supposedly they were very successful. |
| 00:40 | ddellacosta | well, he sounds impressive and I appreciate some of his ideas, but I think I am far to hedonistic to pattern my life after his in any meaningful way |
| 00:40 | ddellacosta | far to -> far too |
| 00:40 | callen | ddellacosta: he was hedonistic in his own way |
| 00:40 | callen | ddellacosta: he was simply unwilling to sacrifice his dignity to enhance his comfort. |
| 00:40 | ddellacosta | ah, I can see the the distinction |
| 00:41 | callen | ddellacosta: he was once invited to a lavish dinner, a man at the dinner table insulted him, possibly making a comment about him living like a dog. Diogenes proceeded to urinate on him at the dinner table to prove him right about his doghood. |
| 00:41 | ddellacosta | haha |
| 00:41 | callen | ^^ this is the callen behavior playbook btw |
| 00:41 | ddellacosta | callen: I was just reading the section in wikipedia about dogs |
| 00:41 | callen | you have been warned. |
| 00:41 | ddellacosta | understood. :-) |
| 00:43 | yogthos | wink: ah might've been cached and nobody hit that page since it got fixed :) |
| 00:48 | callen | yogthos: hey! how have you been? |
| 00:48 | callen | yogthos: http://osrc.dfm.io/yogthos |
| 00:48 | yogthos | callen: not too bad :) |
| 00:48 | yogthos | callen: haha awesome :P |
| 00:48 | callen | yogthos: new best practices for korma, ping me if you want info. |
| 00:48 | yogthos | callen: will do in the morning :P |
| 00:49 | yogthos | callen: gotta be sleeping soonish here :) |
| 00:49 | callen | yogthos: sure just nag me. |
| 00:50 | yogthos | callen: might actually have a few questions too :) |
| 00:52 | callen | yogthos: please send me them, I love Qs. |
| 00:52 | yogthos | callen: awesometastic :) |
| 01:00 | tomoj | can you implement many-to-every on top of many-to-many? |
| 01:00 | tomoj | channels |
| 01:01 | tomoj | oh, hmm. many-to-every would probably be really weird. |
| 01:17 | mthvedt | is there a way to check if a fn will return a primitive, given some # of args |
| 01:17 | alex_baranosky | anyone know if R can output EDN? |
| 01:18 | akhudek | mthvedt: no, you either check the return type every call or try to used typed clojure |
| 01:19 | akhudek | though not sure how easy typed clojure is to use at this point |
| 01:19 | mthvedt | akhudek: not a case of type-safety, i want to know if something returns a long or a Long |
| 01:20 | mthvedt | the compiler can figure it out, so it might be possible in theory |
| 01:22 | akhudek | mthvedt: the compiler doesn't know either, you need to check the type of values dynamically. The compiler does have type hints to avoid this, though I can't comment on the details of how those work. |
| 01:22 | akhudek | but multimethods, for example, dynamically check the type of values on the go |
| 01:22 | akhudek | similarly calling java methods does reflection without type hints |
| 01:25 | mthvedt | akhudek: the compiler does figure it out, that's why fns with primitive hinted return values are much faster |
| 01:26 | mthvedt | it's not the jvm that does that, the jvm is bad at auto boxing removal. |
| 01:27 | mthvedt | this is implemented as various interfaces in IFN supporting primitive invocation and return values |
| 01:29 | akhudek | mthvedt: I'm not very well versed on how type hints work internally. I've always assumed that if you hint a function, the compiler uses the optimized path for that type and errors out if it actually receives something else. I've never actually tried incorrectly hinting function. |
| 01:30 | akhudek | in any case, there is theoretically no way to know the return type of a function ahead of time without either specifying it manually or doing fancy type inference |
| 01:32 | akhudek | what is your use case? |
| 01:33 | mthvedt | akhudek: i'm writing macros that wrap fns that are used in tight loops. if there's a mismatch between, say, long and Long, there's a big performance penalty. |
| 01:34 | mthvedt | what's particularly bad is that clojure has its own helpful version of a long cast that it supplies, which can't be inlined. so you're paying both for boxing and a long jump on certain mismatches |
| 01:35 | mthvedt | or at least, my jvm won't inline it |
| 01:35 | mthvedt | in my setup |
| 01:35 | livingston | so await will wait for all work from this thread to an agent to be complete, but what if I want to wait for all work from all threads? (i.e. I have a thread pool that's feeding an agent serializing data to an output file, I want to close that file but only after all relevant send-offs are complete...) |
| 01:39 | akhudek | mthvedt: that's an interesting problem. It does sound like something that type checking would help with, though I can't think of anything in clojure that would help there. |
| 01:41 | mthvedt | akhudek: it's really only the primitive/non primitive case that has a large performance penalty. |
| 01:41 | mthvedt | the JVM is very good at guessing object types, particularly when it can inline |
| 01:43 | akhudek | mthvedt: you basically want it to throw an error if you ever find a Long? |
| 01:43 | akhudek | or actually change behaviour? |
| 01:43 | mthvedt | akhudek: basically, i want the macro to generate a wrapping fn that matches the type of the underlying fn. which in clojure can only be long, double, or Object |
| 01:44 | akhudek | oh I see |
| 01:44 | akhudek | there must be a way to access type hints |
| 01:45 | mthvedt | fns are a special case, because in fns the return type can depend on arity, i think (haven't confirmed) |
| 01:45 | mthvedt | but the macro knows the arity |
| 01:47 | akhudek | mthvedt: if you type hint a function you can call meta on the function symbol and it seems to give something |
| 01:49 | akhudek | huh, nevermind, that doesn't work with defn |
| 01:49 | mthvedt | right, fns are a special case somehow. |
| 01:50 | akhudek | annoying, I can only suggest looking through the clojure source |
| 01:57 | livingston | is there a way to know if there are sends or send-offs pending or in-progress for an agent? |
| 02:26 | suiang____ | so is there any clojure ORM which could cache the object in redis implicitly? |
| 03:14 | wei_ | compojure question: how do I disable wrap-restful-format for specific routes? for example, I have a websocket endpoint that compojure is trying to convert into JSON. |
| 03:15 | weavejester | wei_: Just separate out the routes into ones you want to apply the middleware and ones you don't. |
| 03:20 | wei_ | weavejester: like this? https://gist.github.com/yayitswei/5618027 I'm getting "null" when I load / now |
| 03:37 | wei_ | ^ oh nevermind, that works |
| 05:16 | spoon16 | I have a sequence that I want to partition by a vector of indexes (partition-by-index [3 7 9] (repeat 1)) => ([1 1 1] [1 1 1 1] [1 1]) |
| 05:16 | spoon16 | is there an interesting way to do this with built in clojure.core functions? |
| 05:17 | spoon16 | the last partition in my example would continue into infinity |
| 05:32 | rasputnik | i'd love to use clj-xmpp but need a newer version of one of its dependencies . Is there a decent guide for putting your own bits in clojars? |
| 05:33 | noidi | spoon16, here's an uninteresting, quick'n'dirty way to do it :) https://www.refheap.com/paste/14809 |
| 05:37 | noidi | and it doesn't even handle your requirement of returning the rest of the infinite sequence |
| 05:37 | noidi | oh well, someone will soon tell you how to do it on one line with two built-in functions :) |
| 05:50 | noidi | bleh, I was bored and did a slightly improved version https://www.refheap.com/paste/14810 |
| 06:20 | fleehode | what about the performance of datomic compare to pgsql? |
| 06:24 | icarot | This channel sure does die at night. |
| 06:25 | Foxboron | at night? |
| 06:25 | Foxboron | Early morning here in Norway |
| 06:25 | fleehode | but this is not night at my location :] |
| 06:25 | icarot | Well, it could just be a coincidence, but it seems like it dies down a ton whenever it is night time here in Western America (GMT -7) |
| 06:25 | fleehode | its 18:19 here |
| 06:25 | icarot | 3:19 here. |
| 06:25 | Foxboron | icarot: i think more then half of the IRC community is US based |
| 06:26 | Foxboron | 12:19 |
| 06:26 | icarot | (San Francisco) |
| 06:26 | fleehode | i just stuck with the sql problem |
| 06:26 | fleehode | and after seached the final answer |
| 06:27 | icarot | I just expect conversations about things I do not have any semblance of a basic understanding of (FRP, logic programming on top of Hadoop/Cascading) etc. |
| 06:27 | fleehode | i was think is there any db using custimized lisp as the querying lang |
| 06:27 | icarot | And it seems to die down around here, heh. That's all. |
| 06:28 | fleehode | ok zombie time, hello, is there Mr zombie? |
| 06:31 | Foxboron | we should make a irc bot having a markov chain |
| 06:31 | Foxboron | call it zombie, feed it with clojure and FP stuff |
| 06:32 | Foxboron | and let it ramble in the middle of the night so the chan seem active |
| 06:32 | Foxboron | then we call it "Mr.Zombie" |
| 06:33 | ivan | fleehode: are you looking for datomic? |
| 06:33 | ivan | oh, I see the performance question above now |
| 06:35 | fleehode | ivan: just ask , as i said, i am angry with sql |
| 06:36 | fleehode | pgsql channel's guy responsed my features request by `could work in therotic` but they need abey the sql standard |
| 06:37 | mynomoto | fleehode: Have you looked at honeysql? |
| 06:38 | fleehode | mynomoto: nope maybe you could give some quick intros ? |
| 06:39 | mynomoto | https://github.com/jkk/honeysql |
| 06:39 | mynomoto | You can use maps to generate sql queries. |
| 06:39 | fleehode | got it , this is a trans level |
| 06:41 | fleehode | mynomoto: this wont improve the performance i think |
| 06:42 | mynomoto | Only yours :) Not the db. |
| 06:44 | fleehode | i see sqlite use a vm design |
| 06:45 | fleehode | which i dont know if it could apply lisp as query language |
| 06:45 | fleehode | just like clojure on jvm, by another compiler |
| 07:24 | mpenet | honeysql is nice but incomplete, it only supports select statements |
| 07:39 | spoon16 | ,(defn ^bytes y [] (.getBytes "hi"))(String. (y)) |
| 07:39 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 07:41 | AWizzArd | Hi, any RegExperts here? I want all texts between x and y, without matching x/y. I tried this: |
| 07:41 | AWizzArd | ,(re-seq #"(?<=x).*(?=y)" "x123y---x456y") |
| 07:41 | clojurebot | ("123y---x456") |
| 07:41 | AWizzArd | Instead I wanted ==> ("123" "456") |
| 07:41 | spoon16 | ^^ this code is throwing a "Unable to resolve classname: clojure.core$bytes" https://www.refheap.com/paste/14812 |
| 07:46 | spoon16 | ,(re-seq #"[\d]+" "x123y---x456y") |
| 07:46 | clojurebot | ("123" "456") |
| 07:46 | spoon16 | AWizzArd: does that work for you? |
| 07:47 | Anderkent | What's the right way to get the maximum (last) key from a sorted set? |
| 07:47 | Anderkent | last is linear afaik |
| 07:48 | spoon16 | AWizzArd: also this, which is maybe a better answer given your "between x and y criteria" |
| 07:49 | spoon16 | ,(map second (re-seq #"x([^y]+)y" "x123y---x456y")) |
| 07:49 | clojurebot | ("123" "456") |
| 07:49 | spoon16 | (map second (re-seq #"x([^xy]+)y" "x1a23y---x45x6y")) |
| 07:49 | spoon16 | ,(map second (re-seq #"x([^xy]+)y" "x1a23y---x45x6y")) |
| 07:49 | clojurebot | ("1a23" "6") |
| 07:49 | Anderkent | ah, (first (rseq ...)) |
| 07:50 | ucb | ,(doc rseq) |
| 07:50 | clojurebot | "([rev]); Returns, in constant time, a seq of the items in rev (which can be a vector or sorted-map), in reverse order. If rev is empty returns nil" |
| 07:50 | ucb | nice. |
| 07:50 | spoon16 | ,(map second (re-seq irc://irc.freenode.net:6667/#"x([^y]+)y" "x1a23y---x45x6y")) |
| 07:50 | clojurebot | #<CompilerException java.lang.RuntimeException: No such namespace: irc://irc.freenode.net:6667, compiling:(NO_SOURCE_PATH:0:0)> |
| 07:50 | Anderkent | not really, but I guess it's manageable |
| 07:50 | Anderkent | `last` should do that |
| 07:50 | spoon16 | ,(map second (re-seq irc://irc.freenode.net:6667/#"x([^y]+)y" "x1a23y---x45x6y")) |
| 07:50 | clojurebot | #<CompilerException java.lang.RuntimeException: No such namespace: irc://irc.freenode.net:6667, compiling:(NO_SOURCE_PATH:0:0)> |
| 07:50 | spoon16 | hmm |
| 07:52 | rasputnik | i'm using clojure.tools.logging, where would i put the log4j.properties for leiningen to find it? |
| 07:52 | Anderkent | rasputnik: project-root/resources |
| 07:52 | echo-area | Anderkent: `last' also works on non-sorted sequences |
| 07:52 | rasputnik | Anderkent: thanks! |
| 07:53 | echo-area | While `rseq' only works on sorted sequences |
| 07:53 | Anderkent | echo-area: sure, but it could check whether it's given a reversible one. Oh well. |
| 07:54 | echo-area | Hmm, I guess `last' (as well as some others) are only helper functions for core.clj, or defining macros. |
| 07:55 | echo-area | `butlast', for example |
| 08:38 | Anderkent | Is there a filter/map combined? I.e. return f(x) for every x in map whenever f(x) is truthy |
| 08:40 | dnolen` | Anderkent: no, but it's just (filter identity (map f xs)) |
| 08:41 | llasram | `keep` ? |
| 08:41 | marutks | reducers? |
| 08:41 | Anderkent | keep, yes |
| 08:41 | clojurebot | reducers are http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html |
| 08:41 | Anderkent | thanks |
| 08:42 | dnolen` | Anderkent: I always forget about keep |
| 08:42 | dnolen` | Anderkent: tho it'll return false values |
| 08:42 | Anderkent | yeah it's what I want |
| 08:42 | Anderkent | the fn is a (when-let .) |
| 09:56 | CookedGryphon | Ugh, I'd like to use timbre more, but I quite often don't bother because I can never remember the namespace. Does anyone else have this trouble? I have to look it up every time! |
| 10:05 | devn | technomancy: what did you do to fix it? (the issue with lucene/clucy) |
| 10:18 | mefesto | is there a built-in cljs function for converting a hashmap to js object? |
| 10:19 | mefesto | easy enough to implement, just wondering if it exists in core cljs |
| 10:22 | nDuff | mefesto: sounds like maybe you want clj->js |
| 10:22 | mefesto | nDuff: ah thanks. |
| 10:41 | tomoj | I dreamt I understood monads |
| 10:41 | tomoj | :( |
| 10:41 | seangrove | Really? |
| 10:48 | gfredericks | memory question |
| 10:49 | gfredericks | I make a query to postgres via java.jdbc that reads back ~3gb of data |
| 10:49 | gfredericks | there is a :row-fn that parses some json in clojure data structures, and then a :result-set-fn of `count` |
| 10:50 | gfredericks | i.e., it ought to simply take the result-set-seq and read through it |
| 10:50 | gfredericks | when I monitor the memory with visualvm, I see it climb from nothing past 4gb; at that point it keeps climbing, but GC periodically takes it back to 4gb |
| 10:51 | gfredericks | once the query is finished, GC can clean up the 4gb as well |
| 10:51 | gfredericks | the question is -- what the hell are those 4gb? |
| 10:51 | tomoj | seangrove: well, maybe more hypnagogia than dream. I was reading this before bed http://web.science.mq.edu.au/~mmccurdy/cms2010talk.pdf |
| 10:52 | tomoj | but the feeling that it makes sense is mostly gone this morning :) |
| 10:57 | seangrove | tomoj: Well, maybe that's the first step :) |
| 10:57 | seangrove | Or some subsequent step, who knows |
| 10:58 | seangrove | I still have a feeling that Clojure is a more practical language than Haskell, but more and more I think that's just biased based on my current limitations |
| 11:00 | vijaykiran | what's correct syntax for using java method in function arg-destructuring ? |
| 11:00 | vijaykiran | I'm looking for something like: (defn foo-date [day (.get c Calendar/DAY_OF_MONTH) ^java.util.Calendar c]) |
| 11:00 | gfredericks | vijaykiran: that's not possible |
| 11:00 | gfredericks | you'll need let |
| 11:01 | vijaykiran | yeah, I had a let which was working fine though |
| 11:01 | vijaykiran | any specific reason why it isn't possible ? I thought the destructuring sytax is same everywhere |
| 11:03 | gfredericks | it is |
| 11:03 | gfredericks | you're probably confusing destructuring with the other stuff that let does |
| 11:03 | vijaykiran | ah - true - this isn't destrcturing |
| 11:04 | vijaykiran | I guess I'm conflating destruct with binding - sorry for the noise |
| 11:04 | gfredericks | no problem |
| 11:05 | vijaykiran | in an unrelated question - anyone knows a fancy clojure library to parse tabular-delimited data ? |
| 11:05 | gfredericks | kind of a pitty data.csv doesn't do it |
| 11:11 | gfredericks | is it to be expected that clojure.walk doesn't work with records? |
| 11:12 | bbloom | gfredericks: yes. |
| 11:19 | gfredericks | is that a solvable problem? with a jira ticket? |
| 11:20 | bbloom | gfredericks: consider the `empty function |
| 11:20 | bbloom | gfredericks: so no, not really... |
| 11:21 | gfredericks | well if you know what the special keys are |
| 11:21 | gfredericks | and you follow the rule that dissoc'ing a special key reverts to a vanilla map |
| 11:22 | gfredericks | do records have an API for exposing their special keys? |
| 11:24 | dnolen | gfredericks: you can get the basis |
| 11:25 | gfredericks | it sounds doable |
| 11:25 | gfredericks | after not having thought about it long enough |
| 11:26 | dnolen | the lack of an empty protocol/interface still makes it problematic I think |
| 11:26 | TimMc | From this armchair, the problem looks entirely soluble. |
| 11:26 | dnolen | in core.logic I added an IUnitialized protocol to work around this |
| 11:26 | gfredericks | (defprotocol IFudgyEmptyable (-fudgy-empty [_])) |
| 11:27 | dnolen | in anycase conceptually an empty record makes little sense. Just that you have something with no initialized fields |
| 11:27 | gfredericks | yeah |
| 11:27 | gfredericks | I'm dealing with clojure.data.xml |
| 11:28 | gfredericks | which has an Element record |
| 11:28 | gfredericks | I wonder what the reasoning behind that choice was |
| 11:29 | tomoj | I often suspect we just need a walking protocol that could be extending to Element |
| 11:29 | tomoj | but I dunno what it would look like.. |
| 11:31 | gfredericks | I spend a lot of finger-effort reformatting my clj code in emacs by selecting all the lines for a given form and then hitting tab |
| 11:37 | mefesto | gfredericks: dunno if this saves any time but you can place the cursor that the beginning of the form and type C-M-q or M-x indent-sexp |
| 11:40 | gfredericks | mefesto: seems perfect; thanks :) |
| 11:43 | jodaro | it would be incredibly easy to polish off this entire thing of guacamole from whole foods in one sitting |
| 11:43 | jodaro | damn them |
| 11:56 | gfredericks | oh data.csv _can_ do tabs. oh well. |
| 12:01 | Foxboron | so messing with clojure and pprint, currently getting the first, but i want to format the output too the latter: http://hastebin.com/mofisivuhe.LISP |
| 12:05 | justin_smith | Foxboron: http://clojuredocs.org/clojure_core/1.3.0/clojure.pprint there are some vars listed on that page that influence pprint behavior |
| 12:06 | justin_smith | I think clojure.pprint/*print-miser-width* may help here |
| 12:07 | Foxboron | justin_smith: trying, dosnt give me any difference |
| 12:08 | justin_smith | yeah, I am experimenting with those variables too |
| 12:08 | TimMc | gfredericks: M-q will reindent the entire top-level form. Just don't hit it inside a string or comment. |
| 12:09 | Foxboron | justin_smith: *print-right-margin* works |
| 12:09 | Foxboron | or well, almost |
| 12:10 | justin_smith | ,(binding [pprint/*print-miser-width* 40 pprint/*print-right-margin* 30] (pprint [{:server "irc.test.net", :port 6667, :chans #{"#lobby"}} {:server "test", :port 6667, :chans #{"lol"}}])) |
| 12:10 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve var: pprint/*print-miser-width* in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 12:11 | justin_smith | well, it is excatly the output you wanted, if you have pprint bound to clojure.pprint |
| 12:11 | justin_smith | ,(binding [clojure.pprint/*print-miser-width* 40 clojure.pprint/*print-right-margin* 30] (clojure.pprint/pprint [{:server "irc.test.net", :port 6667, :chans #{"#lobby"}} {:server "test", :port 6667, :chans #{"lol"}}])) |
| 12:11 | clojurebot | #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.pprint> |
| 12:11 | Foxboron | justin_smith: yeah i see. Thanks :) |
| 12:11 | justin_smith | heh, I give up |
| 12:16 | gfredericks | TimMc: oh weird I never noticed that. I use M-Q for text all the time |
| 12:17 | justin_smith | before saving a file I like to M-< M-> M-x indent-region |
| 12:17 | justin_smith | also, M-x whitespace-mode and look for anything bright yellow or red |
| 12:20 | llasram | You can have whitespace-mode be a minor mode you have on in most major modes, and have whitespace-cleanup hang off of a before saving hook |
| 12:20 | llasram | Keeps everything nice and tidy! |
| 12:20 | justin_smith | I find it distracting during normal editing |
| 12:20 | technomancy | llasram: fsvo "everything" which does not include the git commit history |
| 12:21 | llasram | technomancy: That is the down-side -- I do turn it off when making patches to other people's code. But for stuff I'm going to touch extensively, I just have a "Clean up whitespace" commit first |
| 12:21 | technomancy | yeah, as long as it's in its own commit that's reasonable |
| 12:22 | llasram | justin_smith: You can customize what it shows. I have it just show out-of-place whitespace (mixed tabs + spaces, training whitespace etc) by default |
| 12:22 | justin_smith | llasram: I'll look into that some day, for now turning it on real quick before save and double checking the file is OK |
| 12:28 | justin_smith | And I have definitely had the experience of wanting to track down why someone wrote particular code, and find out git was only giving them credit because they re-indented it |
| 12:30 | technomancy | I think there's a flag you can give it to ignore whitespace-only changes |
| 12:30 | technomancy | but I'm not sure whether that works with blame or just diff |
| 12:30 | justin_smith | oh, that would be nice, I'd never heard of that |
| 12:31 | callen | gtrak: how did you overuse defroutes? |
| 12:39 | callen | wink: have you repro'd that clabango bug and created the issue yet? |
| 13:01 | wink | callen: https://github.com/danlarkin/clabango/issues/9 |
| 13:10 | technomancy | tpope: are you on this mailing list? https://groups.google.com/group/clojure-tools/browse_thread/thread/c08b628a9af8346d |
| 13:26 | callen | wink: yissssss |
| 13:26 | callen | wink: I love you now. |
| 13:27 | wink | callen: I'm shivering with anticipation |
| 13:28 | gfredericks | is there anything good for doing string conversions? camelcase and such? |
| 13:28 | callen | wink: too bad I am preoccupied with taco salad and stomach pain. |
| 13:28 | technomancy | yogthos|away: lemme know when you're back; I can clear out the clojars artifacts for luminus |
| 13:28 | technomancy | gfredericks: https://github.com/qerub/camel-snake-kebab |
| 13:28 | callen | yogthos|away: and when you're done showing technomancy love, ping me with your questions. |
| 13:29 | wink | callen: I'm quite unsure whether to ask what taco salad is or don't want to know |
| 13:29 | callen | "kebab case" well I'm glad I know what that is now. |
| 13:29 | rasmusto | lots of food references today |
| 13:29 | gfredericks | technomancy: ermahgerd |
| 13:29 | callen | wink: taco salad is the god of all food. |
| 13:29 | technomancy | gfredericks: I know, right? kebab-case. |
| 13:29 | technomancy | it's great. |
| 13:29 | jodaro | mmm, kebabs |
| 13:30 | technomancy | I don't think it's a widespread term yet, but I'm doing what I can to make that happen |
| 13:31 | llasram | "kebab-case" is more concise than "levitating-snake-case" |
| 13:31 | wink | they've built a fucking orthanc taco salad: http://www.foodnetwork.com/recipes/paula-deen/taco-salad-recipe/index.html |
| 13:32 | gfredericks | technomancy: oh man those function names (not listed in README) are clever |
| 13:33 | callen | wink: LOL |
| 13:43 | xeqi | technomancy, yogthos|away: why are we removing artifacts? |
| 13:44 | technomancy | xeqi: because aether is being annoying and fetching *every single pom* for templates even though it only needs the latest version and can get that with two calls =\ |
| 13:44 | xeqi | haha |
| 13:44 | xeqi | and its for templates, got it |
| 13:46 | technomancy | xeqi: do you know why it does that? |
| 13:46 | xeqi | as in what part of the code does it? |
| 13:46 | xeqi | I have a good idea from playing around with the version range checks |
| 13:47 | technomancy | more like the justification behind it |
| 13:47 | xeqi | but I don't have an idea off hand for the reason someone wrote it to do that |
| 13:48 | xeqi | well... I could see trying to restrict it to be very hard when having multiple version ranges from transative dependencies |
| 13:48 | xeqi | so, probably because it is easier to gather all the poms needed (including transative ones) to find out all the dependencies and then restrict |
| 13:49 | technomancy | I could see it checking older versions for ranges *if* the newest version had a range in it to see if older versions might jive better with additional range requirements. but checking older versions in the absence of resolving range conflicts makes zero sense. |
| 13:50 | technomancy | so yeah, probably just a lazy implementor =( |
| 13:57 | xeqi | technomancy: you could change the template to use "RELEASE" as a version when searching |
| 13:57 | xeqi | I think that only gets the latest pom/jar combon |
| 13:57 | technomancy | xeqi: huh; I did not know this fact |
| 13:58 | xeqi | well. I think you want "LATEST" |
| 13:59 | xeqi | source: 2nd answer on http://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of-a-dependency |
| 13:59 | xeqi | hmm, looks like the luminous template has a release version |
| 13:59 | technomancy | dunno, RELEASE is probably a better default |
| 14:00 | xeqi | and apparently so do my libs |
| 14:00 | technomancy | xeqi: thanks; this is perfect |
| 14:02 | xeqi | I don't remember implementing adding the release tag as part of pomegranate... |
| 14:02 | xeqi | wonder how it gets there |
| 14:02 | xeqi | I'll accept "magic" for now |
| 14:03 | xeqi | though adding one of those versions in a project.clj breaks deps :tree :p |
| 14:03 | technomancy | I have no problem with that =) |
| 14:06 | xeqi | also not caught by the new version range checks for 2.2.0 :( oh well |
| 14:10 | gfredericks | so certain kinds of errors cause 'lein run' to report that the class <main ns name> is not found |
| 14:10 | gfredericks | is that a clojure issue or a lein issue? |
| 14:11 | technomancy | gfredericks: hard to say |
| 14:12 | scottj | someone shared this funny github analytics link http://osrc.dfm.io |
| 14:12 | scottj | on Rich Hickey (creator of Clojure): "Rich is a champion Java expert...Rich seems to speak only one programming language: Java. Maybe it's about time to branch out a bit." |
| 14:12 | gfredericks | technomancy: do you know the error msg I'm talking about? |
| 14:13 | technomancy | gfredericks: I don't think so |
| 14:13 | gfredericks | technomancy: in this case it was caused by foo.main requires foo.bar requires foo.baz where foo.baz doesn't exist |
| 14:14 | gfredericks | technomancy: I'll work on a minimal example |
| 14:15 | TimMc | technomancy: ⟜-kebab-case- |
| 14:16 | gfredericks | technomancy: yeah simply foo.main requires foo.no-exist triggers it |
| 14:17 | TimMc | &(let [⟜-a- 3, ⟜-b- 5] (* ⟜-a- ⟜-b-)) |
| 14:17 | lazybot | ⇒ 15 |
| 14:17 | TimMc | Unicode makes everything better! |
| 14:17 | technomancy | gfredericks: what's the message? |
| 14:18 | tomoj | hmm 'multimap'? |
| 14:18 | TimMc | I don't know what it is, I just appropriated it. |
| 14:19 | gfredericks | technomancy: class not found foo.main |
| 14:19 | gfredericks | technomancy: if I change from `lein run` to `lein run -m foo.main/-main` I get class-not-found: "foo.main/-main" |
| 14:21 | hiredman | my guess is lein tries to fall back to loading a class and calling a static main |
| 14:22 | technomancy | yep |
| 14:22 | hiredman | and swallows the errors loading the foo.main namespace |
| 14:22 | technomancy | I want to get rid of that; I don't think calling Java methods is worth supporting in the run task |
| 14:23 | technomancy | it only swallows FileNotFound, but in this case that's enough to do it |
| 14:23 | technomancy | I guess we could inspect the exception message, but I'd rather just ditch Java support |
| 14:23 | technomancy | move it to a plugin |
| 14:23 | technomancy | or use another option than -m for it |
| 14:24 | gfredericks | I don't have a strong opinion on it |
| 14:25 | gfredericks | this just comes up often (most ns typos) and confuses the heck out of my coworkers |
| 14:25 | gfredericks | who conclude "clojure is terrible" |
| 14:26 | technomancy | just wait till you upgrade to lein3; that'll show em |
| 14:26 | gfredericks | right on |
| 14:27 | hiredman | ^- a result of relying heavily on tools |
| 14:27 | hiredman | you should just hand them notepad and a repl |
| 14:30 | tpope | technomancy: it was out of sight out of mind |
| 14:33 | technomancy | what do you call the third member of a triumvirate? |
| 14:34 | technomancy | whatever it is, it'd be good to get the input from it in this case |
| 14:34 | tomoj | apparently right multimap is used for linear logical implication, which maps onto CSP |
| 14:34 | tomoj | :) |
| 14:34 | gfredericks | technomancy: so would you accept an error message patch for the issue? |
| 14:35 | technomancy | gfredericks: sure |
| 14:36 | gfredericks | technomancy: how do I test running a local leiningen? |
| 14:36 | technomancy | gfredericks: CONTRIBUTING.md covers it I think |
| 14:36 | gfredericks | technomancy: yehuda man |
| 14:37 | gfredericks | er, you da man |
| 14:51 | `fogus | Does anyone have a (srsly-load-the-thing-from-ANYWHERE-on-the-classpath-dammit "filename") function that they could share? |
| 14:53 | lglenn | technomancy: the third member of a triumvirate is a triumvir. As are the first and second, unfortunately. |
| 14:54 | tpope | technomancy: I'll see what I can do. Kind of swamped these next couple of weeks |
| 14:57 | technomancy | lglenn: TIL |
| 14:57 | mefesto | is there a way to configure nrepl so that when i 'nrepl-jack-in that it uses the current emacs window and doesn't create a new one? |
| 14:57 | jtoy | im trying to figure out why my code broke, but has anyone seen errors like: Exception in thread "main" java.lang.IllegalArgumentException: Malformed member expression, compiling:(clj_liblinear/core.clj:49:5) |
| 14:58 | jtoy | the code compiles fine on my box, but on every other box i try on i get that error |
| 14:59 | jtoy | I think its because I upgraded leinigen |
| 14:59 | mefesto | jtoy: did you do a lein clean on your system ? |
| 15:00 | jtoy | mefesto: on all the boxes i tried on, they are clean |
| 15:00 | Glenjamin | which implies yours is the unclean one :) |
| 15:00 | mefesto | im guessing you have run `lein clean` on yours as well? |
| 15:01 | mefesto | lein clean && lein compile |
| 15:01 | jtoy | hmm, i just did lein clean and it breaks now |
| 15:01 | jtoy | although it was working before :( |
| 15:01 | hiredman | technomancy: have you read any of the revelation space books? |
| 15:02 | technomancy | hiredman: doesn't ring a bell |
| 15:02 | hiredman | they feature a triumvir |
| 15:02 | mefesto | jtoy: well at least when you fix it for yourself it should be fixed for all others :) |
| 15:02 | technomancy | nice |
| 15:03 | hiredman | technomancy: "Revelation Space" the titular book is great |
| 15:06 | hiredman | technomancy: if I've every mentioned conjoiner drives to you, "conjoiner drives" are a thing in revelation space (but not engines for doing joins) |
| 15:07 | jtoy | mefesto: yup,thx |
| 15:09 | amalloy | jtoy: malformed member expression? that comes from expressions like (.5 x) |
| 15:09 | amalloy | ie, trying to access the field named "5" on the object x |
| 15:09 | hiredman | ,(.foo) |
| 15:09 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: Malformed member expression, expecting (.member target ...)> |
| 15:09 | amalloy | oh, that's probably more likely |
| 15:10 | amalloy | you can also get it with exciting things like (. x (((((blah)))))) |
| 15:10 | trptcolin | that *is* exciting |
| 15:14 | pjstadig | that used to be exciting to me, but it's too mainstream now |
| 15:15 | gfredericks | the hipsters use (. x ((((((blah)))))))? |
| 15:17 | kmicu | the haskell hipsters use ((.) x (((((blah)))))) |
| 15:18 | amalloy | (inc kmicu) |
| 15:18 | lazybot | ⇒ 1 |
| 15:27 | amalloy | gfredericks: kinda sounds like a 1920s gang of bank robbers |
| 15:28 | gfredericks | man why do the 1920's have to be in the past |
| 15:29 | guns | Wow, java.util.concurrent is a magical candy store. |
| 15:30 | pjstadig | guns: truth |
| 15:31 | guns | I was abusing futures and making spaghetti. Replaced it all with a cached thread pool, and everything just works. |
| 15:32 | mefesto | i love clojurescript but man these compiler errors are tough on my brain. |
| 15:33 | tomoj | still no line numbers? :( |
| 15:33 | kmicu | @tryhaskell (((((.) . (.)) (((length))) ((((filter))))) ((((>0)))) ((([1,0,1]))))) |
| 15:34 | hyPiRion | $tryhaskell 1 |
| 15:34 | lazybot | ⇒ 1 |
| 15:34 | kmicu | I call it lispell ;] |
| 15:34 | kmicu | $tryhaskell (((((.) . (.)) (((length))) ((((filter))))) ((((>0)))) ((([1,0,1]))))) |
| 15:34 | lazybot | ⇒ 2 |
| 15:39 | mefesto | using cljs + atom + add-watch to drive page updates is just plain badass :) |
| 15:41 | asteve | I have to have hardcoded numbers for the size of a vectors, I cannot pass the size as input into the function |
| 15:41 | asteve | what is the best solution other than writing them in both functions |
| 15:41 | asteve | creating a dynamic? |
| 15:42 | asteve | I guess I could define the result |
| 15:45 | hyPiRion | asteve: dynamic or just def them |
| 15:52 | mefesto | is it bad practice to keep your *.cljs files in the main project's src dir? |
| 15:53 | mefesto | so far all i notice is that `lein cljsbuild auto` recompiles on *.clj file saves. i was expecting that to only happen for *.cljs files. |
| 15:54 | cmajor71 | mefesto: you can tell cljsbuild where the files are: |
| 15:54 | cmajor71 | :cljsbuild |
| 15:54 | cmajor71 | {:builds |
| 15:54 | cmajor71 | [{:source-paths ["src/yourprj/client"], |
| 15:55 | cmajor71 | so it is only triggered on cljs updates |
| 15:56 | supersym | mefesto: I use https://github.com/Gozala/wisp now :) |
| 15:58 | mefesto | cmajor71: thanks. i had separate src dirs ["src/clj" "src/cljs"] but decided to just have .cljs files intermingled with my .clj files. maybe i'll have a myapp/client ns like in your example. |
| 15:59 | supersym | The compilation/optimization is very much not the same though |
| 16:00 | cmajor71 | mefesto: sure, that works well for me |
| 16:00 | cmajor71 | supersym: why would you prefer wisp over cljs? |
| 16:00 | spoon16 | what is the appropriate way to write a map so that it can be read using clojure.edn/read |
| 16:01 | mefesto | spoon16: i think the pr functions are what you want |
| 16:01 | cmajor71 | ,(read-string "{:a 1}") |
| 16:01 | clojurebot | {:a 1} |
| 16:01 | cmajor71 | ? |
| 16:01 | mefesto | (pr {:username "mefesto"}) |
| 16:01 | mefesto | ,(pr {:a 1 :b 2}) |
| 16:01 | clojurebot | {:a 1, :b 2} |
| 16:01 | spoon16 | thanks |
| 16:02 | mefesto | ,(with-out-str (pr {:a 1 :b 2})) |
| 16:02 | clojurebot | "{:a 1, :b 2}" |
| 16:02 | mefesto | ,(read-string (with-out-str (pr {:a 1 :b 2}))) |
| 16:02 | clojurebot | {:a 1, :b 2} |
| 16:05 | cmajor71 | going back to clojurescript (read-sting "{:a 1}") is a frequent guest, as well as reading numbers, dates, vectors, etc.. to connect browser to the server via data |
| 16:06 | kofno | ok |
| 16:08 | cmajor71 | map is king of data, reader is king of homoiconicity :) |
| 16:10 | tomoj | cmajor7: don't use read-string for connecting the server to the browser |
| 16:10 | tomoj | oh you meant edn/read-string? |
| 16:11 | trptcolin | the reader is also earl of eval. |
| 16:12 | cmajor7 | tomoj: correct, http://clojure.github.io/clojure/clojure.edn-api.html |
| 16:13 | tomoj | I would always say edn/read-string :) |
| 16:13 | cmajor7 | agree, it's clearer |
| 16:13 | tomoj | (:require [clojure.edn :refer [read-string]]) (:refer-clojure :exclude [read-string]) seems.. risky |
| 16:14 | cmajor7 | or just clojure.lang.EdnReader/readString :) |
| 16:14 | cmajor7 | get it raw and fresh |
| 16:15 | mefesto | is there a way to configure eshell to stop saying, "WARNING: terminal is not fully functional" ? |
| 16:15 | antares_ | Elastisch 1.1 is released: http://blog.clojurewerkz.org/blog/2013/05/21/elastisch-1-dot-1-0-is-released/ |
| 16:15 | technomancy | mefesto: I don't see anything wrong with storing cljs in src/ |
| 16:16 | mefesto | or better yet, is there a way to make eshell fully functional :) |
| 16:16 | technomancy | mefesto: what I do is export PAGER=cat |
| 16:16 | Raynes | technomancy: There is an obvious connection between us. |
| 16:16 | technomancy | for eshell |
| 16:16 | mefesto | technomancy: thanks i'll try that |
| 16:17 | Raynes | technomancy: http://osrc.dfm.io/Raynes |
| 16:17 | Raynes | We're meant to be friends, you see. |
| 16:17 | technomancy | Raynes: my heart has always told me so |
| 16:18 | trptcolin | mine claims i'd rather be commenting on issues than pushing code. dammit. |
| 16:18 | supersym | cmajor71: good question. Learning purposes most of it really. Less output to dig through, and a chance to learn some more basic lisp/functional programming styles, as I'm not a native |
| 16:18 | Raynes | so: You have a horribly common nickname. How do you live with all of the highlights when people say 'so'? |
| 16:18 | mefesto | technomancy: heh i actually prefer the warning message now :-) |
| 16:19 | rasmusto | Raynes: who says so? |
| 16:19 | mefesto | technomancy: running `git show` in eshell with `setenv PAGER cat` isn't good |
| 16:19 | technomancy | mefesto: wait why would you use CLI git from inside Emacs? |
| 16:19 | technomancy | git's CLI is awful =( |
| 16:19 | mefesto | technomancy: im being silly these days :) |
| 16:19 | Raynes | So's your face. |
| 16:20 | mefesto | technomancy: yeah it's on my list to learn the git emacs stuff |
| 16:20 | mefesto | i finally got around to paredit and have been kicking myself for taking so long to use it |
| 16:20 | technomancy | mefesto: oh man, prepare to have a great weight lifted from your shoulders |
| 16:20 | rasmusto | so... he must not have the addon to irssi |
| 16:20 | mefesto | im sure i'll feel the same way with the emacs git stuf |
| 16:20 | technomancy | going from regular git to magit/vc is almost like learning paredit, yeah |
| 16:21 | mefesto | there's only so much cool shit my brain is capable of absorbing. cljs is taking the lions share atm |
| 16:21 | technomancy | "Here is Edward Bear (a.k.a. Winnie The Pooh), coming down the stairs, bump, bump, bump, on the back of his head, behind Christopher Robin. It is, as far as he knows, the only way of coming downstairs, but sometimes he feels that there really is another way, if only he could stop bumping for a moment and think of it. And then he feels that perhaps there isn't." <- git's UI |
| 16:21 | pppaul | magit? |
| 16:21 | mefesto | cljs + paredit + magit/vc ... dunno i just think my nose will start bleeding if i tackle all of them at once |
| 16:22 | pjstadig | :( |
| 16:22 | pppaul | paredit is easy :) |
| 16:22 | pjstadig | i actually prefer the git CLI to magit in some cases |
| 16:22 | cmajor7 | mefesto: all the same 0s and 1s, just ordered differently |
| 16:22 | cmajor7 | and have names |
| 16:23 | duncanm | dnolen: heya |
| 16:23 | technomancy | classic: http://stevelosh.com/blog/2013/04/git-koans/ |
| 16:23 | duncanm | any of you goign to Strange Loop? |
| 16:23 | mefesto | added to my instapaper: http://www.emacswiki.org/emacs/Magit |
| 16:23 | brainproxy | if you occasionally need some hand-holding with respect to visualizing some complicated git stuff you've done or are doing, SourceTree is nice |
| 16:23 | brainproxy | http://www.sourcetreeapp.com/ |
| 16:23 | duncanm | brainproxy: it's a little slow sometimes |
| 16:23 | duncanm | i like using 'tig' |
| 16:35 | mefesto | M-x magit-wazzup |
| 16:35 | mefesto | :) |
| 16:52 | mefesto | wow magit is very intuitive |
| 16:57 | Okasu | mefesto: Magit eats my merges. :( |
| 16:58 | mefesto | uh oh |
| 16:58 | Okasu | Might be some kind of bug or something but in the middle of automerge magit crashes horribly. |
| 16:58 | mefesto | are you on the latest version? |
| 16:58 | Okasu | Yeah. |
| 16:59 | mefesto | Okasu: well i'll definitely be careful when i need to do that :-\ |
| 16:59 | amalloy | i don't use magit, but i doubt anyone would use it if it couldn't merge |
| 17:01 | Okasu | amalloy: It can merge, my coworker uses magit happily for years and it works for him just fine. It can be my specific corner case, just be aware of it. |
| 17:02 | Okasu | http://www.mail-archive.com/magit@googlegroups.com/msg00518.html I've encountered something like that but fix from that thread didn't helped much. |
| 17:02 | Okasu | Automerge -> funky unicode chars -> crash. |
| 17:25 | howdynihao | hi, using lein to start a project repl |
| 17:25 | howdynihao | is there anyway i can have it refresh the source without having to restart the repl? |
| 17:26 | TimMc | howdynihao: You can pass :reload or :reload-all to `require` and `use`. |
| 17:26 | TimMc | So you can periodically say (require 'my.namespace :reload-all) from the REPL. |
| 17:29 | howdynihao | thank you |
| 17:30 | howdynihao | is the convention to use java interop whenever possible over a plugin? |
| 17:30 | howdynihao | like for making an http request |
| 17:30 | howdynihao | well i guess any plugin would just use java anyway right? |
| 17:31 | technomancy | howdynihao: maybe you mean libraries? |
| 17:33 | howdynihao | im not sure what i mean, i'm new to java AND clojure haha |
| 17:34 | howdynihao | outside of clojure docs i'm lost, i know there are leinegen plugins, there are jars , theres java api |
| 17:34 | technomancy | "plugin" usually means something used to extend an existing end-user application |
| 17:34 | howdynihao | not sure where to look first to do simple things that are 'standard library' stuff, i'm guessing just stick with java |
| 17:35 | technomancy | typically search github for libraries; clojuresphere.com is a good resource for getting a feel for how widely used a given library is |
| 17:35 | zerokarmaleft | howdynihao: there are clojure wrappers for some tasks (e.g. synchronous and asynchronous http clients), for others it makes more sense to do interop |
| 17:36 | technomancy | direct Java interop is usually only needed for more obscure stuff these days |
| 17:36 | howdynihao | ok thank you, i wasnt sure what the convention / practice was for which to go look to first |
| 17:37 | technomancy | well you can't go wrong by asking on IRC |
| 17:37 | howdynihao | wouldn't clojure libraries as you say just wrap java interop anyway though? |
| 17:37 | zerokarmaleft | only if they need to |
| 17:38 | technomancy | howdynihao: usually at some point. but using a library wrapper gets you better support for higher-order functions, more discoverability, etc. |
| 17:38 | technomancy | plus in many cases it protects you from imprudent mutability |
| 17:39 | howdynihao | hardest part about clojure is getting started with a clojure project |
| 17:39 | supersym | hehe |
| 17:39 | trptcolin | lein new foobar |
| 17:39 | tomoj | in too many cases it doesn't protect you at all :( |
| 17:39 | technomancy | true of all languages =) |
| 17:39 | trptcolin | ;) |
| 17:39 | tomoj | s/at all/enough/ |
| 17:40 | howdynihao | well its figuring out the conventions and work flow and all that |
| 17:42 | zerokarmaleft | howdynihao: cemerick has a solid intro video on youtube that might suit you |
| 17:43 | zerokarmaleft | it shouldn't be *too* outdated |
| 17:44 | supersym | howdynihao: I don't think Clojure itself has many (if any) conventions. But I assume you also mean by that, idiomatic ways of writing Clojure? I'd say check out the source code of some top projects on GitHub - see how those authors deal with problems |
| 17:53 | hiredman | a programming language is a tool, the most important thing for putting a new tool through its paces is a problem to use it on |
| 17:55 | wink | howdynihao: supersym: I found https://github.com/bbatsov/clojure-style-guide really good |
| 18:05 | yogthos | technomancy: |
| 18:05 | yogthos | technomancy: hey want to do it up :) |
| 18:05 | technomancy | sure |
| 18:06 | technomancy | yogthos: 3, 2, 1 |
| 18:06 | technomancy | deleted |
| 18:06 | yogthos | technomancy: awesome :) |
| 18:08 | technomancy | yogthos: did you see xeqi found a workaround for the gotta-fetch-em-all bug? |
| 18:08 | yogthos | technomancy: no missed that, what can you do? :) |
| 18:09 | technomancy | yogthos: there's a special "RELEASE" value you can use in place of a version range that does the same thing without triggering useless downloads. |
| 18:09 | yogthos | technomancy: ahhh |
| 18:09 | yogthos | technomancy: that would be reasonable |
| 18:10 | technomancy | well |
| 18:10 | technomancy | oh, reasonable for leiningen you mean? |
| 18:10 | technomancy | I don't think aether's behaviour here can be described as reasonable =) |
| 18:10 | yogthos | technomancy: oh no |
| 18:10 | yogthos | definitely not |
| 18:10 | yogthos | but tricking aether that way might work :) |
| 18:11 | technomancy | yogthos: so we're shooting for a 2.2 release early next week |
| 18:12 | yogthos | technomancy: nice work, v2's been pretty slick I gotta say |
| 18:12 | technomancy | glad to hear it |
| 18:12 | technomancy | development hasn't been as fast-paced as it used to |
| 18:13 | yogthos | that's to be expected though, most of the major stuff's been shaken out by now |
| 18:13 | yogthos | it's just ironing out different quirks at this point I imagine? |
| 18:13 | technomancy | growing list of stuff to change once we can break backwards-compat with 3.0 =) |
| 18:13 | technomancy | https://github.com/technomancy/leiningen/issues?milestone=9&page=1&state=open |
| 18:13 | yogthos | hehe |
| 18:14 | technomancy | yeah, very few things still slated for 2.x which aren't just de-quirkification |
| 18:14 | yogthos | what's the plan for 3.0? |
| 18:15 | trptcolin | xml |
| 18:15 | yogthos | haha |
| 18:15 | yogthos | ah looking at the link :) |
| 18:15 | technomancy | yogthos: the biggies are a complete rewrite of profile merge logic, rewriting the :filespecs stuff which is used to specify what goes in jars, and probably tidying up test selectors |
| 18:16 | technomancy | and taking the clojars legacy repo off the defaults list |
| 18:16 | yogthos | nothing too crazy :) |
| 18:16 | yogthos | I haven't played with profiles too much myself though :) |
| 18:16 | technomancy | you can go insane trying to figure out how they interact with middleware |
| 18:17 | yogthos | ah I can see that |
| 18:17 | technomancy | it's fine for the basic cases, but there are some edge cases where the complexity shoots up, and the implementation has become very difficult to keep loaded in your head all at once |
| 18:17 | hiredman | sure, go insane, as long as it doesn't set your hair on fire |
| 18:17 | technomancy | middleware has been ... an interesting experiment |
| 18:17 | yogthos | hehe |
| 18:18 | yogthos | I kinda ran into a similar problem with luminus options |
| 18:18 | yogthos | originally I was like hey I'll just let people set flags for what they want like +postgres or +cljs, etc |
| 18:18 | yogthos | but then some of those start interacting in funny ways :P |
| 18:18 | technomancy | murkily-defined semantics are the worst |
| 18:19 | yogthos | I keep meaning to rewrite that with a declarative graph of interdependencies |
| 18:19 | yogthos | then it can just fall through the options when the stuff gets selected |
| 18:19 | yogthos | or just just scrap the whole idea and pick some sane defaults :) |
| 18:20 | yogthos | I should do some sort of a poll on options people actually use |
| 18:20 | tomoj | technomancy: is what nrepl does for middleware a solution to that problem? |
| 18:20 | hiredman | can't you just make poms for for that? like make a pom that depends on everything you want to pull in for cljs, give it a nice short name in a mave repo, tell me to add that to their lein deps? |
| 18:21 | technomancy | tomoj: I don't think so; the problem is how middleware and profiles interact |
| 18:21 | technomancy | not ordering |
| 18:21 | tomoj | hmm |
| 18:21 | technomancy | tomoj: basically some people want middleware to be "downstream" of profiles and other people want it to be "upstream" |
| 18:21 | hiredman | introducing a new way of specifying dependencies, and a new dependency resolution system on top of lein seems crazy |
| 18:22 | tomoj | I see |
| 18:22 | hiredman | technomancy: well, so the "nrepl approach" might be to flag your middleware with metadata that says pre or post profiles |
| 18:23 | tomoj | what is the input and output with lein middleware? |
| 18:23 | technomancy | hiredman: I think a single codebase which supports both would surpass the complexity threshold of the human mind |
| 18:23 | technomancy | well, my human mind |
| 18:23 | hiredman | lets get rid of middlware and profiles then |
| 18:24 | technomancy | ;; Warning: before editing this code it's recommended to take vast quantities of spice so that your awareness of the flow of space/time is enhanced |
| 18:24 | technomancy | hiredman: profiles on their own aren't a problem really |
| 18:24 | hiredman | too late, throw them out |
| 18:25 | technomancy | hiredman: guilt by association |
| 18:25 | yogthos | lol |
| 18:25 | tomoj | hmm |
| 18:25 | tomoj | it's not really 'middleware' in my vocabulary |
| 18:25 | tomoj | or doesn't look like it |
| 18:25 | technomancy | tomoj: it doesn't have the "request/response" aspect of middleware to be sure |
| 18:26 | tomoj | yeah. I never knew what the hell 'middleware' was exactly supposed to mean |
| 18:26 | hiredman | http://en.wikipedia.org/wiki/Middleware |
| 18:26 | technomancy | pretty sure it will not exist in its present form in lein3 |
| 18:27 | tomoj | I guess taking 'ring' or 'nrepl' off the front makes it not a specific thing in a clojure context |
| 18:27 | tomoj | if you just made it like ring middleware, wouldn't the upstream/downstream issue have a natural solution? |
| 18:28 | technomancy | tomoj: you mean like each task would have to request a representation of the project? |
| 18:28 | technomancy | I think that brings in its own set of problems. |
| 18:28 | tomoj | I don't know, I need to go read the relevant code before I would understand what that might mean |
| 18:29 | tomoj | ah, I'll just take you're word for it then instead of trying to understand the code :) |
| 18:29 | technomancy | ring and nrepl don't have anything analogous to profiles really |
| 18:29 | tomoj | right |
| 18:30 | hiredman | I think the ring equivalent would be something like middleware is a function that takes a task (I guess a task name, or task var) and returns a function that takes a project map |
| 18:30 | technomancy | well, nrepl might in terms of clojure vs clojurescript context, but I don't think that's a proven model yet |
| 18:30 | tomoj | and profiles then become instances of that? |
| 18:31 | tomoj | or the profile logic anyway |
| 18:31 | hiredman | they could, I suppose |
| 18:31 | tomoj | yeah, in spirit I mean :) |
| 18:31 | callen | yogthos: hey |
| 18:31 | technomancy | hiredman: hmm... maybe so |
| 18:31 | yogthos | callen: heya |
| 18:32 | hiredman | so then you are left with a much of these middlewares, and how do you build your stack from them? |
| 18:32 | yogthos | callen: was gonna message you, but had a bit of a busy day :) |
| 18:32 | hiredman | with ring you directly do the function composition yourself, with nrepl you can do that or it uses dependency metadata to build it |
| 18:33 | tomoj | obviously you should write a core.logic program inside your project.clj which handles this |
| 18:33 | hiredman | well, linearizing a dependency graph is pretty easy |
| 18:34 | hiredman | weird |
| 18:34 | tomoj | bad joke, I was really imagining writing relational middleware I think |
| 18:34 | hiredman | I have a gist for that, but github seems to have eaten it |
| 18:34 | tomoj | I found some topological-sort in the group |
| 18:35 | hiredman | https://gist.github.com/hiredman/5314535 |
| 18:35 | hiredman | "Hm." |
| 18:35 | tomoj | https://gist.github.com/alandipert/1263783 |
| 18:36 | hiredman | that sounds familiar |
| 18:38 | hiredman | https://gist.github.com/hiredman/5623801 |
| 18:40 | hiredman | ugh, reverse? gross |
| 18:54 | tomoj | is that reverse inessential? |
| 18:55 | tomoj | inductive graphs as presented in the paper uses foldr, and rseq is neither foldable nor chunked :( |
| 18:56 | tomoj | relatedly, are graph node/edge labels an abuse of metadata? |
| 18:56 | tomoj | my gut says yes |
| 18:56 | tomoj | but thinking "hmm I want to add extra data which does not affect equality" makes me wonder |
| 18:57 | tomoj | oh labelled graph equality should consider labels I think |
| 18:57 | tomoj | so, yes. |
| 19:00 | tomoj | and you should be able to stick a var in a graph and give it an arbitrary label |
| 19:05 | tomoj | or numbers.. duh |
| 19:36 | pandeiro | in a route wrapped in ring-multipart-params, do i have to do something magical to access the :tempfile in :params? When I try to get it, I'm getting a java.io.IOException: Stream closed |
| 19:38 | weavejester | pandeiro: The :tempfile is, as the name suggests, a temporary file. There's nothing special about it... |
| 19:38 | AWizzArd | Is there a reader syntax for floats? |
| 19:38 | weavejester | pandeiro: Maybe you're falling afoul of the old lazy-seq and with-open thing. |
| 19:38 | nightfly | 0.129 |
| 19:38 | pandeiro | weavejester: i am trying to do something with that file that involves (with-open (io/reader ...) ...) - is that the problem i take it? |
| 19:38 | AWizzArd | nightfly: that is the reader syntax for doubles. |
| 19:39 | justin_smith | nightfly: I think that would be a double |
| 19:39 | weavejester | pandeiro: You have to be careful about lazy seqs. For instance... |
| 19:39 | pandeiro | I want to use line-seq on the file, hence the need for io/reader (i think) |
| 19:39 | AWizzArd | Just thought that appending something like an “f” would make the reader create a float. |
| 19:39 | weavejester | pandeiro: Yeah, I thought it might be line-seq |
| 19:39 | weavejester | Do you have something like... |
| 19:39 | weavejester | (with-open [r (io/reader …)] (line-seq r)) ? |
| 19:40 | pandeiro | yessir |
| 19:40 | weavejester | The line-seq is lazy, but after the with-open the reader will be closed. |
| 19:40 | pandeiro | so can i just (line-seq (io/reader f)) ? |
| 19:40 | weavejester | You need to keep the reader open, or read the file into memory by realizing the seq |
| 19:40 | tomoj | are you going to stop early? line-seq will close it automatically if you read the whole thing |
| 19:40 | weavejester | (with-open [r (io/reader …)] (doall (line-seq r))) |
| 19:41 | weavejester | doall will turn a lazy seq into a fully realized one. |
| 19:41 | pandeiro | i'm doing a bunch of mapping and partitioning with it but i guess nothing is forcing it to realize... |
| 19:41 | tomoj | well I guess any inputstream will close if you read to the eof? |
| 19:41 | pandeiro | just a doall at the top then? |
| 19:43 | tieTYT2 | is there something like add-watch but for things that aren't ref types? |
| 19:43 | tieTYT2 | i guess that might be what a :pre/:post is for |
| 19:43 | technomancy | tieTYT2: sure; (constantly nil) |
| 19:43 | technomancy | works for detecting changes on any immutable data structure |
| 19:44 | tomoj | shoreleave-pubsub has publishize for functions |
| 19:45 | tomoj | :pre/:post is definitely not for add-watch-like things |
| 19:46 | pandeiro | thanks weavejester tomoj, that was it |
| 19:46 | tieTYT2 | technomancy: i don't get it, is that a joke? |
| 19:47 | technomancy | tieTYT2: yes |
| 19:47 | technomancy | things that aren't ref types shouldn't change |
| 19:51 | tieTYT2 | technomancy: yeah that kind of makes sense |
| 20:09 | amalloy | technomancy: i dunno, i think @(promise) is a better desciption of how to detect changes in an immutable structure |
| 20:14 | technomancy | not bad |
| 21:17 | trptcolin | amalloy: updated :) http://blog.8thlight.com/colin-jones/2013/05/21/extract_temp_to_query.html |
| 21:19 | amalloy | trptcolin: if you're interested, some macro trickery can make the delay entirely transparent. for example, (let-later [field (finders/find key :field), ^:delay validation-errors (validate-field updated-field)] ... (seq validation-errors) ...) |
| 21:19 | trptcolin | lol |
| 21:20 | trptcolin | in useful? |
| 21:20 | actsasgeek | I'm experimenting with a framework that has 34 (!) jar files. is there an easy way to get these on the class path in Lein 2 without fussing around with a local maven repository? |
| 21:20 | trptcolin | nm, found it :) |
| 21:20 | amalloy | indeed it is in useful |
| 21:21 | amalloy | whether that actually makes the code easier to read is a matter of judgment, of course |
| 21:21 | trptcolin | sure. well it's certainly fun to read! symbol-macrolet whee!! |
| 21:21 | amalloy | <3 macrolet |
| 21:22 | trptcolin | actsasgeek: https://github.com/dchelimsky/lein-expand-resource-paths |
| 21:22 | trptcolin | with the usual caveat that you really should read this first: https://github.com/technomancy/leiningen/wiki/Repeatability |
| 21:23 | amalloy | theoretically it ought to be possible to let-later something that's being destructured, but that sounds pretty complicated so i just required that you can only delay "ordinary" bindings |
| 21:23 | actsasgeek | trptcolin: thanks! |
| 21:54 | amalloy | incidentally, trptcolin, i just slapped together a version of let-later that handles destructured values. a bit of a mess, but cute: https://www.refheap.com/paste/7bb21cbb3d633d743f4f88c7f |
| 21:55 | trptcolin | but it's recursive what if i need to destructure a billion items??!? |
| 21:55 | trptcolin | that's crazy, that'll take me awhile to wrap my head around. thanks! |
| 21:56 | amalloy | if you've never stackoverflowed the macroexpander before, you haven't lived |
| 22:08 | gdev | is there a clojure library that emits jsp? asking for a friend :>o |
| 22:12 | djwonk | amalloy: you also haven't lived if you haven't created a neverending cascade of function calls from `add-watch` |
| 22:22 | TimMc | ,(macroexpand-1 '(->> amalloy trptcolin (->> amalloy trptcolin))) |
| 22:22 | clojurebot | #<StackOverflowError java.lang.StackOverflowError> |
| 22:22 | TimMc | Wait a sec... |
| 22:22 | TimMc | &(macroexpand-1 '(->> amalloy trptcolin (->> amalloy trptcolin))) |
| 22:22 | lazybot | ⇒ (clojure.core/->> (clojure.core/->> amalloy trptcolin) (->> amalloy trptcolin)) |
| 22:23 | TimMc | That should have been fine unless I used macroexpand. |
| 22:23 | amalloy | TimMc: agreed. can you stop pinging me, though? :P |
| 22:23 | TimMc | I wonder what clojurebot is complaining about? |
| 22:23 | TimMc | Sure thing. |
| 22:31 | xeqi | amalloy: do you guys run a private maven repo at geni? |
| 22:32 | amalloy | no, although we've been talking about needing to |
| 22:32 | amalloy | most of our clojure is open-source, and most of our closed-source isn't clojure |
| 22:34 | xeqi | have you spent any time looking at what to use? |
| 22:36 | amalloy | no |
| 22:37 | amalloy | i hereby invite you to do that research for us |
| 22:38 | xeqi | haha |
| 22:49 | tomoj | huh, hoare says "[nondeterministic choice] is not intended as a useful operator for implementing a process... The main advantage of nondeterminism is in specifying a process." |
| 22:52 | tomoj | oh, no |
| 22:52 | tomoj | well, yeah, but "alt" isn't "nondeterministic choice", it's "general choice", I think |
| 23:02 | callen | technomancy: http://penny-arcade.com/comic/2011/06/13 I'm sick and miserable, but PA is keeping me smiling |
| 23:03 | callen | I love the expressive face. |
| 23:13 | tomoj | once you read the result of async macro, it's gone O_o |
| 23:53 | muhoo | is it really true that there's no twitter oauth2 flow for friend? |
| 23:53 | muhoo | (or even oauth1)? |
| 23:54 | muhoo | i mean there's this, but it ain't friend: https://github.com/mattrepl/clj-oauth |
| 23:56 | mattrepl | muhoo: what's wrong with clj-oauth? |
| 23:56 | TimMc | muhoo: I haven't worked with friend, but isn't it an authentication lib with its own authorization stuff built in? |
| 23:56 | TimMc | OAuth is just for authorization; it's not intended to authenticate users. |