#clojure log - Mar 04 2014

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

0:01 dsrx: the with-channel macro ain't too bad https://github.com/http-kit/http-kit/blob/master/src/org/httpkit/server.clj#L135

0:05 technomancy: minikomi: if you don't plan on making changes, just use lein install

0:06 firefaux: can anybody think of an elegant way to iterate over the values of 2 maps with the same keys? I can't think of anything that wouldn't be terrible

0:07 minikomi: sorry, I'm not sure how if the version I want is not on clojars..

0:07 firefaux: so (f {:a 2 :b 3 :c 4} {:b 1 :c 2 :d 3}) => ([3 1] [4 2])

0:08 technomancy: minikomi: I mean from the checkout

0:08 minikomi: ah

0:08 right, makes sense sorry :)

0:08 technomancy: np

0:10 minikomi: well, that went well :D

0:23 amalloy: (for [k (keys m1)] ((juxt m1 m2) k)), firefaux

0:24 firefaux: thank you, amalloy

0:24 TEttinger: amalloy, subtle bug there

0:24 amalloy: or if you're really bothered by the unnecessary map lookups, (for [[k v] m1] [v (m2 k)])

0:24 SegFaultAX: What if they have different keys?

0:24 amalloy: well he did say "with the same keys"

0:24 firefaux: I just want the keys that match

0:24 SegFaultAX: Something like:

0:24 TEttinger: the example given has an :a key in one and a :d in the other

0:24 firefaux: sorry

0:24 SegFaultAX: ,(#(map (apply juxt %&) (apply clojure.set/intersection (map (comp set keys) %&))) {:a 1 :c 6} {:b 2 :c 3})

0:25 clojurebot: #<CompilerException java.lang.ClassNotFoundException: clojure.set, compiling:(NO_SOURCE_PATH:0:0)>

0:25 SegFaultAX: ,(require 'clojure.set)

0:25 clojurebot: nil

0:25 SegFaultAX: ,(#(map (apply juxt %&) (apply clojure.set/intersection (map (comp set keys) %&))) {:a 1 :c 6} {:b 2 :c 3})

0:25 clojurebot: ([6 3])

0:25 firefaux: I was saying I just wanted it to use the values to shared keys

0:25 what's this %&

0:25 I've never seen that

0:25 TEttinger: that's a good one SegFaultAX

0:26 SegFaultAX: TEttinger: Juxt to the rescue!

0:26 amalloy: (for [[k v] m1 :let [e (find m2 k)] :when e] [v (val e)])?

0:26 TEttinger: it's like [a b & c] goes to %1 %2 %&

0:26 firefaux: oh

0:26 that's good to know

0:26 TEttinger: it's a vital part of swearjure is the only reason I know it, haha

0:27 SegFaultAX: I think there should be 2 functions here: get the intersection of the keysets, then find all the shared values for those keys.

0:28 Mine is clearly hard to follow and complects those two things.

0:28 TEttinger: that's a very reasonable idea

0:28 should be more reusable anyway

0:29 SegFaultAX: I like amalloy's but it doesn't generalize to n-maps

0:29 Not to be confused with nmap, a useful network utility. :)

0:29 amalloy: yes, good point; it's very special-cased

0:29 firefaux: I've never used juxt

0:29 amalloy: ~juxt

0:29 clojurebot: juxt is usually the right answer

0:29 SegFaultAX: firefaux: It's like magic.

0:29 So simple, so obvious, but so powerful.

0:29 firefaux: sounds like it from the docs

0:30 seancorfield: I'm amazed how often I use juxt...

0:30 SegFaultAX: seancorfield: Yup, me too. And I very frequently reimplement it in Python and Ruby when I'm working in those langs.

0:31 firefaux: man, I wish I had started out with functional programming, and not OO

0:31 then things like this would be more natural

0:31 by now

0:31 SegFaultAX: Meh.

0:31 firefaux: I'm getting there, thoguh

0:32 SegFaultAX: Both models have things to teach you. If you had grown up in FP, you might be saying "man I wish I would have started with OOP..."

0:32 firefaux: clojure's really opened my eyes a lot more than Common Lisp did

0:32 I suppose, but FP is just so much more elegant and powerful

0:32 TEttinger: I do think that having an understanding of OO helps when you need to use a java lib, certainly. and debugging clojure, since it does compile down to java-compatible .class files, so even basics help.

0:32 firefaux: that's true

0:32 didn't think about that

0:33 maybe I wouldn't have started with clojure, then

0:33 SegFaultAX: The fact that OOP is basically an industry standard makes it essential knowledge anyway.

0:33 TEttinger: really the more you have in your toolbelt the better IMO

0:33 firefaux: that's true

0:33 SegFaultAX: Not basically. It /is/ the industry standard.

0:33 firefaux: you can always try and apply functional strategies to OOP

0:33 TEttinger: SegFaultAX, is cobol industry these days?

0:33 firefaux: I hope not

0:34 TEttinger: I think there's still a pretty massive amount of non-OO legacy code being maintained

0:34 SegFaultAX: firefaux: With varying degrees of success... and pain... sure.

0:34 amalloy: TEttinger: i don't think understanding OOP helps at all with .class file debugging. like, knowing OOP is great, but you don't need any of the "oriented" or the "programming" to understand a classfile. you just need to know what an object is

0:34 seancorfield: I grew up in FP and I've _never_ said "man I wish I would have started with OOP..." SegFaultAX :)

0:35 SegFaultAX: seancorfield: Maybe you just haven't needed a sweet ass type hierarchy yet. :)

0:35 firefaux: amalloy: I have no idea what debugging a .class file is like :D

0:35 seancorfield: But of course when I started OOP wasn't a "thing", at least not in the workplace :)

0:35 SegFaultAX: FP was?

0:35 seancorfield: SegFaultAX: sure I have, but that doesn't mean I wish I _started_ that way ;)

0:36 amalloy: you'll never have to, firefaux, unless you're really excited about squeezing every last drop of performance out of things. then it's handy to check the compiler is generating the code you wish it would

0:36 TEttinger: yeah, I guess amalloy. I seem to recall some times where I've said "oh! that's why I'm having problems, it's this gen-class/proxy/whatever isn't up-to-date, or this anon function compiled to that class file so...."

0:36 SegFaultAX: You're taking my words too literally. firefaux said he wished he'd started /so that FP stuff would already be second nature by now/. Starting in one or the other doesn't really matter as long as you get around to both.

0:36 firefaux: I'll probably be able to read .class files after I take Compiler Construction next semester

0:37 I, like many before me, will be writing mini-java

0:37 and compiling it to bytecode myself

0:37 :S

0:37 TEttinger: and from there you can make mini-clojure heh

0:37 firefaux: lol

0:38 amalloy: i remember writing mini-java

0:38 firefaux: what language did you write it in?

0:38 amalloy: it was during the year that they were transitioning from teaching the class in c++ to teaching in java, and so it was a complete mess

0:38 firefaux: lol

0:39 amalloy: i don''t think the prof/ta ever got things working well enough to actually run student code, so they probably graded by guessing

0:39 SegFaultAX: amalloy: Bummer.

0:39 firefaux: that sucks

0:39 amalloy: eh, it was still pretty educational

0:40 firefaux: luckily I'll be taking it with the same person who always teaches it in the same language

0:40 SegFaultAX: amalloy: Still, it's never fun to be in that situation. I've been in a class that was a total shit-show like that and it was not awesome.

0:41 amalloy: SegFaultAX: it was actually one of my favorite classes. really good lectures and assignments, just not well managed on the other end

0:41 seancorfield: SegFaultAX: i was exposed to FP at uni and started commercial dev in '80 part time... i first learned OOP in '92

0:41 TEttinger: I do think that clojure's strengths are almost entirely in how well-made the standard lib is, that and the way the different data structures are used for fitting purposes (not any complex compiler stuff that I'm aware of), rather than the compiler being a heavyweight type-inferring optimizing thing that takes a minute to compile hello world like some OTHER languages...

0:42 SegFaultAX: amalloy: Oh well that's good then.

0:42 amalloy: TEttinger: welllllll, all of those nice things don't mean squat unless you have a good compiler

0:42 TEttinger: I still remember waiting 10 minutes for MLton to compile hello world

0:42 SegFaultAX: seancorfield: Was it scheme?

0:42 amalloy: clojure really generates quality bytecode fairly quickly, and reliably

0:43 seancorfield: SASL, Miranda, ML mostly

0:43 SegFaultAX: Whoa, Miranda? That's the Haskell pre-cursor, no?

0:43 seancorfield: plus LispKit (Henderson's subset of Lisp)

0:44 Haskell appeared about five years after I stopped working on my PhD :)

0:45 I always hoped Haskell would go mainstream... sigh...

0:45 SegFaultAX: I used to work with a guy who was PhD-brothers with Wadler. He did a couple research projects back then in Miranda which he told me about. Pretty interesting stuff.

0:46 n_b: Haskell is getting increasingly mainstream

0:46 People have to go from Scala to somewhere sane, right? ;)

0:46 SegFaultAX: I don't know if I would say it's going mainstream.

0:46 seancorfield: SegFaultAX: Prof Turner would have been my external...

0:47 minikomi: UnsatisfiedLinkError .. uh oh.

0:48 SegFaultAX: seancorfield: Are you going to Clojure/West?

0:50 amalloy: this year will be my first clojure/west

0:50 (he said, not that anyone asked him)

0:50 SegFaultAX: amalloy: Awesome! Mine too.

0:50 I'll find you and introduce myself.

0:51 amalloy: You're from SoCal, right?

0:51 amalloy: well, i live there now. i grew up in the bay area

0:51 firefaux: I need to dabble more in haskell some time

0:51 I once played with an online REPL for about an hour

0:52 that's my experience with haskell

0:52 SegFaultAX: amalloy: Are you near Raynes?

0:52 amalloy: i was glad to see that the company i'm now working for (factual) is one of the main clojure/west sponsors

0:52 yeah, he moved to LA for the same job i did

0:52 Raynes: But then life separated us by about 3 miles on most days.

0:53 SegFaultAX: Raynes: Life is cruel like that.

0:54 amalloy: How're you liking factual?

0:54 Also, what do you do there?

0:54 Raynes: Programs, I'd guess.

0:54 ;)

0:54 amalloy: i take over projects from ztellman

0:54 Raynes: lolol

0:54 I build debian packages. ;)

0:55 amalloy: but seriously, it's only been a couple weeks. mostly i ask questions, and make trivial edits

0:55 SegFaultAX: I was waiting for you to add in a sick burn there.

0:55 amalloy: maintain a clojure webapp and the java libraries it uses. that kind of stuff

0:56 TEttinger: oh no I'm in san gabriel valley... do I need to come and socialize clojurists?

0:57 amalloy: all the cool kids are in santa monica

0:57 TEttinger: phew, san francisco

0:57 SegFaultAX: TEttinger: You should register soon, it'll probably fill up if it hasn't already.

0:58 amalloy: Is factual based down there or are you remote?

0:58 amalloy: factual's headquarters are in century city, so just a few miles to commute

0:58 TEttinger: nah, I barely leave the house. if anything I'll be on IRC chatting with people who aren't there.

0:58 amalloy: we have an SF office for ztellman and some of his ilk

0:58 Raynes: I take the 405 briefly every day now.

0:59 Luckily, the direction I'm going is not that bad in the morning.

1:00 SegFaultAX: Raynes: You've become a local; you can tell because you said "the" 405.

1:00 TEttinger: anyone know what happened to bitemyapp?

1:00 I think he's in san francisco

1:00 SegFaultAX: He actually moved last weekend to Austin.

1:00 I know, because I had dinner with him the night before he moved.

1:01 amalloy: he also moved to #haskell

1:01 SegFaultAX: (Although he's still doing clj at work)

1:01 TEttinger: yeah it did seem kinda odd how he was in #clojure and always talking about haskell

1:02 &seen oakes

1:02 lazybot: java.lang.RuntimeException: Unable to resolve symbol: seen in this context

1:02 amalloy: $seen oakes

1:02 TEttinger: $seen oakes

1:02 lazybot: I have never seen oakes.

1:02 I have never seen oakes.

1:02 TEttinger: hm

1:02 he seems to make a bunch of things I use

1:03 systemfault: Hmm, I find it weird that even though Scala is more popular on the tiobe index than Clojure... #clojure has about twice as many people as #Scala

1:03 TEttinger: perhaps the tiobe index isn't reliable? gasp.

1:03 maxthoursie: systemfault: where did you get those numbers?

1:04 systemfault: TEttinger: Seems fair to be... C and Java being on top

1:04 maxthoursie: Here vs #Scala

1:04 s/to be/to me

1:05 SegFaultAX: Maybe it's a less IRC-centric community in general for whatever reason.

1:05 systemfault: Probably

1:05 maxthoursie: ah

1:06 TEttinger: how did F# go from 69 to 12?

1:06 SegFaultAX: I've never really had the impression (perhaps wrongly so) that Java is not heavily focused on IRC. It's much more forum and mailing list based.

1:06 systemfault: SegFaultAX: You could be right, #Java has 340 members

1:06 SegFaultAX: And a lot of scala people are former java people.

1:09 TEttinger: apparently they only count the search "% programming" where % is the language name. so if a few books came out called F# programming, that would skew it in its favor

1:10 systemfault: Makes sense

1:10 Because I'd be REALLY surprised if F# suddenly became that popular.

1:11 TEttinger: also they have to explain in every post, the F stands for Functional Programming.

1:11 at least for MS

1:11 SegFaultAX: I've read a bit about F# and watched some talks on it. It actually looks like a pretty amazing language.

1:12 systemfault: Yeah... waayyy to amazing to be popular

1:12 *too

1:12 TEttinger: ha and Lisp is separate from clojure.

1:12 which I can kinda see

1:12 but it's a very strange distinction when the different SQL "languages" are there too

1:13 SegFaultAX: Lisp is separate from Clojure.

1:14 TEttinger: so they have lisp, common lisp, emacs lisp... what's going on here

1:15 J# I don't think there are new jobs in, seeing as it's been discontinued for years

1:16 systemfault: TEttinger: Now that I looked a bit more at it, I would say that only the top ones make sense...

1:16 1-10

1:17 LISP is 16.. what is LISP? I thought there wasn't a language called LISP (

1:17 Only Common Lisp.. but it's also there at position 29

1:17 *39

1:20 TEttinger: I am guessing it's because they changed a metric that allows # in searches somewhere

1:20 explaining J# and F#

1:21 n_b: Is F# popular anywhere outside of finance?

1:22 TEttinger: (also, the F# channel is almost dead despite a bunch of people in it. it seems very hard to actually get a question answered even with a fair number of people joined)

1:23 n_b, it doesn't appear so. it looks like an excellent language that's languishing with a lack of official attention paid to it and a dwindling .NET platform (MS seems to want to kill all that they made that was good, but that's something slightly different)

1:24 systemfault: I wouldn't be surprised if MS kills .net :P

1:24 Aren't the new APIs native?

1:24 seancorfield: SegFaultAX: yes, I'll be at Clojure/West with one of my team (Fumiko) who does Clojure full-time

1:24 systemfault: (I don't know...)

1:24 TEttinger: yeah, the RT crap

1:24 n_b: I don't believe so

1:24 TEttinger: RT I think is C#, C++, and VB only

1:25 n_b: VB.NET/C#/F# all compile to IL

1:25 you can do f# on WP8 at least

1:26 systemfault: From wikipedia, Windows Runtime is pure C++

1:27 TEttinger: n_b, yeah it seems to be possible, but not supported

1:29 http://msdn.microsoft.com/library/windows/apps/bg125378 these are your choices for winRT unless you add a dependency to .NET (and that may require some fiddling with sealing classes, I would look but I don't care for windows 8)

1:32 SegFaultAX: seancorfield: Sweet!

1:32 amalloy: Question: How much of factual is Clojure-based?

1:33 amalloy: like 25%? i'm not sure

1:34 SegFaultAX: That's pretty significant.

1:35 amalloy: Are you working only on Clojure there? What other techs do they use?

1:35 amalloy: i'm doing like 1/3 clojure, 2/3 java

1:35 like any corporation, factual uses every tech under the sun :P

1:36 but the backbone is hadoop, hbase, that kinda stuff

1:36 SegFaultAX: I meant to say language, but it sounds like Java is the other main one.

1:36 amalloy: yes. there's a bit of python, ruby, and js, but mostly jvm

1:37 SegFaultAX: Have you picked a team yet? Like, do you know which part(s) of the factual products you'll be working on?

1:38 amalloy: more or less

1:40 like i said earlier, a clojure webapp, and the mostly-java libraries it uses, which are mostly for hbase and hadoop

1:40 SegFaultAX: So is that the customer facing stuff, then?

1:40 Or internal tooling?

1:40 amalloy: tooling

1:41 well, internal stuff anyway

1:43 muhoo: is there a way in cljs to conditionally compile stuff only if it's in not-advanced mode?

1:43 SegFaultAX: amalloy: I'm asking because I find factual interesting from both a product and engineering perspective.

1:43 Seems like a pretty awesome place to work.

1:43 muhoo: amalloy: cool, congrats on landing at factual (if i'm reading the backscroll correctly)

1:46 amalloy: SegFaultAX: i've started helping teach the internal clojure classes some of the engineers are taking

1:47 SegFaultAX: amalloy: Oh, that's awesome!

1:55 amalloy: speaking of factual, i asked someone at work today why a diner in pittsburgh turns up when you ask look up clojure on factual

1:55 turns out that's where the clojure meetups in that area are hosted

1:55 i don't remember who was asking, but if you're here now, that's why

2:05 firefaux: (map f [a b c] [d e f]) does ((f a d) (f b e) (f c f)), but what if I had ((a d) (b e) (c f)) and wanted to do (f (a b e) (d e f)) ?

2:06 I sort of want the inverse of map

2:08 ambrosebs: (map #(%1 %2) ...)

2:09 oh nvm

2:09 too many letters

2:09 ;)

2:09 SegFaultAX: What you want is commonly referred to as an unzip

2:09 firefaux: yeah

2:09 SegFaultAX: Since the other direction is commonly referred to as a zip.

2:09 firefaux: I know this is pretty common

2:09 I used to know what to do in Common Lisp

2:10 and in python I would have used zip()

2:10 which is also unzip()

2:18 alright, another night up past 2 writing clojure

2:18 time for bed

2:18 'night everyone

2:34 voldyman: anyone ever tried html5 server-side events with compojure

3:11 muhoo: alright, i made a hello world in om. https://github.com/kenrestivo/blinker fwiw

3:32 sm0ke: so if i have a macro which has let binding for x# can i use x# in a different macro which is supposed to be nested inside the first one?

3:33 ambrosebs: sm0ke: it will be a different x#

3:33 sm0ke: it's actually syntax-quote that handles this.

3:33 sm0ke: ambrosebs: hmm any ideas for this kind f thing?

3:33 ambrosebs: sm0ke: what do you want to do?

3:33 sm0ke: do you want them to be the same x#'s?

3:34 sm0ke: ambrosebs: yes

3:35 ambrosebs: sm0ke: can you show an example?

3:36 one idea might be to have a top level def that contains a gensym. Then you can use that gensym instead of x#

3:37 sm0ke: ambrosebs: yes infact i can use a ~'weird-name-which-cant-be-repeated, also ?

3:37 ambrosebs: sm0ke: sure

3:37 sm0ke: that's all gensym is

3:37 sm0ke: hurm.,,i though this would be cleaner

3:37 ambrosebs: sm0ke: sounds a bit odd that two different macros need the same binding

3:38 sm0ke: yea? may be i am doing it wrong again

3:39 seems like i have this itch for writing a macro, i need to think over it again if this is not a common practive

3:41 szymanowski: hello, how could i turn :B/C into "B/C" ?

3:41 ambrosebs: ,(symbol (str (namespace :B/C)) (name :B/C))

3:42 clojurebot: B/C

3:42 ambrosebs: ,(str (symbol (str (namespace :B/C)) (name :B/C)))

3:42 clojurebot: "B/C"

3:42 szymanowski: great thank you!

3:46 ddellacosta: question about getting meta data from pointers (local variables) to functions: how do I get the metadata from the function at :foo {:foo ns/some-fn}?

3:46 seems like it should be simple, but I'm banging my head against the wall right now

3:48 ambrosebs: ,(-> {:foo (with-meta #() {:meta 1})} :foo meta)

3:48 clojurebot: {:meta 1}

3:48 ambrosebs: not sure if that's what you meant?

3:49 oh you mean non-local variables?

3:50 ddellacosta: ambrosebs: well, what I want to do is something like this (assuming I have {:foo ns/some-fn}): (get-meta-from-fvar :foo) -> returns ns/some-fn's metadata

3:50 ambrosebs: yeah

3:50 (meta #'clojure.core/str)

3:50 whoops

3:50 ,(meta #'clojure.core/str)

3:50 clojurebot: {:arglists ([] [x] [x & ys]), :ns #<Namespace clojure.core>, :name str, :column 1, :added "1.0", ...}

3:50 ambrosebs: ddellacosta: there's probably some trick that works most of the time.

3:50 ddellacosta: can I def stuff here?

3:50 ambrosebs: maybe?

3:51 ddellacosta: (def foo clojure.core/str)

3:51 arg

3:51 ,(def foo clojure.core/str)

3:51 clojurebot: #'sandbox/foo

3:51 ddellacosta: ah

3:51 nice

3:51 ,(meta foo)

3:51 clojurebot: nil

3:51 ddellacosta: right

3:51 ambrosebs: can you just use the var in the map?

3:52 ddellacosta: ambrosebs: maybe that's the answer, I'm probably thinking about it the wrong way

3:53 right...

3:53 ,(def foo-map {:foo 'clojure.core/str})

3:53 clojurebot: #'sandbox/foo-map

3:53 ddellacosta: (meta (resolve (:foo foo-map)))

3:53 ,(meta (resolve (:foo foo-map)))

3:53 clojurebot: {:arglists ([] [x] [x & ys]), :ns #<Namespace clojure.core>, :name str, :column 1, :added "1.0", ...}

3:53 ddellacosta: ambrosebs: yeah, that's the way to do it ^

3:54 ambrosebs: why not just use the var?

3:54 you probably want find-var.

3:55 unless you're using aliases.

3:55 ddellacosta: ,(def foo-map {:foo #'clojure.core/str})

3:55 clojurebot: #'sandbox/foo-map

3:55 ddellacosta: ,(meta (:foo foo-map))

3:55 clojurebot: {:arglists ([] [x] [x & ys]), :ns #<Namespace clojure.core>, :name str, :column 1, :added "1.0", ...}

3:55 ddellacosta: ambrosebs: yeah, I guess that's best

3:56 ambrosebs: thanks for pointing out the obvious (seriously). :-)

3:56 ambrosebs: :)

3:56 ddellacosta: ambrosebs: yeah, a little explanation--I'm building something that is looking up functions based on map keys, but we have full control over how it's specified. So using the var makes the most sense I think.

4:26 sm0ke: so if i have a function with signature like (foo 123 :a 1 :b 2 :c 3), can i destructure the last key value pairs into a map?

4:27 i mean oob, obviously i can do a (into {} (map...)) kind of stuff

4:30 ambrosebs: sm0ke: what do you mean?

4:30 sm0ke: ambrosebs: i mean something like (defn foo [x & more]) where more is a list can i have a map instead?

4:31 fredyr: sm0ke: so you want the opposite of destructuring? collapse arguments into a map?

4:31 sm0ke: yes kind of

4:31 its still destructuring imo

4:32 fredyr: um i wouldn't say so but no matter

4:32 sm0ke: yep, not the point

4:33 pyrtsa: sm0ke: Do you mean (defn foo [x & {:keys [a b c] :as m}] ...) ?

4:33 sm0ke: pyrtsa: well i have to define a b c

4:33 what if there are unbounded arguments

4:34 pyrtsa: sm0ke: (defn foo [x & {:as m}] ...) works as well.

4:34 sm0ke: oh ok

4:34 ambrosebs: ,((fn [& {:as m}] m) 1 2 3 4)

4:34 clojurebot: {1 2, 3 4}

4:34 sm0ke: awesome

4:34 (inc pyrtsa)

4:34 lazybot: ⇒ 2

4:34 fredyr: oh nice

4:34 sm0ke: (inc ambrosebs)

4:34 lazybot: ⇒ 7

4:34 ambrosebs: also works with let

4:35 ,(let [{:as m} '(1 2 3 4)] m)

4:35 clojurebot: {1 2, 3 4}

4:35 ddellacosta: how do I reload a type in the repl (if I'm referring to it in a namespace that is)?

4:35 pyrtsa: Mind you, unlike with [x & more], [{:keys [x] :as args}] will leave args with all arguments, x included. So it's more similar to [x & more :as args].

4:36 ddellacosta: :reload doesn't seem to pick up the edits.

4:36 I guess I should consider using Stuart Sierra's workflow...may help

4:36 ambrosebs: ddellacosta: try and save all your files and :reload-all?

4:36 ddellacosta: ambrosebs: sorry, as an argument to what, require?

4:36 ambrosebs: yes

4:37 ddellacosta: ambrosebs: yeah, that doesn't seem to do it. :-(

4:37 ambrosebs: ddellacosta: probably needs a restart + clean

4:37 ddellacosta: ambrosebs: I assume it has something to do with re-compiling the Java class that is hanging out in cache somewhere

4:37 ambrosebs: ugh, didn't want that to be true but not sure what else to do

4:40 ambrosebs: ddellacosta: dirty REPLs cause so much trouble. Sometimes you need to know when to give up ;)

4:40 ddellacosta: ambrosebs: this is very true. :-)

4:41 BartAdv: I wonder what's world record in REPL time without restart

4:41 ddellacosta: ambrosebs: however, I should probably suck it up and get my project working inside of https://github.com/stuartsierra/component or https://github.com/zcaudate/vinyasa or something

4:42 BartAdv: I've heard cemerick say he goes weeks without restarting, but dunno if that's the record. I can imagine someone's broken the months/year barrier...

4:42 clgv: ddellacosta: yeah vinyasa was advertised with java class reloading

4:42 ambrosebs: I'm the wrong person to comment on those, core.typed does some crazy things which I've internalised ;)

4:43 gotta get those startup times down..

4:43 ddellacosta: ambrosebs: ha...I can only imagine.

4:43 clgv: weeks without restarting? I always restart the REPL on weird errors to make sure it's not the current repl state that's messed up

4:44 ddellacosta: clgv: I know, I was a bit surprised. It's not THAT big of a deal...but I guess some people have different ideas of what inconvenience means. ;-)

4:44 ambrosebs: clgv: weak ;)

4:44 ddellacosta: haha

4:44 ambrosebs: harsh man, harsh

4:44 clgv: my record are approximately 5 days

4:44 ambrosebs: :D

4:45 scheme people are laughing at us. *obviously* restart the REPL!

4:45 ddellacosta: I'm not sure, I've left a repl going for a while and not realized it. Probably I've gone a week before, but I never do it on purpose.

4:45 ambrosebs: :)

4:45 clgv: well usually I shutdown my development machine at closing time ;)

4:45 koreth_: Is there any way to install a hook such that code gets called whenever a symbol is defined? I want to trigger a browser reload with the LiveReload plugin whenever I update a function definition from the REPL.

4:45 ddellacosta: clgv: ah.

4:45 koreth_: I think https://github.com/technomancy/robert-hooke/ does that

4:46 koreth_: er, assuming you can hook to defn or however you're designing it, not sure.

4:46 designing -> defining

4:46 koreth_: defn is a macro, so I'm not sure if that'll work.

4:46 BartAdv: clgv> well usually I shutdown my development machine at closing time ;) <- is there a way to save REPL session state? With common lisp it was easy

4:46 koreth_: But can't hurt to try!

4:47 clgv: BartAdv: not that I know of.

4:47 ddellacosta: koreth_: you can definitely hook "defn" but not "def"

4:48 if the var already exists you can add a watch

4:48 koreth_: clgv: defn is good enough for my purposes. Thanks.

4:48 ddellacosta: clgv: ah, okay, good to know.

4:49 clgv: ddellacosta: that's the problem with thos special forms^^

4:49 ddellacosta: clgv: yeah...d'oh.

4:49 clgv: ddellacosta: though probably the right way would be to watch the changes on a namespace

4:50 ddellacosta: clgv: yeah, I haven't ever needed to do so much heavy namespace wrangling myself. I find if I'm getting to that point there is something wrong with my design...but I don't write a ton of libraries.

4:51 clgv: ddellacosta: I did some hooking into defn and deftype for a debug tool

4:51 ddellacosta: clgv: ah, that would be a good example of appropriate use I'd think

4:51 koreth_: Watching the changes on the namespace is workable but slightly annoying because I'd have to watch changes on *all* the namespaces in my app (since I want to trigger the reload no matter which bit of the code I'm editing).

4:52 clgv: koreth_: yeah, I meant that namespace should support add-watch and trigger the function on changes ;)

5:08 ddellacosta: omfg, testing types is such a pain in the ass. There must be an easier way.

5:08 * ddellacosta sobs

5:11 koreth_: Ah, beautiful. This is like magic now. Edit function, hit "cpp" to make fireplace-vim send it to the REPL, and boom, the browser instantly reloads without me having to switch window focus. http://pastebin.com/REaQebPG

5:11 (Not sure if that's the best way to touch a file.)

5:17 quizdr: y'all think merge-with will result in a sorted map if the arg maps are sorted-maps?

5:19 alew: you would have to use (into (sorted-map) ...)

5:19 jowag: quizdr: result is of same type as the first map (second arg)

5:20 quizdr: alew appears as though jowag suggests into sorted-map would not be necessary

5:21 alew: he's right

5:21 pyrtsa: quizdr: The documentation of merge-with implies the result will have the type of the first argument: "Returns a map that consists of the rest of the maps conj-ed onto the first. (...)"

5:22 So you can rely on it

5:22 jowag: exactly

5:22 quizdr: that's great.

5:22 if I have a map like {:a [1 2 3] :b [4 5 6]

5:22 and I want a new map like {:a 3 : 6} where values are the last arg of the vector, is update-in an option here?

5:22 I can't figure out how to use it. I'm using into/for combo

5:23 pyrtsa: quizdr: You could do (into (empty m) (for [[k v] m] [k (last v)])) for example.

5:24 Unfortunately, there's no standard function for mapping a function over the values of a map.

5:24 (I put (empty m) there only to preserve the sorted-map'ness of m, because that was your previous concern. You could use (into {} ...) as well.)

5:25 quizdr: ok, that's what i'm doing currently, but the docs for update-in seemed to suggest there might be a possiblity here

5:25 pyrtsa: update-in only updates at one key.

5:26 You'd need to do something like (reduce #(update-in %1 [%2] last) m (keys m)), which probably isn't as optional.

5:26 quizdr: oh ok

5:26 pyrtsa: s/optional/optimal/

5:26 quizdr: ok, i'm getting used the into/for idiom, so i'll stick with that.

5:28 jowag: quizdr: you can also use something like (zipmap (keys m) (map f (vals m)))

5:29 alew: I don't think that's guarranteed anymore

5:29 pyrtsa: alew: No, the opposite, it *is* guaranteed now.

5:30 jowag: ^what pyrtsa said

5:30 pyrtsa: Rich involved in the email discussion and confirmed the implementation does the only right thing it should do: have consistent order for (seq m), (keys m) and (vals m).

5:30 alew: well thats fantastic

5:31 pyrtsa: Here's hoping it's also written down and added to the docstring in Clojure 1.6.

5:44 jowag: pyrtsa: it's there, http://dev.clojure.org/jira/browse/CLJ-1302

5:57 systemfault: Is there any way to see what's printed on the console with cider?

6:00 Nevermind... updating cider to the latest version fixed the problem

6:11 tomjack: consider a 'distinct' reducer

6:12 https://www.refheap.com/8f8bc4fa9580a8dc6209131aa

6:13 d'oh, I should have tried it first

6:14 well, my point was that that doesn't work

6:15 though I thought it worked more than it does..

6:15 seems like you need an atom?

6:23 sm0ke: any nice method to recursively apply function to all map keys?

6:23 maps value can be map

6:24 tomjack: what if the function is not injective?

6:24 sm0ke: i am talking about simple functions

6:25 like str to keyword

6:25 nothing fancy

6:25 tomjack: ah, by simple you mean injective, I guess :)

6:25 sm0ke: seems like there is nothing to map on a map directly

6:25 recursively is far fetched idea

6:26 tomjack: (reduce-kv (fn [ret k v] (assoc ret (f k) v)) {} map) ?

6:26 :/

6:28 sm0ke: what is that for?

6:28 is it recursive?

6:29 tomjack: no

6:29 sm0ke: (into {} (for [[k v] m] ..)) is better

6:29 tomjack: probably

6:31 pyrtsa: jowag: Yay, great!

6:33 tomjack: sm0ke: you don't actually want to stringify keys, do you?

6:33 sm0ke: tomjack: actually i want opposite

6:33 tomjack: it appears clojure.walk/stringify-keys provides a recursive example in any case

6:33 there is keywordize-keys too

6:33 minikomi: ah nice, got webcam working with quill, fireplace

6:33 live video manipulation :D

6:33 tomjack: I was going to suggest a clojure.walk impl next and then noticed that again :)

6:35 sm0ke: nice

6:35 ,(clojure.walk/keywordize-keys {"a" 1 "b" 2})

6:35 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.walk>

6:36 sm0ke: nice its recursive all right

6:36 i have another problem now

6:36 how do i recursively conver a java map to clojure map

6:37 (inc tomjack)

6:37 lazybot: ⇒ 2

6:38 tomjack: #(if (and (instance? java.util.Map %) (not (map? %))) (into {} %) %)

6:38 sm0ke: ooh (into {}...) works

6:39 tomjack: yes thanks

6:39 tomjack: with a walk?

6:39 sm0ke: tomjack: one more think is there a walk function for applying ustom functions?

6:39 custom*

6:39 tomjack: my function above was for clojure.walk/prewalk

6:39 but I'm not sure that makes sense

6:40 sm0ke: ok wait, so many questions

6:40 i was asking is there a clojure.walk with custom function on keys?

6:41 tomjack: look in clojure.walk and read the docstrings

6:41 also read the source of keywordize-keys and stringify-keys

6:41 sm0ke: ok thanks

6:41 tomjack: there is no such function but you can copy stringify-keys to write it

6:42 sm0ke: and yes into {} seems recursive

6:42 tomjack: &(class (:foo (into {} (doto (java.util.HashMap.) (.put :foo (doto (java.util.HashMap.) (.put :bar 42)))))))

6:42 lazybot: ⇒ java.util.HashMap

6:42 pyrtsa: (into {} ...) itself isn't recursive, but of course you can use it with a recursive function.

6:43 tomjack: I guess a postwalk makes sense?

6:43 sm0ke: hmm really?

6:44 try this in repl, (clojure.walk/keywordize-keys (java.util.HashMap. {"a" 1 "b" {"c" "b"}}))

6:44 and this, (clojure.walk/keywordize-keys (into {} (java.util.HashMap. {"a" 1 "b" {"c" "b"}})))

6:44 pyrtsa: sm0ke: It's keywordize-keys that is recursive there, not into.

6:45 sm0ke: but then how come it doesnt work on the first case?

6:45 tomjack: it's because into is not recursive

6:45 oh, hmm

6:46 not your example

6:46 pyrtsa: No, it's because clojure.walk only deals with IPersistentMaps and java.util.HashMap isn't one.

6:46 tomjack: &(clojure.walk/keywordize-keys (into {} (java.util.HashMap. {"a" 1 "b" (java.util.HashMap. {"c" "b"})})))

6:46 lazybot: ⇒ {:b #<HashMap {c=b}>, :a 1}

6:46 pyrtsa: See (source clojure.walk/keywordize-keys).

6:47 ,(map? (java.util.HashMap. {})) ;; in particular.

6:47 clojurebot: false

6:48 tomjack: ah, which is also why postwalk doesn't work

6:48 pyrtsa: Yeah.

6:48 sm0ke: ,(map? (into {} (java.util.HashMap. {"a" 1 "b" {"c" "b"}})))

6:48 clojurebot: true

6:48 sm0ke: ,(map? ((into {} (java.util.HashMap. {"a" 1 "b" {"c" "b"}})) "b"))

6:48 clojurebot: true

6:48 sm0ke: see

6:48 tomjack: but prewalk is going to (into {}) each hashmap just to rebuild that map anyway?

6:48 sm0ke: into is in fact recursive

6:49 oh ok got it..

6:49 :P

6:49 ,(map? ((into {} (java.util.HashMap. {"a" 1 "b" (java.util.HashMap. {"c" "b"})})) "b"))

6:49 clojurebot: false

6:49 sm0ke: haha

6:49 so is there a way to recursively convert a java map to clojure?

6:50 tomjack: call prewalk with the anon function I gave above

6:50 and the two walks can't be zipped!

6:50 not that it probably matters

6:51 s/zipped/fused/ I guess

6:51 sm0ke: i could use a form

6:56 clgv: use postwalk, then each map is changed only once

6:58 pyrtsa: sm0ke: (defn f [m] (if (or (map? m) (instance? java.util.Map m)) (into {} (for [[k v] m] [k (f v)])) m))

7:00 sm0ke: pyrtsa: why are you not using walk?

7:00 pyrtsa: Why use walk?

7:00 sm0ke: look convenient

7:00 looks*

7:02 ok this fails, (clojure.walk/postwalk (fn [x] (if (instance? java.util.Map x) (into {} x))) jm)

7:03 (def jm (java.util.HashMap. {"a" 1 "b" (java.util.HashMap. {"c" "b"})}))

7:03 pyrtsa: One thing to watch out, regardless whether you use clojure.walk or a recursive function like the one above: self-referential data structures will cause an infinite loop (broken with a stack overflow).

7:03 That won't really happen with persistent data structures but may happen with java.util.Map.

7:04 sm0ke: pyrtsa: your functions works well

7:04 pyrtsa: sm0ke: Like I said above, the trouble with clojure.walk is it expects Clojure maps, not Java.

7:05 sm0ke: pyrtsa: it works on plain forms, if i am reading the docs correctly

7:05 has nothing to do with maps

7:06 pyrtsa: Btw, my function f above won't recur into sequences and vectors, only maps. You'd need to add another condition for that.

7:06 sm0ke: pyrtsa: i am copying another one of your functions

7:07 i remember i copid something related to lazy seq one time

7:07 pyrtsa: No problem.

7:08 sm0ke: oh i see the porblem, yes you are right i think this cant be done with walk

7:08 pyrtsa: sm0ke: What comes to documented vs. actual behavior... use the source (macro), Luke.

7:08 sm0ke: as its not a seq which clojure can walk

7:17 hhenkel_: Hi all, I'm currently trying to parse the server response of zabbix (https://www.zabbix.com/documentation/2.2/manual/appendix/items/activepassive#active_checks => Server Response after sending collected data).

7:18 I'm currently failing on parsing the json part, as it seems like there are "NUL" chars within my result.

7:19 I allready tried to write the response to a file and there I see the NUL chars but I'm not completly convinced that the server is sending me this.

7:20 clgv: hhenkel_: what are NUL chars? a string with content "NULL"?

7:21 or character of value zero?

7:21 quizdr: jowag that zipmap idea is very clear and elegant, thanks!

7:22 pyrtsa: clgv: "foo\u0000bar"

7:23 clgv: pyrtsa: thats what I want to know from him. what exactly he means...

7:23 pyrtsa: hhenkel_: If that's the only problem (and you consider JSON input containing NUL chars valid, which I don't), you could do (clojure.string/replace input #"\u0000" "")

7:23 hhenkel_: clgv: https://www.refheap.com/51801

7:24 pyrtsa: I also thinks those are valid...and so does cheshire as it fails. I'll give your suggestion a try.

7:24 clgv: hhenkel_: the trailing 0s you mean?

7:25 hhenkel_: clgv: I guess it will allready fail with the leading nul

7:27 clgv: so that file is the body of an http response?

7:27 pyrtsa: hhenkel_: I don't know of Zabbix but to me it seems like you're getting broken data. The docs say it should start with "<HEADER><DATALEN>{", and the three zero chars don't look like a header.

7:27 ...nor a data length.

7:27 hhenkel_: pyrtsa: That is right, it is only the "data" part I posted.

7:28 clgv: It's not http, they are using there own protocol.

7:28 pyrtsa: Are you sure you're parsing it right?

7:29 hhenkel_: pyrtsa: that's a valid question, I'm able to extract the header and the length - but maybe there is a better way.

7:29 pyrtsa: The datalen is probably 4 bytes or something like that. Are you sure you're using it right?

7:29 8 bytes, according the docs.

7:29 hhenkel_: I'll post what I currently got.

7:34 pyrtsa: https://www.refheap.com/51804

7:34 pyrtsa: I guess problem could be that I initialize a byte-array that is to big?

7:35 pyrtsa: hhenkel_: (. (:in @conn) read datalen 0 5) ...

7:35 Should be 8.

7:35 And you should use the value of datalen for message length, instead of a fixed 1024.

7:35 hhenkel_: pyrtsa: yes, you're right.

7:36 pyrtsa: (Protip: datalen comes little-endian, i.e. first byte contains the least significant part of the Long.)

7:36 hhenkel_: pyrtsa: TRACE: "5900000000000000"

7:36 pyrtsa: You should treat that value as 0x0000000000000059

7:42 hhenkel_: pyrtsa: I'll give it a shut. Thanks so far!

7:48 pyrtsa: hhenkel_: This could help: http://stackoverflow.com/a/14827440/26981

8:00 clgv: pyrtsa: byte order confusion yay!

8:20 szymanowski: is there a function to get the n lasts elements of a coll?

8:21 pyrtsa: take-last

8:21 szymanowski: ok thank you :)

8:22 pyrtsa: In case it's a vector, subvec is better.

8:59 hhenkel_: pyrtsa: you're still around?

9:30 mikerod: Is it correct to say that the clojure.lang.Compiler$Expr#emit method would only be called when compiling to a file ("static" compile/AOT compile)?

9:34 ambrosebs: mikerod: sounds about right. Not sure tbh.

9:34 pyrtsa: hhenkel_: Back.

9:55 mikerod: ambrosebs: yeah, it's my assumption so far

9:55 which should make sense.

9:59 llasram: mikerod: Kind of. All AOT compilation does is write out the class files for generate classes while also performing "normal" compilation/evaluation

10:05 mikerod: llasram: that was my impression.

10:07 hhenkel_: pyrtsa: https://www.refheap.com/51845 Is this a sane way to do things?

10:12 llasram: hhenkel_: There are several problematic aspects

10:12 pyrtsa: hhenkel_: You should use getLong. The following probably reads better: (.. (ByteBuffer/wrap datalen) (order ByteOrder/LITTLE_ENDIAN) getLong)

10:13 llasram: hhenkel_: The biggest IMHO is that there's no nead for a ref -- you can just use `loop` and do normal Clojure tail recursion until the exit condition is met

10:14 hhenkel_: I agree with pyrtsa that your use of the `.` special form should be replaced, but I'd argue that `->` and `.method` forms has become the most common

10:15 pyrtsa: llasram: Heh, I was actually first suggesting that form, but I thought someone just suggested otherwise. I think (-> x (.foo) (.bar)) reads better for Java interop.

10:15 llasram: pyrtsa: 100%

10:15 Someone has an older style guide which says to use `..`, but I think it's just wrong :-)

10:15 pyrtsa: Nod.

10:16 llasram: My justification is that `->` works w/ both functions and interop method invocation, and results in more consistent-reading code

10:16 (I note for hhenkel_'s benefit)

10:17 fredyr: but I'd argue that `->` and `.method` forms has become the most common

10:17 16:14 < pyrtsa> llasram: Heh, I was actually first suggesting that form, but I thought someone just suggested otherwise. I think (-> x (.foo) (.bar)) reads better for Java interop.

10:17 16:14 < llasram> pyrtsa: 100%

10:17 ouch

10:17 sorry about that

10:17 llasram: tut tu ttu

10:17 pyrtsa: fredyr: No offense taken. Why?

10:17 llasram: pfft

10:19 fredyr: selecting text and clicking was apparently a bad idea in the terminal window i run my irc client

10:20 pyrtsa: Haha. Thought you were disagreeing.

10:20 fredyr: nono, just massively misclicking

10:20 TimMc: Middle-click?

10:21 fredyr: not really wanna reproduce it right now

10:21 :)

10:21 hhenkel_: llasram: okay, not completly sure what you meant regarding the ref. Should I better loop till there are no more bytes?

10:21 llasram: hhenkel_: Right now `conn` is a ref, right?

10:21 hhenkel_: llasram: pyrtsa: I'll try to rework the java interop then.

10:21 fredyr: but perhaps middle-click yeah

10:21 pyrtsa: A great feature in OS X Terminal: double clicking a paren/bracket/brace selects everything to the matching pair.

10:21 hhenkel_: llasram: yes.

10:22 llasram: hhenkel_: But AFAICT, it's only a ref so that you can mutate it to change the value at the `:exit` keyword to `true`, yes?

10:23 Or maybe I've misunderstood the broader context

10:24 hhenkel_: llasram: yes, probably. To be hones I did not think much about that part so far, I took it from this sample: http://nakkaya.com/2010/02/10/a-simple-clojure-irc-client/

10:26 Wild_Cat: hhenkel_: you might like to be made aware of https://github.com/Raynes/irclj

10:27 clgv: Wild_Cat: wild guess. I dont think he wants to implement an irc client. ;)

10:27 Wild_Cat: urk. Apologies, I didn't read the whole conversation.

10:27 I need coffee.

10:28 hhenkel_: Wild_Cat: Thanks, I will look at it but clgv is right...I'm not working on an irc client. ;)

10:33 llasram: hhenkel_: huh. I have no idea why that code uses a ref

10:33 hhenkel_: I'm afraid that isn't really a very good example

10:36 hhenkel_: llasram: okay, that's good to know then...any suggestions for a better example? the irc client Wild_Cat mentioned before?

10:37 clgv: hhenkel_: example for what?

10:37 hhenkel_: communication with some remote service?

10:39 hhenkel_: clgv: good example for using sockets for low level communication.

10:40 llasram: hhenkel_: The thing is the basic Java standard library there is pretty straightforward, so it's pretty much just normal Clojure + that library

10:40 s,that library,the standard library,

10:42 hhenkel_: llasram: okay, then I will try to dive in there deeper.

10:43 Wild_Cat: llasram: irclj uses a ref for "irc" objects, which each represent a connection to a specific server. The reason they're refs is that they mainly hold a big bunch of state, which changes throughout the life of the IRC object (e.g. a server is connected to, then channels are joined/parted, statuses are set...).

10:43 ...and of course by "IRC objects" I actually mean "maps", in classic Clojure tradition :p

10:44 llasram: Wild_Cat: I was referring to the blog-posted example hhenkel_ linked to. I haven't looked at irclj before :-)

10:45 Wild_Cat: llasram: and I, in another characteristic display of caffeine deprivation, was actually answering hhenkel_'s highlight. :p

10:45 llasram: ho ho ho

10:46 Wild_Cat: today's lesson: I can do Python in my (near-)sleep. Not Clojure.

10:48 CookedGryphon: is there a good reason clojure.core.match couldn't be extended to support the following: https://www.refheap.com/51896

10:49 at the moment it complains because it thinks I'm binding two different things to the same name

10:49 I tried implementing it with (_ :guard (partial = x)) instead of the second x, but the first x isn't in scope at that point to use in the guard

10:53 pyrtsa: CookedGryphon: That's unification, not pattern matching. A bigger topic.

10:54 bbloom: pyrtsa: that is not unification

10:54 pyrtsa: unification means that there are variables on both sides of the match

10:54 pyrtsa: No?

10:54 Ohh kay.

10:55 bbloom: CookedGryphon: frankly, i'm surprised that doesn't work already. seems like it should generate an equality guard

10:55 CookedGryphon: bbloom: that's what I thought too

10:55 ambrosebs: seems like it should just work

10:55 bbloom: CookedGryphon: i don't use core.match, but dnolen_ hangs around here & maybe he can give you rationale or tell you "contributions welcome" :-P

10:55 ambrosebs: pretty sure Racket's match works like that

10:56 dnolen_: bbloom: that feature is actually quite rare outside of Erlang

10:57 ambrosebs: I'd be surprised if it did, but perhaps they added it. It's not common in FP langs.

10:57 bbloom: dnolen_: why? because universal equality is rare outside of erlang?

10:57 ambrosebs: dnolen_: yea, I need to check :)

10:57 dnolen_: ML derived I mean

10:57 bbloom: but we've got it :-)

10:58 dnolen_: bbloom: it's nice for expressiveness but it isn't particularly simple to implement (at least as far as I've thought about it)

10:58 bbloom: dnolen_: you've got pattern guards, right?

10:58 dnolen_: if you think about it doing it right in the general case

10:58 bbloom: you need to think about about scoping + nesting

10:58 fredyr: http://docs.racket-lang.org/reference/match.html

10:59 seems like they do have something like that

10:59 bbloom: dnolen_: i'm not sure how scoping and nesting complicate this

11:00 dnolen_: (match [z] [{x :foo} [x _ x _ {{x :bar} :baz] ...)

11:00 ambrosebs: I've only got proof that it's there, not any docs. Reuses `p` with some sort of equality https://github.com/plt/racket/blob/master/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/infer/infer-unit.rkt#L176

11:01 CookedGryphon: dnolen_: what if we gensymed a new name for each of the duplicates and then test for equality as the last stage and use the first occurence as the binding?

11:01 dnolen_: CookedGryphon: nope

11:01 CookedGryphon: the only thing I'm going to consider is something that is fast and correct

11:02 thus I haven't bothered

11:02 someone tried it in the past and realized it's more work than it looks at first

11:02 which why we just disallow for now

11:02 bbloom: dnolen_: i'm not trying to suggest it's easy nor do i have any stake in this (i don't use core.match), but i'm trying to understand the scoping/nesting issue... that match you just showed seems sane to me...

11:03 dnolen_: are you concerned about creating efficient decision trees using knowledge of equalities to optimize?

11:03 dnolen_: bbloom: you can read the source and see the problems

11:04 bbloom: dnolen_: i've written a non-optimizing pattern matcher with this feature & it was trivial to implement...

11:04 dnolen_: hence my question is if you're concern is the decision tree optimization

11:07 pyrtsa: TIL: The above kind of match pattern is called non-linear. E.g. Haskell only allows linear patterns, but you can use guard expressions to refine the match.

11:09 ambrosebs: pyrtsa: makes sense

11:09 pyrtsa: It does.

11:10 fiorellino: ciao :D

11:10 !list

11:15 seangrove: dnolen_: Ah, sorry, just saw the "No pull requests at this time" for Om, I'll close the PR and open an issue

11:15 I just had the changes since I needed to make them locally anyway

11:16 ambrosebs: does racket's match have optimised branching?

11:16 CookedGryphon: So reading a little on the implementation of core.matrix, is the issue that in order to generate an optimal decision tree you would also need to score and rearrange the rows as well as the columns in the match? Potentially leaving you with tricky ordering issues

11:18 ambrosebs: core.matchrix

11:18 CookedGryphon: oops

11:18 :P

11:18 i obviously meant to say core.match there

11:26 dnolen_: bbloom: sorry I'm not saying it's conceptually challenging - just that the implementation in core.match is gonna be some work - lots of tests since core.match has a lot of features

11:27 bbloom: dnolen_: ah ok, makes more sense :-)

11:33 sdegutis: ,:foo

11:33 clojurebot: :foo

11:56 verma: is #lighttable the official lighttable support channel?

11:57 TimMc: verma: Chris Granger is in that channel, so I'd assume so!

11:57 verma: TimMc: thanks :)

12:17 gfredericks: latest adventure -- having trouble using clojure at work because of fortran

12:18 justin_smith: weird

12:18 bbloom: wut?

12:18 ptcek: fortran is good :)

12:19 gfredericks: app -> incanter -> jblas -> fortran

12:19 that last arrow is broken

12:19 wink: lol

12:20 bbloom: ha, wow

12:20 TimMc: gfredericks: You have the strangest problems.

12:21 gfredericks: says the man who cannot abide gen-class wanting to compile to a class file

12:21 hiredman: gfredericks: try using j instead of i

12:21 TimMc: ssshhhh

12:21 gfredericks: hiredman: jncanter?

12:21 TimMc: gfredericks: It's not *so* weird wanting to store my code in a database, is it?

12:22 gfredericks: TimMc: s/code/bytecode/

12:22 S11001001: TimMc: well, you're in g.... company. http://mindprod.com/project/scid.html

12:22 TimMc: gfredericks: http://techblog.netflix.com/2014/03/the-netflix-dynamic-scripting-platform.html

12:24 bbloom: TimMc: aawwww yeah dynamic/reflective/funtimes

12:25 TimMc: I'm giving up on using Clojure for the actual scripts, for now.

12:25 *filters

12:27 llasram: TimMc: Oh, you know, I totally forgot about another option

12:27 TimMc: https://github.com/llasram/shady

12:28 Integrates `gen-class` with the Clojure 1.3+ DynamicClassLoader

12:28 TimMc: oooh

12:28 llasram: And removes the requirement for it to actually drop a class file to disk

12:28 TimMc: What's the catch?

12:28 llasram: TimMc: It's little-tested

12:29 I thought I needed it, wrote it, and didn't

12:29 And I think the most recent release might be bugged. I switched to generating the classes at run-time instead of macro-expansion time. Which I think will usually be fine, except when it isn't

12:29 If you always call it at top-level, it shouldn't matter

12:30 But if you ever call it in a function, the `shady` version will generate a new class on each call

12:30 OTOH, -- why would you ever do that?

12:30 TimMc: Right.

12:31 llasram: And if it's not clear from the doco, you can use the DynamicClassLoader-integrated `gen-class` w/o the `defclass` attempt at sugar

12:31 TimMc: The only thing left to do would be to exfiltrate the Class name to the compiler's caller, which I could do with a var.

12:32 llasram: In fact, you might be best off justs copying the code from https://github.com/llasram/shady/blob/master/src/shady/gen_class.clj into your project

12:32 Anderkent: llasram: is it a drop-in for genclass? Can I inject it and have protocols and types that reevaluate nicely in repl?

12:32 wait, does defprotocol expand to genclass?

12:32 llasram: Anderkent: No :-)

12:32 To the latter

12:32 Anderkent: bah.

12:33 actually now that I think about it my issue is exactly the reverse, i.e. reevaluating a namespace with defprotocol even if it hasnt changed breaks compatibility

12:33 so I guess I was really confused when I wrote the above

12:34 TimMc: llasram: Cool, I'll give this a try!

12:34 llasram: Anderkent: It's kind of a hard problem. I mean, defmulti/method does essentially the opposite thing, with it's own class of confusing results

12:34 TimMc: I hope it works! Curious to know :-)

12:34 * llasram crosses his fingers

12:37 notofi: Hello everybody. At my team at work we have made the experience that we can not use hash-maps for our datastructures for a big application, because keyword lookup just returns nil if some value is not in the map. I am wondering if there would be a way to use strict hashes in clojure

12:38 As I see it, implementing a strict hash that would throw an exception if the key is missing would break the contract of keyword lookup

12:38 technomancy: notofi: unfortunately no such thing exists afaik

12:38 people use preconditions or something like prismatic schema instead

12:39 patchwork: notofi: (contains? map key) returns true or false depending on whether the key is in the map

12:39 notofi: patchwork: sure, you could write a function and call (strict-get entity :id) everywhere. but thats rather verbose

12:40 Anderkent: notofi: nothing like that AFAIK, also looked for it a year or two ago;

12:40 patchwork: wrapping every access with contains? is not a solution

12:40 gfredericks: I get a lot of questions about debuggers -- is ritz still viable?

12:40 technomancy: notofi: it's going to be verbose no matter what, sadly

12:40 llasram: It'd be pretty easy to write such a strict map, but somewhat difficult to ensure all the maps you cared about were-and-remained this new map type

12:40 notofi: currently at my workplace we have a bunch of protocols about 30-40 and types that implement these. so we use functions like p/id or p/name instead of keyword lookups everywhere

12:41 llasram: ouch

12:41 notofi: in that way we have short accessors, but we lose all the advantages of maps like destructuring

12:41 ambrosebs: notofi: somewhat related, in core.typed I have a custom defrecord type internally that throws if you `get` a missing field.

12:41 Anderkent: I think at some point you have to just bite the dynamic bullet and trust your tests

12:42 notofi: ambrosebs: yeah thats the solution I was thinking of, but it breaks the contract of 'get' AFAIK so we cant do it

12:42 So I was wondering , maybe we should extend the language somehow or change contracts or something

12:43 I am also not quite sure what is my question ;)

12:43 technomancy: preconditions and schemas are fine, but for example if you create a string and some value is not in the hash then this will just be nil, so it is a limited approach

12:43 patchwork: Anderkent notofi: If that is really what you want, I see nothing wrong with implementing a (get! …) and (get-in! …) that throw exceptions

12:44 technomancy: notofi: agreed; I don't think there's a good solution for this problem in clojure.

12:44 clojurebot: Excuse me?

12:44 Anderkent: notofi: so there's a difference between a hash that you expect to have a constant set of keys (basically, a container data structure), and a hash where you expect a key might be missing

12:45 notofi: patchwork: sure but the problem is you want a hash which always throws so you can use the idiomatic keyword access

12:45 Anderkent: notofi: for the first one, schema does okayish; validate your args at function entry point (with a macro, perhaps?)\

12:45 then trust the hash contains the keys you need for the rest of the function

12:45 patchwork: (defn get! [m k] (if (contains? m k) (get m k) (throw "NO")))

12:45 notofi: Yeah, but that is a small price to pay

12:46 If the whole problem is you want to preserve keyword access, I barely use that anymore anyway

12:46 notofi: Anderkent: that seems to be fine, but then you cant use normal functions

12:46 Anderkent: notofi: how so?

12:47 TimMc: technomancy: s/Clojure/any language I can think of/

12:47 notofi: Anderkent: well, every function that works on your data structure would need to be one of those

12:47 that assert it

12:47 clojurebot: Excuse me?

12:47 TimMc: clojurebot: shush

12:47 clojurebot: Gabh mo leithscéal?

12:47 technomancy: TimMc: racket throws on not-found if you don't provide a default value

12:48 TimMc: Ah, avoiding having the problem in the first place.

12:48 technomancy: and using option types when the compiler can't determine whether you'll get a sensible value helps a lot

12:48 Anderkent: notofi: yeah, but that's just a question of changing defn into (defnv ..) or something; you can of course use external functions that don't validate; in theory it'd be sufficient to validate only in external api calls, and trust your tests internally

12:49 technomancy: but you need pervasive pattern matching for that

12:49 notofi: Anderkent: hmm ..

12:50 TimMc: notofi: Is this for normal data flow, or for catching exceptional cases?

12:51 notofi: TimMc: for normal data flow

12:51 Anderkent: notofi: but I know your pain, had a prod bug because of a typo in keyword in a rare path that caused a value that was supposed to be a set to become nil, and then be conjoined onto in further executions, becoming a seq and breaking contains?

12:52 notofi: If many people have this issue, maybe we can allow strict-hashes in clojure and change the 'contract' of lookup valAt and get to allow throwing ? That would solve the problem nicely. I am not sure if something like that is possible

12:52 you couldnt do things like (or (:foo data) (:bar data)) anymore because if foo is not there then boom

12:52 Anderkent: notofi: the problem is in keeping your strict-hash a strict-hash

12:53 would have to change all things like update-in etc. to preserve strictness

12:53 notofi: Anderkent: actually you would only have to implement basic map interfaces.

12:54 Anderkent: But we were thinking of only implementing lookup anyway and no other interfaces, so a lookup-only data structure

12:54 Anderkent: not for things that look at the map as a seq, surely

12:56 notofi: Another solution I was thinking of is creating a deftype that only implements IFn , it would look a bit odd and not sure if it is unidiomatic

12:56 gfredericks: notofi: can't you do whatever that does with just a function?

12:56 notofi: so you say (my-data-object :foo) and it calls strict-get on an internal map

12:56 gfredericks: sure you can but (my-data-object :foo) is shorter than (strict-get my-data-object :foo)

12:56 llasram: notofi: Will you never need to create modified versions of these values?

12:57 gfredericks: notofi: no I mean

12:57 notofi: llasram: We have a big application and chose to initialise our values in one central place

12:57 gfredericks: (defn make-getter [m] (fn [k] (assert (contains? m k)) (get m k)))

12:57 notofi: ^ as I understand your proposal, that's equivalent but w/o deftype

12:58 i.e., a deftype that only implements IFn is essentially a function, and you can already make functions without deftype

12:58 llasram: notofi: If you really never need to modify / create modified versions of these things after initial creation, then you have tons of options

12:58 Anderkent: gfredericks: doesnt prevent someone using (get) on it.. (or can you get on a deftype anyway?)

12:58 notofi: gfredericks: oh yeah, sure lol

12:58 gfredericks: Anderkent: sure it does; you can't call get on (make-getter {:foo 12})

12:58 notofi: Anderkent: there is already an issue where they want to change that in clojure.core, that it throws when you call get on something that isnt a lookup like (get 3)

12:58 gfredericks: ,(defn make-getter [m] (fn [k] (assert (contains? m k)) (get m k)))

12:58 clojurebot: #'sandbox/make-getter

12:59 gfredericks: ,(get (make-getter {:foo 12}) :foo)

12:59 clojurebot: nil

12:59 llasram: haha

12:59 Oh, `get`

12:59 Anderkent: notofi: if it's not modifiable then just never expose the map and just make sure your getters in the namespace are correct

12:59 gfredericks: oh wait

12:59 ,(get (Object.) :foo)

12:59 clojurebot: nil

12:59 gfredericks: I take it all back

12:59 I guess if you want get to throw you need deftype

12:59 or reify

12:59 notofi: gfredericks: yeah but then it breaks the contract of 'get'

13:00 llasram: notofi: I don't think that's a problem

13:00 Anderkent: I'm not sure about that. get doesn't say it never throws exceptions

13:00 patchwork: ,((make-getter {:foo 12}) :bar)

13:00 clojurebot: #<AssertionError java.lang.AssertionError: Assert failed: (contains? m k)>

13:00 notofi: ,(doc get)

13:00 clojurebot: "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

13:00 Anderkent: AFAIK anything can throw anything unless it explicitly says it never throws

13:00 or is that not the common understanding?

13:00 llasram: (inc Anderkent)

13:00 lazybot: ⇒ 9

13:01 Anderkent: yay! imaginary internet points!

13:01 llasram: :-)

13:01 notofi: Anderkent: I dont know

13:02 Anderkent: the docstring says otherwise, I think it would be worth doing but my teammates say it breaks the contract

13:02 patchwork: that sounds obstructionist

13:02 llasram: notofi: Your teammates need to decide which problem they think is worse :-)

13:03 notofi: llasram: hmm

13:03 llasram: What are they concern about wrt "breaking the contract of get"?

13:03 ambrosebs: FWIW every lookup in this namespace throws an exception if not found, and I can sleep at night https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/cs_gen.clj

13:04 llasram: (inc ambrosebs)

13:04 lazybot: ⇒ 8

13:04 notofi: llasram: get explicitly says it returns nil

13:04 Anderkent: I can't read typedclojure :(

13:04 llasram: Wow, only 8? ambrosebs: you need to get your core.typed posse on that

13:04 notofi: So?

13:05 That only matters if you pass the map to a function which calls `get` for a value which doesn't exist in the map

13:05 WHich is exactly the situation you are trying to fail fast when happens

13:05 Anderkent: WRT breaking contracts, it's generally a smell; but if there's good reason to do it or you're not exposing the broken contract then you're still okay

13:06 notofi: llasram: I know. I am all for this approach, but the guys which are in my team argue that it is worse if we break the contract

13:06 ambrosebs: it would be breaking the contract if you returned false.

13:06 throwing an exception.. not so much IMO

13:06 but whatever.

13:06 llasram: notofi: Then you might consider replacing your teammates with other teammates when they are asleep

13:06 Anderkent: yeah I also feel it's acceptable

13:07 llasram: notofi: Or just tell them that the author of core.typed disagrees with them :-p

13:07 notofi: llasram: I havent looked into that yet

13:07 Anderkent: but even if you had a really good reason to return ::no-value, for example, as long as you never give the breaking object back to someone else in an external api, you're still good

13:07 notofi: llasram: that might be a nice counter-argument, what exactly are they doing in core.typed?

13:07 llasram: notofi: Well, ambrosebs just linked you to the code :-)

13:07 ambrosebs: let me dig for the impl..

13:08 notofi: llasram: its 1700 lines ;)

13:08 llasram: A pleasant afternoon read

13:08 ambrosebs: https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/utils.clj#L402

13:08 haha DONT read cs_gen

13:08 ;)

13:08 notofi: ambrosebs: very interesting

13:09 this is really helpful ;)

13:09 Anderkent: >commented out code. This better be a WIP!

13:10 notofi: what exactly is this def-type thing?

13:10 Anderkent: ambrosebs: https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/utils.clj#L502 heresy! :P

13:10 llasram: ~guards

13:10 clojurebot: SEIZE HIM!

13:11 Anderkent: ambrosebs: Lots of respect though for core.typed, I'm just poking fun.

13:11 ambrosebs: Anderkent: oh you mean the extra dash?

13:11 Anderkent: love dem dashes

13:11 Anderkent: the paren on a line of its own

13:11 ambrosebs: oh

13:11 haha

13:12 if you follow the other end it's a tc-ignore.

13:12 DONT TYPE CHECK

13:12 :)

13:12 Anderkent: gah :P

13:12 notofi: ambrosebs: Do you know why they are doing it strict? is this some special case or just useful for their library?

13:12 ambrosebs: notofi: def-type defines a kind of defrecordy thing

13:12 Anderkent: it's missing the ;end tc-ignore comment then :(

13:13 ambrosebs: Anderkent: true. For mine eyes only

13:13 me and my 4 contributors

13:13 Anderkent: nah, is cool, matching parens 140 lines higher with no indent of contents is what I eat for brewakfast

13:13 ambrosebs: LOL

13:14 notofi: this is my own library.

13:14 notofi: I know how crazy it can be finding these kinds of lookup bugs.

13:14 notofi: so I implemented this .. thing

13:15 notofi: ambrosebs: can you show me some example code of yours were these types are created and used with keywords?

13:15 ambrosebs: cant find any in cs_gen

13:16 ambrosebs: notofi: here's the def-type for Function https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/type_rep.clj#L634-L649

13:17 stepping back a bit I realise all that stuff in the definition seems insane

13:17 but again, sleep

13:17 and when I use a Function type, I just need a precondition like this https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/cs_gen.clj#L1183

13:18 then all these lookups are robust to typos https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/cs_gen.clj#L1191-L1196

13:18 notofi: ambrosebs: I see, thank you.

13:19 ambrosebs: the Precondition has nothing to do with this lookup topic right?

13:19 ambrosebs: notofi: not directly

13:20 notofi: ambrosebs: maybe we should use core.typed ;)

13:20 ambrosebs: notofi: that could be a bigger investment ;)

13:21 FWIW core.typed follows the normal lookup semantics

13:21 it has to, because macros and stuff

13:21 notofi: ambrosebs: what do you mean?

13:21 ambrosebs: notofi: this type checks as nil: (get {})

13:22 (get {} :foo)

13:22 rather

13:22 notofi: ambrosebs: ok. anyway i am signing off, good evening

13:22 ambrosebs: cya

13:23 Anderkent: UGT strikes again :D

13:24 ambrosebs: combating contrib pull requests: make your project as complicated as possible

13:24 success

13:26 Anderkent: not sure if sarcasm; I've seen more projects saying 'please do not make pull requests' recently. All I can say is I wish I had that problem :P

13:27 technomancy: "You know the error is there, I know the error is there. Let's just say it goes away and we forget about this PR." I loled https://github.com/clojure/test.check/pull/1

13:27 ambrosebs: that's a classic

13:28 Anderkent: and it went away!

13:29 S3thc0n: Hello #clojure people :) It occurs to me that often multimethods are used when the need does not seem obvious, be it in core itself or other code. Specifically I'm talking about cases like this one: http://clojuredocs.org/clojure_core/clojure.core/partial#source

13:30 Is that for performance reasons? If not, why then?

13:30 Anderkent: S3thc0n: that's not a multimethod; that's just multiple arities

13:31 but yeah I'd guess it's for performance reasons

13:31 S3thc0n: Okay, mixed that up then. Multimethods only are sued with different types or so I guess. I'll reread about that; thanks. But my question persists.

13:31 mindbender1: Are there any examples out there of the new enliven library?

13:32 dnolen_: S3thc0n: for perf reasons

13:33 S3thc0n: Okay, thank you two. Already thought something like that.

13:37 arcatan: pull requests are a pretty nice way to point out typos

13:41 gfredericks: ,(some? false)

13:41 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: some? in this context, compiling:(NO_SOURCE_PATH:0:0)>

13:44 gfredericks: I submitted a typo PR to some clojure project recently and a few weeks later the maintainer made his own identical commit and closed the PR

13:44 so now I won't get my internet money

13:45 ambrosebs: gfredericks: :)

13:45 gfredericks: I lost all my cred to the `clojure` github organisation

13:46 just realised core.matrix isn't contrib. What's the deal there?

13:46 S3thc0n: Have a banana instead, here. \____/-

13:47 ambrosebs: "The plan is to become an official Clojure Contrib language extension once the API has been well tested."

13:51 hiredman: the internet has enabled misunderstandings at an accelerated rate

13:55 SegFaultAX: (inc hiredman)

13:55 lazybot: ⇒ 37

14:00 TimMc: llasram: The Compiler is now yelling at me about not being able to find the containing namespace on the classpath. -.-

14:00 llasram: TimMc: Awww. *Is* the containing namespace on the classpath?

14:01 TimMc: Zuul uses gradle, so I have no idea. :-P

14:01 llasram: The static initializer for gen-class'd classes `require`s the implementation namespace, so...

14:01 Oh

14:02 hiredman: ambrosebs: I suspect it went something like <Guy> hey clojure mailing list, how cool would it be to have a matrix library in contrib? <Random Mailing List People> that would be super cool!

14:02 TimMc: But the ns should already be loaded when I compile it, yeah?

14:02 llasram: TimMc: Class loader fun times.

14:02 hiredman: <Guy> great, I'll go do that

14:02 ambrosebs: hiredman: :D

14:02 hiredman: (time passes)

14:03 llasram: TimMc: The code in shady may be using the wrong classloader as the parent of the dynamic class loader instance

14:03 ambrosebs: hiredman: I'm impressed it's not just called matrix. analyze -> jvm.tools.analyzer, match -> core.match, typed -> core.typed

14:03 llasram: Depending on how much yak-shaving time you have, you might be able to figure out the right thing to do...

14:03 hiredman: <Guy> hey clojure/core, I made a matrix library for contrib <Clojure/Core> lol wut?

14:03 technomancy: ...awkward silence

14:04 ambrosebs: haha

14:04 llasram: I think the API hasn't entirely settled down yet

14:04 mikera was still adding things last time I checked in

14:04 TimMc: llasram: I don't have a big yak-shaving budget at the moment.

14:04 llasram: TimMc: Alas :-/

14:05 hiredman: technomancy: http://www.youtube.com/watch?v=9SULsR9-lbw

14:05 tolstoy: In OM, if I set the shared option {:shared {:key "value"}} how come (om/get-shared owner) is null?

14:06 TimMc: llasram: I'll probably take a swing at it again in a couple weeks.

14:06 Pate_: Hi everyone, I'm new here. :) @ibdknox: thank you for Light Table.

14:07 seangrove: goldfeld: We've moved the cljs meetup to the 27th, and found a new speaker from Prismatic for it

14:07 ambrosebs: Pate_: welcome!

14:09 abp: how can i include javascript files from jars when building with cljsbuild and :optimizations :none?

14:09 Pate_: thanks, ambrosebs :). I come from a .NET background, but I was compelled by the Clojure+Datomic+Om stack to switch. Recently built a large application in Python+AngularJs, and now I want to rebuild everything in Clojure!

14:12 noprompt: i'm a bit confused about resources in compojure

14:13 we're using a different configuration for resource-paths and we're not using the :root "public"

14:14 we keep getting 404s. :(

14:15 rasmusto: what's the deal about keys/vals not having a deterministic order anymore?

14:16 tolstoy: Hm. om/root seems to require that "shared" key be in {:opts}.

14:20 ambrosebs: rasmusto: they are deterministic.

14:20 rasmusto: Rich says seq order == key order == vals order

14:21 rasmusto: ambrosebs: okay. I must have misinterpreted a jira ticket or something. thanks :)

14:22 seangrove: ambrosebs: Wasn't that more or less accidental?

14:23 The discussion was awhile ago though, I've forgotten the conclusions

14:23 dnolen_: tolstoy: how shared propagates is a bit of an implementation detail at the moment, om.core/get-shared is the only way you should access it

14:24 hiredman: after years of rich saying the order of keys matches the order of vals, for some reason stu decided to stir things up by telling people that is an implimentation detail

14:24 tolstoy: dnolen_: om/get-shared is returning null unless I use {:target ... {:opts {:shared {:key "value"}}}}.

14:25 dnolen_: tolstoy: going to need a minimal failing case, there's a working example in the repo

14:25 abp: dnolen_: can i add js files from a jar in a :optimizations :none build? trying to use react-cljs

14:26 goldfeld: seangrove: you guys are awesome!

14:27 dnolen_: abp: there's no good way to do that under :none

14:29 tolstoy: just confirmed shared example in repo still works, so need a specific example where things go wrong.

14:30 tolstoy: dnolen_: Yes, I've seen the example. Very strange. I thought it might be because my components take "opts" but that's not working.

14:30 dnolen_: I'll see if I can figure out how to do a "minimal case". ;)

14:33 dnolen_: fwiw: https://gist.github.com/zentrope/9353859

14:33 CookedGryphon: does anybody have any ideas how I can effectively debug a gummed up core.async state machine (i.e. figure out what it's waiting for)

14:34 though i suppose that's a silly question as it's waitin g on everything which is why it's doing nothing...

14:34 dnolen_: tolstoy: I prefer all Om minimal cases only involve Om, can you do a new gist sans and even better sans core.async

14:34 sans sablono

14:35 tolstoy: dnolen_: Okay.

14:58 dnolen_: Here's a minimal version: https://gist.github.com/zentrope/9353859.

14:58 dnolen_: Do you need a complete project for these sorts of things?

14:58 dnolen_: tolstoy: nah this is good thanks

14:59 tolstoy: so frame-component is not valid here

14:59 tolstoy: you must return IRender or IRender reify instance

14:59 you can't just call build like that

14:59 tolstoy: Heh.

15:00 dnolen_: er IRenderState

15:00 tolstoy: Yet it renders! ;)

15:00 That fixed it. ;)

15:00 dnolen_: tolstoy: and a bunch of things break - the docstring / docs are quite clear

15:00 tolstoy: cool

15:00 tolstoy: Oy. I've done LOTS of OM prototypes and never made that mistake.

15:01 dnolen_: In other words, I think it's clear in the docs, just my mistake.

15:01 dnolen_: tolstoy: I might put in a run time assert for this that you can elide under production

15:01 tolstoy: sure, but it's an easy mistake to make and I've seen other people do it.

15:03 tolstoy: https://github.com/swannodette/om/issues/133

15:04 tolstoy: dnolen_: Thanks! Makes sense.

15:04 dnolen_: tolstoy: thanks for the report and doing the minimal case

15:16 atyz: Does anyone know any good alternatives to incanter

15:16 ?

15:18 llasram: R

15:18 justin_smith: atyz: do you need both the statistical and graphic components?

15:19 SegFaultAX: IPython, pandas

15:19 justin_smith: if you only need the visualization, cljs / d3 may be an option

15:19 atyz: justin_smith: I mostly want the statistical components

15:19 llasram: the syntax is so weird!

15:19 SegFaultAX: atyz: Are you looking for clj alternatives or just alternatives in general?

15:20 llasram: atyz: Have you looked at Apache Commons Math?

15:20 atyz: hahahahah

15:20 atyz: SegFaultAX: clj alternatives preferably, but I don't mind trying something new

15:21 llasram: I haven't looked at Apache Commons Math

15:21 SegFaultAX: atyz: Apart from R, python is becoming one of the de facto standards in data science.

15:21 IPython and Pandas are definitely worth a look.

15:21 isaacbw: how would you all recommend someone learning clojure who is already somewhat familiar with common lisp and functional programming?

15:22 *learn

15:22 fairly familiar with FP, somewhat with common lisp

15:22 also know the basics of clojure already

15:22 I did all the clojure koans a while back

15:23 atyz: isaacbw: then I would suggest they just pick something and go at it

15:23 SegFaultAX: isaacbw: Or read JoC

15:23 atyz: There is clojure for teh brave and true.

15:23 isaacbw: SegFaultAX: JoC?

15:23 atyz: Joy of clojure

15:23 noprompt: it's funny how a language w/o good facilities for functional programming would be regarded as a "de facto" for any kind of science.

15:24 isaacbw: ah!

15:24 actually it's on my amazon wishlist already. Maybe I'll go ahead and order it

15:24 harmspam: isaacbw: buy the second Joy of Clojure directly from manning, you get a free copy of the first edition

15:24 hyPiRion: oh wow, https://github.com/clojure/test.check/pull/1 just exploded it seems

15:24 Anderkent: noprompt: why do you think pythin has no facilities for functional programming? functions are first class members there AFAIK; you can have high order fns etc.

15:24 hyPiRion: I'm tempted to say that it literally exploded, but I won't go that far.

15:25 noprompt: Anderkent: pythons fp tools are a joke. it's lambdas are a joke.

15:25 Anderkent: elaborate?

15:25 isaacbw: harmspam: ah, cool deal! So I can prorder and have something to read in the meantime

15:26 arcatan: eh

15:26 turbofail: Anderkent: well you can only do "expressions" in a lambda, not "statements." and you can only do one of them

15:26 the distinction between those two is in itself kind of goofy

15:26 noprompt: Anderkent: ^

15:26 isaacbw: harmspam: though it's $10 more than amazon. Probably worth it for the 1st edition ebook

15:27 harmspam: isaacbw: there was a promotional code for quite a bit off of the preorder floating around, you can probably find it if its still active

15:28 turbofail: and of course python doesn't get scope right. you can only have one level of scope per function, so if you try to capture an iteration variable in a closure, then surprise! you're hosed!

15:28 noprompt: Anderkent: mutability and lack of referential transparency are default, imho thats a pretty bad start already for doing science.

15:29 not just in python but any language that encourages the use of those properties.

15:29 atyz: noprompt: don't underestimate the effort people have put into their libraries though

15:29 turbofail: right, the python data structures being mostly mutable also makes things harder

15:29 noprompt: atyz: i don't. i was just stating a silly opinion.

15:30 ToBeReplaced: noprompt: that's a little unfair... ex. scientific python; mutability is a requirement for performance

15:30 noprompt: atyz: what i'm saying is the impedence mismatch between science and computing w/ respect to using a language like python is greater than say haskell or clojure.

15:31 isaacbw: harmspam: schweet, found an active one. Thanks

15:31 noprompt: ToBeReplaced: maybe at some level sure.

15:31 ToBeReplaced: but that's an implementation detail the consumer shouldn't have to worry about.

15:32 if x = 1 doesn't mean that "x is 1" what good is that?

15:32 ToBeReplaced: noprompt: my take for the last few years wrt scientific computing has been that all operations need to be unambiguous and unmistakable above anything else, and that has nothing to do with mutability

15:32 noprompt: and something that core.matrix is not doing (by conscious decision), for example

15:34 noprompt: ToBeReplaced: what do you mean by "unambiguous and unmistakable"?

15:34 ToBeReplaced: noprompt: it's fair enough to comment on the toxicity of mutability for exposed interfaces in scientific work, but that's rarely been the real source of error that i've seen in practice

15:35 PinkPrincess: If a function returns a chan intended to be "exhaustively read", what's the best way to convey the expected number of data structures that will be put on the chan?

15:36 noprompt: ToBeReplaced: well it's sounds like you know from experience and that's definitely worth something. still something inside me feels doubtful and distrustful. :P

15:36 not of you but the concept of doing data science w/ a language that has bad defaults.

15:36 scttnlsn: is there a way to specify a default implementation of a protocol? i.e. something like (extend-type <any type> (-some-fn [this] ...))

15:36 i mean... (extend-type <any type> IMyProtocol (-some-fn [this] ...))

15:36 isaacbw: you're probably a mutability spy sent here to lie and create disorder

15:37 noprompt: scttnlsn: extend-type Object i think is what you're looking for. be careful w/ that though.

15:37 scttnlsn: noprompt: will that work on clojure primitives as well?

15:37 noprompt: isaacbw: ha! you caught me.

15:38 :S

15:38 ToBeReplaced: noprompt: consider "multiply"... what should semantics be for matrix * vector, matrix * matrix, matrix * constant, matrix * matrix * matrix, 3d matrix * some-other-structure, etc?

15:38 noprompt: then consider it with "add" or other operators where things like "element-wise" and "matrix-wise" mean the same thing ... then you've got sources of confusion

15:39 noprompt: ToBeReplaced: i'm not sure. i don't do a lot of that type of work. at first blush i'd probably think of composing transforms before doing any "real" work.

15:39 isaacbw: has anyone here used tern.js? I'm wondering if there's something like it for clojure for inspecting (inferred) type signatures of functions

15:39 noprompt: actually i don't do any, but i understood the performance concern.

15:40 ToBeReplaced: noprompt: and you're not the typical data scientist ;)

15:40 isaacbw: of course it doesn't work when a function can take multiple types, but that sort of function shouldn't be too common anyway

15:40 noprompt: ToBeReplaced: ha! guilty as charged.

15:40 :)

15:41 ToBeReplaced: noprompt: it's tricky because the academic notation is varying as well... these problems are all really hard

15:41 noprompt: ToBeReplaced: i would imagine.

15:42 ToBeReplaced: but it seems like that's a place where symbolic computation would excel.

15:42 ToBeReplaced: noprompt: i'd love to tell someone "you don't need your view"... never works telling someone "oh, you want rollups? you have that... it's called reduce"

15:47 noprompt: i'm not sure what you mean by symbolic comp... but i wonder what would happen if a set of libraries mandated that you "introduce a suitable notation" prior to using it

15:48 avoid the "pick the best of the bad options" situation and instead force the user to always elect their interpretations

15:49 noprompt: ToBeReplaced: basically the idea that something like "x" "x^2" etc are just placeholders that don't evaluate anything until you say given this expression evaluate with x.

15:49 ToBeReplaced: noprompt: ah, sure

15:49 noprompt: ToBeReplaced: so in an OO perspective a Symbol "x" would expose methods for +, *, and so forth.

15:52 so essentially like math. if i have the polynomial expression "a^2 + b^2" and i say evaluate when a = 2 then i just get back a new polynomial "4 + b^2"

15:52 llasram: noprompt: Have you seen https://github.com/clojure-numerics/expresso ?

15:52 noprompt: llasram: oh yeah! heh, i totally forgot about that. :)

15:56 pcn: Buffer 17

16:00 ToBeReplaced: PinkPrincess: can you elaborate?

16:00 PinkPrincess: I can try.

16:00 ToBeReplaced: PinkPrincess: usually you just have the producer close! the channel and the consumer read until nil (or use into! if that's the intent)

16:00 PinkPrincess: I have a function called all-cards, which will do a lot of really heavy IO to fetch a huge list of cards. I want the function to immediately return a channel, and then start putting a lot of these cards onto the channel.

16:00 dacc: PinkPrincess: could you just send a termination message of some kind on chan?

16:01 PinkPrincess: Oh.

16:01 That'll work perfectly, I think.

16:01 So closing it will send a nil?

16:02 ToBeReplaced: PinkPrincess: nil cannot be put onto a channel; if a channel is closed, then when anyone tries to read from it, they will receive nil instead

16:02 PinkPrincess: after any items already on the channel are consumed *

16:02 PinkPrincess: That's exactly what I need, then.

16:02 Thanks, ToBeReplaced.

16:04 So I'd just consume it like (simplified): (while (<!! the-chan) ...)

16:04 ?

16:04 There's no risk of non-truthy values being put on the channel.

16:09 ToBeReplaced: PinkPrincess: that would work, yes... i recommend (go-loop [] (when-let [msg (<!! ch)] (recur))) as pseudo-code

16:10 PinkPrincess: Ah, there's even a macro for it.

16:10 tim____: PinkPrincess: you can put a false on a channel, but not a nil

16:10 PinkPrincess: Handy.

16:10 tbaldridge: PinkPrincess: so when-let can sometimes do the wrong thing, but the best answer is often "don't put false in a channel"

16:11 ToBeReplaced: tim___: PinkPrincess: yeah, you should use "when-some" if you are on clojure 1.6 already ;)

16:11 PinkPrincess: I'm in the lucky position of never having to worry about falsy values (except nil when closing), so that's not going to be an issue.

16:12 when-some sounds pretty cool. When's 1.6 scheduled for release?

16:16 stuartsierra: PinkPrincess: When it's done. beta2 just came out.

16:18 PinkPrincess: I suppose that's the obvious answer. With this being a hobby project, I guess there's nothing wrong with betas, though.

16:20 sdegutis: PinkPrincess: Clojure is a hobby project?

16:20 PinkPrincess: Ah, nothing of the sort! My project *using it* it, though. ;)

16:20 sdegutis: Ah :)

16:20 PinkPrincess: is*

16:21 sdegutis: I'm not so sure Clojure isn't a hobbyist project...

16:22 I'm not even sure what hobbyist means anymore. Didn't Rich start it as a hobby?

16:23 S11001001: sdegutis: I wouldn't say that. Taking time off work specifically to work on this thing seems to imply the expected future value of the result is greater than the present value of the opportunity cost of not working for a time.

16:23 alew: I believe he worked on it full-time when he started

16:24 sdegutis: Oh I didn't know that.

16:24 Cool.

16:25 Was Rich pretty high up in the tech world before Clojure? Like did he own companies or work for a big company? Or is Clojure his first claim to fame?

16:26 Neat: https://github.com/clojure/clojure/commit/894a0c81075b8f4b64b7f890ab0c8522a7a9986a

16:27 That was 8 years ago, wow.

16:27 alew: Is that the first commit?

16:28 sdegutis: First code commit.

16:28 Second commit. (First one was just IDEA project file.)

16:29 "added if" -- https://github.com/clojure/clojure/commit/e7f3719fcbe74e0f923243f9628f7450ebed2e4f

16:29 technomancy: heh, that comment

16:29 holo: wow, such a unique coding style!

16:30 technomancy: wait, the analyzer used to be CL?

16:30 alew: .lisp file extension

16:30 TimMc: All good Java projects eventually end up with a Cons.java.

16:30 A fair number of bad ones, too.

16:32 sdegutis: first commit with CL code: "added clojure.lisp" -- https://github.com/clojure/clojure/commit/30a0f7dfd9caddc149fda7ddff9c211f6cdbf4ff

16:33 rasmusto: im glad most of those parens disappeared :)

16:33 :]*

16:34 alew: was there plans to have clojure run on a CL implementation?

16:42 PinkPrincess: So... my channel flow is working as I want it now, but it's not very happy about 14000 puts. What's the best way to handle a large number of puts on a channel? Split it into multiple channels?

16:46 ToBeReplaced: PinkPrincess: what is the behavior that is an issue?

16:46 PinkPrincess: Exception in thread "async-dispatch-1609" java.lang.AssertionError: Assert failed: No more than 1024 pending takes are a

16:46 llowed on a single channel.

16:47 ToBeReplaced: PinkPrincess: it looks like you are trying to read from the channel in 1025 places -- maybe a bug in your read code?

16:48 PinkPrincess: That's a very real possibility.

16:49 I'm doing something like this: http://pastebin.com/wuXcRyAz

16:50 Which, I see now, calls for a bit of refactoring.

16:50 But shouldn't this do one read at the time?

16:52 ToBeReplaced: PinkPrincess: inside of a go block, you can use <! instead of <!!; i don't know what <!! does inside of a go block

16:53 PinkPrincess: if you just want to block until all of the operations are complete, change the "go-loop" to "loop"

16:53 PinkPrincess: I expect most use cases to be "for each card, add it to a database".

16:53 So blocking may be perfectly fine.

16:54 sdegutis: Your nicks are the same length. It's hard to tell who's talking.

16:54 Not complaining, just commentating on a neat phenomenon.

16:55 PinkPrincess: Clearly you need a fancy add-on to color nicks based on their hash value.

16:55 Rainbow colors everywhere!

16:55 sdegutis: That sounds fun. Let me see if my client does it.

16:56 PinkPrincess: ToBeReplaced: using <! has the same problem. I'll try using loop instead of go-loop.

16:56 sdegutis: Sir or madam, thank you for your suggestion. Unfortunately I regret to inform you that it is not practically feasible in my particular specific case. With my best regards, thanks.

16:57 ToBeReplaced: PinkPrincess: okay, the code as you've presented it with <! in place of <!! looks okay to me; i would expect that your issue is somewhere else; good luck

16:57 technomancy: I don't understand how you could do IRC without nick coloring

16:57 it'd be like ... turning off syntax highlighting

16:58 sdegutis: technomancy: name lengths and first/last-char auto-heuristics

16:58 tolstoy: For some reason, ToBeReplaced and PinkPrincess are the same color in Textual.

16:58 technomancy: sdegutis: that's what google go users say about syntax highlighting

16:58 sdegutis: technomancy: You're "te...cy" of medium/long-ish length

16:58 PinkPrincess: It's probably somehow in the producer, then. Thanks for all your helpful suggestions, ToBeReplaced.

16:58 technomancy: t9y

16:58 ToBeReplaced: i use Empathy b/c gnome integration... sucks as a client though and doesn't have nick coloring

16:59 sdegutis: technomancy: Go... syntax.. wha.. how.. ... I'm speechless

16:59 seangrove: Ah, bummer. Is there some clear way of running tests in parallel with clojure.test?

16:59 sdegutis: technomancy: you've left me speechless sir, now GOOD DAY!

17:00 seangrove: I've never heard of a plugin but I can't imagine why you couldn't write one, they're just functions.

17:00 seangrove: sdegutis: Blows my mind that we still write test runners that run serially by default

17:00 sdegutis: clojure.test is simple but powerful

17:01 seangrove: I wonder if it has to do with how we like to read test results linearly..

17:02 technomancy: org.clojure/test.noneuclidean

17:02 bring it

17:03 tolstoy: org.clojure/test.heisenbergian?

17:06 sdegutis: I really don't think the reverse-DNS style is going to catch on.

17:07 It's just so unnatural. In human speech we refer to specifics first and give context as needed. Because ultimately the level of context can go on forever.

17:08 llasram: Except where you're actually dealing with DNS

17:08 sdegutis: So we say "John" and they usually know we mean "John Smith" but if not, we can elaborate. And even then we can specify "of New York City", etc.

17:08 llasram: Then you deal with everything reverse-style so that the sort order reflects the hierarchy

17:09 alew: Actually, you deal with a generallity and then go into specifics

17:10 sdegutis: But how far back do you go to maintain a hierarchy? Take Java for example, we do com.mycompany/lib, but it could be in Maven or in Clojars, so should that be specified before "com" too? And what if there's another language that uses it, should we say clojure.maven.com.mycompany/lib? And what about other people's forks?

17:10 alew: John isn't very specific

17:10 sdegutis: alew: THAT.

17:10 alew: Oh I mean, yes.

17:10 * sdegutis gets slang mixed up

17:11 technomancy: sdegutis: the thing is, domain registrations always last forever

17:12 and projects never move on from one company to another

17:12 so actually DNS is a great way to do it

17:12 sdegutis: :D

17:12 Sold.

17:13 * technomancy remembers at his first company the day they shut down SVN in order to move the java package hierarchy to a new com.whatever name

17:14 * sdegutis remembers using SVN for a few hours and being frustrated

17:14 sdegutis: technomancy: that sounds pretty intensive

17:14 hiredman: obviously you should use tag uris

17:14 sdegutis: Hey now let's not go crazy.

17:16 alew: why not just a globally coordinated incrementing integer?

17:17 sdegutis: (inc alew)

17:17 lazybot: ⇒ 1

17:18 technomancy: gfredericks just uses uuids

17:18 sdegutis: Oh wait, yes. There are enough UUIDs, why don't we use them for everything?

17:18 Even our identities!

17:19 alew: I was also thinking of UUIDs, but we might get a conflict in 10000 years

17:19 sdegutis: ,(def sdegutis #uuid "719c2e7f-49bc-4551-9b97-ed36b0b82b88")

17:19 clojurebot: #'sandbox/sdegutis

17:19 sdegutis: ,sdegutis

17:19 clojurebot: #uuid "719c2e7f-49bc-4551-9b97-ed36b0b82b88"

17:19 sdegutis: Woooo

17:21 Found a reliable random number generator: &(->> #(java.util.UUID/randomUUID) repeatedly (take 2) (map hash) (reduce -))

17:21 ,(->> #(java.util.UUID/randomUUID) repeatedly (take 2) (map hash) (reduce -))

17:21 clojurebot: -2169937940

17:21 sdegutis: Yesssss

17:24 justin_smith: sdegutis: my real name is 4108eca2-bef0-4102-90bb-ff9b9621f483

17:24 oh shit now he's gonna get a bunch of credit cards and ruin my credit

17:24 hiredman: we can't all be 01590049-7034-49cb-b946-dee3f9ced5f2

17:25 lgas_: I'd like to enable cemerick.{austin,piggieback} only in development. It's easy enough to add the dependencies to the dev profile but how do I reference the symbols at runtime only if the libraries are present? Is there a good example of a project that does something similar?

17:29 sdegutis: justin_smith: Nope, your real name is protected by the public key of your bitcoin wallet or something

17:30 Hence I can't pretend to be you.

17:33 ToBeReplaced: lgas_: i do this by adding a file with the requisite require statements in a separate directory and then use :source-paths option to include that directory only for development build

17:33 danielszmulewicz: lgas_: yes, there is a template that saves you all the trouble: https://github.com/aamedina/cljs

17:33 justin_smith: sdegutis: haha, an official public identification and authentication system that isn't designed so badly as to be indistinguishable from malice? that's crazy talk!

17:35 devn: 10 dogecoin to someone who can give me an idea for a narrative about using agents that doesn't involve logging

17:35 TEttinger: sdegutis: xorshift may be uh... a lot faster?

17:35 sdegutis: TEttinger: dunno about that

17:36 TEttinger: devn: any episode of burn notice

17:36 chouser: lgas_: you can use the 'resolve' function to discover if a given var in some namespace has been defined or not

17:36 sdegutis: TEttinger: sounds like premature optimization

17:36 lgas_: ToBeReplaced & chouser: thanks

17:36 TEttinger: http://www.javamex.com/tutorials/random_numbers/xorshift.shtml

17:37 heh it just seems like total overkill to be using UUIDs when there's other simple methods out there

17:38 justin_smith: devn: a company with departments, each department gets tasks sent to it, and is modeled by an agent. The simulation helps you optimize management / resource allocation strategies.

17:38 chouser: devn: http://blog.n01se.net/blog-n01se-net-p-34.html https://gist.github.com/Chouser/32494#file-using-agents-clj

17:38 TEttinger: http://xorshift.di.unimi.it/xorshift1024star.c is similar

17:42 (source: http://xorshift.di.unimi.it/ )

17:43 rasmusto: ,(replace {0 :a} [0 1 2]) ; confused me for a minute

17:43 clojurebot: [:a 1 2]

17:48 lgas_: danielszmulewicz: didn't see your answer before -- thanks!

18:21 cespare|home: Is there a single function I can call instead of (doall (map ...)) ?

18:22 nvm, I can reformulate using doseq

18:24 SegFaultAX: cespare|home: Also, mapv might be a reasonable option.

18:24 ,(realized? (map inc [1 2 3]))

18:24 clojurebot: false

18:24 SegFaultAX: ,(realized? (mapv inc [1 2 3]))

18:24 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IPending>

18:25 bbloom: cespare|home: i've frequently wanted a function-form of doseq. i've got a helper i paste around that i call "each"

18:25 SegFaultAX: Well there you go. :)

18:25 bbloom: it's just (defn each [f coll & args] (doseq [x coll] (apply f coll args)))

18:25 er i mean: (defn each [f coll & args] (doseq [x coll] (apply f x args)))

18:26 cespare|home: SegFaultAX: bbloom thanks

18:35 What's a simple way to make a map with integer values that I can add to? Basically a map where the default value is 0.

18:35 Think histogram

18:36 qbg: ,(doc frequencies)

18:36 clojurebot: "([coll]); Returns a map from distinct items in coll to the number of times they appear."

18:36 qbg: Do you want to do something like that?

18:36 rasmusto: cespare|home: check out fnil

18:37 cespare|home: qbg: I saw that. I could probably make it work with frequencies

18:37 rasmusto: ah thanks

18:37 SegFaultAX: Yea frequencies + fnil is awesome.

18:38 rasmusto: ##(update-in {:a 1} [:b] (fnil inc 0))

18:38 lazybot: ⇒ {:b 1, :a 1}

18:41 rasmusto: ##(update-in {:a 1} [:a] (fnil inc 0))

18:41 lazybot: ⇒ {:a 2}

18:42 rasmusto: ok, good :>

18:42 isaacbw: leiningen zsh completion script with ring subcommand support: https://gist.github.com/isaacbw/99255c98118b165838ea

18:42 massive ugly hack :P

18:42 zsh scripting is... interesting

18:42 (I just added the ring stuff, the rest comes stock with oh-my-zsh)

18:42 hyPiRion: isaacbw: shell scripting in general is an amusing thing

18:43 huh, I thought "test!" was removed

18:44 and swank, for that matter

18:44 isaacbw: it's probably an old-ass script that no one bothered to change

18:44 technomancy: the completion files might be the oldest untouched files in the whole repo

18:46 hyPiRion: technomancy: I was about to say that the license was, but then =/

18:57 gvickers: Whats the best way currently to add a jar to a lein library? Should I add it to my local maven repository?

19:02 zoldar: I'm trying to make a resuable component/widget (select scroller - alternative to select input - eventually touch friendly). https://www.refheap.com/52072 Now, I'm having problems with attaching event handler - the one in line 57 does not get called even though the new value gets passed on rerender. How to approach this?

19:02 Ah, forgot to mention that it's in Om

19:04 qbg: :onChange, not :on-change

19:04 maybe not; not sure about sablano

19:04 zoldar: qbg: sablono converts it

19:06 qbg: Are you trying to type anything in the field?

19:06 zoldar: qbg: It was a hidden input field before, I've changed it to textjust to check if the event handler will catch on

19:07 qbg: :on-change won't be called just because value changes

19:07 zoldar: I mean, I suppose that the way I'm trying to do this is wrong

19:10 bob2: gvickers, lein library?

19:10 gvickers, if you mean ~/.m2, lein install

19:14 gvickers: oh

19:14 bob2: thanks

19:45 echosa: Hi. I'm messing around with typed clojure and can't figure out why this isn't working: https://gist.github.com/echosa/9358930

19:51 brehaut: echosa: its possible you need to qualify NonEmptySeqable wiht some type paramater?

19:51 echosa: I tried some various things, but wasn't able to get anything to work.

19:52 brehaut: echosa: well im just looking at your use of first (as per the type error), your type for grid, and the domains of first

19:52 cespare|home: If I put :main my.namespace in my project.clj, when I start lein repl things seem to work (I can see symbols in my.namespace). When I don't have this in my project.clj, if I do (ns my.namespace), it doesn't work (the symbols I expect are available). Do I need to use one of the other namespace incantations instead?

19:52 s/available/unavailable

19:52 echosa: brehaut: tha's what I did too, to no avail

19:53 technomancy: cespare|home: (doto 'my.namespace require in-ns) is what I do

19:53 cespare|home: :|

19:54 technomancy: if you want your repl to always open to that ns you can do :repl-options {:init-ns my.namespace}

19:54 but ns by itself won't load existing code

19:54 cespare|home: I don't always want that ns, but I want an easy way to hop between them

19:55 echosa: more specifically, the repl won't, be default, be in the namespace of the file, necessarily

19:55 you have to switch to it

19:55 technomancy: well, hopping to a namespace that doesn't exist isn't that useful

19:55 cespare|home: without evaluating the code there, you mean

19:56 brehaut: echosa: doesnt check-ns take an optional ns as an arg?

19:56 technomancy: cespare|home: what I mean is that you're asking for two different things

19:56 so naturally the solution involves two things =)

19:56 echosa: brehaut: has a second argument, but I haven't needed it so far.

19:56 I've gotten other annotations working, just not this one

19:57 because of the call to first and the type of grid

19:57 but I can't figure out the correct way to write the annotation for this

19:59 brehaut: echosa: i suspect its something to do with the domain of count but i dont have the code in a live env to test sorry

19:59 echosa: you may find #typed-clojure useful

20:00 echosa: Oh, there's a separate channel? Ha. Of course there is.

20:38 firefaux: is there any reason using assoc-in on a map would give me an empty map?

20:38 the map isn't empty to begin with

20:40 brehaut: ,(assoc-in {:a {:b 1}} [:a b:] 2)

20:40 clojurebot: #<RuntimeException java.lang.RuntimeException: Invalid token: b:>

20:40 brehaut: ,(assoc-in {:a {:b 1}} [:a :b] 2)

20:40 clojurebot: {:a {:b 2}}

20:40 brehaut: ,(assoc-in [:a :b] {:a {:b 1}} 2)

20:40 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>

20:42 firefaux: I'm asking because I have a ref to a hash-map, which I populate, and sometimes it just goes back to {}

20:42 and the only function I'm calling to alter it is assoc-in

20:43 hiredman: firefaux: are you reloading the namespace?

20:44 firefaux: hmm

20:44 ohhh

20:44 yeah I am

20:44 brehaut: step one: defonce, step two: stop holding state in defs/globals

20:44 firefaux: it never occured to me that reloading cider with C-c C-k

20:45 was actually going to reset my refs

20:45 yeah

20:45 hiredman: ~I'll be in my trailer

20:45 clojurebot: everybody take five!

20:45 firefaux: there's only 1 ref in my entire program

20:46 dsrx: ,(doc defonce)

20:46 clojurebot: "([name expr]); defs name to have the root value of the expr iff the named var has no root value, else expr is unevaluated"

20:46 firefaux: ooh

20:46 neato

20:47 so reloading the namespace won't reset it, then?

20:47 noonian: right

20:48 firefaux: is that all defonce is meant for?

20:48 unless you're calling def inside of some control flow for some reason?

20:48 dsrx: I think it's suitable any place where you'd expect a namespace to be reloaded

20:49 not that I have ever done anything like that outside of a repl

20:50 firefaux: well, if I'd realized my mistake earlier it would have saved me hours of debugging

20:50 I probably wrote and rewrote functions so many times, and did it properly, but thought it wasn't because I cleared my map

20:53 jbrechtel: So if I want project specific tasks in leiningen is ":eval-in-leiningen true" in my project.clj the right way to do it? That seems to break uberjar (can't find my project's core.clj).

20:53 I'm guessing that's because eval-in-leiningen should be put in a specific profile to only use for the tasks I want to define?

20:54 But now this feels like I'm going down the wrong path.

21:15 moquist3: I prefer to name fns that could be anonymous, so that stacktraces are less opaque. Anybody have a recommendation for a convention for naming such fns? e.g.: (defn myfn [] (fn myfn- [] ...))

21:16 firefaux: I'm also interested to hear what people use for names

21:17 I've only used named lambdas a few times, and it was mainly to figure out which one threw the exception

21:22 tomjack: (gen/such-that #(some-> % not-empty first zero?) (gen/vector gen/nat))

21:22 why is this so slow?

21:22 well, I see an obvious workaround..

21:23 (gen/fmap (partial into [0]) (gen/vector gen/nat))

21:25 is it just me or does clojure.test.check.generators have argument order problems?

21:25 maybe the choices make sense somehow

21:26 e.g. seems rather odd though that fmap and bind are flipped

21:31 gfredericks: tomjack: such-that is just a naive filter

21:31 and most vectors of numbers don't start with zero

21:31 so you're doing a lot of throwaway work

21:31 tomjack: yeah

21:31 when I write it as a filter, it seems much faster

21:32 (->> (gen/vector gen/nat) (gen/such-that not-empty) gen/sample-seq (filter #(some-> % first zero?)) (take 100))

21:32 returns almost instantly

21:33 gfredericks: that's weird

21:33 * gfredericks does not understand

21:35 tomjack: I guess it relies on the size impl details which change with such-that for some reason

21:35 looks like ~20 out of the first 1000 (gen/vector gen/nat) will start with 0 due to sizing

21:50 better way to define the generator applicative? https://www.refheap.com/90638734bcc2c72d934d27b84

21:51 surprised it's not already there

21:51 maybe it is?

21:53 I guess (defn lift [f & gens] (gen/fmap (partial apply f) (apply gen/tuple gens)))

21:53 seems backwards, but it works :)

21:54 firefaux: 'night everyone

21:54 I won't be staying up till 2 this evening :)

22:16 fowlslegs: join ##crypto

22:18 dissipate: where can i see the source code for 'shuffle'?

22:18 oh hell no

22:18 this is horrible

22:19 horrible, horrible horrible

22:21 did anyone realize the Java 'shuffle' is bad?

22:21 brehaut: calling the standard java method is horrible‽

22:21 dissipate: brehaut, have you read it?

22:21 http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#shuffle(java.util.List)

22:21 brehaut: no. i dont normally go out of my way to read java code

22:22 thats not exactly a whole lot of source code

22:23 dissipate: brehaut, you need to understand the theoretical horribleness of the Java shuffle function

22:23 brehaut: actually, no. i dont

22:23 dissipate: brehaut, "Randomly permutes the specified list using a default source of randomness. All permutations occur with approximately equal likelihood."

22:23 brehaut, this is extremely vague

22:24 technomancy: didn't we have this conversation a couple weeks ago?

22:24 dissipate: brehaut, but nonetheless, i guarantee you that the 'default' source of randomness has a fewer number of possible permutations than any collection you can pass into it.

22:25 technomancy: about how it's not appropriate to require high levels of entropy for basic default functionality like that because most people just need something fast?

22:25 amalloy: dissipate: that's the best implementation of shuffle that's really possible

22:25 you can complain about the source of entropy, but the shuffle algorithm is great

22:25 dissipate: technomancy, you realize it is completely unsuited for scientific and statistical applications

22:25 technomancy: dissipate: of course

22:25 Schaefer: there is a second shuffle method that allows you to pass in your own random object

22:25 technomancy: it's a general-purpose shuffle function

22:25 it's fast, it's appropriate for everyday use

22:26 it doesn't consume lots of entropy

22:26 Schaefer: so if you want cryptographic random, use SecureRandom (or something similar)

22:26 dissipate: technomancy, at a *minimum* it should have a warning for when the size of your collection is larger than the maximum for all potential permutations to occur

22:26 technomancy: dissipate: never in my life have I written code where that would matter

22:26 brehaut: you know whats also not appropriate for scientific computing? floats.

22:26 technomancy: cool that you do stuff where it does, but I have a really hard time caring

22:26 dissipate: technomancy, guess you never developed an online casino?

22:27 brehaut: oh shit guys, all out casinos are broken1eleven

22:27 amalloy: online casinos can be expected to do a little more due diligence than "eh, let's just call shuffle"

22:27 brehaut: thats it. close the clojures, everyone get your things

22:27 amalloy: $shutdown

22:27 $abort

22:27 lazybot: run!

22:29 dissipate: amalloy, but what about casual users who don't realize not all of the permutations of their collection can be generated from 'shuffle'?

22:29 amalloy: they don't care

22:29 like technomancy. like me

22:29 cespare|home: How do I create and mutate a java integer?

22:29 amalloy: when i shuffle a deck of cards, i know there are two to the squintillion possible shuffles, and of course i won't get all of them. but i'll get a representative shuffle

22:29 Schaefer: on another topic - has anyone successfully used austin against the latest clojurescript? (0.0-2173). i get an NPE when evaluating (cemerick.austin/repl-env) . i filed a github issue but thought i'd check to see if anyone else has a similar problem

22:30 cespare|home: I read the java interop page and whatever else I could find via googling.

22:30 dissipate: amalloy, BTW, i'm not here to just complain. what can be done about this?

22:30 brehaut: i look away for a minute and we've gone from craziness about shuffle to mutating integers‽ bloody hell

22:31 amalloy: dissipate: use the version of shuffle that takes a Random, if you care

22:31 if you don't care, don't use it. that's really it

22:31 muhoo: has clojars gone TU?

22:31 dissipate: amalloy, i do care. i care very much.

22:31 brehaut: muhoo: its being converted to a casino

22:31 hiredman: brehaut: #clojure requires constant vigilance

22:31 muhoo: brehaut: like bitcoin?

22:31 brehaut: muhoo: doge

22:31 muhoo: aye

22:32 brehaut: i think Bodil is in charge

22:32 muhoo: seriiously curl: (7) Failed to connect to 2600:3c02::f03c:91ff:fe96:4d76: Network is unreachable

22:32 dissipate: Bodil Stokke?

22:32 muhoo: and on another machine clojars.org just hangs

22:33 brehaut: muhoo: downforeveryoneorjustme.com aggrees

22:33 muhoo: and yet another, three different networks, all failed

22:33 bob2: cespare|home, aren't java integers immutable?

22:33 muhoo: that's sad. lein anything dies if it can't get to clojars

22:33 bob2: cespare|home, what was the X part of this XY problem?

22:34 muhoo: so who runs clojars who should be pinged right about now?

22:34 brehaut: technomancy might know?

22:35 it might be xeqi ?

22:35 cespare|home: bob2: yes it is, I have an answer now

22:35 dissipate: holy crap, are you serious? clojars down?

22:35 that could break sooo many deployments

22:36 bob2: a good reminder not to couple your own deployments to random sites on the innerweb

22:36 brehaut: Fallacies of Distributed Computing #1 The networks is reliable; call it an object lesson

22:36 http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing

22:36 dissipate: bob2, so you cache locally all of your dependencies?

22:36 bob2: I deployer uberjars

22:37 dissipate: bob2, and where do you get the jar dependencies inside your uberjar?

22:37 bob2: lots of places, including clojars

22:37 this would definitely break my builds

22:37 which is of course shit

22:38 dissipate: bob2, that's my point. first i find out shuffle was implemented poorly and now clojars goes down. this is a bad night for Clojure. :(

22:38 bob2: errrrrr ok

22:39 dissipate: does anyone know what the SLA is for the clojar's site?

22:39 bob2: lol

22:39 are you for real?

22:40 dissipate: bob2, if the SLA was violated, there could be a refund or cash payout

22:40 brehaut: SLA for clojars: some dudes made it gratis and everyones glad they did

22:41 xeqi: brehaut, muhoo : just saw a ping email about it

22:42 dissipate: brehaut, so if a critical application can't get deployed...

22:42 xeqi: dissipate: clojars as a single point of failure has been a worry of mine for awhile

22:42 dissipate: xeqi, what mirrors are available?

22:43 brehaut: dissipate: … it wont get deployed. seriously its a free service for the community by generous people in the community. you arent paying for it.

22:43 xeqi: ah, I assume its from the ATL linode outage

22:43 dissipate: brehaut, i would pay for it actually

22:44 brehaut: dissipate: have you considered that the people who run clojars dont want to be tied to an SLA ? you can always run your own repo or use something enterprisy like sonatypes

22:44 muhoo: indeed. i'm surprised tehre aren't clojars mirrors

22:44 dissipate: brehaut, is there a bitcoin donation address for clojars? i would be more than willing to send $20 to that every couple weeks or month.

22:44 muhoo: they could do like the linux distros do. the problem of free highly-available repositories has been solved for a while.

22:44 brehaut: i have no idea

22:45 xeqi: there are some people who mirror the repo, but I don't know of any of them being public

22:45 dissipate: brehaut, i'm passionate about clojure. that's why when i see 'shuffle' the way it is, it pains me.

22:45 xeqi: dissipate: I'm interested in finding a monetary way to run clojars, but thats in a limbo state while I do stay at home dad stuff

22:46 hiredman: we use a caching archiva setup at work, so any artifacts are builds pull in from other repos are cached in our archiva maven repo for future uses, works great

22:46 xeqi: * monetary as in self sustaining for a dev or ops person

22:46 dissipate: xeqi, you are running clojars?

22:46 xeqi: dissipate: a co-maintainer

22:47 + technomancy and _ato

22:47 dissipate: xeqi, do you have a bitcoin donation address set up?

22:47 xeqi: I haven't touched btc

22:48 dissipate: xeqi, BTW, you can get cash deposited to a bank account from bitcoin donations

22:48 xeqi, see this: https://coinbase.com/merchants

22:48 xeqi: muhoo: do they solve distributed deploying of new version based w/ access controls, and prevention of a malicous actor?

22:49 dissipate: xeqi, BTW, are any of the Clojure shops like Relevance donating to Clojars?

22:50 xeqi: muhoo: also, who pays for bandwidth? a 503 or corp behind the linux distro? (see recent $7k rubygems.org monthly cost)

22:50 dissipate: nope

22:50 dissipate: all costs are currently paid for by _ato

22:51 dissipate: xeqi, wow, that is sad. why has no one contacted the clojure shops to chip in?

22:51 xeqi, you should keep logs to see how many time's their IPs hit the webserver. tell them your site needs mirrors.

22:52 koreth__: Do they take donations? I'd pitch in.

22:52 muhoo: xeqi: 503 seems the right way to do it. bummer one guy is fronting the whole thing

22:52 dissipate: muhoo, yeah, i agree, that's bad.

22:52 muhoo, shameful actually

22:52 jimrthy2___: <delurk>I may be feeding the troll, but as a drive by: I used to do casino software, and that's pretty much exactly the same sort of shuffle we used (with a software RNG that, honestly, left a lot to be desired). It was more than good enough.</delurk>

22:52 dissipate: koreth__, i will too, but i refuse to donate via paypal. they need a bitcoin address.

22:53 muhoo: bitpay.com

22:53 dissipate: muhoo, and coinbase

22:53 koreth__: Heck, I'll mail them a check if that's how they want to do it. I use that service literally every day.

22:53 muhoo: supposedly supports the new payment protocol (might be in beta).

22:53 i've had good luck with coinbase. super easy.

22:53 dissipate: jimrthy2___, that's just negligent! you can't run a casino on that 'shuffle'!

22:54 muhoo: it's possible that the serious clojure deployments all have private repos with their jars in them, and don't rely on clojars.

22:54 dissipate: jimrthy2___, there are a huge number of permutations that would never even show up in card games for instance

22:54 muhoo: fyi, clojars is back up.

22:55 xeqi: I appreciate the enthusiam. As soon as I can devote more then 2 hours a week to clojure I'll be trying to work on the problem of sustaining it

22:55 dissipate: muhoo, do you think the Clojure shops that aren't donating to Clojars would donate?

22:55 hiredman: given how much people complain about mailing in cas, asking for mailed checks may just be too much

22:55 muhoo: dissipate: if i'm reading the scrollback correctly, there isn't a way to donate. i think that's why coinbase/bitpay was brought up

22:56 hiredman: it could be done as a joke. "to donate, you must submit this form..." and it's a parody of the core CA

22:57 seriously, a coinbase seems like a low-effort quick stopgap. long term, a 503 with corporate sponsors seems a better approach.

22:57 dissipate: muhoo, a stop gap? paypal is a stop gap

22:58 xeqi: 503(c)s are ugly to setup iiuc, though I've considered it as an option

22:58 muhoo: dissipate: lots of people eschew paypal

22:58 xeqi: i've been the treasurer of one. it is a PITA indeed

22:59 _ato2: clojars outage cause: http://status.linode.com/2014/02/network-maintenance-in-atlanta-march-4-2014.html

23:00 dissipate: _ato2, is clojars on a CDN?

23:00 muhoo: _ato2: thanks for the update, and thanks for hosting clojars.

23:01 dissipate: muhoo, it seems they don't want donations or help

23:02 bob2: _ato2, thank you for running clojars!

23:02 SegFaultAX: I might be late to the party, but is it or is it not currently possible to donate to clojars?

23:02 _ato2: dissipate: nope, no CDN

23:03 dissipate: SegFaultAX, apparently it is not possible.

23:03 _ato2: not currently possible, it hasn't really come up until now

23:03 muhoo: probably because there's nothing wrong with it. just the occasional linode glitch i guess

23:04 SegFaultAX: muhoo: Not about something wrong, just want to do my part is all :)

23:05 _ato2: uptime history: http://status.clojars.org/584988/history

23:05 dissipate: SegFaultAX, how much will you donate?

23:06 SegFaultAX: _ato2: Nice!

23:07 muhoo: that's pretty damn good. oh well, i guess nothing to see here

23:07 SegFaultAX: dissipate: Dunno, hadn't really thought about it.

23:07 dissipate: muhoo, nothing to see here? the site went down with no failover

23:07 SegFaultAX: dissipate: Maybe a couple server/months?

23:08 dissipate: SegFaultAX, how about servers across multiple regions with a CDN in front?

23:09 plus mirrors of course

23:09 SegFaultAX: dissipate: Well if we're talking AWS, then storage alone is dirt cheap.

23:09 koreth__: A CDN seems like overkill. It is not a latency-sensitive application.

23:10 bob2: a cdn is not a replacement for fixing your deployment strategy

23:10 SegFaultAX: How hard is it to setup a full mirror right now?

23:10 _ato2: https://github.com/ato/clojars-web/wiki/About#wiki-can-i-mirror-the-clojars-repository

23:11 dissipate: SegFaultAX, what do you think of Digital Ocean?

23:12 SegFaultAX: For the frontend? It's fine.

23:12 dissipate: SegFaultAX, i really think there should be a CDN

23:13 SegFaultAX: dissipate: Sure, but as previously stated the issue is availability, not latency.

23:14 muhoo: riight, i remember, they were working on a releases repository. it held up a version of lein for a while, till it was decided to release it anyway and wait for releases repo later

23:14 koreth_: I would probably also donate a couple server-months worth, unless my gut feel for how much it costs to run is way off.

23:14 SegFaultAX: CloudFront is just an optimization for the real underlying problem.

23:15 koreth_: Lindoe runs from 20 - 360+/mo. If we guess mid-tier, maybe like 80+/mo?

23:15 koreth_: I was figuring a couple hundred a month or thereabouts.

23:15 SegFaultAX: Linode, even.

23:15 Per server?

23:15 koreth_: Yeah

23:16 SegFaultAX: Maybe, but it seems like overkill to get the biggest boxes for what is essentially a name resolution service.

23:16 _ato2: Can you share any details on the current hardware hosting clojars?

23:16 r00k_: Hi all. I'm trying to experiment with core.async in a clojurescript project and I'd like to play with it in my REPL. I have core.async in my project.clj, so I'm assuming it's on my classpath when I run `lein repl` (true?). But a (require 'core.async) isn't working. What am I missing?

23:16 koreth_: Well, don't get me wrong, I'll be thrilled if they spend less than that and my donation will last longer!

23:17 bob2: (require [core.async :as async])

23:17 _ato2: SegFaultAX: the smallest linode plan :)

23:17 SegFaultAX: _ato2: How many instances?

23:17 dissipate: SegFaultAX, to have such a brittle jar repo is just not professional. IMO this needs to be fixed.

23:17 _ato2: 1

23:17 xeqi: r00k_: (require 'clojure.core.async)

23:17 SegFaultAX: Wow, nice!

23:17 bob2: dissipate, stop being such an ass

23:17 koreth_: Ah, in that case I'd be willing to pay for more than just a couple months' worth of server costs. But at that price maybe it's just not worth the trouble to take donations at all.

23:17 tomjack`: r00k_: it's clojure.core.async

23:18 SegFaultAX: _ato2: And how many mirrors are active?

23:18 _ato2: 0

23:18 SegFaultAX: Whoa, that's awesome!

23:18 dissipate: 1 machine? really? yikes!

23:19 TimMc: dissipate: You have expressed your surprise, disdain, and concern six ways to Sunday. We get it.

23:19 SegFaultAX: _ato2: Impressive that you're able to get such high availability/low latency out of one box. Well done.

23:19 dissipate: bob2, how am i being an ass? i don't see any big players adopting clojure when there is only 1 jar repo that is running on 1 machine

23:20 koreth_: I think that's pretty far down the list of reasons big players aren't adopting Clojure, sadly.

23:20 dissipate: TimMc, i offered to donate money, but was offered no way to do so.

23:20 bob2: dissipate, by going on and on and on

23:20 r00k_: xeqi, tomjack, bob2: Got it now. Thanks for the help!

23:21 SegFaultAX: _ato2: What's the current size of the full repository?

23:21 TimMc: dissipate: Perhaps you should consider that you are offering something that is not desired.

23:21 dissipate: TimMc, so they don't want money?

23:21 _ato2: for me it's mostly about time and energy, Clojure is alas not my day job. Luckily xeqi and technomancy have stepped in and done most of the work on clojars recently

23:22 TimMc: dissipate: I can't speak for the maintainers, but I also haven't heard any positive reactions to the notion of donations...

23:22 I, too, would donate -- and encourage my employer to as well.

23:22 dissipate: TimMc, that's just crazy

23:22 TimMc: But if it would add complication to people's lives, so be it.

23:23 dissipate: TimMc, how complicated is it to throw up a bitcoin address?

23:23 xeqi: SegFaultAX: when I checked mid Jan it was 11G https://twitter.com/xeqixeqi/status/424620237724450816

23:23 _ato2: SegFaultAX: repo size is 12 GB or so. outgoing traffic is maybe 150 GB/month if I remember correctly

23:23 TimMc: Remember, "free" money still isn't free.

23:23 dissipate: TimMc, how so? what is this? the mafia?

23:23 SegFaultAX: Great! I could probably stand up an s3 bucket with cloudfront in a couple hours.

23:24 xeqi: the problem with donations is who do they go to? I don't pay for hosting. Maybe _ato2 ? but does that open up other issues?

23:24 dissipate: SegFaultAX, is the site static?

23:24 TimMc: Sorry, it's past my bedtime. Maybe someone else will explain.

23:24 SegFaultAX: dissipate: Currently I'm focusing more on the storage strategy than the frontend. One thing at a time my son.

23:24 dissipate: xeqi, more money more problems

23:24 xeqi: does introducing money affect recent US safe harbor rulings (napster) vs currently?

23:24 dissipate: SegFaultAX, ok, well, that's a good move in the right direction

23:25 xeqi, no, just put the bitcoins through a tumbler. they won't be able to trace them back to you anyways.

23:25 SegFaultAX: I reckon clojars itself could be setup on a single m1.small or m1.medium on elastic beanstalk for autoscaling and simple deployment.

23:25 dissipate: xeqi, BTW, a lot of hosting sites accept bitcoin directly

23:26 xeqi: dissipate: if you like tax evasion. Still has to count as income somewhere

23:26 cespare|home: How could I do something like the example here: http://clojuredocs.org/clojure_core/clojure.core/assoc! but update (assoc!) three transients inside the loop at once, instead of one?

23:27 dissipate: xeqi, i seriously doubt the IRS is going to care about that small sum of money. now if you have political enemies, that could be a problem, i guess.

23:28 SegFaultAX: Can we refocus on something productive?

23:28 dissipate: SegFaultAX, how easy it is to deploy clojure apps on elastic beanstalk?

23:28 SegFaultAX: Entirely trivial.

23:29 uberjar -> s3 -> redeploy. lein-beanstalk already does everything you want.

23:29 dissipate: SegFaultAX, nice, very nice

23:29 SegFaultAX, can you run python scripts in that uber jar?

23:31 SegFaultAX: You can script the deploy, sure. It's just EC2 afterall.

23:31 Why?

23:31 clojurebot: why not?

23:31 SegFaultAX: ~botslap

23:31 clojurebot: It's greek to me.

23:31 SegFaultAX: Aww.

23:32 dissipate: SegFaultAX, get it going then. set up the mirror.

23:38 dpathakj: cespare|home: it's not clear to me what you mean. are you reducing over a list of vectors of transients or similar? if so, you can just write a different reducing function that knows about the structure of your data.

23:39 cespare|home: dpathakj: I just have 3 of them, they don't need to be in a vector or map or anything until I make them persistent at the end.

23:39 dpathakj: anyway, I eventually figured out I need with-local-vars

Logging service provided by n01se.net