#clojure log - Dec 26 2013

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

0:01 logic_prog: when using cljs with :optimizations :none, where do I get goog.base and all the standard libraries to include ?

0:01 (I don't want the slow goog closure library to run on every time)

0:11 TEttinger: yedi: http://blog.malcolmsparks.com/?p=67 might be of interest

0:13 yedi: TEttinger: thanks, will take a look

0:20 bitemyapp: I just created my first Twitter list.

0:23 arrdem: bitemyapp: a what?

0:24 bitemyapp: arrdem: you can add people on Twitter to lists.

0:24 arrdem: I created one called "Assholes" and the first inductee is @maccaw.

0:25 arrdem: classy

0:25 bitemyapp: arrdem: I realized I was juggling too many people in my mental "naughty" list, so I decided to start recording.

0:25 logic_prog: (compojure.route/resources "/out/goog/" { :root "/public/out/goog/"}) <- how do I make this recursive, i.e. handle /out/goog/bar/foo/test.js -> /public/out/goo/bar/foo/test.js ?

0:25 bitemyapp: arrdem: vidya?

0:25 logic_prog: right now, it seems to only do requests of pattern /out/goo/blahblah.js , where "blahblah" is a file, and does not include a directory within it

0:32 n/m, I'm a dumbass

0:32 it worked

0:34 arrdem: bitemyapp: yeah lemme kill the miner and I'll be down for a game

0:34 bitemyapp: arrdem: doters or dayzers?

0:34 * arrdem mutters darkly about family and TV marathons

0:34 arrdem: bitemyapp: doterz perferred.

0:34 bitemyapp: you got it.

0:35 arrdem: mumbur

1:15 OneFourSeven: Anybody use clojurescript.test?

1:37 devn: https://github.com/weavejester/reagi looks pretty cool

1:38 speaking of cool -- hoplon. my favorite thing in clojure land right now.

1:50 TEttinger: devn, wow, hoplon does look amazing

1:54 sm0ke: whats so great about holpon?

1:56 *hoplon

1:57 eh looks like clojure is not about having simple lightweight libraries anymore

1:57 we have giant frameworks now

1:57 like pedestal and hoplon

2:00 TEttinger: I couldn't really tell how big it is

2:53 logic_prog: in cljs, when using js/WebSocket. -- is there a way to specify a timeout? i.e. the max amount of time allowed for .-onopen to be called before giivng up and saying "fuck it, this doesn't work"

4:15 abaranosky: ho ho ho!

4:18 nones: ,(def t 100500)

4:18 clojurebot: #'sandbox/t

4:18 nones: ,t

4:18 clojurebot: 100500

4:19 sm0ke: oh!

4:19 broquaint: sm0ke: AIUI pedestal is a collection of complementary libraries rather than a big ol' framework.

4:20 nones: ,(ns user)

4:20 clojurebot: nil

4:20 nones: ,t

4:20 clojurebot: 100500

4:20 sm0ke: broquaint: collection of libraries + large learning curve = big ol' framework

4:20 ,(defn inc [x] (dec x))

4:20 clojurebot: #<CompilerException java.lang.SecurityException: denied, compiling:(NO_SOURCE_PATH:0:0)>

4:21 nones: ,foo

4:21 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0:0)>

4:21 sm0ke: ,(def inc dec)

4:21 clojurebot: #<CompilerException java.lang.SecurityException: denied, compiling:(NO_SOURCE_PATH:0:0)>

4:22 nones: ,(def foo (fn [x] (inc x)))

4:22 clojurebot: #'sandbox/foo

4:22 nones: ,(foo 7)

4:22 clojurebot: 8

4:22 nones: ,(def inc (fn [x] (inc x)))

4:22 clojurebot: #<CompilerException java.lang.SecurityException: denied, compiling:(NO_SOURCE_PATH:0:0)>

4:22 sm0ke: ha!

4:23 nones: what about infinite loop?

4:23 ,(def foo (fn [x] (foo x)))

4:23 clojurebot: #'sandbox/foo

4:23 Raynes: &(#(recur))

4:23 nones: ,(foo 7)

4:23 lazybot: Execution Timed Out!

4:23 * Raynes whistles and fades back into the darkness.

4:23 ddellacosta: what are people using to figure out test coverage?

4:23 clojurebot: #<StackOverflowError java.lang.StackOverflowError>

4:25 nones: what difference between lazybot and clojurebot?

4:25 #foo

4:25 abaranosky: I saw Caribou mentioned on the mailing list. Anyone done any coding with it?

4:25 sm0ke: , (inc 1) ; ##(dec 1)

4:25 lazybot: ⇒ 0

4:25 clojurebot: 2

4:25 nones: ##foo

4:26 smth ##foo

4:26 smth ##(foo)

4:26 lazybot: java.lang.RuntimeException: Unable to resolve symbol: foo in this context

4:26 Raynes: &(while 1)

4:26 lazybot: Execution Timed Out!

4:26 sm0ke: lazybot is faster than clojurebot

4:26 , (inc 1) ; ##(dec 1)

4:26 lazybot: ⇒ 0

4:26 clojurebot: 2

4:27 Raynes: I highly doubt that to be true.

4:27 The network is perhaps faster.

4:27 Lazybot does significantly more sandboxing than clojurebot does.

4:27 sm0ke: yep, perhaps network is faster, where have you hosted them?

4:28 nones: ##(def inc (fn [x] (inc x)))

4:28 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

4:28 abaranosky: Clojure on Caribou just doesn't have the same ring to it

4:28 ... and the acronym wouldn't be as good as RoR either

4:28 Raynes: lazybot is hosted on a linode.

4:28 In particular, the same one running 4clojure and refheap.

4:29 sm0ke: and clojurebot?

4:29 Raynes: I don't actually know.

4:29 hiredman would know

4:30 You'd have to ping 'em though, I don't think his client sees my messages.

4:30 sm0ke: may be he's using irssi

4:30 sucks to not have notification

4:30 Raynes: Well, maybe, but that's not why he doesn't see my messages :p

4:31 He has had me on his IRC ignore list for approximately 4 years.

4:31 I'm still not entirely certain why, but I was 15 at the time and likely deserved it.

4:31 ;)

4:31 sm0ke: hmm wow! when did you even start coding?

4:32 ddellacosta: abaranosky: I find that the impetus that some have (coming) in (-to) the Clojure community to seek out a monolithic convention-over-configuration web framework is misguided. </rant>

4:32 Raynes: Around 13.

4:32 Haskell. Was interested in the Diablo 2 hacking community. Never actually hacked a single thing related to that game, but it got me interested for sure.

4:33 sm0ke: weird you started with Haskell? very uncommon choice

4:33 Raynes: The guy who essentially sits on top of the blizzhacker kingdom is a Haskell programmer.

4:33 So I just copied whatever he was doing.

4:34 Because he was clearly much smarter than me.

4:34 sm0ke: heh

4:34 TEttinger: so, the issue I had earlier with print-dup and read-string and such? thanks to justin_smith it works for 1d arrays, but now I need to have some way to reconstruct a 2d float array from some source...

4:34 sm0ke: smart decision

4:34 why are you not hacking in haskell anymore then?

4:34 is clojure better?

4:35 Raynes: I occasionally write Haskell still.

4:35 TEttinger: (defmethod print-dup (Class/forName "[D") [a out] (.write out (str "#=" `(double-array ~(vec a))))) ;; this works for 1D arrays, but I have no idea how to extend it to 2D

4:35 Raynes: I just rarely get a good opportunity.

4:35 I don't think Clojure is 'better'. Clojure is nicer to you.

4:36 Makes you feel like a friend instead of a student after a while.

4:36 Haskell mostly just keeps you feeling like a student. Which is great, there aren't a ton of languages with a seemingly endless supply of things to learn from. It's just sometimes you just want a friedn.

4:36 friend*

4:36 TEttinger: friedn works

4:37 clojure does use edn

4:37 Raynes: Hah

4:37 sm0ke: hmm true. clojure has indeed less barrier to entry

4:37 Raynes: Not that I ever stop learning things from Clojure ;)

4:37 ddellacosta: Raynes: nice, I like that explanation. Rings true with my experience (of Clojure, still a Haskell n00b): Clojure is forgiving of my mistakes, and helps me out in important ways that I always appreciate.

4:38 abaranosky: dellacosta: I've never felt any need for one myself, but am still *slightly* curisou about it... as if maybe I'm missing some line of reasoning

4:39 sm0ke: hmm clojure people are becoming spiritual i see

4:39 Raynes: We're just really emotional.

4:39 * Raynes sniffles

4:39 Raynes: (I actually sniffled, I am quite ill)

4:39 abaranosky: group hug

4:39 TEttinger: I LOVE YOU GUYS

4:39 ddellacosta: abaranosky: yeah, I hear you--that is totally valid. I still feel like I have some obligation to check out Caribou, as it may contain some good ideas. I don't mean to dismiss it out of hand.

4:39 * Raynes coughs on abaranosky

4:39 Raynes: abaranosky: Hah! Bronchitus!

4:40 Bronchitis too!

4:40 * ddellacosta feels warm and fuzzy, and slightly phlegmy

4:40 TEttinger: haha

4:40 sm0ke: Brochitijure

4:40 abaranosky: ddellacosta: I tend to think it has an aweful lot of LoC

4:40 ddellacosta: abaranosky: Lines of Code? Does it? I haven't even cloned the thing, I'll admit.

4:40 sm0ke: i hate that patch from technomancy for `jure` suffix!

4:40 abaranosky: my initial worry is that it is overengineered... but that's just worry.. not founded in experience with th eframework

4:41 TEttinger: so anyone have any idea on how best to deconstruct/reconstruct 2D arrays into strings?

4:41 just mapv vec to deconstruct, then...

4:41 ddellacosta: abaranosky: yeah. I mean, one thing I've found to be true up to now in Clojure is that concise, "surgically applied" libraries really end up being more productive than larger all-encompassing libs. I end up scraping away cruft to get at the useful parts.

4:41 abaranosky: jure suffix is horrific

4:42 sm0ke: are you saying clojure is awful name?

4:42 TEttinger: haha

4:42 ddellacosta: can we agree that it is awkward? I *still* feel funny saying it out loud

4:42 abaranosky: when you're as l33t as Clojure the language you can call yourself whatever you want

4:42 ddellacosta: I just end up saying "Closure" most of the time.

4:42 heh

4:43 Raynes: Well.

4:43 Good.

4:43 Because that's how it is pronounced.

4:43 abaranosky: yep

4:43 they are pronounce the same

4:43 sm0ke: is clojure infulenced by clozure?

4:43 Raynes: ddellacosta doubts himself too much.

4:43 sm0ke: clozure is definitely better!

4:44 ddellacosta: Raynes: is it? Great. I don't hang out with folks in person (kinda hard being thousands of miles away from conferences/community), so I miss these kinds of things...

4:44 Raynes: ddellacosta: Yes, and REPL is not pronounced as an acronym. I learned this the hard way.

4:44 ddellacosta: Raynes: well, ya know...there's always a lot to doubt, heh.

4:44 abaranosky: Raynes: hehe, that's pretty funny :)

4:44 sm0ke: since clojure is not tied to just JVM anymore can we call it `closure` instead?

4:45 abaranosky: I remember when I first heard someone call SQL "seekwell"

4:45 ddellacosta: Raynes: ah...yeah, that one I was always too lazy to say as an acronym anyways.

4:45 TEttinger: javascript has a j too

4:45 sm0ke: well clojure is on .net too

4:45 cloj.ure

4:45 TEttinger: you mean .jet

4:45 ddellacosta: sm0ke: I thought I remember Rich Hickey stating that part of the reason he chose it was for search-ability

4:45 Raynes: TEttinger: I'm gonna need you to get off IRC.

4:45 Before you hurt yourself and those around you

4:45 TEttinger: :-(

4:46 abaranosky: so is Clojure officially mainstream yet?

4:46 sm0ke: yea well python is searchable too.

4:46 ddellacosta: TEttinger: I don't know the answer to your question, btw, but maybe turn 'em into vectors and pr-str 'em? :-/

4:46 sorry, I got nothin'

4:46 abaranosky: I feel like the answer is no

4:46 TEttinger: yeah the real problem is constructing the 2d array from a string of sorts

4:47 I can use #=

4:47 ddellacosta: TEttinger: huh, is there anything in Clojure like the #js token in ClojureScript? That is a super awesome thing right there.

4:48 TEttinger: that could theoretically solve your problem, depending on how your data is structured

4:48 ...if you were using ClojureScript

4:48 TEttinger: it's just a 2d array

4:48 floats

4:49 abaranosky: TEttinger: I don't really undestand your problem spec. If I did, maybe I'd kow how to solve it

4:50 TEttinger: ok uh... so I have a 2D float array in each of a number of maps.

4:51 I want to be able to pr-str the maps, with everything inside them, then read-string back the string later

4:51 I can do this for 1d arrays

4:51 (defmethod print-dup (Class/forName "[D") [a out] (.write out (str "#=" `(double-array ~(vec a))))) ;; like so

4:52 the key there is the `(double-array ~(vec a))

4:52 abaranosky: I see... and you can't just cheat and store them as vectors?

4:52 TEttinger: well I don't really know how to form a 2D array without doing a lot of setting

4:53 and I do store as vectors I think

4:53 but it's the restoring that's tricky

4:56 sm0ke: Hey guys, is it possible to have a provided dependency in github and ask travis to build against different versions of it?

4:57 is some doing something similar for their clojure projects?

4:57 TEttinger: http://amalloy.hubpages.com/hub/Dont-use-XML-JSON-for-Clojure-only-persistence-messaging gives some background btw

4:57 sm0ke: someone*

4:59 ddima: ,(pr-str (map vec (into-array [(float-array [23.32 42.23]) (float-array [1.3 2.4])])))

4:59 clojurebot: "([23.32 42.23] [1.3 2.4])"

4:59 ddima: hm

5:06 slightly OT, but would you recommend a lenovo T530 with the 1080p display? I hate glossy displays, so macbook pro is a no go, but the cheaper displays like on my personal L530 are not very convincing either (dead pixels after 6 months, contrast etc)

5:10 abaranosky: ddima: you killed the convo with your off-topic stuff

5:10 just messing with you.... I used to hate glossy monitors as well

5:11 I've got a macbook pro for work though, and either they have gotten less glossy, or i've gotten more used to it

5:12 TEttinger: ddima, my brother loves his lenovo T series, it is older by a bit though

5:12 ddima: abaranosky: I used osx for a couple of years before and now I'm very happy with my 'awesome' setup, so thats another thing

5:12 yeah, the older ones are good, but there's at least some criticism of the recent models

5:12 Raynes: I'd just spray paint nyan cat onto the screen of the macbook pro.

5:12 It's all you really need to see there anyways.

5:13 ddima: well, sorry for killing the cozy emotional moments, please proceed ;)

5:16 TEttinger: hell yes

5:16 ,(let [data (mapv vec (into-array [(float-array [23.32 42.23]) (float-array [1.3 2.4])])) sz (count data) arr (make-array Float/TYPE sz (count (nth data 0)))] (doseq [a (range sz)] (aset arr a (float-array (nth data a)))) (mapv vec arr))

5:16 clojurebot: [[23.32 42.23] [1.3 2.4]]

5:16 drorbemet: Hi, I am about to put a batch insert for neo4j REST API together. I have to deal with milions of unique nodes.

5:16 Does any body of you know what the current usage of neocons for batch insertions into neo4j is? The functionality of neocons overlaps with the cypher query language for neo4j.

5:16 TEttinger: where's bitemyapp when you need him

5:17 wait no, I think he uses datomic

5:17 hm

5:18 drorbemet: Do I have to let neocons just send cypher strings? Or are there some efficient functions left in neocons to perform batch insertions over REST?

5:19 here are the pages I am currently looking at ...

5:19 http://clojureneo4j.info/articles/populating.html

5:19 http://docs.neo4j.org/refcard/2.0/

5:19 ddellacosta: is there a way to COPY with clojure.java.jdbc?

5:19 er, without being super user that is

5:19 ddima: dotemacs: there are batch functions

5:19 drorbemet: It's a mix of old and new ways to do the same operations ...

5:21 dsrx: letting neocons handle cypher strings is how we ended up with prism :(

5:21 ddima: dotemacs: I think I used nodes/create-batch (couple hundred k)

5:21 sm0ke: does lein has docs on what different inbuild profiles are for ? :base :system :user :provided :dev

5:21 dotemacs: ddima: sorry ?

5:22 ddima: sry, drorbemet

5:22 dotemacs: ah, ok :)

5:24 drorbemet: dsrx: so, that means I have to put together cypher strings in clojure in order to perform an efficient batch insert?

5:25 dsrx: it was a bad political joke about the nsa, sorry

5:27 drorbemet: dsrx: ah ... I think I got you :-)

5:27 but anyway I will have to find an answer soon

5:28 abaranosky: What do you all think of this article?: http://programming-puzzler.blogspot.com/2013/12/frustrations-with-namespaces-in-clojure.html

5:29 ddima: drorbemet: http://reference.clojureneo4j.info/clojurewerkz.neocons.rest.nodes.html -> create-batch

5:29 abaranosky: I work on very large projects at work, and don't feel any of the pain he is mentioning in the article, so I'm very interested in hearing other peoples' experiences regarding namespaces

5:30 ddima: abaranosky: where would that magical place with large clj projects at work we? ;)

5:30 be

5:30 abaranosky: ddima: Staples Innovation Lab (formerly Runa)

5:31 we're in San Mateo, CA

5:32 ddima: cool. not gonna move from berlin to the us atm though ;)

5:32 drorbemet: ddima: thanks, yes I will have to check that out, I will have to combine it with unique constaints and lables though

5:33 abaranosky: ddima: I know of at least one Clojure shop in Germany

5:33 Cr8: abaranosky: I only use it for small things (I'm the only person at work I've convinced.)

5:33 but

5:33 TEttinger: ok, so the method to produce 2d arrays, works. but there's one more hurdle relating to I believe macros

5:33 (defmethod print-dup (Class/forName "[[F") [a out] (.write ^java.io.FileWriter out (str "#=" `(let [dat ~(mapv vec a) arr (make-array Float/TYPE (count dat) (count (nth dat 0)))] (doseq [a2 (range (count dat))] (aset arr a2 (float-array (nth dat a2)))) arr))))

5:33 this gives an error about let needing a vector for its binding

5:33 Cr8: while I run into a few of these things, I tend to prefer the state of my project after applying the "workaround"

5:34 e.g. avoid the circular namespace problem by having namespaces be small and single purpose

5:34 which they tend not to be when I start, but I get forced to make them so

5:34 drorbemet: abaranosky: which is it?

5:35 ddima: abaranosky: tell us, if thats not a trade secret :)

5:35 abaranosky: I forget the name of the place :|

5:35 let me see....

5:35 Cr8: and it actually comes in handy when I get the occasional patch by folks who don't cloj' and they don't have to read/understand as much

5:36 ddima: Cr8: I managed to convince 3 people without trying to convince by a) showing how much nicer storm topologies are in the clojure dsl b) having a couple of small/understandable export/import tools from hbase, to neo4j etc.pp. and suddenly people started messing with that code

5:36 Cr8: ddima: I've got our *support team* wanting to learn it ;)

5:36 ddima: though, I don't think one necessarily has to convince anybody to do anything

5:36 TEttinger: awesome guys

5:37 abaranosky: Cr8: I agree the "workaround" for no cicular dependencies means you end up with a better system design

5:38 TEttinger: so does anyone know why that code that I pasted would have something other than the shown vector for the binding?

5:38 something about ` , which I don't know much about?

5:45 Cr8: TEttinger: works here..

5:46 TEttinger: only on decoding does it fail, Cr8

5:46 sorry should have said this is supposed to yield something that you can read-string

5:46 Raynes: abaranosky: Do you live in the bay area?

5:47 Cr8: AH

5:47 I see what you're doing

5:47 TEttinger: so, ` will qualify any symbols inside the quoted form

5:48 TEttinger: so should I quote dat in some way?

5:48 Cr8: you probably want a gensym'y thing. Put a # after any names that are local to the `

5:48 ,`(let [dat# foo] (do dat#))

5:48 clojurebot: (clojure.core/let [dat__25__auto__ sandbox/foo] (do dat__25__auto__))

5:48 TEttinger: uh ok, will do...

5:48 Cr8: TEttinger: dat, arr, any names that are local to your generated code

5:49 TEttinger: and when I refer to them?

5:49 Cr8: a2 I think as well

5:49 TEttinger: do I have the # in there too?

5:49 Cr8: TEttinger: in any place you use them

5:49 yeah, you see above that I used dat# twice, and it got the same generated symbol in both places

5:50 ,`(let [dat# foo other# bar] [other# dat#]))

5:50 clojurebot: (clojure.core/let [dat__50__auto__ sandbox/foo other__51__auto__ sandbox/bar] [other__51__auto__ dat__50__auto__])

5:50 abaranosky: Raynes: yeah, I live 30 minutes south of San francisco

5:50 Raynes: abaranosky: It's 2:48AM.

5:50 Cr8: where a different name gets a different generated symbol (but again, reusing that name gets the same one, at least inside the same `)

5:50 abaranosky: vacation :)

5:51 Raynes: Only reason I'm awake is cuz insomnia.

5:51 TEttinger: hm, didn't help, Cr8

5:51 IllegalArgumentException dat__243__auto__ requires a vector for its binding in dk.spritecore: clojure.core/let (core.clj:4043)

5:51 abaranosky: I regularly stay up this late. For better or worse

5:52 ... I think I like the quiet

5:52 TEttinger: abaranosky, same here

5:54 that' using the messy

5:54 (defmethod print-dup (Class/forName "[[F") [a out] (.write ^java.io.FileWriter out (str "#=" `(let [dat# ~(mapv vec a) arr# (make-array Float/TYPE (count dat#) (count (nth dat# 0)))] (doseq [a2# (range (count dat#))] (aset arr# a2# (float-array (nth dat# a2#)))) arr#))))

5:57 Cr8: well this is weird

5:57 if I just paste the output into the REPL it evals alright

5:57 ah

5:58 but not with the #= in front of it

6:01 TEttinger: ,((fn [a out] (.write ^java.io.FileWriter out (str "#=" `(let [dat# ~(mapv vec a) arr# (make-array Float/TYPE (count dat#) (count (nth dat# 0)))] (doseq [a2# (range (count dat#))] (aset arr# a2# (float-array (nth dat# a2#)))) arr#)))) (make-array Float/TYPE 2 2))

6:01 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval28/fn--29>

6:01 TEttinger: ,((fn [a out] (.write out (str "#=" `(let [dat# ~(mapv vec a) arr# (make-array Float/TYPE (count dat#) (count (nth dat# 0)))] (doseq [a2# (range (count dat#))] (aset arr# a2# (float-array (nth dat# a2#)))) arr#)))) (make-array Float/TYPE 2 2) *out*)

6:01 clojurebot: #=(clojure.core/let [dat__54__auto__ [[0.0 0.0] [0.0 0.0]] arr__55__auto__ (clojure.core/make-array java.lang.Float/TYPE (clojure.core/count dat__54__auto__) (clojure.core/count (clojure.core/nth dat__54__auto__ 0)))] (clojure.core/doseq [a2__56__auto__ (clojure.core/range (clojure.core/count dat__54__auto__))] (clojure.core/aset arr__55__auto__ a2__56__auto__ (clojure.core/float-array (clojure.co...

6:02 TEttinger: agh

6:02 Cr8: okay

6:02 I have *no idea why it works*

6:02 but wrapping it with an eval works

6:02 https://www.refheap.com/22231

6:02 TEttinger: yeah, it's supposed to be read-string'ed

6:02 but I didn't guess eval would be needed

6:03 Cr8: I am not really sure why it is

6:03 ,(read-string "#=(let [a 1] a)")

6:03 clojurebot: #<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>

6:03 Cr8: oh right

6:03 TEttinger: #= is supposed to read and eval

6:03 Cr8: anyway that doesn't work

6:04 hyPiRion: ,(binding [*read-eval* true] (+ 1 2))

6:04 clojurebot: 3

6:04 Cr8: ah

6:04 ,(binding [*read-eval* true] (read-string "#=(let [a 1] a)"))

6:04 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/let>

6:04 Cr8: ,(binding [*read-eval* true] (read-string "#=(eval (let [a 1] a))"))

6:04 clojurebot: 1

6:04 TEttinger: ,(binding [*read-eval* true] (read-string "#=(let [x 1] x)"))

6:04 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/let>

6:05 TEttinger: whaaaaat

6:05 Cr8: Ah

6:05 hyPiRion: yesh, #= is not some arbitrarily function call guys

6:05 Cr8: AH

6:05 #= doesn't do macroexpansion, for some reason

6:05 TEttinger: but I have it doing that in other calls

6:06 I think...

6:06 (defmethod print-dup (Class/forName "[C") [a out] (.write ^java.io.FileWriter out (str "#=" `(char-array ~(vec a))))) ;; this works , I think

6:06 Cr8: ,(binding [*read-eval* true] (read-string "#=(inc 1)"))

6:06 clojurebot: 2

6:06 Cr8: ,(binding [*read-eval* true] (read-string "#=(-> 1 inc)"))

6:06 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/->>

6:06 Cr8: no worky, -> macro doesn't expand

6:07 or.. only expands once

6:07 TEttinger: ahhhh

6:07 Cr8: it looks like it expanded once

6:07 wacky

6:07 TEttinger: so either i write it without macros, or use eval

6:07 Cr8: ,(binding [*read-eval* true] (read-string "#=(eval (-> 1 inc))"))

6:07 clojurebot: 2

6:07 Cr8: works though

6:08 hyPiRion: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L1019 <- the actual source

6:10 Cr8: okay

6:11 TEttinger: Cr8, with eval it does work

6:11 Cr8: so if the thing after #= is a list, and the first element is a symbol, that corresponds to a var that can be resolved in the current NS, it will use that var as a Fn

6:11 on the rest of the read-stuff

6:11 it's not actually an eval

6:11 TEttinger: ok

6:12 Cr8: #=(eval stuff) is what you want if you want to be able to write arbitrary clojure

6:12 #=(foo ...) won't do you what you expect if foo is not a fn and if ... contains any macros that you expect to expand

6:52 ddima: "The core problem is that Lisp makes programmers selfish. Giving programmers so much flexibility is inviting the alienation of other programmers; Lispers think: how can I express this problem best, for me?" (http://chrisdone.com/posts/emacs-users-are-like-igor) - here we go ;)

6:56 bitemyapp: ddima: sounds about right.

6:59 ddima: I'd say attitude comes before the language and remains after that as well - sure, personally everybody does whatever he pleases, but is that really true for well-adjusted non-egomaniac lisp-developers in a team?

7:01 ior3k: not if you do code reviews

7:01 bitemyapp: ddima: simply not using macros goes a long way.

7:01 if you're doing FP correctly, that'll happen anyway.

7:01 ddima: ior3k: or feel like your decisions depend upon/affect others ;)

7:01 ior3k: ddima: yes, but even if you don't, there's no way selfish code will pass a code review

7:02 saying this by experience

7:02 from*

7:02 ddima: because ignorance/constant (bad) reinvention of stuff and ignorance towards understandability is also very prevalent with your average 9-5 java dev ;)

7:03 I'm just still wondering about the constant "bashing" on the lispers mindset. I have not been using lisp since the 70s or anything, but isn't that a constant theme: lispers are egomaniacs, dont like sharing, bash on others ;)

7:03 bitemyapp: it's always fun watching people in OOP langs trying to leverage inversion of control.

7:03 ddima: and so far with the clojure community this has not been the case at all

7:03 bitemyapp: That sort of thing is insanely painful if you're not using a nice FP lang.

7:03 * bitemyapp gags on DI frameworks

7:04 Cr8: ddima: yeah, it's just kind of a conversation stopper

7:05 bitemyapp: ddima: hum. the propaganda against lispers is true WRT to Common Lispers

7:05 ddima: the only reason I could imagine for this being "true" to some extent is if you'd assume that lisp has mainly been used in academic circles in the past decades - most are just not really interested in coding itself

7:05 bitemyapp: they're arrogant !@#$s and look down on anything that isn't actually Common Lisp.

7:05 ddima: Clojurians are a bit more social and cooperative, culturally. Flatter, more idiomatic code styles too.

7:06 ddima: but it's the same way with python/java/c code from some academics

7:06 hm

7:06 bitemyapp: seriously, try talking to somebody like lispm on HN. CLers are fucking insufferable.

7:06 Cr8: there's more of a pragmatic/practical use focus

7:06 ddima: but in a good way, without sliding towards ruby-community "awesomeness" ;)

7:06 <duq>

7:07 bitemyapp: why do you think that is?

7:07 bitemyapp: Clojure's community is nice. It's a good balance of FABULOUSSSSS, practicality, and interestingness.

7:08 ddima: I'm an ex-CLer. We were so much better than everybody else for so long that it went to our heads and stayed that way even after it stopped being the case.

7:08 ddima: oh, ok :D

7:08 bitemyapp: you can do a lot better than CL these days, they just haven't figured it out yet.

7:08 ddima: but they are so much better per definition!

7:09 Cr8: I wrote a bit of CL but I could feel myself becoming antisocial ;P

7:09 ddima: goes straight into your head

7:10 bitemyapp: I like how for most a default way to start out a java project is to depend on as many spring components as you can get your hands on ;)

7:10 bitemyapp: Cr8: CL lends itself to desert island programming where you build some weird alternate universe out of macros.

7:10 ior3k: ddima: I am a full time ruby programmer (would love to move to clojure full time). I can attest there's too much "awesomeness" in the ruby community

7:10 bitemyapp: ior3k: too much pop culture and drama, not enough coding.

7:10 tenderlove is subsidizing like 20% of the practical work that happens in that community.

7:10 ior3k: "drama" is the keyword there

7:11 ddima: ior3k: didn't really mean it negatively, have been doing ruby (sometimes even with rails) for a couple of years, but couldnt really bond with all that awesomeness

7:11 bitemyapp: well the pop culture bit matters too. too many people trying to be "involved" that aren't contributing anything.

7:11 ddima: ior3k: generally not finding too many things "oh so awesome" ;)

7:11 ior3k: ddima, bitemyapp: agreed

7:12 ddima: in the end the lack of "serious" libraries like numpy/ntlk etc made me move to python for the greatest part, which i like

7:12 Cr8: I managed to wield Common Lisp as if it were PHP ;)

7:12 that is, mostly with mudballs of mutable state

7:12 ddima: well, then me not writing macros until the pain really becomes bad, seems to be a good approach

7:13 Cr8: and the only reason anything worked is that i destroyed the world all the time

7:13 ior3k: with ruby it feels as if people are still extolling the qualities of horse carriages while clojure people are building rockets

7:14 but I'm not trying to become a smug clojurian

7:14 ddima: nice try ;)

7:14 ior3k: it just feels like a totally different league

7:14 heh, sorry

7:14 I wonder what the right attitude is, though

7:15 ddima: just do your thing and dont compare, I'd assume

7:15 I mean, they are probably muuuch better at css and stuff!!11 ;)

7:15 Cr8: I'd say that the different langs and their communites *value* different things

7:15 or have different sensibilities

7:17 ior3k: maybe... I remember what attracted me to ruby at the time was how much better it felt to use ruby over java. But what attracts me to clojure is how it makes much easier for me to build software that works (and that's from very limited experience)

7:18 ddima: thanks to hickey a lot of stuff seems to be much more thoughtful and motivates to think more in contrast to just spit out code the way one has done 100s of times, especially since many things can be written quickly WHEN a solution is found - that's what it feels like to me. combined with an unspoken love for sucklessness ;)

7:18 (not only to him, but I guess his talks helped when bootstrapping the community)

7:19 ior3k: definitely, I think the focus on simplicity is a very important part of the clojure community

7:19 ddima: thought that's nothing you couldn't pursue in java for example, it's just culture i guess

7:20 Cr8: well there's something to be said for having sharp tools that are fun to work with

7:22 ddima: I was amazed at how quickly and enthusiatically a collegue at ex-work picked up clojure and pimped a tool I wrote without ever having done lisp before and it didn't even look to bad - so I don't buy the elitism/nobody gets it argument anymore

7:22 that was also the reason why I wanted to learn a lisp for the last 10 years but never came far, just a mindset thing

7:23 which was entirely my fault ofc

7:23 so thanks, dear clojure community, for such a nice tool :)

7:24 have to go and paint some walls with physical tools now ;)

8:05 fizruk: hello! can I somehow use map as format parameters? e.g. (format "%(name)s %(surname)s" {:name "John" :surname "Doe"}) ?

8:06 mdrogalis: fizruk: Not that I'm aware of, but that's pretty neat.

8:08 justin_smith: that's not far from what a moustache based template engine does

8:09 fizruk: yeah I think template engine suits better for my purposes

8:11 nonetheless in python they have something like "%(name)s %(surname)" % {"name": "John", "surname": "Doe"}

8:12 I think it would be cool to have a similar thing in clojure

8:12 mdrogalis: Yaawn, work the day after a holiday. D:

8:12 fizruk: (sometimes you don't want a template engine)

8:19 atomphil: can you not just use String.format?

8:27 fizruk: atomphil: I can't use argument names in format string that way, only argument indexes

8:27 atomphil: ah I see

8:35 hcumberdale: Hi there :)

8:36 Getting this strange error after updating to ring 1.2.1: assoc-conj does not exist

8:37 Tried to include [ring/ring-codec "1.0.0"] but it does not seem to be helpful :(

8:40 mdrogalis: hcumberdale: Sounds like conflicting versions of the same JAR on your classpath.

8:40 lein deps :tree might reveal some trouble.

8:40 hcumberdale: thx mdrogalis, i'll see

8:41 justin_smith: fizruk: a slightly ugly version of what you are asking for https://www.refheap.com/22233

8:41 it works

8:41 fizruk: justin_smith: :)

8:42 justin_smith: oops, the escaping is off

8:42 hcumberdale: lein clean was the solution :) thx mdrogalis deps :tree displayed the issue

8:44 mdrogalis: hcumberdale: Awesome. :)

8:46 justin_smith: fizruk: I just fixed the paste, escaping now works https://www.refheap.com/22233

8:48 fizruk: justin_smith: thanks!

8:48 justin_smith: any suggestions of making the above cleaner / more readable welcome

8:49 I like how searchihg for : in the string creates smileys wearing jaunty hats

8:58 Guest85538: is it possible to create a macro that returns a java static function call. I have a lot of java static calls like this (Javaclass/method x y z). I would like rename the method in a clojure way but i dont want a performance penality by wrapping each static method in a clojure one. Can I do this with a macro? Like (my-method x y z) => (Javaclass/myMethod x y z)

8:59 justin_smith: well, I don't know where it would get JavaClass from in your example

8:59 but otherwise, yeah

9:06 Guest85538: I am tring to make a wrapper for lwjgl. It is full of static java calls with each method residing in tis own class(GL11...GL30,...).So I would like to have one clojure file(lwjgl wrapper) with all the Java impports, and inside a bunch of macros that all they do is translate (my-method x y z) to (Javaclass/myMethod x y z) so I would not have to keep track of all th eclasses. So whenever I would

9:06 like to use lwjgl I would just have to (:use lwjg-wrapper) instead of having to import all java classes. Or Would I still have to import Java classes where I would use this macros, cuz this macros would just translate, and once a method is translated it would still require a java class?

9:07 justin_smith: no, if the class is found in the file where the macro is defined that works

9:08 so you would have a macro that expanded (foo ...) to (GL11/foo ...) and another that expands (foo ...) to (GL30/foo ...) etc.

9:08 that seems doable

9:09 gfredericks: Guest85538: it works because the macro file ensures the classes have been loaded, and then in the expansion the class names are fully qualified

9:09 ,`Long

9:09 clojurebot: java.lang.Long

9:09 Guest85538: nice, can you give me an example how to create such a macro. Like (defmacro gl-gen-buffer [] GL15/glGenBuffers) something like this

9:09 gfredericks: Guest85538: (defmacro gl-gen-buffer [& args] `(GL15/glGenBuffers ~@args))

9:10 you can use some specific arity if you know it, which you probably do

9:10 Guest85538: nice thanks, I will try it out

9:15 works like a charm, thanks again

9:20 gfredericks: ~macros

9:20 clojurebot: Barking spiders!

9:23 justin_smith: Guest85538: another note is if you are concerned enough about overhead to prefer a macro over function here,, the version that specifies the arguments individually will churn a bit less garbage than the ~@args version

9:24 also you can use hinting if there are multiple versions of a static method differentiated by input type

9:25 (reflection to pick a method is more expensive than function dereference is by far)

9:30 mdrogalis: Barking spiders lolol

9:30 gfredericks: justin_smith: I don't think a variadic macro implies reflection

9:31 justin_smith: no, a variadic macro implies creating and then throwing away a seqeuence

9:31 I was pointing out two separate concerns

9:34 mdrogalis: Does it imply barking spiders?

9:34 justin_smith: we could blame the dog instead

9:38 gfredericks: justin_smith: that's at compile-time though

9:38 justin_smith: true

9:40 ... barely resisting the opportunity to snark about clojure load time clearly not being an issue

9:40 point taken though, not a big deal

9:47 benedikt: what is the state of clojure on android? last time i tried there was a servere lack of documentation and a lot of library "fungus"

9:52 ToxicFrog: Under what circumstances will "lein run" re-use some older compiled version rather than using the source as it exists?

9:53 justin_smith: ToxicFrog: with some lein versions I have found the need to lein clean to avoid bugs

9:57 I don't really have a full formal description of the problem, but I know "when in doubt, lein clean" seemed to take care of it

10:04 ToxicFrog: justin_smith: that sorted it, thanks.

10:05 Now I just need to get error messages out of saturnine that aren't complete garbage

10:06 justin_smith: Good luck with that. Gigo is a bitch.

10:07 ToxicFrog: Gigo?

10:07 justin_smith: garbage in garbage out

10:08 the dominant philosophy of error handling in the clojure world

10:08 ToxicFrog: Yeah :/

10:08 justin_smith: "if the input is meaningless, the output can be meaningless"

10:10 ToxicFrog: Makes it hard for me to recommend it.

10:11 justin_smith: I wish windmove and org mode didn't clash :(

10:12 ToxicFrog: I gave up trying to talk anyone into a lisp ages ago

10:12 I use it, it works for me. Being an advocate is hard work.

10:13 ToxicFrog: justin_smith: the thing is, clojure is the first lisp I've really enjoyed using and would like to recommend

10:13 ddima: justin_smith: that's also a fundamental principle in natural language processing and statistics ;)

10:14 ToxicFrog: But then I have to hedge it with "just be aware that any sort of syntax or runtime error will result in a terminal full of trash with, if you are lucky, the real error in there somewhere"

10:14 Whereas if I recommend, say, Lua, it's a less capable language but the error reporting actually doesn't suck.

10:14 justin_smith: ddima: but this isn't a natural language, we can have heuristics, or strict enough rules to verify the error and report it cleanly

10:15 ToxicFrog: ddima: on the other hand, garbage in to a compiler should at least get it to tell you why it is garbage.

10:15 ddima: justin_smith: true, but still, if you fail to do so... ;)

10:15 yes, true, true. I just like the saying

10:16 this is for sure one of the rougher aspects, easpecially with lazy seqs

10:16 -a

10:16 justin_smith: also, I work with audio, and sometimes garbage in, perfection out is even an option (totally outside the programming world now, I am not advocating for perl)

10:17 ddima: yeah, with lazy seqs tracking down where the actual error is can be maddening

10:19 ddima: justin_smith: last time i had something like this just a simple indicator that it actually was during realization of a lazy seq would have helped. but haven't digged into the code to see if this can be easily done

10:19 cost me like 2 hours of my life

10:21 are there attempts at improving this part (havent checked any roadmaps)?

10:29 Guest85538: justin_smith: thanks for the tips about the optimization. Do you know any good resource about various optimization tips for clojure?

10:46 lnostdal: anyone tried running clojure on java 8? how did it work out?

10:47 mdrogalis: lnostdal: I remember Andy tried it a while ago and it worked mostly okay?

10:47 There's a post on the Clojure-dev mailing list about it.

10:48 "It failed a few tests involving reflection, which I tracked down to a problem that exists in earlier JDKs, too."

10:48 "It also had a few more warnings while compiling one Java source file about the use of the identifier _."

10:48 "With both of those applied, latest Clojure master compiles and passes all tests with no more warnings (1) than when using Oracle JDK7."

10:48 Should be fine.

10:49 lnostdal: interesting, thank you .. i'm gonna give it a spin :)

10:58 Tekhne: (I'm a newbie to Emacs and Clojure. Trying to learn both.) How can I eval my current Clojure form in my cider REPL? The cider docs kind of assume more Emacs knowledge than I have, so I don't understand.

10:59 technomancy: Tekhne: pick one to learn first

10:59 trying to do both is just going to end in sorrow

11:00 Tekhne: technomancy: Oh, nevermind. I think I figured out my problem. I needed to put my point (cursor?) after the last paren of my form.

11:00 technomancy: ...then do the Emacs command.

11:05 mdrogalis: technomancy: Just saw the To the Moon talk.

11:05 That was incredible.

11:12 technomancy: <3

11:13 glad they got that one posted

11:13 mdrogalis: Yeah, me too. It was moving sitting here watching it myself. I can't imagine the energy in that room.

11:14 gfredericks: is this about that video jame?

11:15 mdrogalis: Eh?

11:16 ior3k: Eloquent Ruby... I knew I had heard of Russ Olsen before

11:16 JampoL: .

11:28 KahviIslaamilain: Raynes, are you there?

11:39 shiranaihito: has anyone got experience working with Clojure using Ant (instead of Leiningen/Maven)?

11:40 has anyone got experience working with Clojure using Ant (instead of Leiningen/Maven)?

11:40 whoops.. sorry for the double post

11:42 sdegutis: Welp.

11:42 Tried my hand at an IDE and got pretty far before I completely lost all steam.

11:42 shiranaihito: hm? :P

11:42 you mean instead of Lein? .. or instead of Emacs or something?

11:42 sdegutis: https://github.com/sdegutis/leviathan

11:43 Not instead of anything. Just an IDE.

11:43 gdev: shiranaihito, yes, I wouldn't recommend it...unless you have to for legacy reasons

11:44 sdegutis: Oh, different conversation. Sorry.

11:44 shiranaihito: gdev: well, it's just that i'm annoyed by the "Java-baggage" that Clojure has inherited.. for example, I wanted to play with Datomic, and after adding it as a dependency, Lein started exploding with a complaint about commons-codec.. Apparently, the AWS SDK uses codec 1.3, and other stuff depends on 1.6.. so.. there we go

11:45 someone suggested setting some kind of "exclusion" to circumvent the problem, but that might.. cause some instability issues with whatever depends on commons-codec, or something.. ? i don't really know

11:46 they're all probably just using "codec" for Base64 anyway

11:48 .. so, i'm left wondering if i should try using Ant instead, or .. just give up on Clojure or something? :P yeah, that would probably be too drastic, but still.. all the baggage is really annoying

11:49 gdev: what kind of problems did you run into with Ant?

11:49 sdegutis: Also, while I'm here, I want to clear something up. The last time I was here, I was upset about a "crazy feminist" as I called her. And I still stand by what I said. But her being crazy has nothing to do with her being a feminist, and says nothing about my views about feminism. She's just a crazy person who also happens to be a feminist. I figured you guys all understood that, but someone PMed me explaining that I should keep my opini

11:49 on on feminism to myself.

11:50 shiranaihito: sdegutis: people are way too touchy about feminism anyway (and a vast array of other stuff too, of course)

11:51 sdegutis: I intentionally try not to talk about that kind of stuff, because there's always someone who will take offense at anything you say.

11:51 I wrote about how I think we should talk about that kind of stuff: http://sdegutis.github.io/2013/11/18/how-professionals-should-do-politics-and-religion/

11:51 shiranaihito: yeah, it's silly, to put it mildly :P

11:53 sdegutis: So anyway, I wrote this IDE. It uses some really fun C tricks, but it uses Cocoa so it's not portable unfortunately.

11:53 lgs32a: Emacs/nrepl question: Can you point me to a way to get a command that puts the current sexp in the nrepl buffer and evals enter

11:53 meaning evals it like I have pressed enter

11:54 gdev: lgs32a, Meta-W, Ctrl-x right , Ctrl-Y

11:54 lgs32a: gdev: lol

11:55 every cognitect person has a specific command for that in their presentations

11:57 you also forgot the C-x C-b, *nrepl*, M-Shift, M->, (C-y), Return

11:58 gdev: shiranaihito, how is dependency management "java baggage".

12:00 shiranaihito, using Ant I ran into the same problems you're having

12:00 shiranaihito: gdev: not dep management itself.. an example of the baggage is everyone and their neighbour's dog depending on various commons-whatever -jars, mostly just for the sake of re-use, even though whatever little tidbit they needed could have been implemented with not much difficulty

12:00 rovar_away: shiranaihito: would you rather they roll their own utility library rather than depend on a commons-*?

12:01 shiranaihito: rovar_away: perhaps.. i guess "it depends"

12:02 i've got a java background myself.. and i remember it was common practice to have a "lib" directory with pretty much everything in it, include everything there in the classpath and just hope things run smoothly

12:02 .. and that was mostly because everything depended on so many of the same libraries, etc

12:02 rovar_away: lein does help mitigate that

12:03 because it does make it easy to pull down new libs in an ad-hoc manner, so you don't need to start out depending on everything

12:03 shiranaihito: for example, i'd have loved to have only a hibernate.jar .. but nope, it depends on commons-whatever and commons-even-more-stuff, and so on

12:04 gdev: shiranaihito, oh okay, but what you were originally trying to do was play with Datomic. How did it all go so wrong?

12:04 shiranaihito: rovar: yeah, that's nice and all.. but maven and the like are mostly just a "band-aid" over this problem

12:05 http://pastebin.com/KVsdczNx - this kind of thing

12:06 nDuff: shiranaihito: would you mind using a pastebin without ads? refheap.com is a good choince (being written by one of our own); likewise, gist.github.com.

12:06 shiranaihito: nDuff: sure, refheap is fine with me.. i just didn't remember it now

12:07 gdev: yeah, refheap doesn't get websensed to death

12:07 kzar: Regretfully not been looking at Clojure for a while but was having a look at this example in the hope to get back into it again. Confused by the recursion in it though, could anyone explain? (def fib-seq (lazy-cat [0 1] (map + (rest fib-seq) fib-seq)))

12:07 shiranaihito: i kind of feel like this baggage is a serious problem for Clojure too.. but i really want to use Clojure for everything i do these days, so i'm kind of torn

12:08 kzar: (I mean I get the general idea, I guess but...)

12:09 nDuff: kzar: could you be a little more specific about what part needs explaining?

12:09 shiranaihito: https://www.refheap.com/22234 <-- here's the same thing again, in case someone wanted it

12:09 kzar: nDuff: Well I understand the idea of adding the last two items of the list to create the new one

12:09 rovar: shiranaihito: almost all of that is clojure libs, it's not java's fault. Normally I'm happy to blame java developers for everything.

12:10 seems like its a pace-of-iteration thing

12:10 ring is a small and young project.. datomic, relatively less so..

12:10 kzar: nDuff: I've not seen / used lazy-cat before but I roughly understand the idea of concatinating two sequences together and returning a lazy one

12:11 nDuff: I guess I just don't understand how the new item is appended on to the sequence each time

12:11 shiranaihito: rovar: well, i'm not blaming either _language_.. just expressing my discontent with java's "culture of overzealous re-use" and the neglectfulness that's resulted from it

12:11 kzar: nDuff: as (rest fib-seq) must be returning different things, how is the definition of fib-seq changing?

12:12 rovar: shiranaihito: IMO the real problem here is that datomic is not open source. If it were, I'd just say pull down the repo, flip the dependency to 1.6 and then lein install.

12:12 kzar: (What I don't understand is fuzzy, I just know that I don't fully understand it)

12:12 nDuff: kzar: there's only one rest sequence. Map moves over it.

12:12 rovar: shiranaihito: it might be worth putting that question to the mailing list to see about proper solutions for reconciling the conflict.

12:12 kzar: nDuff: oh I see

12:13 rovar: kzar: it's also interesting to note that it is an infinite sequence, it will recurse forever

12:14 shiranaihito: rovar: yeah that might help too, but it seems it's AWS that depends on 1.3 .. i guess i'd have to modify that too? -actually i saw someone had opened an "issue" in the aws project, asking about updating commons-codec to 1.6, but it's 2 months old and didn't seem to get any attention.. i've never actually contributed to an open source project myself (yeah, i know.. a sad excuse of a programmer :p), so i don't

12:14 know that i could just go ahead and "contribute" the change either, etc..

12:14 kzar: rovar: Yea I understand that

12:14 rovar: most of amazon's stuff is open source..

12:14 maybe you could just mod it locally.

12:14 sdegutis: What's a good cross platform C GUI API, for writing a Clojure IDE in?

12:15 rovar: what's annoying is that datomic might not even actually need the aws stuff if you're not using it.

12:15 sdegutis: does it have to be written in C?

12:15 sdegutis: I guess the core of emacs is in c and its cross platform. I'd recommend that.

12:15 if not that, then vim

12:15 sdegutis: rovar: hmm I see.

12:16 * nDuff thinks Light Table made a good choice in using Chromium.

12:16 rovar: emacs has a long, steep learning curve, but at the top of that curve you will achieve enlightenment

12:18 shiranaihito: rovar: yeah.. i don't know.. then i guess i'd have to re-apply the "local patch" whenever aws gets updated etc, it's all very silly.. and i'm not sure it even really makes sense for me to complain.. i just feel like things are somewhat horribly wrong in this regard

12:18 sdegutis: nDuff: that's one of the main reasons I don't use Light Table actually.

12:18 rovar: I'm not looking for an IDE, I'm already writing one.

12:18 lgs32a: gdev: I have now implemented it myself in elisp: https://www.refheap.com/22235

12:19 sdegutis: I'm just looking for a way to run it on other OSes, not just OS X.

12:19 Right now it uses Cocoa for GUI.

12:20 nDuff: It may be my OCD, but I really don't like using things that I know are overly complicated. That's one reason I hate browsing the web. (There's no browser that I know of where I can browse the web on my laptop and *not* hear my fan spin up to full speed.)

12:20 So using an HTML layout engine to render text is just overkill to my OCD-riddled brain.

12:20 gdev: lgs32a, is this for live coding and presentation purposes? whats wrong with C-x C-e ?

12:20 rovar: sdegutis: have you looked at wxWidgets?

12:20 nDuff: sdegutis: ...eh. You're on top of a huge, complex stack no matter what.

12:21 sdegutis: ...using Emacs certainly doesn't get you away from that.

12:21 sdegutis: nDuff: I'm not opposed to complexity, just unnecessary or unrelated complexity.

12:22 lgs32a: gdev: for most people i guess. But I am kind of tired of editing large forms in the *nrepl* buffer after i pulled them out of the history. I want to edit them in a seperate buffer so that I can save them into a file and e.g. later create tests from them.

12:22 rovar: I think wxWidgets is one of the only libs that has native finish implementations on all platforms.

12:22 Guest85538: is there a way to compare tow keywords by their characters, like this (let

12:22 [b :test] (if (= (:test b)) (println "equal")) (if (= (:test1 b)) (println "notequal")))

12:22 scottj: sdegutis: when you use light table does your fan spin up?

12:23 sdegutis: scottj: honestly I haven't tried it for that long.

12:23 scottj: it's not the only reason I don't prefer LT.

12:23 gdev: lgs32a, ah okay, that's an interesting work flow

12:26 sdegutis: rovar: hmm I haven't, but I will now.

12:26 Hmm, it requires C++

12:26 Guess it's not much different than ObjC in terms of ugly dependencies.

12:28 gfredericks: Guest85538: does (= :test b) not do what you want?

12:28 technomancy: sdegutis: you could contribute to NightCode

12:28 somewhat less likely to run out of steam if you have other people helping you

12:29 gfredericks: the nightcode website is the first time I've seen the phrase "targeting the command line"

12:29 sdegutis: technomancy: I would but I don't agree with the philosophy of NC.

12:30 technomancy: so I feel like I should start a novelty twitter account that just retweets markov bots that happen to use the word "clojure" in their strings

12:30 there are some really good ones

12:30 sdegutis: technomancy: I wanted an IDE that's basically emacs but extremely custom to Clojure and without any emacs baggage and without RMS.

12:30 (And with a more Clojure-like scripting language.)

12:31 * technomancy stops pretending to understand motivation of people who want to use IDEs =)

12:32 kzar: I think next year I'm going to have another push at groking clojure

12:33 been a bit slack for a while there

12:35 sdegutis: technomancy: Let me very briefly try to explain mine.

12:36 technomancy: Whenever I have to write ObjC, I minimize emacs and use Xcode. (I minimize emacs instead of closing it because Magit is awesome for any project.)

12:37 technomancy: Because Xcode is way more integrated with ObjC than emacs is (at least that I know of). It shows me syntax errors in my code *as I'm typing*. It loads every framework and library into memory and analyzes their types properly.

12:37 Basically, Xcode *knows* about ObjC intimately, so it can do way more than a generic text editor can (even with plugins that try to emulate this externally).

12:38 That intimacy is what I want for Clojure.

12:39 technomancy: that might make sense if I knew xcode or objective C

12:40 sdegutis: I think you understand what I mean just by context.

12:40 The same could probably be said with IntelliJ and Java.

12:40 technomancy: never used those either

12:41 sdegutis: :P

12:42 augustl: I tried to explore the elasticsearch Java codebase with the terminal, then emacs, then wanted to burn my house down. Had to open IntelliJ for that. There's just so many _things_ in an OO codebase, hard to navigate.

12:42 this is rather fuzzy.. But I've never felt that need in a Clojure codebase

12:44 technomancy: is objc really such a terrible ecosystem that it's easier to suffer through xcode than teach a better editor how to understand it?

12:44 (from what I hear this is true of Java)

12:45 augustl: technomancy: afaik all the ObjC know-how in Xcode is in llvm

12:46 edw: technomancy: I do ObjC development, and while I balance my checkbook in Emacs, I use Xcode for ObjC.

12:48 technomancy: must pay well

12:48 edw: ObjC development?

12:50 pippo: ciao

12:50 lista

12:50 technomancy: edw: xcode doesn't sound like something you'd use by choice

12:51 edw: technomancy: I (just) developed an iOS analytics framework for our clients to provide us in-app data. I hear iOS development pays well. Very few people do in-house development because, you know, you actually need to know what you're doing. Seg faults and all. Your typical PHP/Javascript ninja is not cut out for such work.

12:54 arubin: edw: Many apps are built using things like PhoneGap though.

12:54 Embedding a browser in an app and writing the actual app in HTML/JS is very common.

12:55 scottj: arubin: where many = a very small percentage of apps, right?

12:55 arubin: scottj: No.

12:55 edw: arubin: Yeah, we run into a lot of people who do things like that. Keep the revolver securely locked away in the safe.

12:55 arubin: PhoneGap is very popular.

12:55 sdegutis: technomancy: It's not that it's a terrible ecosystem (although it kind of is), it's that Xcode makes it so much easier and faster to write than other IDEs and editors do.

12:55 edw: scottj: It all depends on the type of app.

12:55 sdegutis: Just being pragmatic.

12:55 arubin: scottj: Even companies like Facebook did such things for quite a while.

12:56 edw: arubin, scottj: Yeah, and LinkedIn finally stopped drinking the app-as-WebKit container Kool-Aid cup.

12:56 technomancy: sdegutis: hm; maybe there's just a low overlap between the kind of people who know enough elisp to make things better and the kind of people who choose a career path with a high level of vendor-lock-in

12:57 sdegutis: technomancy: that could be it too; elisp is extremely painful for many of us

12:57 technomancy: Not just the language but the API.

12:57 (both)

12:57 justin_smith: Guest85538: regarding your earlier question, there is a book, http://www.packtpub.com/clojure-high-performance-programming/book but based on your other questions you may want to get a bit more familiar with clojure basics before you jump into that

13:00 sdegutis: technomancy: I was only trying to explain my angle to you. I wasn't hoping to convince you. I know we won't see eye to eye, since I'm the kind of person who actually likes writing in C and you don't :P

13:00 technomancy: I'm writing C right now

13:00 ddima: heh

13:00 technomancy: well, not liking it though

13:01 https://github.com/technomancy/ergodox-firmware/commits/master

13:05 sdegutis: Fun :)

13:05 To be fair, I really don't like a lot of C.

13:05 kzar: technomancy: Oo is that keyboard any good?

13:06 sdegutis: The primitive control structures and lack of useful built-in types is frustrating.

13:06 That's where Clojure shines.

13:06 But I love the turing-machine aspects of C and how low-level it is. I love allocating memory on the stack and passing it to other functions as a pointer, pretending it's on the heap.

13:07 technomancy: kzar: I haven't used a lot of mechanical keyboards, but it's the best I've tried

13:08 kzar: ^ is the tl;dr of http://technomancy.us/172 if you are really curious

13:09 for my purposes and condition it's the best, anyway

13:13 just ordered some lighter key switches for the modifiers and pinkies

13:13 kzar: arg internet here is dodgy

13:14 technomancy: curious about that keyboard, is it worth looking into compared to kinesis etc?

13:14 technomancy: kzar: the kinesis advantage costs more and is more bulky, which put me off

13:14 kzar: I used to use it but I sold it a while back

13:14 technomancy: also you don't get to choose your switch type; I like the tactile clicky response vs the low-force, muted brown switches on the Advantage

13:15 but the matrix layout (non-staggered) is similar, and I love that now that i've adjusted

13:15 plus the thumb clusters

13:15 kzar: is it expensive?

13:15 technomancy: heh... well you have some options

13:16 the base price of the kit is US$235 if you include the keycaps

13:16 but if you already have some of the parts, the design is all OSS

13:16 rovar: if i needed to write firmware I'd probably start with https://github.com/whitequark/picobit

13:17 but I don't really mind C so much

13:17 kzar: oh cool

13:17 technomancy: so you can get your case laser-cut into acrylic at a local makerspace or something and scavenge your switches+caps from an existing keyboard

13:18 rovar: one day when I have time, I'll make a proper dvorak keyboard out of that.

13:18 technomancy: in that case it'd just be US$40 for the printed circuit board plus whatever they charge for the acrylic cutting

13:19 and $16 for the microcontroller I guess

13:20 maravillas: technomancy: do you have any thoughts on determining what flavor switch one likes best, aside from trial and error?

13:20 technomancy: maravillas: seems like gamers like blacks. for hackers it just depends on your co-workers' tolerance for clickiness =)

13:21 I work alone, so I got the noisy blue switches

13:21 and some people like the low-force browns, but they feel a bit mushy for me

13:22 I just ordered some browns for my pinkies though

13:22 maravillas: do you find there's a tradeoff in noise vs comfort? or are they unrelated?

13:22 scottj: maravillas: you can buy a cheap kit that has one of each switch. or buy and return a couple keyboards. imo just try blue and brown and skip black and red. idk about clear/green.

13:23 maravillas: blue and brown are roughly equally popular.

13:24 maravillas: comfort/appeal/good-ness

13:24 marcopolo`: technomancy: have you tried the kinesis advantage? what are your thoughts on that vs the ergodox?

13:24 technomancy: maravillas: browns trade silence for (IMO) comfort, but some people like them better

13:25 if you don't like the low-force feel of the browns but can't get something loud supposedly the clear switches are somewhere in between

13:25 marcopolo`: it's cool, but it's too bulky to bring to coffee shops like I do. also I like the blue switches better, and the ergodox is cheaper and more hackable.

13:26 but I haven't spent enough time on the bowl layout to have a qualified opinion on that aspect; the ergodox is totally flat

13:26 maravillas: unless you have a lot of fatigue I'd go with either clear or blue, depending on noise tolerance

13:27 maravillas: but it'd probably be easier to give the browns a test run since they're in the kinesis advantage

13:27 depending on where you live, I guess

13:31 scottj: maravillas: there are also lots of used mechanical keyboards that you can buy used on ebay and resell after a month for no loss other than shipping and ebay fees

13:33 technomancy: building an ergodox from scavenged switches would actually be a lot ofd fun

13:36 lots of tedious work, but I find that kind of thing relaxing

13:37 maravillas: i have a ms 4k natural and despise the buttons...it sounds like browns will feel more like that than i'd like

13:38 good ideas, thanks guys

13:42 sdegutis: ,(->> (range 100) (reverse) (partition 2 1))

13:42 clojurebot: ((99 98) (98 97) (97 96) (96 95) (95 94) ...)

13:42 sdegutis: Commence bottles-of-beer song.

13:46 gfredericks: (range 99 -1 -1) for more efficient singing

13:47 rovar: is there an example of serializing functions into maps?

13:48 I have a need to pickle functions to disk for later evaluation..

13:48 I was thinking of just mimicking defn with a macro which includes the doc string, params, and makes a symbol of the executable bits..

13:48 perhaps a string

13:49 not a symbol of the bits, a quoted list..

13:53 gfredericks: $google serializable-fn

13:53 lazybot: [technomancy/serializable-fn · GitHub] https://github.com/technomancy/serializable-fn

13:53 gfredericks: rovar: ^

13:54 rovar: gfredericks: <3

14:10 jergason: What is the use case for do?

14:10 Wouldn't things with side effects still work fine if not wrapped in a do?

14:10 gdev: jergason, side effects

14:10 rovar: jergason: do doesn't return a value, so it kind of implies that the action you're performing is for its side effects..

14:10 AimHere: There's also cases where you want to bundle more than one command in a place that only wants one command

14:11 jergason: Germ

14:11 gdev: jergason, do actually does return a value, the last expression in the do block

14:11 jergason: Dang iPhone keyboard. Meant hrrrrm

14:11 AimHere: One case would be (if wibble (do ... lots of things) (do ... other things))

14:11 gdev: ,(do (print "oh hai") (+ 1 1))

14:11 clojurebot: oh hai2

14:12 jergason: Ah that one makes sense

14:12 Ty friends

14:12 gdev: ,(do (+ 2 2) (+ 1 1))

14:12 clojurebot: 2

14:12 mdrogalis: (if (true? true) (do (thing1) (thing2)))

14:12 AimHere: Useless use of true?!

14:13 rovar: indeed

14:13 AimHere: Also if you're returning nil on falsy values, then use 'when' instead of 'if'

14:13 rovar: in almost all cases true? is useless

14:13 jergason: Okay, it is starting to make sense.

14:13 AimHere: ,(map true? [true 3])

14:13 clojurebot: (true false)

14:14 AimHere: There is some sort of use case there somewhere

14:14 gdev: ,(true? (is-useless 'true?))

14:14 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: is-useless in this context, compiling:(NO_SOURCE_PATH:0:0)>

14:14 mdrogalis: You get the point. ;[

14:15 gfredericks: ~true

14:15 clojurebot: Huh?

14:15 gfredericks: ~false

14:15 clojurebot: Titim gan éirí ort.

14:15 mdrogalis: Barking spiders.

14:15 gfredericks: clojurebot: true is false

14:15 clojurebot: In Ordnung

14:15 edw: AimHere: `when` is most useful to imply that somethin' imperative's going on. If you're doing something that doesn't involve mutation, an explicit nil is the classy thing to do.

14:15 gfredericks: presumably now clojurebot can prove anything

14:16 ~false

14:16 clojurebot: Cool story bro.

14:16 gfredericks: clojurebot: that's sexist

14:16 clojurebot: Cool story bro.

14:16 justin_smith: edw: or "and" even, if it is purely functional and value oriented

14:16 ,(and true :OK)

14:16 clojurebot: :OK

14:17 edw: justin_smith: I get yelled at by my peeps when I do that.

14:17 justin_smith: weird

14:17 edw: Werd.

14:18 justin_smith: and means "all of these values, or else false - and there are no concerns about side effects here"

14:18 that's what it means to me at least

14:18 well "the last value if all or true"

14:19 edw: justin_smith: These people are not fans of C's ternary operator either.

14:20 gdev: ,(and (= 1 2) 3 4)

14:20 clojurebot: false

14:20 gdev: ,(and (= 2 2) 3 4)

14:20 clojurebot: 4

14:21 justin_smith: gdev: usually more like (and (cond-1 input) cond-2 result)

14:22 gdev: justin_smith, yeah I was just showing how it only cares about the last value when they're all true

14:23 justin_smith: gotcha, right

14:24 gfredericks: (#'and true false)

14:24 ,(#'and true false)

14:24 clojurebot: true

14:24 gdev: I've seen people see code like (and (cond-1 input) blah blah result) and think, ah, I know the code block that is the "result" so this should work too (and (cond-1 input) result blah blah)

14:25 and I've only been teaching Clojure for a few months

14:28 this is usually because some people are used to putting return statements anywhere in a method to short circuit it

14:29 justin_smith: of course

14:33 gdev: teaching java devs anything other than "yet another java framework" is quite a masochistic task

14:35 rhg135: hello, i have a (probably obvios) qquestion, how do you manage mutable java objects for, say, concurrency?

14:35 justin_smith: rhg135: you can put it in an atom, and wrap the ops in swap! calls

14:36 rhg135: justin_smith, i don't exactly understand, you'd still be mutating the same state

14:36 and not all calls are idempotent

14:37 justin_smith: right, but with an atom at least there is some negotiation of access and mutation

14:37 there is also the option of using the (locking ...) call

14:38 (locking some-mutabale-object ...)

14:38 rhg135: ya... I saw that, but didn't understand why it worked

14:38 justin_smith: but it is up to you in that case that all access is wrapped in a locking call

14:38 gfredericks: wait what

14:38 we're talking about a mutable java object

14:38 justin_smith: yes

14:39 gfredericks: using an atom means your update functions are subject to being run multiple times

14:39 justin_smith: oh shit, you are right

14:39 don't mind me

14:39 an atom is exactly the oposite of what you want there

14:39 rhg135: oarticularly sockets and Readers

14:40 gfredericks: so you _could_ use an agent instead; but I think what you want depends on what you're doing

14:40 so yeah if you have an object shared between threads and you want to make sure only one thread is calling methods at a time, you could use locking or an agent

14:40 rhg135: i think bitemyapp chewed me out for using atoms for this once lol

14:41 gfredericks, agents does sound right

14:41 gfredericks: atoms work best when used with immutable values

14:41 rhg135: why must mutability be over-complicated

14:41 gfredericks: yeah not only do atoms subject your functions to retries but they also can run on different threads at the same time

14:41 justin_smith: gfredericks: maybe we could upgrade that to "atoms should never be used for mutable things"

14:41 gdev: rhg135, there are a lot of talks that answer this question

14:42 rhg135: i know

14:42 and yet ppl still do it :\

14:42 justin_smith: rhg135: at a root level, unless you reject concurrency altogether, mutation *is* complication

14:42 rhg135: justin_smith, agreed

14:53 gdev: ,(clojure-version)

14:53 clojurebot: "1.6.0-master-SNAPSHOT"

14:53 gdev: &(clojure-version)

14:53 lazybot: ⇒ "1.4.0"

14:55 gdev: ,(interleave)

14:55 clojurebot: ()

14:55 gdev: &(interleave)

14:55 lazybot: clojure.lang.ArityException: Wrong number of args (0) passed to: core$interleave

14:57 gfredericks: ,(doc interleave)

14:57 clojurebot: "([] [c1] [c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc."

14:59 gdev: &(doc interleave)

14:59 lazybot: ⇒ "([c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc."

15:16 rhg135: if I understand the docs, agents use a thread pool, any way to have it run on one thread?

15:17 justin_smith: rhg135: you could use core.async and have a process reading from a channel

15:18 rhg135: i guess, but i thought 1.5 added this type of thing

15:18 justin_smith: rhg135: why do you need the agent to always be in the same thread - is it not good enough to know it will only be running in one thread at a time?

15:18 lnostdal: hi guys, does cider use the same server component as nrepl.el? ( https://github.com/clojure/tools.nrepl )

15:19 justin_smith: rhg135: an agent will block until the previous task is done

15:19 rhg135: justin_smith, ah perfect

15:20 tought asynchronous meant it didn't wait

15:20 but ok

15:20 justin_smith: check out the output of (doc agent) in your repl

15:21 wait, never mind

15:21 that is not as comprehensive as I thought it would be

15:22 http://clojure.org/agents rhg135: see the enumerated list on this page

15:23 or more to the point "At any point in time, at most one action for each Agent is being executed."

15:23 rhg135: ah ic

15:26 justin_smith: I think I have some stuff in my code base that could be better represented as agents, now that I consider it actually

15:28 rhg135: is the thread pool set to a reasonable size?

15:29 justin_smith: http://stackoverflow.com/questions/11316737/managing-agent-thread-pools-in-clojure

15:29 rhg135: the key thing is to know when to use send versus send-off

15:29 that helps it use the pool intelligently

15:30 rhg135: what is the difference

15:30 justin_smith: you can also, as the so answer mentions, use your own ExecutorService to override the default

15:30 rhg135: the docs are scarce here

15:30 justin_smith: rhg135: same link I posted to clojure.org above explains it

15:31 send for CPU heavy, send-off for IO-bound

15:32 rhg135: ah

15:32 solidus_: does one use agents as threads with message queues?

15:32 rhg135: send uses a bounded pool

15:33 send-off doesn't right?

15:39 justin_smith: I think send-off allows sharing of one of the threads

15:39 like a lighter-weight thread

15:39 I could be wrong though

15:39 solidus_: you can - it is like an inverted message queue though, the agent has the value, and you pass it a function that acts on the value

15:40 rhg135: meh

15:40 specifics

15:40 justin_smith: solidus_: but I think you can do nice messge-queue like things with that design

15:40 rhg135: i get the main idea

15:40 justin_smith: rhg135: that SO link I posted linked to the actual source

15:40 at this point it would be easier to read that then speculate

15:42 rhg135: based on the source of send / send off you should look at pooledExecuter and soloExeter respectively

15:43 rhg135: justin_smith, "The send-off pool (also used for futures) is a cached thread pool and will grow without bound. This allows an arbitrary number of background tasks to wait for I/O"

15:43 justin_smith: ahh

15:43 makes much more sense than my first guess did, thanks :)

15:43 rhg135: it's from the so answer

15:45 justin_smith: yeah, reading comprehension ftw

16:10 gdev: it's more important than list comprehension

16:12 Guest85538: With macros I am tring to encapsulate all static java calls and all the Java import to a single file, so wherever I need this Java functionality I just have to import this macros. Translating only methods calls works, but when I am tring to add parameters it reuires to import Java classes. Here is a short snippet of he problem http://pastebin.com/Ej2Xw2kD. Any ideas?

16:13 gdev: pastebin gets websensed on my network, can you paste it into refheap.com?

16:14 Guest85538: https://www.refheap.com/e962558e200e1ac2186194754

16:14 here

16:16 justin_smith: Guest85538: could those args be at any position in the argument list, or are they in predefined places?

16:16 Guest85538: predefined

16:17 the args list should retain the order

16:17 justin_smith: in that case you may want to use an explicit arg list instead of & rest args

16:18 Guest85538: are predefined, and some java methods are overloaded so this would solve for all those methods

16:18 but if it is not possible

16:18 i ll try the other way

16:19 justin_smith: (defmacro gl-bind-buffer [buffer-type & args] `(GL15/glBindBuffer ~(get {:gl-element-array-buffer GL15/GL_ELEMENT_ARRAY_BUFFER :gl-array-buffer GL15/GL_ARRAY_BUFFER} ~@args)))

16:19 something like that maybe

16:19 also why are you quoting the GL15 constants? that may be your issue

16:20 Guest85538: otherwise are not htey evaluated?

16:20 justin_smith: they are constants

16:21 if you quote it you get a symbol

16:21 if you don't you get the constant value

16:21 Guest85538: get it

16:21 justin_smith: you want the latter I think

16:21 gdev: Guest85538, are you the one trying to write a Clojure wrapper for JLWGL?

16:21 Guest85538: jes

16:21 gdev: you're awesome

16:21 good luck with that

16:22 Guest85538: justin_smith is not the result the same if I quote or not

16:23 in once case i get integers else i get GL15/GL_ARRAY_BUFFER which when executed gets the same result

16:24 mandu_: Hi everyone!

16:24 justin_smith: Guest85538: a quoted symbol is just the symbol

16:24 Cr8: you could write out the fully qualified class name

16:25 justin_smith: Guest85538: if you want quoting, do what Cr8 describes

16:25 otherwise just drop the quoting and you will get the right result I think

16:25 the extra level of quoting delays the evaluation until the usage namespace, which is why the symbol is not being resolved properly

16:25 (unless you import in the using namespace, or fully qualify the symbol, of course)

16:26 mandu_: Is there good a way of filtering more than one collection at a time? Like map with multiple collections that will take a function with multiple arguments and return a collection of filtered collections?

16:26 justin_smith: there is hardly ever a reason to quote a constant

16:27 mandu_: currently i'm doing this: http://pastebin.com/GvEs1HgV

16:27 but i'm not sure if this is very efficient

16:27 Guest85538: if I drop quotes it works without the need to import. Seems like I do not fully understand how macros work :/

16:28 justin_smith: mandu_: maybe something like (filter (fn [a b c] (and (p1 a) (p2 b ) (p3 c))) (map list s1 s2 s3))

16:28 (filter (fn [[a b c]] (and (p1 a) (p2 b ) (p3 c))) (map list s1 s2 s3)) sorry, this one

16:28 Guest85538: quotes delay evaluation

16:28 mandu_: but then i'd have to unzip the result again right?

16:29 justin_smith: mandu_: depends what you want to do with the result

16:29 mandu_: i need them separately...

16:29 justin_smith: the unzip is easy to write

16:30 mandu_: yeah, just seems inefficient

16:30 justin_smith: (reduce (fn [[a b c] [e f g]] [(conj a e) (conj b f) (conj c g)]) zipped)

16:30 mandu_: that is the point of laziness, there is really just one traversal

16:31 unless it is forced in between, it only looks like you walk it more than once, really the operations are composed

16:31 though there are of course the small lists created / unwrapped again

16:32 mandu_: okay, cool.. thanks

17:09 rhg135: one more question (for now), I don't really see the use case for a channel over a seq.

17:10 i mean i do get what they are meant for, but i don't see why you would need them

17:10 justin_smith: rhg135: if somebody gets a value from a channel, it is gone

17:10 seqs are immutible

17:10 so you can have multiple go blocks reading the same channel, only one will read a given value

17:11 rhg135: sounds like it's back to a queue

17:11 justin_smith: a channel is a nice way to use a queue

17:11 exactly

17:11 rhg135: i see

17:12 but i still don't see an use case

17:12 justin_smith: the use case is core.async

17:12 core.async is a dsl for calculating things via channels

17:13 rhg135: doesn't j.u.c already have queus

17:13 ?

17:13 justin_smith: it does

17:13 core.async is a particular abstraction over queues

17:13 similar to futures vs. threads

17:13 rhg135: just a nice wrapper?

17:14 justin_smith: well, a nice wrapper for queues with some threading / concurrency stuff mixed in I guess

17:15 BobSchack: rhg135: core.async also extends queue to clojurescript

17:15 rhg135: BobSchack, so true

17:16 i'm kind of out of ideas for making my server behave

17:17 i'm so sure it's due to my lack of understanding about java concurrency

17:17 justin_smith: what behavior do you want from it?

17:17 rhg135: normal server behavior

17:18 namely listen, aceept, respond in a new thread and close

17:18 it goes fine until the respond part

17:18 it doesn't at all

17:20 but idk it seems i'm only talking to the client on one thread

17:21 justin_smith: have you narrowed down where things break down? not responding could be caused in a bunch of different layers

17:22 rhg135: i've tried too but i seem to get different results

17:22 justin_smith: maybe try stubbing things out at different levels

17:22 so first just reply with the same string to every request - verify you can reply at all...

17:23 then stub out a layer below that, etc.

17:23 rhg135: my most recent attempt has much more seperation in that sense

17:24 i'll try that the actual json code is seperate anyway

17:24 the socket code is standalone

17:26 the code i refer to is https://bitbucket.org/rhg135/jimjure/commits/6e6451e16a57e902ebe0b70fdfec22ad056c807e#chg-src/jimjure/core.clj btw

17:29 justin_smith: rhg135: what in the code you pasted would make the server stay alive long enough to serve a second request?

17:29 it could be I am missing it

17:30 also in jim-server you create a future to start the server, but that returns immediately, and on the next line you close the server

17:30 so it won't even run once

17:30 maybe you intended to deref the future so it would block until it completed?

17:31 rhg135: justin_smith, i think the doseq in json-handler won't finish until the stream ends

17:31 justin_smith: but even so, you would want to change json-server so it looped or something

17:31 rhg135: hmm

17:31 justin_smith: rhg135: the server gets closed as soon as the future is created

17:32 you seem to in general be using futures as if they blocked until completion

17:32 rhg135: so close the socket in the same thread it runs AFTER i'm done

17:32 justin_smith: they do not

17:32 ,(future (Thread/sleep 1000000000000) :hello)

17:32 clojurebot: #<SecurityException java.lang.SecurityException: no threads please>

17:32 rhg135: justin_smith, but the server is open

17:32 justin_smith: the above will show you waht I mean in a repl

17:32 rhg135: it does accept

17:32 justin_smith: ok

17:32 rhg135: it lets you sen stuff

17:32 just no reply

17:32 justin_smith: but you are closing it regardless

17:33 you are closing server on the next line after starting the json-handler

17:33 rhg135: i understand, but it doesn't explain the behavior

17:33 justin_smith: I think it does

17:33 rovar: is there a standard function to take the last n of a sequence?

17:33 justin_smith: it tries to use the socket, socket is closed, so it cannot reply

17:34 rhg135: i thought if you stop a server it closes al lclients connected to it

17:34 justin_smith: rovar: take-last

17:34 rhg135: but i guess not

17:36 rovar: that is close, I'll take it

17:36 rhg135: justin_smith, can you specify the line as I don't see it?

17:37 justin_smith: lines 46+47 run start-server on a socket called "server"

17:37 line 48, which will likely run before the future does, closes "server"

17:37 it is inteterminite, maybe the future gets a chance to initialize first

17:38 but it is very likely to serve a request before that close runs

17:38 rhg135: justin_smith, line 48 is in the future body

17:38 justin_smith: nope

17:38 check your parens

17:38 rhg135: damn

17:38 you're right

17:38 justin_smith: my eyes are better than your editor, lol

17:38 sorry, that was uncalled for

17:38 rhg135: i feel so stupid

17:39 ofc json-handler isn't called lol

17:39 justin_smith: to be fair, seeing future called by close made me immediately suspicious, given the bug you were complaining about

17:39 rhg135: i wondered why that trace-ns call did nothing

17:39 justin_smith: s/called/followed

17:40 rhg135: i'm going to try that

17:42 mandu_: hey, justin_smith

17:42 justin_smith: yo

17:42 mandu_: i did it your way and then it struck me to do the entire thing in one "reduce"

17:42 justin_smith: cool!

17:42 mandu_: the latter is significantly faster

17:42 rhg135: i should of caught that with the rainbow-parentheses

17:43 justin_smith: rhg135: I catch many of those things by only auto-indenting and not allowing any manual indentation

17:43 rhg135: justin_smith, i was :(

17:44 i'm just bad at this

17:44 mandu_: here are the 2 listing in case anyone is interested http://pastebin.com/RTJ8QzSg

17:44 rhg135: mandu_, not lying my mouse batteries died

17:45 justin_smith: mandu_: I don't get why you use apply there

17:46 in any of the places you use it

17:46 mandu_: ah that's just my datastructure

17:46 justin_smith: you know map is varargs right?

17:47 oh, is it because your args to map are all in one sequence?

17:47 mandu_: yeah, my "values" is a vector of vectors

17:47 it's basically time series data

17:47 dates are the vector with dates

17:47 justin_smith: ahh, got it

17:47 mandu_: values are columns of data corresponding to those dates

17:48 cjfrisz: justin_smith: has map always been varargs in Clojure or am I just confusing it with the fact that reduce isn't?

17:48 justin_smith: the latter

17:48 mandu_: the second method is roughly twice as fast

17:48 so i think the first one does transverse twice

17:48 justin_smith: it at least has been varargs for a very long time

17:49 cjfrisz: I guess I just remember being frustrated the one time I wanted vararg reduce and couldn't have it

17:49 Or rather I just had to be a big boy and do it differently

17:49 justin_smith: mandu_: interesting, I wonder why it would traverse twice.

17:50 because laziness should at least allow it to traverse once

17:50 rhg135: justin_smith, still nope and trace-ns still says nothing

17:51 mandu_: <cjfrisz> clojure is making me extremely lazy and picky

17:53 cjfrisz: mandu_: I write a lot of Scheme, and it's taken lots of effort to un-Scheme-ify my Clojure code

17:53 justin_smith: rhg135: looking closer, jim-server returns a closure that would close the server, but does not invoke it

17:53 cjfrisz: Treating them as different things has made me much happier

17:53 justin_smith: in the original version you shared

17:54 mandu_: what's the main difference so far? pairs vs vectors?

17:54 justin_smith: I would imagine laziness would be the huge one

17:54 Bronsa: cjfrisz: generally when I want to reduce multiple colls i do (reduce (fn [[a b] ..) (map list a b))

17:55 cjfrisz: Bronsa: that's what I ended up doing

17:55 rhg135: justin_smith, thats kind of the point

17:55 mandu_: well i've just started clojure, haven't really "needed" laziness so far

17:55 or concurrency

17:55 hope to change that soon

17:55 cjfrisz: justin_smith: the laziness has surprisingly never bitten me

17:56 rhg135: not to close it but allow to stop the server

17:56 justin_smith: right, just saying my previous diagnosis was wrong

17:56 rhg135: similar to http-kit

17:56 cjfrisz: mandu_: actually the differences are a little hard to put my finger on right now for some reason

17:56 rhg135: returns a nullary closure

17:57 cjfrisz: Though I do kinda miss pairs

17:57 justin_smith: right. I'll repeat my earlier suggestion: start at the stage that the request first hits your code, write a string to their socket, verify that works

17:57 mandu_: for me the big difference from what little scheme i had is the datastructures and the core library

17:57 justin_smith: then go one step at a time back from the point of request to the rest of the code, mocking up and verifying that layer works

17:58 rhg135: so... ignore input for now and test if it even writes?

17:58 justin_smith: yeah

17:58 then verify at that same level that you get the input

17:58 once both those are verified, go one level deeper in your code (one level further from the code that opens the client request)

17:59 that's how I would do it at least

17:59 rhg135: i don't understand how to test the whole json stream idea

18:00 can't get it until the stream closes and then you can't write

18:00 well not print it

18:00 justin_smith: well, you break things down into pieces you can verify first, right? or keep rewriting the whole thing blindly hoping you get it right, but the latter sounds much more difficult and more likely to waste your time

18:00 mandu_: okay guys, thanks a lot

18:00 off to bed

18:09 justin_smith: rhg135: also, does the :default multimethod def for handle actually work?

18:10 rhg135: justin_smith, idk, but it's not getting called anyway yet

18:10 justin_smith: how do you know? if :action is returning nil, you write nil to the socket and close it

18:11 mandu_: btw, I'm trying to make a time series library for financial analysis and such at https://github.com/xmonkee/clj-time-series

18:12 would love any suggestions etc

18:12 justin_smith: rhg135: oh, ok, :default does work, I was not aware that worked

18:15 rhg135: another debugging technique that may help - (def debug (atom [])), then open a repl from inside the server

18:15 rhg135: hmm

18:15 justin_smith: rhg135: then conj data onto it, indicating where the data was found/ what it is, etc.

18:15 then you can investigate it from the repl

18:15 that can be more informative than printlns

18:15 rhg135: justin_smith, seems the let isn't finishing as the handler in server.clj is never run but client does exist

18:16 justin_smith: well a simple println would narrow down where it stalls

18:16 there is the classic (let [_ (println "got this far") ...] ...)

18:17 rhg135: i add a debug call in the let it runs, in the let body before the future, it doesn't

18:17 justin_smith: that's why I am suggesting inside the binding block

18:17 rhg135: yup

18:17 justin_smith: the binding block is evaluated sequentially

18:17 rhg135: but gotta go eat now

18:17 justin_smith: so you start from the top, do a binary search, see where it halted

18:18 rhg135: bbiab

18:22 deadghost: I started programming three years ago

18:23 and I still feel like I'm terrible at it

18:23 justin_smith: three years is not long for a skill like programming

18:24 hell I have been at it for nearly two decades and I am still bad at it

18:24 jared314: There was a day, years ago, where I actually felt like I knew what I was doing. That feeling passed quickly.

18:24 bbloom: decade here. yup, pretty bad at it, just like everybody else :-)

18:25 in fact, there was a time where every new thing i learned, i felt i knew less

18:25 b/c the rate of stuff i was learning was slower than the rate at which i learned of things i had yet to learn

18:25 deadghost: I don't know whether I need to read more code, write more code, read more books, concentrate on one language, learn more languages or what

18:25 possibly all of the above

18:25 bbloom: deadghost: the answer is always write more code

18:26 deadghost: b/c you'll need to learn more languages, read more libraries & other people's code, and use one language more all at the same time :-)

18:26 create goals & then just go accomplish them, or learn something failing to do so

18:27 jared314: and don't forget to pair program with other humans from time to time

18:27 bbloom: *shrug* that works for some people & not others

18:27 jared314: that's fine

18:27 deadghost: also doesn't help the only people I know who use clojure are in this channel

18:27 hyPiRion: It is not a bad idea to prepare for the journey too. Finding good books is hard, I think

18:28 deadghost: I've been trying to find a home language

18:28 since people who focus one down seem to get more done

18:28 bbloom: what is a "home" language?

18:29 deadghost: I guess one language that you primarily use

18:29 that are you proficient in

18:29 bbloom: most good coders i know have a few of those

18:30 usually it's something like choose one of python/ruby/perl + java/c++/go + clojure/haskell/scala/erlang + sql/css/html/etc

18:30 + javascript

18:30 since depresssignly, everybody needs to know js these days

18:32 deadghost: I know one guy that prefers to use js for everything

18:32 I still think he's not quite right in the head

18:32 but he gets things done with it mostly

18:34 bitemyapp: you can get things done with toothpicks and paste too.

18:34 brainproxy: it's possible to be pretty productive in js, but I think to "big things" done you end up building support for a lot of meta-programming

18:34 bbloom: javascript is proof that our entire industry is not quite right in the head

18:34 justin_smith: I think the thing with js is it is the most universal platform now

18:34 brainproxy: lockerdome.com used to be a mix of tech, but their engineering team moved all the backend code to node.js over time

18:35 deadghost: nodejs is funny

18:35 because I either totally don't get it

18:35 brainproxy: but to go "pure js" they invested a huge amount of time into some DSLs and metaprogramming stuff, of their own making

18:35 deadghost: or a huge chunk of programmers are insane

18:36 bbloom: deadghost: in short, it's a brilliant example of "worse is better"

18:36 hcumberdale: :)

18:37 Someone said once if you review your code years later and you don't think WTF!? you've made no progress :)

18:37 TEttinger: deadghost, why not both?

18:37 deadghost: my first project was a pornhub clone

18:37 and I ended up writing and finishing it

18:37 without knowing how functions worked

18:37 hcumberdale: awesome :)

18:38 deadghost: in php of course

18:38 needless to say I don't want to look at it

18:38 hcumberdale: deadghost: for yourself? or have you been charged

18:38 http://xkcd.com/844/

18:39 deadghost: personal project

18:39 hcumberdale: I like php. Well done with smarty & templates it is nice.

18:39 deadghost: then I messed around with learn python the hard way and didn't like it

18:39 and picked up k&r

18:39 hcumberdale: Such a project as job will be nice. Get money for it and have fun knowing the "business insides" :D

18:40 TEttinger: deadghost, this is pretty mind-blowing http://www.stefankrause.net/wp/?p=144

18:40 hcumberdale: don't like python too. But with extensions you can write native c in it and it gets nice again

18:40 deadghost: I'm fine with python

18:40 I just didn't like the book I used

18:40 TEttinger: on some platforms, clojurescript on node.js would outperform clojure on the jvm, it seems.

18:41 (because dalvik is not so great)

18:41 aka: I think python is great but the hoops you have to jump through when using it to server http requests is annoying

18:41 compared to php

18:42 that being said I prefer python over php and just deal with the extra work

18:43 hcumberdale: I really like php when it's done right. Most people just mixed the whole markup with the code. That's causing the bad memories

18:43 and array_a array_assoc, ...

18:43 ddima: aka: ever tried flask?

18:43 aka: yeah I think PHP is def in a better place than it was

18:44 deadghost: I haven't used enlive much but I'm liking it

18:44 it's different

18:44 aka: I don't mind PHP as much as a lot of people I know but it def lacked conventions in a lot places

18:44 func naming, arg order, etc.

18:44 hcumberdale: I've had a look at symphony, cakephp and so on but they are overkill :(

18:44 aka: ddima: I love me some flask

18:44 deadghost: django is ok but big

18:45 aka: it's what I use when building web services and sites in python

18:45 hcumberdale: deadghost: I don't like enlive because you are mixing things up again when using it. CSS selectors / Styles and page layout

18:45 aka: yep used django too but don't care for it

18:46 PHP's ecosystem is a lot better too. Composer seems nice.

18:46 ddima: aka: ok, just thought there are not very many hoops to jump through to serve, unless you mean "quick hacks" like directly embedding a little bit of code directly into your markup, which is a nono ;)

18:46 aka: http://laravel.com/ << that framework seems clean too

18:46 hcumberdale: https://github.com/kremers/clojurewebtemplate << I prefer stencil / moustache templates

18:47 ddima: code / markup seperation is generally a good idea! Mixing things may be okay in different use cases (where hiccup is also fine)

18:48 aka: ddima: yeah I meant in comparison to PHP's integration with apache. I am usually doing more advanced architectures that include caching proxies and what not but for the basic web developer I think PHP can be easier

18:49 hcumberdale: aka: do you know why heroku went away from caching proxies and why they prefer "per application / instance" caches?

18:50 aka: I also have always been the type of person that rather use PHP as the templating language rather than using another abstraction like smarty. I seperate templates of course but still just use PHP in templates

18:50 hcumberdale: For the ruby stack it's still there

18:50 deadghost: I might need to get a job soon

18:51 HN makes it sound like people will throw money at any decent dev

18:51 hcumberdale: HN?

18:51 deadghost: hackernews

18:51 justin_smith: hell, they throw money at incompetent devs too

18:51 aka: news.ycombinator.com

18:51 justin_smith: I don't think the competence / money target thing is all that strong :)

18:51 all that strong a correlation that is

18:52 hell I got a salaried job

18:52 aka: hcumberdale: I'm not sure. I don't use heroku currently. Are you referring to the rapgenius drama several months back?

18:52 hcumberdale: No, rapgenius?

18:53 aka: nm I think they use ruby

18:53 I was refering to this btw http://news.rapgenius.com/James-somers-herokus-ugly-secret-lyrics

18:54 ddima: aka: ahok, thought code-wise. yeah, mod-wsgi is slightly more complicated

18:54 logic_prog: is there a javascript tool for converting a pdf to a png? (pdf.js I thikn converts pdf to css/svg/html)

18:54 aka: logic_prog: you can output png with phantomjs I believe

18:55 logic_prog: as in pdf.js + phantom js + take a virtual screen shot?

18:55 oh shit, I'm in #clojure, not #javascript

18:55 apologies

18:55 deadghost: justin_smith, is the job market really that soft for devs?

18:55 ddima: deadghost: well, market is good right now (at least in EU, i guess US too), but competence and compensation are not always linked ;)

18:55 deadghost: since I have no degree and have really no benchmark for what qualifies as hireable

18:56 ddima: so never worked as dev?

18:56 deadghost: nope

18:56 justin_smith: deadghost: I have no post-highschool credentials and got very bad grades in highschool

18:56 I was in special ed until the saw the books I was reading in my free time

18:57 ddima: deadghost: still doable, I started and had good jobs before studying years later (and earned sh** as a student/parttime ;))

18:57 TEttinger: justin_smith, you're special, just not in that sense

18:57 hcumberdale: aka: wow. but that they haven't recognized it from the beginning. Nearly 1sec should be noticable

18:57 justin_smith: on the other hand, I had some experience with lisp family languages, and someone was ramping up clojure on their backend, so they welcomed me with open arms and I started learning clojure as fast as I could

18:57 TEttinger: thanks, I think

18:57 ddima: deadghost: just have something to show, read, know your linux and be a quick learner (you'll have to convince a little) - done ;)

18:58 justin_smith: when I say experience, I mean "hacked with it on the weekends while working in a warehouse"

18:59 ddima: justin_smith: interesting path :D

18:59 justin_smith: it was fun to be sure

18:59 TEttinger: heh, I went to sorta a special ed high school. meant for high-functioning autism kids, aspergers kids, kids with a lot of symptoms from adhd, and so on.

18:59 aka: I didn't graduate highschool or college. I just slowly built up experience. I believe the most important thing to many companies is experience/proven ability. For senior roles anyways.

18:59 hcumberdale: deadghost: you are searching for a full time position as dev? EU ?

18:59 deadghost: what kind of warehouse puts you on linux

18:59 aka: Never had issues with my lack of diploma or degree

18:59 deadghost: nope US california

18:59 justin_smith: I am just lucky I found a hobby that is somewhat rare as a skill, and lucritive

19:00 aka: justin_smith: that's exactly how I feel

19:00 justin_smith: deadghost: hell they didn't even let me use a computer in the warehouse

19:00 I was hacking on the weekend

19:00 ddima: I was into OpenVMS as a kid, but no diagnosed autism or anything ;)

19:00 aka: haha

19:00 deadghost: I wish I started earlier

19:01 but I was never introduced to programming early on

19:01 highschool had one java course that they stopped teaching after one run

19:01 taught from o reilly's headfirst java

19:01 hcumberdale: ouch

19:01 TEttinger: head injury first

19:02 justin_smith: I was introduced, but my father was a weirdo conspiracy nut who refused to get a computer, so I didn't start really programming until much later in life. Due to the "alternative school" path I didn't actually really learn to use a computer until I was in my '20s

19:02 hcumberdale: hating this books. Still seeing "Head first servlets" in my sleep. Hunting me ...

19:02 deadghost: I thought headfirst html was good

19:02 the sql and php books not so much

19:02 hcumberdale: All clojure / lisp books were pure gold compared to Head first whatever

19:03 justin_smith: http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html I like this one just for the title

19:03 ddima: it's never too late, I know mulitple people who became really good within two years full-time job, which some prior knowledge, but really juniorjunior in the beginning. Starting out as a kid doesnt necessarily help too much with complex problem solving ability and thinking. many just write small webapps or CMS in PHP or stuff like that, which doesnt go very deep. so no worries ;)

19:04 justin_smith: well, he was right, look at the NSA now! ;)

19:04 deadghost: I have a friend that's always ranting about google and the nsa

19:04 I mean

19:04 he was right

19:04 but he's still nutty

19:04 ddima: justin_smith: What I really liked (non clojure/lisp stuff) were Andrew Tanenbaums books, especially modern operating systems and skienas algorithm design manual

19:04 aka: everyone knew the NSA was spying on us... right?

19:04 I mean I just assumed they were.

19:05 ddima: aka: on the internet, yes, since the late 80s ;)

19:05 justin_smith: hell, they wouldn't even aknowledge the NSA existed, so come on

19:06 deadghost: I want to say RMS is crazy but he's kind of always right

19:06 ddima: we need people like this, but not too many

19:07 I like some of his essays (dont like his talks): https://www.gnu.org/philosophy/right-to-read

19:07 hcumberdale: RMS is super awesome :D

19:08 deadghost: I thought he just wrote one talk

19:08 and kept giving it for 20 years

19:08 ddima: He "felt" the "war on general purpose computing" in 97...

19:09 cory doctorow also has an interesting talk on that subject from the 28c3 if anyone is interested

19:09 (not looking at apple <cough>)

19:09 aka: RMS is galvenizing :D

19:10 deadghost: people would probably take him more seriously if he wasn't an overweight neckbeard

19:10 with a video of him eating something from his foot

19:10 ddima: what?

19:10 clojurebot: what is exceptions

19:10 deadghost: ddima, http://youtu.be/I25UeVXrEHQ

19:11 I think that was it

19:11 justin_smith: ddima: a classic, he was an expert witness in some court hearing iirc

19:11 and starts eating his toe fungus

19:11 or something off his toes

19:11 maybe he was keeping pieces of jerky under his toenails

19:11 ddima: deadghost: he just hides acid blotters between his toes

19:12 justin_smith: that would explain it

19:12 that would also explain emacs

19:12 ddima: hehe, well, havent seen that one so far, but still, he has done a lot

19:12 justin_smith: (as I type that into erc)

19:17 ddima: so, we learn once again: dont watch stallman, just read ;)

19:20 rads: dnolen: I have some ideas for om but I'd like to write a little about them first. where would be the best place to post them? github issue, link to a gist, wiki?

20:02 dnolen: rads: feel to free to open up a github issue to start the conversation

20:03 rads: some things are changing soon

20:03 as far as how paths are handled, and I think I have a decent solution for rendering "lists" of children

20:17 hcumberdale: How to use deftype? I don't understand it :(

20:19 No implementation of method: :dsave of protocol: ...

20:21 gfredericks: hcumberdale: might be an arity mismatch

20:28 (defprotocol I (m [_])) (deftype T [] I (m [_] 42)) (m (T.)) ;; => 42

20:38 hcumberdale: gfredericks: In all examples I find 'this' or '_' as the first parameter of every method

20:39 Isn't that bad design if there is no use for it?

20:39 justin_smith: the argument will be the thing dispatched on

20:40 decaf: (javadoc Math) opens url in swing. how can I tell it use the flippin web browser?

20:40 justin_smith: _ is a conventional name for things you don't use

20:40 decaf: your jvm is misconfigured for your OS

20:40 hcumberdale: Yeah, but for java interop I carry unused things over my interfaces

20:41 decaf: I shouldn't use that alpha stage package builder script

20:41 justin_smith: hcumberdale: someone implementing a protocol / method implementation can choose to use an inpout arg or not

20:41 _ is a clear way to indicate the value is unused and does not matter

20:42 *input

20:42 gfredericks: hcumberdale: I've used the first arg occasionally, especially if I have a defrecord and want to preserve metadata/extra-keys

20:43 (e.g., (assoc this :foo 42) rather than (->Record 42)

20:43 justin_smith: a common pattern for me is to implement a record that specializes my protocol, and use fields of the record to further specialize for each record instance

20:43 (this is in putting together a plugin system)

20:45 hcumberdale: I want an abstract datasource. For example the ability to choose filesystem or database.

20:46 technomancy: hcumberdale: using _ as the dispatch value means you're dispatching on something essentially meaningless. usually a sign that you're letting protocols dictate the arity, which means you should be using multimethods unless they're too slow for the task at hand.

20:46 hcumberdale: (defprotocol xy_storage

20:46 (dsave [_ dd])

20:46 (dload [_ dd]))

20:47 justin_smith: so the information in the individual storage instance is not useful while saving or loading?

20:47 that seems an odd design choice

20:48 why not initialize the thing that can be stored / loaded with some data that tells it how to do so?

20:48 hcumberdale: https://www.refheap.com/22240

20:48 justin_smith: I don't see why that is even a protocol, it is just a function on dd

20:49 hcumberdale: justin_smith: remembering how it would be done in java. maybe a bad idea

20:49 justin_smith: the natural thing (to me) would be to put the info for the storage directory / database connection in the type

20:49 hcumberdale: defprotocol generates an interface. This would normally be my choise/way here

20:49 justin_smith: and dd would just be the data to store or load

20:50 right

20:50 I am just saying, the thing implementing the protocol can actually store some useful information

20:50 hcumberdale: justin_smith: then I'm ending up with a tight coupled dispatching method

20:50 justin_smith: I have no idea what that means

20:50 the type still decides how to use its fields

20:50 but it may as well cary its config

20:51 *carry

20:51 hcumberdale: justin_smith: that has different downsides I think

20:51 justin_smith: if all the info for loading/storage is in dd, then you are doing all the work by hand

20:51 that the protocol / deftype could be doing for you

20:51 hcumberdale: for example the redundant information. Not both db and fs should be used.

20:51 justin_smith: right

20:52 so one type has a db field

20:52 it has its implementation of the protocol

20:52 hcumberdale: For example how I would do it in java with spring

20:52 1. Create interfaces 2. implement it n times with different logic 3. wire it up & success

20:52 justin_smith: the type should have fields appropriate for configuring that type, and the protocol implementation should use those fields in order to do its job

20:53 ok a protocol is an interface

20:53 the logic is in the protocol's type specific implementation

20:53 the configuration is in the type's fields

20:54 hcumberdale: yeah. I do not have the wiring and have to write it by myself, sure

20:54 justin_smith: otherwise you are just doing redundant work matching up the right config to the right type by hand

20:54 that is what that first arg is for

20:54 it is the thing with those config fields you would use

20:54 hcumberdale: justin_smith: seen my refheap?

20:54 justin_smith: yes

20:55 you are not using the type at all, it may as well be (Object.)

20:55 you are doing the work the system should be doing for you, by hand, by using dd

20:55 hcumberdale: yeah, understanding my issue? I want seperated functional, testable code

20:55 justin_smith: absolutely

20:56 I don't see what that has to do with this though

20:57 hcumberdale: Having the information about how to persist data in the type means that all the logic to choose different strategies belongs to the type/implementation

20:58 justin_smith: and you think that is a bad idea?

20:58 hcumberdale: Yes. That's what I learned :)

20:58 justin_smith: I don't know why you are using a type in t hat case

20:59 hcumberdale: You can't swap implementations. That is the power the interface provides

20:59 justin_smith: just write a function

20:59 you don't need types if that is the design you want

20:59 hcumberdale: justin_smith: I need defprotocol to generate an interface, right?

20:59 justin_smith: why do you need an interface?

20:59 just write a function

20:59 pass it some args

21:00 hcumberdale: hmpf.

21:00 justin_smith: protocols are for when you have a type that specializes a behavior

21:00 using a protocol but ignoring the type is silly

21:01 hcumberdale: justin_smith: that's not possible.

21:01 I "use" the type. I'm not ignoring it.

21:01 justin_smith: all you care about is which protocol specialization is attached to it

21:01 why use a type

21:01 just pick a function

21:02 hcumberdale: and how to use defprotocol and replace them by configuration?

21:02 It will result in a bunch of functions like create,read,update,delete

21:02 justin_smith: sure

21:03 hcumberdale: All implemented different for database, filesystem or whatever

21:03 and you want me to implement all of them with different names? Without protocols / interfaces?

21:05 And have a big dispatching function that resolves the right function everywhere?

21:05 justin_smith: https://www.refheap.com/22241 this is what I mean

21:05 hcumberdale: Or thousands of (if then else else else ) bricks around every persistence touching action

21:06 justin_smith: the type itself should be used

21:06 bstro9000: hey, i'm trying to understand the following line, that spits out a lazy sequence of fibonacci numbers... can anyone explain to me what the [[ a b ]] bit means? It looks like arguments to the anonymous function, but why is it wrapped in double brackets? => (def fib (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1])))

21:06 ^ clj noob here, btw.

21:06 justin_smith: bstro9000: it is destructuring

21:06 ,(let [[a b c] [1 2 3]] [b a c])

21:06 clojurebot: [2 1 3]

21:07 arrdem: (inc justin_smith)

21:07 lazybot: ⇒ 22

21:07 logic_prog: how does react/om handle which svg element is on top?

21:07 justin_smith: it mirrors the shape of the data it refers to

21:07 hcumberdale: justin_smith: that is just a configuration value passed... don't know how that should solve my problem

21:07 bstro9000: justin_smith: thanks a bunch!

21:08 that makes sense

21:08 justin_smith: hcumberdale: I thought you were complaining that the first argument to protocols was useless / bad design

21:08 I am showing how it is typically usefull

21:08 cgag: is there a way to lookup a key in a map that'll throw an exception if the key isn't there?

21:09 arrdem: cgag: you could have a (throw (Exception. "well crap")) as your alternative value...

21:09 ,(get {} :foo (throw (Exception. "FUUUUUU")))

21:09 clojurebot: #<Exception java.lang.Exception: FUUUUUU>

21:09 hcumberdale: justin_smith: agreed.

21:10 justin_smith: arrdem: you need laziness for that to work properly

21:11 cgag: arrdem: yeah that's pretty nasty though, i've got a better idea for my particular use case, was just curious

21:11 bstro9000: justin_smith: referring back to my question, what is [[a b]] destructuring to? there doesnt appear to be another vector to decompose it to, as there is in your example

21:11 cgag: justin_smith: good point

21:11 fakedrake: hello!

21:11 justin_smith: bstro9000: the argument to the function

21:12 ,(get {:a 0} :a (lazy-seq [(throw (Exception. "Not Found"))]))

21:12 clojurebot: 0

21:12 justin_smith: kind of a hack

21:12 bstro9000: justin_smith: i guess i just dont understand why the function isnt merely asking for two arguments. whats the advantage of the double brackets over single brackets in this case? (feels like i'm missing something here)

21:12 hcumberdale: What's the common way to dispatch to the different interface implementations in clojure?

21:12 justin_smith: bstro9000: because it is recursive and a function cannot return two values

21:12 bstro9000: huh! i feel like i just learned something.

21:12 fakedrake: some time ago i came across a project of which clojure was supposed to use a superset to parse the program structure. It's name was an acronym like eda or sth but I cannot remember exactly

21:13 justin_smith: fakedrake: edn

21:13 bstro9000: justin_smith: thanks again

21:13 justin_smith: np

21:13 arrdem: fakedrake: yeah it's just edn

21:13 fakedrake: edn eys! thank you

21:13 arrdem: $google clojure tools reader

21:13 lazybot: [clojure/tools.reader · GitHub] https://github.com/clojure/tools.reader

21:14 fakedrake: and there is a python implementation! what could go better?

21:15 arrdem: hehe yeah. why would you ever use json again? :P

21:15 $google javascript edn reader

21:15 lazybot: [Implementations · edn-format/edn Wiki · GitHub] https://github.com/edn-format/edn/wiki/Implementations

21:16 cjfrisz: Style question: when doing let bindings in a for, when do you use the :let in the for's binding vector vs. a let expression in its body?

21:16 Any convention on that?

21:16 arrdem: cjfrisz: the :let is provided to make your code more consise. using it is a good thing, but optional.

21:16 technomancy: cjfrisz: no real reason to ever avoid :let

21:17 cjfrisz: arrdem technomancy: that was my default, but I wanted to see if there was an implicit rule about :let bindings referring to the for's bindings

21:17 It would seem that's not the case, though

21:18 justin_smith: bstro9000: this may be better, in terms of preventing an overeaber misfire: (get {:a 0} :a (future (throw (Exception. "Not Found"))))

21:18 still feels hacky though

21:18 bstro9000: I am certain that I don't understand what you just typed. But maybe someday I will.

21:18 justin_smith: bstro9000: oops, misdirected that

21:19 arrdem: justin_smith: I don't know if that works... the future could create the exception in a different threead and then everything goes to hell

21:19 bstro9000: haha ok

21:19 justin_smith: cgag: the above was meant for you, sorry ^^

21:19 arrdem: justin_smith: useing (contains?) to force lazyness is probably the nicest way to do this...

21:20 justin_smith: arrdem: I guess there could just be an (assert (contains? ...)) too

21:20 arrdem: ,(fn griping-get [m k] (when (contains? m k) (m k) (throw (Exception. "Crap not found."))))

21:20 clojurebot: #<sandbox$eval25$griping_get__26 sandbox$eval25$griping_get__26@11b2664>

21:20 arrdem: ,(doc assert)

21:20 clojurebot: "([x] [x message]); Evaluates expr and throws an exception if it does not evaluate to logical true."

21:20 justin_smith: arrdem: when?

21:20 arrdem: maybe you want if

21:20 arrdem: justin_smit: yeah if.

21:21 meh

21:21 justin_smith: (#(do (assert (contains? % %2)) (get % %2)) {:a 0} :a)

21:21 ,(#(do (assert (contains? % %2)) (get % %2)) {:a 0} :a)

21:21 clojurebot: 0

21:22 justin_smith: ,(#(do (assert (contains? % %2)) (get % %2)) {:a 0} :b)

21:22 clojurebot: #<AssertionError java.lang.AssertionError: Assert failed: (contains? p1__101# p2__102#)>

21:22 justin_smith: too bad about the ugly macro names though

21:25 arrdem: justin_smith: eh gensyms. got a better way to name 'em?

21:27 ddellacosta: is this the best way to get CI integration w/Jenkins? https://github.com/jenkinsci/leiningen-plugin

21:28 bitemyapp: ddellacosta: jenkins lets you just write little scripts, I usually give it a directory and a leiningen command to run

21:28 hcumberdale: If some instance is defined for defprotocol, how to access it without the specific name?

21:28 bitemyapp: ddellacosta: usually just lein test for testing, lein uberjar for build artifacts.

21:29 ddellacosta: bitemyapp: yeah, that's what I was thinking initially. Maybe that's the best approach anyways...

21:29 justin_smith: ,((fn [haystack needle] (assert (contains? haystack needle)) (get haystack needle)) {:a 0} :b)

21:29 clojurebot: #<AssertionError java.lang.AssertionError: Assert failed: (contains? haystack needle)>

21:29 bitemyapp: ddellacosta: it's simple.

21:29 technomancy: ddellacosta: I'd just check a bin/test script into your repo and have jenkins run that

21:30 bin/bootstrap if it's nontrival to set up a fresh checkout, and then bin/ci if you have jenkins-specific stuff

21:30 bitemyapp: justin_smith: http://hackage.haskell.org/package/base-

21:30 ddellacosta: ^^

21:30 technomancy: that way your commands are tracked in git too.

21:30 bitemyapp: justin_smith: your haystack/needle thing reminded me of the code I just linked. I rather liked the code.

21:30 ddellacosta: technomancy: yeah, I will do a test setup and see what works--that sounds like a pretty good setup, thanks!

21:31 technomancy: having to coordinate changes in git with changes in jenkins config is a nightmare, which you get if there's anything more complex than "run bin/ci" in your jenkins config

21:31 ddellacosta: technomancy: yeah, in my past life doing RoR CI with jenkins, we had a much more complicated setup that was, as you say, a nightmare...

21:32 bitemyapp: this is probably why we don't actually do CI at my company

21:32 it's just a test server.

21:32 it doesn't check anything in or push anything.

21:32 that would require me trying to convince my coworkers to exert more discipline than they're currently wont to do.

21:33 technomancy: bitemyapp: it just logs each run off to a well-documented and accessible location?

21:33 ddellacosta: bitemyapp: I just want something that automatically runs tests in a centralized location (our team is pretty distributed) after checkins to a main branch, and notifies people/logs/all the above

21:33 bitemyapp: technomancy: we just look at the build history on Jenkins itself.

21:33 ddellacosta: that's all ours does. Triggers a run of the tests on check-in.

21:34 hcumberdale: https://www.refheap.com/22240

21:34 ddellacosta: yeah, I mean, fundamentally that's all I need...but Jenkins comes with a bunch of other stuff that could be useful to leverage

21:34 hcumberdale: do I have to use type hints ?

21:35 justin_smith: hcumberdale: you need to implment xy_storage on the my.namespace.param

21:35 right now, from what you show, it is only implemented for xy_storage, which you are not passing in

21:36 hcumberdale: but when I use something like (dsave (->xy_storage) x) I need to tell about my strategy at this point :(

21:37 justin_smith: hcumberdale: you would create the strategy when creating the xy_storage instance, yes. If you need a different strategy you make a different instance of xy_storage

21:38 hcumberdale: justin_smith: meaning all the code for all different data stores is in xy_storage?

21:38 justin_smith: is in the individual instances of xy_storage

21:39 hcumberdale: ahh okay.

21:39 justin_smith: that's why I suggested xy_storage should have fields, specializing how it stores

21:39 but you would need to add fields to the type, and use those fields in the protocol impl

21:39 as I tried to show above in my version of your paste

21:39 hcumberdale: isn't there a way to include implementations (conditional) by the reader, talking only to the interface?

21:42 justin_smith: I don't understand that question, sorry

21:42 hcumberdale: like a namespace app.storage.db and app.storage.fs ? Where I can choose what implementation is loaded from the reader?

21:43 justin_smith: example: 1 file with the db implementation for persistence

21:43 2. file with the filesystem implementation

21:43 justin_smith: how I use a protocol: the base library implments a protocol, and has functions that call methods on that protocol

21:44 the end user of the lib creates things that implement the protocol, and pass them to functions in the base lib

21:44 hcumberdale: To write an conditional include shouldn't be the problem. But how to access the methods behind.

21:45 justin_smith: it flattens out dependency loops, because all the underlying library cares about is the protocol methods it defines, it is up to the user to pass something in that will work

21:45 so for your example, the base lib just calls dsave or dload on the object passed in

21:45 the end user decides on how those are implmented

21:47 hcumberdale: justin_smith: okay. that's another way how to deal with it (inside out)

21:47 justin_smith: for the rightside out case, you don't need a protocol

21:47 the library defines a function, the end user calls it

21:47 end of story

21:47 hcumberdale: coming from java I've only know about the best practices there and how EJB3 services and so on work

22:08 cjfrisz: Hmm...how do you look at a stack trace using cider in emacs?

22:08 As in, the thing I just typed into the repl blew up and I want to look at the associated stack trace

22:12 Raynes: cjfrisz: It didn't just pop the stack trace up?

22:13 I mean, you can use (clojure.repl/pst *e) to slightly-pretty-print the stacktrace.

22:13 But it should open a buffer with the trace automatically afaik.

22:13 cjfrisz: Raynes: nope, just printed the source of the exception inline in the repl

22:13 Raynes: But then again, I haven't used Emacs since before cider was cider.

22:13 cjfrisz: Plus, I didn't see a stacktrace buffer in my buffer

22:14 Yeah, this seems to be a change with cider, because I also remember getting a stacktrace buffer automatically in nrepl

22:15 arrdem: if so it's a new change to cider. the cider version I'm running does pop an error buffer.

22:16 cjfrisz: arrdem: I'm using whatever version is on marmalade

22:17 Should I be using bleeding edge?

22:17 Is it still too early to be using cider instead of nrepl?

22:17 technomancy: cjfrisz: it says in the readme how to turn on what you want

22:17 some setq

22:18 kind of baffling that it doesn't do it for you, but whatever

22:18 cjfrisz: technomancy: Ah, yeah, forgot to go check that piece of docs

22:18 Thanks

22:18 technomancy: np. I'msure you could find it with apropos-variable too

22:18 arrdem: cjfrisz: I've heard it said here that cider is still too new to use, I haven't personally had issues with it yet.

22:19 cjfrisz: arrdem: I've mostly had good luck with it, but Stuart Sierra said he was wary via the Twitters some time back

22:20 arrdem: cjfrisz: yeah. I'm an Arch Linux user, so bleeding edge is my norm. Which also implies some willingness to fix your own tools...

22:21 s/implies/demands/g

22:21 gfredericks: I've been using cider

22:21 cjfrisz: arrdem: same here

22:21 gfredericks: the only big thing I've noticed is that `cider-restart` doesn't seem to work

22:21 arrdem: yeah can confirm that cider-restart craps out.

22:21 gfredericks: so I just cider-quit & cider-jack-in or whatever manually

22:22 arrdem: {we|I} should open a ticket...

22:22 * gfredericks still doesn't have any confidence reading the elisp

22:22 cjfrisz: arrdem: I bet we both have the same problem of "oooh, a shiny new version of a thing I use!" /me upgrades and promptly has tons of trouble

22:22 I guess they call that being an early adopter

22:22 aka sucker

22:23 arrdem: hehe. As long as I have enough of my system either cached or under version control to roll back and achieve a sane state I'm OK with some of that.

22:23 gfredericks: arrdem: I'll go open a ticket

22:23 arrdem: if you'll back me up

22:23 arrdem: gfredericks: totally.

22:25 gfredericks: arrdem: https://github.com/clojure-emacs/cider/issues/439

22:26 arrdem: gfredericks: thanks

22:27 gfredericks: phew now I don't look crazy

22:27 ...for submitting the issue at least

22:27 arrdem: haha. nice currying library btw!

22:28 I hadn't seen it before...

22:28 * arrdem stalks gfredericks some in hope of more cool crap

22:30 gdev: people ask why I like watching UFC. after reading "x language vs y language" articles all the time its nice to see things that can actually verse each other and have a clear winner at the end

22:31 arrdem: gfredericks: the qbits toolkit is hillarious. very nice.

22:31 gfredericks: arrdem: oh the readme?

22:31 and such

22:32 arrdem: thanks on both accounts

22:35 gdev: cider is just a renaming of nrepl.el right? I haven't seen a difference since the key combo for jack-in is the same

22:35 gfredericks: arrdem: the qubits was fun to write because it made OOP seem anomolously appropriate: http://hacklog.gfredericks.com/2013/07/23/object-oriented-qubits.html

22:36 gdev: I do like how it opens up the repl buffer as a split window under my current buffer instead of sending me to the single buffer view

22:38 arrdem: gfredericks: that's why I was entertained reading the README. It makes a mockery of the things that Clojure usually insulates you from.

22:38 gfredericks: the side-effecting read is still cute, abet accurate.

22:41 gfredericks: I think that might have been the only time I've had a legit use for coordinated updates w/ refs

22:55 gdev: rhg135, okay I just found it. it's C-c M-p

22:57 rhg135: whaa

22:57 gdev, what did I do?

22:58 Clome: i heard something about UFC, shits going down on 29th

22:59 gdev: rhg135, were you asking earlier today how to put a form in the repl buffer?

23:00 rhg135: i don't even use emacs, gdev

23:00 gdev: rhg135, so that's a no

23:00 rhg135: gdev, nope lol

23:00 gdev: well shit now I need to read the logs

23:02 oh and of course, lgs32a isn't even online now

23:02 that's who was asking

23:03 technomancy: who's looking for a library name? https://www.adafruit.com/blog/2013/12/24/turbo-encabulator/

23:03 justin_smith: mmm, turbo enchiladas sound yummy

23:05 gdev: technomancy, cool, now I just need a library

23:40 rhg135: well now the handlers do run but after the client closes the sockets

23:44 ok this is weird af

23:45 now it's running in real time and i get it in my log, but it's not writing to my socket

23:59 https://bitbucket.org/rhg135/jimjure/src/f27e70281846513c7170246e4b89246030704e9a/src/jimjure/json.clj?at=dev#cl-18 isn't doing anything

Logging service provided by n01se.net