#clojure log - May 21 2013

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:16 tomoj: wink: it's ok, ruby is not more lispy than clojure

0:17 I guess I'm begging the question

0:19 ddellacosta: did someone suggest ruby was more lispy than clojure?

0:19 it's not

0:19 although it's more lispy than I realized in the past

0:19 tomoj: no, someone was comparing verbosity of pallet and chef

0:20 ddellacosta: ah

0:20 can't speak to that.

0:20 you can be verbose in either if you are determined enough.

0:20 tomoj: but I feel like if you're in a good lisp verbosity should hardly be a concern

0:20 ddellacosta: I would tend to agree.

0:21 but ruby is comparatively pretty good. (comparing to something like Java, or whatnot)

0:21 tomoj: get it right and then if you want you can (defpackage curl) or whatever

0:22 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..

0:23 ddellacosta: haha

0:24 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.

0:25 tomoj: cool, no video online?

0:25 ddellacosta: hmm, I dunno, I'm sure it had a lecture with it at some point, but I just saw the slide show

0:25 gimme one se

0:25 sec

0:25 yeah, this one

0:25 http://www.slideshare.net/yukihiro_matz/how-emacs-changed-my-life

0:26 tomoj: hah so we can blame emacs lisp for ruby syntax!

0:27 ddellacosta: yah, haha

0:27 tomoj: or maybe he means that he managed to succeed doing exactly what he wanted after a week of work

0:27 I inferred that probably some of the syntax choices he made were influenced by what he could do in el

0:27 ddellacosta: I mean, it's illuminating though, 'cause it shows how foundational lisp was for ruby

0:27 I always thought he was much more into smalltalk

0:27 but after reading that slideshow I started to think it was actually lisp

0:28 with smalltalk OO, and perl sprinkled on top

0:28 callen: Raynes: thought you might like it.

0:28 Raynes: way better than coderwall, although still flawed.

0:28 ddellacosta: but yeah, emacs ruby-mode was key huh?

0:28 ha

0:28 callen: ddellacosta: Matz knows his shit.

0:29 ddellacosta: callen: agreed.

0:29 "Emacs changed my life forever. Thank you."

0:30 seangrove: ddellacosta: You should be aware that callen is an inveterate troll

0:30 While I agree with his current sentiment, it's no indication that he's not generally insane :)

0: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.

0:32 Raynes: I don't think callen is a troll. I think he has far too much energy in his fingers.

0:33 ddellacosta: anyways, I've talked to callen before now on IRC, and he strikes me as curmudgeonly more than trollish.

0:33 seangrove: Raynes: Judging from a blackbox perspective, it's hard to tell

0:33 callen: Raynes: the real explanation is that I don't need cocaine because I drink coffee.

0:33 amalloy: he would be a troll if he didn't believe what he said. i think he's just loud and angry

0:33 callen: ddellacosta understands me!

0:33 ddellacosta: haha

0:33 callen: ddellacosta: I am Diogenes of Sinope :)

0:33 ddellacosta: I try.

0:33 callen: amalloy is just mad because I got swag.

0:33 and the very best in cynical heritage.

0:34 ddellacosta: ah, I see, I had to look up that reference.

0:34 callen: a predecessor to the Stoics, then?

0:34 callen: ddellacosta: Something like that.

0:35 ddellacosta: the cynic "school" (barely a thing) was its own mode of thought, stoics borrowed some stuff and then went deep into VIRTUUUUUUEEEE

0:35 the cynic merely acknowledges that there are no virtuous men, so why not live simply?

0:35 ddellacosta: callen: ah…I'm only familiar with the common usage of cynic, less so the more philosophical concept.

0:36 interesting

0:36 seangrove: callen: Fully agreed re: simplicity. Outsource non-core needs to those who do it well, like.... firebase

0:36 callen: ddellacosta: the actual cynic school of philosophy is great.

0:36 seangrove: cynicism is not selling yourself into slavery/sharecropping.

0:36 seangrove: there's a strong self ownership / individualist streak.

0:36 ddellacosta: callen: reading about it now. Seems cool. Thanks for the new info!

0:37 callen: ddellacosta: always!

0:37 seangrove: callen: Yes, that does seem to be inline with Diogenes' morales

0:38 callen: incidentally, there's a myth about Diogenes getting captured and sold as a slave

0:38 he told the man he was being sold to that he was better than him and could raise his children better than him

0:39 ddellacosta: haha

0:39 callen: the buyer was instantly convinced and took him home ot run his household and educate his sons.

0:39 supposedly they were very successful.

0: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

0:40 far to -> far too

0:40 callen: ddellacosta: he was hedonistic in his own way

0:40 ddellacosta: he was simply unwilling to sacrifice his dignity to enhance his comfort.

0:40 ddellacosta: ah, I can see the the distinction

0: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.

0:41 ddellacosta: haha

0:41 callen: ^^ this is the callen behavior playbook btw

0:41 ddellacosta: callen: I was just reading the section in wikipedia about dogs

0:41 callen: you have been warned.

0:41 ddellacosta: understood. :-)

0:43 yogthos: wink: ah might've been cached and nobody hit that page since it got fixed :)

0:48 callen: yogthos: hey! how have you been?

0:48 yogthos: http://osrc.dfm.io/yogthos

0:48 yogthos: callen: not too bad :)

0:48 callen: haha awesome :P

0:48 callen: yogthos: new best practices for korma, ping me if you want info.

0:48 yogthos: callen: will do in the morning :P

0:49 callen: gotta be sleeping soonish here :)

0:49 callen: yogthos: sure just nag me.

0:50 yogthos: callen: might actually have a few questions too :)

0:52 callen: yogthos: please send me them, I love Qs.

0:52 yogthos: callen: awesometastic :)

1:00 tomoj: can you implement many-to-every on top of many-to-many?

1:00 channels

1:01 oh, hmm. many-to-every would probably be really weird.

1:17 mthvedt: is there a way to check if a fn will return a primitive, given some # of args

1:17 alex_baranosky: anyone know if R can output EDN?

1:18 akhudek: mthvedt: no, you either check the return type every call or try to used typed clojure

1:19 though not sure how easy typed clojure is to use at this point

1:19 mthvedt: akhudek: not a case of type-safety, i want to know if something returns a long or a Long

1:20 the compiler can figure it out, so it might be possible in theory

1: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.

1:22 but multimethods, for example, dynamically check the type of values on the go

1:22 similarly calling java methods does reflection without type hints

1:25 mthvedt: akhudek: the compiler does figure it out, that's why fns with primitive hinted return values are much faster

1:26 it's not the jvm that does that, the jvm is bad at auto boxing removal.

1:27 this is implemented as various interfaces in IFN supporting primitive invocation and return values

1: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.

1:30 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

1:32 what is your use case?

1: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.

1:34 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

1:35 or at least, my jvm won't inline it

1:35 in my setup

1: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...)

1: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.

1:41 mthvedt: akhudek: it's really only the primitive/non primitive case that has a large performance penalty.

1:41 the JVM is very good at guessing object types, particularly when it can inline

1:43 akhudek: mthvedt: you basically want it to throw an error if you ever find a Long?

1:43 or actually change behaviour?

1: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

1:44 akhudek: oh I see

1:44 there must be a way to access type hints

1:45 mthvedt: fns are a special case, because in fns the return type can depend on arity, i think (haven't confirmed)

1:45 but the macro knows the arity

1:47 akhudek: mthvedt: if you type hint a function you can call meta on the function symbol and it seems to give something

1:49 huh, nevermind, that doesn't work with defn

1:49 mthvedt: right, fns are a special case somehow.

1:50 akhudek: annoying, I can only suggest looking through the clojure source

1:57 livingston: is there a way to know if there are sends or send-offs pending or in-progress for an agent?

2:26 suiang____: so is there any clojure ORM which could cache the object in redis implicitly?

3: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.

3:15 weavejester: wei_: Just separate out the routes into ones you want to apply the middleware and ones you don't.

3:20 wei_: weavejester: like this? https://gist.github.com/yayitswei/5618027 I'm getting "null" when I load / now

3:37 ^ oh nevermind, that works

5: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])

5:16 is there an interesting way to do this with built in clojure.core functions?

5:17 the last partition in my example would continue into infinity

5: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?

5:33 noidi: spoon16, here's an uninteresting, quick'n'dirty way to do it :) https://www.refheap.com/paste/14809

5:37 and it doesn't even handle your requirement of returning the rest of the infinite sequence

5:37 oh well, someone will soon tell you how to do it on one line with two built-in functions :)

5:50 bleh, I was bored and did a slightly improved version https://www.refheap.com/paste/14810

6:20 fleehode: what about the performance of datomic compare to pgsql?

6:24 icarot: This channel sure does die at night.

6:25 Foxboron: at night?

6:25 Early morning here in Norway

6:25 fleehode: but this is not night at my location :]

6: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)

6:25 fleehode: its 18:19 here

6:25 icarot: 3:19 here.

6:25 Foxboron: icarot: i think more then half of the IRC community is US based

6:26 12:19

6:26 icarot: (San Francisco)

6:26 fleehode: i just stuck with the sql problem

6:26 and after seached the final answer

6: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.

6:27 fleehode: i was think is there any db using custimized lisp as the querying lang

6:27 icarot: And it seems to die down around here, heh. That's all.

6:28 fleehode: ok zombie time, hello, is there Mr zombie?

6:31 Foxboron: we should make a irc bot having a markov chain

6:31 call it zombie, feed it with clojure and FP stuff

6:32 and let it ramble in the middle of the night so the chan seem active

6:32 then we call it "Mr.Zombie"

6:33 ivan: fleehode: are you looking for datomic?

6:33 oh, I see the performance question above now

6:35 fleehode: ivan: just ask , as i said, i am angry with sql

6:36 pgsql channel's guy responsed my features request by `could work in therotic` but they need abey the sql standard

6:37 mynomoto: fleehode: Have you looked at honeysql?

6:38 fleehode: mynomoto: nope maybe you could give some quick intros ?

6:39 mynomoto: https://github.com/jkk/honeysql

6:39 You can use maps to generate sql queries.

6:39 fleehode: got it , this is a trans level

6:41 mynomoto: this wont improve the performance i think

6:42 mynomoto: Only yours :) Not the db.

6:44 fleehode: i see sqlite use a vm design

6:45 which i dont know if it could apply lisp as query language

6:45 just like clojure on jvm, by another compiler

7:24 mpenet: honeysql is nice but incomplete, it only supports select statements

7:39 spoon16: ,(defn ^bytes y [] (.getBytes "hi"))(String. (y))

7:39 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

7:41 AWizzArd: Hi, any RegExperts here? I want all texts between x and y, without matching x/y. I tried this:

7:41 ,(re-seq #"(?<=x).*(?=y)" "x123y---x456y")

7:41 clojurebot: ("123y---x456")

7:41 AWizzArd: Instead I wanted ==> ("123" "456")

7:41 spoon16: ^^ this code is throwing a "Unable to resolve classname: clojure.core$bytes" https://www.refheap.com/paste/14812

7:46 ,(re-seq #"[\d]+" "x123y---x456y")

7:46 clojurebot: ("123" "456")

7:46 spoon16: AWizzArd: does that work for you?

7:47 Anderkent: What's the right way to get the maximum (last) key from a sorted set?

7:47 last is linear afaik

7:48 spoon16: AWizzArd: also this, which is maybe a better answer given your "between x and y criteria"

7:49 ,(map second (re-seq #"x([^y]+)y" "x123y---x456y"))

7:49 clojurebot: ("123" "456")

7:49 spoon16: (map second (re-seq #"x([^xy]+)y" "x1a23y---x45x6y"))

7:49 ,(map second (re-seq #"x([^xy]+)y" "x1a23y---x45x6y"))

7:49 clojurebot: ("1a23" "6")

7:49 Anderkent: ah, (first (rseq ...))

7:50 ucb: ,(doc rseq)

7: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"

7:50 ucb: nice.

7:50 spoon16: ,(map second (re-seq irc://irc.freenode.net:6667/#"x([^y]+)y" "x1a23y---x45x6y"))

7:50 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: irc://irc.freenode.net:6667, compiling:(NO_SOURCE_PATH:0:0)>

7:50 Anderkent: not really, but I guess it's manageable

7:50 `last` should do that

7:50 spoon16: ,(map second (re-seq irc://irc.freenode.net:6667/#"x([^y]+)y" "x1a23y---x45x6y"))

7:50 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: irc://irc.freenode.net:6667, compiling:(NO_SOURCE_PATH:0:0)>

7:50 spoon16: hmm

7:52 rasputnik: i'm using clojure.tools.logging, where would i put the log4j.properties for leiningen to find it?

7:52 Anderkent: rasputnik: project-root/resources

7:52 echo-area: Anderkent: `last' also works on non-sorted sequences

7:52 rasputnik: Anderkent: thanks!

7:53 echo-area: While `rseq' only works on sorted sequences

7:53 Anderkent: echo-area: sure, but it could check whether it's given a reversible one. Oh well.

7:54 echo-area: Hmm, I guess `last' (as well as some others) are only helper functions for core.clj, or defining macros.

7:55 `butlast', for example

8:38 Anderkent: Is there a filter/map combined? I.e. return f(x) for every x in map whenever f(x) is truthy

8:40 dnolen`: Anderkent: no, but it's just (filter identity (map f xs))

8:41 llasram: `keep` ?

8:41 marutks: reducers?

8:41 Anderkent: keep, yes

8:41 clojurebot: reducers are http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html

8:41 Anderkent: thanks

8:42 dnolen`: Anderkent: I always forget about keep

8:42 Anderkent: tho it'll return false values

8:42 Anderkent: yeah it's what I want

8:42 the fn is a (when-let .)

9: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 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 :(

10:41 seangrove: Really?

10:48 gfredericks: memory question

10:49 I make a query to postgres via java.jdbc that reads back ~3gb of data

10:49 there is a :row-fn that parses some json in clojure data structures, and then a :result-set-fn of `count`

10:50 i.e., it ought to simply take the result-set-seq and read through it

10:50 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 once the query is finished, GC can clean up the 4gb as well

10:51 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 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 Or some subsequent step, who knows

10:58 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 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 you'll need let

11:01 vijaykiran: yeah, I had a let which was working fine though

11:01 any specific reason why it isn't possible ? I thought the destructuring sytax is same everywhere

11:03 gfredericks: it is

11:03 you're probably confusing destructuring with the other stuff that let does

11:03 vijaykiran: ah - true - this isn't destrcturing

11:04 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 * vijaykiran using http://flatpack.sourceforge.net/ for it ATM

11:05 gfredericks: kind of a pitty data.csv doesn't do it

11:11 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 gfredericks: so no, not really...

11:21 gfredericks: well if you know what the special keys are

11:21 and you follow the rule that dissoc'ing a special key reverts to a vanilla map

11:22 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 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 I'm dealing with clojure.data.xml

11:28 which has an Element record

11:28 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 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:31 * gfredericks waits for somebody to solve his problem

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 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 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 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 ,(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 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 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 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 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 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 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 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 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 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 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 well... I could see trying to restrict it to be very hard when having multiple version ranges from transative dependencies

13:48 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 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 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 source: 2nd answer on http://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of-a-dependency

13:59 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 wonder how it gets there

14:02 I'll accept "magic" for now

14:03 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 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 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 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 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 it only swallows FileNotFound, but in this case that's enough to do it

14:23 I guess we could inspect the exception message, but I'd rather just ditch Java support

14:23 move it to a plugin

14:23 or use another option than -m for it

14:24 gfredericks: I don't have a strong opinion on it

14:25 this just comes up often (most ns typos) and confuses the heck out of my coworkers

14:25 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 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 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 :)

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 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 the code compiles fine on my box, but on every other box i try on i get that error

14:59 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 lein clean && lein compile

15:01 jtoy: hmm, i just did lein clean and it breaks now

15:01 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 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 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 you can also get it with exciting things like (. x (((((blah))))))

15:10 trptcolin: that *is* exciting

15:12 * gfredericks gets all excited

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:24 * gfredericks mutters "hapstell hiskers" to himself just to see what it sounds like

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 $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 what is the best solution other than writing them in both functions

15:41 creating a dynamic?

15:42 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 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 :cljsbuild

15:54 {:builds

15:54 [{:source-paths ["src/yourprj/client"],

15:55 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 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 ,(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 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 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 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 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 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 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 http://www.sourcetreeapp.com/

16:23 duncanm: brainproxy: it's a little slow sometimes

16:23 i like using 'tig'

16:35 mefesto: M-x magit-wazzup

16:35 :)

16:52 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 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 Automerge -> funky unicode chars -> crash.

17:25 howdynihao: hi, using lein to start a project repl

17:25 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 So you can periodically say (require 'my.namespace :reload-all) from the REPL.

17:29 howdynihao: thank you

17:30 is the convention to use java interop whenever possible over a plugin?

17:30 like for making an http request

17:30 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 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 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 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 technomancy: hey want to do it up :)

18:05 technomancy: sure

18:06 yogthos: 3, 2, 1

18:06 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 technomancy: that would be reasonable

18:10 technomancy: well

18:10 oh, reasonable for leiningen you mean?

18:10 I don't think aether's behaviour here can be described as reasonable =)

18:10 yogthos: technomancy: oh no

18:10 definitely not

18:10 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 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 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 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 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 and taking the clojars legacy repo off the defaults list

18:16 yogthos: nothing too crazy :)

18:16 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 I kinda ran into a similar problem with luminus options

18:18 originally I was like hey I'll just let people set flags for what they want like +postgres or +cljs, etc

18:18 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 then it can just fall through the options when the stuff gets selected

18:19 or just just scrap the whole idea and pick some sane defaults :)

18:20 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 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 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 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 it's not really 'middleware' in my vocabulary

18:25 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 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 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 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 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 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 "Hm."

18:35 tomoj: https://gist.github.com/alandipert/1263783

18:36 hiredman: that sounds familiar

18:38 https://gist.github.com/hiredman/5623801

18:40 ugh, reverse? gross

18:54 tomoj: is that reverse inessential?

18:55 inductive graphs as presented in the paper uses foldr, and rseq is neither foldable nor chunked :(

18:56 relatedly, are graph node/edge labels an abuse of metadata?

18:56 my gut says yes

18:56 but thinking "hmm I want to add extra data which does not affect equality" makes me wonder

18:57 oh labelled graph equality should consider labels I think

18:57 so, yes.

19:00 and you should be able to stick a var in a graph and give it an arbitrary label

19:05 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 Do you have something like...

19:39 (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 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 i guess that might be what a :pre/:post is for

19:43 technomancy: tieTYT2: sure; (constantly nil)

19:43 works for detecting changes on any immutable data structure

19:44 tomoj: shoreleave-pubsub has publishize for functions

19:45 :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 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 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 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 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 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 &(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 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 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 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 oh, no

22:52 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 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 (or even oauth1)?

23:54 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 OAuth is just for authorization; it's not intended to authenticate users.

Logging service provided by n01se.net