#clojure log - Aug 28 2012

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

0:00 tomoj: cjfrisz: had you learned well most of the set of manipulation commands?

0:00 cjfrisz: tomoj: Oh yes

0:00 tomoj: I slurped and barfed with the rest of them

0:00 Wait, I think that came out wrong...

0:01 tomoj: huh, that you hadn't is the only explanation I could think of

0:01 cjfrisz: I mean, I've been thinking I should try it again to remind myself

0:01 TimMc: cjfrisz: Did you ever use paredit-convolute-sexp ? :-)

0:01 That command is baller.

0:01 cjfrisz: TimMc: I'm not sure

0:01 TimMc: Maybe not

0:01 What's it do?

0:01 TimMc: That's for reversing the nesting of e.g. an if and a let.

0:02 Frozenlock: I'm stuck. I have a 5 line function to write to the console and it doesn't work. :-( https://www.refheap.com/paste/4670

0:03 TimMc: (let [foo bar] (if a b| c)) -> (if a b (let [foo bar]| c))

0:03 ivan: Frozenlock: maybe it needs .-keyCode

0:03 cjfrisz: Ahhh

0:03 Hadn't learned that one

0:03 TimMc: It's like transpose, but with parent-child relationships.

0:03 cjfrisz: That might make it worth my while to give paredit another shot

0:03 Frozenlock: ivan: No I tried it also. Btw, what is the '-' for?

0:04 TimMc: I suspect paredit becomes even more useful if you define your own macros.

0:04 ivan: property instead of method call, but I forgot the rules

0:04 so, any error?

0:05 Frozenlock: No, but it doesn't print anything in the log.

0:05 tomoj: what is dom/log ?

0:05 Frozenlock: clojure.browser.dom/log

0:05 cjfrisz: I've been in a quandary lately about the "programming my editor" business

0:06 Frozenlock: To print in the console.

0:06 cjfrisz: I used to do it quite a bit, but then I found a mentor who takes a very minimal approach

0:06 Frozenlock: And [goog.events :as events] [goog.events.KeyHandler :as KeyHandler]

0:06 tomoj: oh, I hadn't even noticed clojure.browser.{event,dom}

0:06 ivan: cjfrisz: you can stop programming your editor by using IDEA and fixing La Clojure ;)

0:06 cshell: Have you guys seen JSFiddle? http://jsfiddle.net/ - It looks like a better HTML/JS version of pastebin

0:07 cjfrisz: Wat

0:07 What is that?

0:07 TimMc: cjfrisz: That, and I am gunshy of customization these days.

0:07 ivan: IDEA is JetBrains' IDE and La Clojure is the Clojure plugin for it

0:08 cshell: I've been thinking of helping out with LaClojure, but the IDEA plugin documentation is horrendous

0:08 however, there are a lot of good features in LaClojure

0:11 uvtc: How can I produce a loop such that one of the bindings in it cycles through some particular vector of values?

0:12 cshell: ,(for [x ["a" "b" "c"]] x)

0:12 ?

0:12 clojurebot: ("a" "b" "c")

0:12 casion: uvtc: (cycle) doesnt work?

0:13 uvtc: From inside the loop, I want to be able to call `recur` and get the *next one*.

0:13 casion: ah

0:13 cshell: ,(doc cycle)

0:13 clojurebot: "([coll]); Returns a lazy (infinite!) sequence of repetitions of the items in coll."

0:13 cshell: that's cool

0:13 casion: you could just do (next cyclevar)

0:13 I think?

0:13 uvtc: Yes, it seems like `cycle` would be involved ... but I'm not sure how to incorporate it.

0:13 casion: and past that in the recursion call

0:13 pass*

0:14 tomoj: (loop [[head & tail] (cycle [1 2 3])] (recur tail))

0:18 amalloy: tomoj's solution seems clearly pretty good, but there's probably a simpler approach to uvtc's problem that doesn't involve loop

0:19 uvtc: In my loop there's a collection that I'm paring down each time through, a data structure I'm building up, then a third item which I want to take on values in that cycle.

0:19 casion: (loop [x (cycle [1 2 3])] (recur (rest x))) works for me

0:20 amalloy: uvtc: so isn't it a reduce, or a reductions?

0:20 every time i try to use reductions it turns out manual recursion is simpler, though, so maybe loop isn't the worst idea ever

0:21 * uvtc still trying out tomoj's suggestion ...

0:21 uvtc: amalloy: will also see if I can use reduce.

0:22 tomoj: can you do reductions with a reducer?

0:23 amalloy: tomoj: i think that's just a transformation

0:24 well, maybe not

0:25 tomoj: say (= (reduce __ [1 2 3 4]) [1 3 6 10])

0:25 amalloy: tomoj: you can easily do that much

0:26 but i'm not sure how you can *use* the reductions like you could use a lazy-seq reduction, eg to stop when the total is >= 40

0:26 tomoj: so it should be (= (reduce __ (__ [1 2 3 4])) [1 3 6 10]) ?

0:27 (reduce + (__ [1 2 3 4])) I guess?

0:28 oh, duh, filling in the reducef above is trivial

0:29 I wish defcurried and friends weren't private in jvm land

0:29 in cljs they seem to be available without even requiring anything

0:35 TheBusby: any decent IRC bots publicly available in Clojure?

0:35 amalloy: $whatis source

0:35 lazybot: source is http://github.com/flatland/lazybot

0:35 TheBusby: amalloy: thank you!

0:36 amalloy: ~source

0:36 clojurebot: source is http://github.com/hiredman/clojurebot/tree/master

0:46 tomoj: curried ops are sometimes hard to make :(

0:46 partition for example

0:47 I guess in cases like that you just drop the currying and require partial

0:50 Sgeo: hmm

0:51 uvtc: amalloy, tomoj : Thanks for the help. This is what I came up with : https://gist.github.com/3495031 . It works.

0:52 casion: uvtc: thanks for posting the result

0:52 uvtc: Y/w. I'm not sure if it's the most elegant way to do it though.

0:53 casion: I'm working on something very similar

0:54 Sgeo: Giving the existence of partition, maybe I shouldn't complain that it's harder to write macros that take vectors with an even number of stuff over macros that group each pair of things

0:55 uvtc: casion: that code is just an extract of the program I'm working on. I'd actually like to take more care in selecting which student gets assigned to the current teacher (rather than just taking the first one).

0:56 But I tried to boil down the problem in order to get feedback on the best way to do that cycling through the teachers bit.

0:56 *to do that "cycling through the teachers" bit. :)

0:57 casion: uvtc: I'm pairing 2 collections so that with your example data I'd end up with [[A [ ad g j]] [B [b e h]] [C [c f i]]]

0:57 tomoj: (->> students (map #(array-map %1 #{%2}) (cycle teachers)) (apply merge-with clojure.set/union))

0:57 casion: mistype, no quotes, but you get the idea

0:57 tomoj: maybe there is an even better way?

0:58 in any case I think amalloy was right about loop :)

0:58 francis: Could someon point me to a good java irc channel?

0:59 samrat: having trouble understanding wison's maze(Clojure Programming)- https://gist.github.com/792959#L14. (keys paths) gives only either the x or the y coordinate, right?

0:59 Wilson*

0:59 tomoj: uvtc: oh, that wasn't the real problem, so maybe loop is still good for you?

1:01 uvtc: tomoj: Well, given the current teacher we're on, I'd *like* to pick a student, compute a score on how well they mesh with the student-pool so far, and if it's a bad fit, randomly choose another student...

1:02 tomoj: sounds loopy to me

1:02 uvtc: So, if the resulting group gets a negative score, choose another student. But if the resulting group gets zero or positive score, keep that student there and move on.

1:02 Yeah, kinda' crazy, but ...

1:02 ;)

1:02 tomoj: I mean (loop [])-y

1:02 uvtc: tomoj: That's what I thought too.

1:02 :)

1:02 Sounds `loop`y.

1:02 amalloy: francis: /join ##java

1:03 francis: amalloy: thanks

1:04 uvtc: tomoj: But, again, I was trying to boil it down to figure out how to do that cycling with the loop (and thanks for that `[head & tail]` suggestion, tomoj).

1:07 (Gah, in my above comment, I *meant* "see how they mesh with the students already assigned to that teacher". Sorry.

1:07 )

1:07 clojurebot: ) is http://xkcd.com/224/

1:08 uvtc: clojurebot, hah. Elegant weapons, for a more ... civilized age. http://xkcd.com/297/

1:08 clojurebot: make a note of http://scienceblogs.com/goodmath/2006/11/the_c_is_efficient_language_fa.php it is yet another article about picking c or c++ for performance being naive

1:09 uvtc: Always has to get in the last word.

1:12 Sgeo: Would choosing Common Lisp for performance be sensible or naive?

1:12 casion: compared to what, in what context?

1:12 on what architecture?

1:12 etc..

1:13 uvtc: ~performance

1:13 clojurebot: http://clojure.org/java_interop#toc46

1:13 Sgeo: I think I may be reluctant to consider the JVM to be "fast"

1:14 frio: er?

1:14 clojurebot: so I don't see where my understanding of 'do' is wrong. I have looked at the special forms page on clojure.org, but the explanation of 'do' is very short and it seems that my usage of it should be ok in this situation

1:14 uvtc: (Hm. I was just guessing clojurebot would share some wisdom on performance there. :) )

1:14 frio: the JVM is very fast

1:14 it's slow to start, admittedly, but it's widely regarded as being one of the fastest runtime environments

1:15 casion: jvm is quite fast

1:15 and usually faster than CL

1:15 though sometimes not

1:16 Sgeo: clojurebot, what situation?

1:16 clojurebot: excusez-moi

1:16 Sgeo: Is clojurebot sometimes human controlled?

1:16 Or was it just being weird?

1:16 frio: no :p

1:16 it's just reading quotes, iirc

1:16 Sgeo: Now I'm curious what situation that person was referring to

1:16 frio: haha :)

1:17 Sgeo: (Also, is there a Clojure equivalent to prog1?)

1:17 uvtc: Clojurebot wishes it to be known that one should not meddle in the affairs of wizards ... or clojurebots.

1:18 Sgeo: clojuredocs is horrible. If I search for do, do is nowhere to be seen on the results page

1:19 uvtc: Sgeo: check the cheatsheet (under "special forms")

1:19 Sgeo: I know what it does, I wish clojuredocs search wasn't horrible.

1:24 tomoj: amalloy: https://gist.github.com/543a721f0f44cf48459d

1:25 maybe it can be folded too?

1:25 Sgeo: And I still want a prog1

1:27 tomoj: does the clhs description of prog2 contain a typo? http://clhs.lisp.se/Body/m_prog1c.htm

1:28 emezeske: Sgeo: As a workaround, you can search for ^do$

1:28 Sgeo: It is unfortunate that a direct match isn't ranked higher without that though

1:29 Sgeo: tomoj, yeah. I don't think any implementation does it like tha

1:29 that

1:33 I wonder if I should try to make a wrapper around some quantum random library

1:34 Would be interesting practice

1:35 uvtc: Oh, amalloy , thanks for posting that gist the other day re. the change counting function. :) Instructive.

1:38 amalloy: instructive is what i usually aim for. glad you found it useful

1:40 Sgeo: Would using with-redefs to make a macro to use a difference source of randomness for things such as shuffle be an abuse of with-redefs?

1:40 (Rather than me rewriting shuffle)

1:54 emezeske: Sgeo: I don't think with-redefs is recommended for use in non-test code

1:54 Sgeo: It affects the Vars it swaps in all threads, which could cause some very weird things to happen

1:54 Depending on your circumstances

1:55 Probably the general tradeoffs about monkey-patching apply.

2:24 Sgeo: I wish I could (time lein repl) to see how bad it is

2:26 mk: Sgeo: startup?

2:27 Sgeo: Yeah

2:27 emezeske: $ time lein repl <<< exit

2:27 lazybot: emezeske: The time is now 2012-08-28T06:25:27Z

2:28 emezeske: lazybot: Thanks, but I think you may have missed the point :P

2:28 mk: you can probably manually time it

2:28 emezeske: Sgeo: ^

2:28 mk: what emezeske said

2:29 Sgeo: I'm on Windows

2:29 emezeske: I'd like to give Windows the benefit of the doubt and assume there's an equivalent shell command

2:29 But I'm wary of giving Windows too much credit

2:30 mk: Sgeo: google shell script system time. Then use a shell script to start lein repl up on a program that prints system time

2:32 presumably this would add some overhead due to having to load that program

3:42 kral: namaste

5:59 augustl: is it possible to force a snapshot dependency download in leiningen?

6:01 xeqi: lein -U

6:05 augustl: xeqi: "Wrong number of arguments to [with-profile update,dev,user,default] task. " :)

6:06 updated to latest leiningen version, works just fine now

6:06 oh nvm, still not working..

6:11 xeqi: augustl: are you giving it a task?

6:12 `lein -U deps` for examp

6:13 augustl: xeqi: ah

7:08 ro_st: Raynes: any idea how i can get noir's code reloading to also pick up code in ./checkouts/* ?

7:08 i already have (server/add-middleware reload/wrap-reload ["checkouts/Core/src"]) but it has no effect

7:10 oh wait, that probably stops it from reloading in src

7:15 wjc: Hi

7:16 in cljs, I'd like sql results to be seqable. I tried to extend-type js/SQLResultSetRowList, but that returns a reference error

7:17 what should I be trying to extend?

7:45 augustl: hmm, lein deploy: "java.lang.String cannot be cast to clojure.lang.IPersistentCollection"

7:47 hyPiRion: augustl: some of the data you have in project.clj is most likely a string instead of a vector

7:48 augustl: doesn't seem like it

7:48 the only thing I changed lately is the leiningen version, I'm pretty sure the previous version I had worked fine

7:49 jweiss: is require+refer now preferred over use?

7:50 augustl: the leiningen error seems to now happen for all projects

7:50 cemerick: augustl: can you paste the exception?

7:50 er, stack trace?

7:51 augustl: there is no exception

7:51 stack trace* :)

7:51 hyPiRion: jweiss: yes

7:51 cemerick: it's just the message?

7:51 augustl: cemerick: yes

7:51 cemerick: :-/

7:51 augustl: status code 1

7:51 exit code, I mean

7:51 hyPiRion: (:require lib :refer :all) == (:use lib)

7:52 cemerick: augustl: what repo are you trying to deploy to?

7:52 augustl: is there a way to downgrade leiningen to the latest "stable"?

7:52 cemerick: my own nexus

7:53 cemerick: augustl: can you paste your project.clj?

7:53 augustl: cemerick: nothing has changed in my project.clj :)

7:53 cemerick: I know, I know. :-)

7:53 I have a theory.

7:53 augustl: sure, https://www.refheap.com/paste/4676

7:54 cemerick: augustl: replace those repo URL strings with {:url "http://…"}

7:54 augustl: really? ><

7:54 not even a deprecation warning, that kind of sucks..

7:54 cemerick: If that works, it's a bug.

7:54 augustl: ah, that's good

7:55 jsabeaudry: also, cheshire 4.0.1 is out

7:55 augustl: cemerick: works fine with {:url foo} instead of just fo

7:56 jsabeaudry: doesn't 4.0.0 actually mean 4.0.0 or newer in maven speak?

7:56 cemerick: augustl: Good. (Not good, but you know what I mean.) File a bug, include your project.clj, and say "it looks like the repository values aren't being normalized to maps when they're supposed to be"

7:57 technomancy_'s gonna facepalm ;-)

7:57 augustl: cemerick: great, will do

8:00 jsabeaudry: augustl, I'm not familiar with maven, plugins like lei-outdated lead me to beleive that when you write 4.0.0 it is 4.0.0

8:00 lein-outdated*

8:01 augustl: I recall reading an article about maven version numbers working like that

8:01 but I'm not sure, and for all I know leiningen fixes it

8:02 clgv: jsabeaudry: nope you have to specify a range instead of an exact number

8:02 jsabeaudry: as far as I remember you can do something like "[4.0.0,)" to have an open range

8:03 augustl: I do have 4.0.1 in my ~/.m2 and none of my projects have 4.0.1 specified

8:03 xeqi: augustl: "4.0.0" means I'd like 4.0.0, but I'll accept any version

8:04 so if something else has a hard requirement or version range maven/aether/lein uses that instead of 4.0.0

8:04 jsabeaudry: That is very interesting, so from day to another my project can break without me changing any file

8:04 hyPiRion: And "[4.0.0]" means I'd only accept 4.0.0, as far as I understand.

8:04 xeqi: hyPiRion: yep

8:06 jsabeaudry: if a transative dependency uses a version range including a version that is not out yet then yes, it could break

8:07 clgv: xeqi: are you sure? usually leiningen gets the exact version you specified if you refrain from using ranges

8:08 well at least lein 1.x did always get what was specified

8:08 xeqi: clgv: if you don't have any ranges in the entire dep tree then yes, it grabs the soft versions based on range to root

8:08 and really, if the version range over laps with the soft dependencies

8:09 this is all hand wavy for quick summary on irc

8:09 clgv: there should be info in leiningen's documentation about that for non-maven devs ^^

8:12 cemerick: clgv: the same things applied in lein 1.x

8:13 clgv: cemerick: humm never encountered them and never read about the issue

8:13 cemerick: nevertheless :-)

8:15 xeqi: clgv: the ecosystem, in general, has chosen to use soft dependencies so its not a common occurance

8:15 cemerick: xeqi: you make it sound like more than 25 people know that "2.0" doesn't mean "[2.0]"

8:16 xeqi: ...

8:16 clgv: cemerick: "20 people" would have been the better choice for that post ;)

8:16 xeqi: maven has chosen to use soft dependencies by default so its not a common occurance

8:16 cemerick: or, maybe, '"[2.0]" when I want 2.0, and 2.1 when that comes out next week'

8:17 huh

8:17 (I thought you were talking about Clojure-land.)

8:18 clgv: who? me?

8:18 cemerick: A number of people that I know that know Maven _very_ well say things like "if you're not using version ranges correctly, you're not using Maven correctly"

8:18 jsabeaudry: I'm so confused.

8:18 cemerick: clgv: no, I'm just generalizing :-)

8:19 hyPiRion: Project management isn't a solved problem, heh.

8:20 clgv: that's just dependency management I guess - but your sentence probably applies as well ^^

8:20 cemerick: Not by a long shot. Probably won't ever be, insofar as different use cases often require entirely unreconcilable semantics.

8:37 gfredericks: I'm having trouble getting CLJS dependencies included in my output JS

8:37 I'm using lein checkouts but hopefully that doesn't make a difference

8:39 I have a single namespace in my own project, from which I require namespaces in the other projects. My code shows up in the built JS file but none of the other code does

8:40 and in the browser it fails on the goog.require statements from my namespace

9:04 jweiss: for the reader literals, will clojure automatically load the namespace from the classpath (the vars that are the values in data_readers.clj)?

9:05 S11001001: jweiss: I would hope not, but I don't know

9:05 gfredericks: I believe not

9:06 I think I ran into that problem when using them

9:08 jweiss: gfredericks: so how are you supposed to load those functions then?

9:08 the namespaces that need them have to load them themselves? that doesn't seem right either

9:09 gfredericks: jweiss: if you're depending on the functionality of a data reader then you should know to load the namespaces, I suppose

9:09 jweiss: for one of the major features of clojure1.4 the docs are basically non-existent :)

9:09 XPherior: Is there a way to block until (run-jetty) actually fully launches its server?

9:09 My tests begin before the server can finish getting up.

9:10 S11001001: jweiss: I think it's caring-proportional (i.e. only those who care enough to hunt down the details should be handed the keys to the feature)

9:10 jweiss: S11001001: i do care, and i've been hunting :)

9:10 XPherior: Oh. That's what :join? does, doesn't it..

9:10 gfredericks: S11001001: does "hunt down" refer to requiring namespaces or googling for docs?

9:11 jweiss: i think he meant googling for docs

9:11 gfredericks: XPherior: :join? determines if it blocks or not

9:11 S11001001: gfredericks: as jweiss says

9:11 I would really hate it if they auto-required nses

9:11 jweiss: which i did, and there's really nothing beyond the release note that i could find after 10 minutes of searching

9:11 XPherior: gfredericks: Makes sense. So calling (run-jetty #'app {:join? true}) should do the trick, I suppose.

9:11 gfredericks: XPherior: I think that's the default behavior

9:12 XPherior: gfredericks: Hm.. I'm always so clumsy with new web frameworks.

9:13 gfredericks: XPherior: I've always been able to use :join? false to start the server in another thread and haven't had an issue

9:13 XPherior: gfredericks: Yeah, this would be the opposite issue.

9:14 Oh, ha. This is my problem. After my tests finishes, the server is still hanging around.

9:14 gfredericks: XPherior: you're using clojure.test? fixtures are great for that

9:15 (defn wrap-with-server [test-func] (let [server (start-server)] (try (test-func) (finally (.stop server)))))

9:15 XPherior: gfredericks: Midje. But should be all the same.

9:15 Sweet. I will definitely use that.

9:17 gfredericks: ah ha; lein-classpath suggests that src-cljs from the deps doesn't make it to the classpath

9:17 how do I make that happen?

9:31 * gfredericks starts upgrading to lein2

9:43 duck1123: gfredericks: Are you just now trying lein2 for the first time?

9:43 gfredericks: no I'm just now trying to use it consistently

9:44 duck1123: ahh, ok. I found that hard to believe otherwise

9:45 gfredericks: I default to avoiding new things.

9:45 wmealing_: new things are hard

9:46 duck1123: I love new things. Give me something fun to play with

9:48 gfredericks: old things are not fun?

9:49 duck1123: old things, or old to me?

9:50 gfredericks: old to you

9:51 duck1123: old things can be fun, but it's not like that rush of learning or exploring something new

9:52 gfredericks: I consider that the least comfortable part; when I don't know what's going on

9:52 only when the thing is old does the rush come :) "Hey now I really know how to use this..."

9:54 * ToxicFrog hands SHODAN part 45m/dEX

9:55 gfredericks: even when explicitly adding the checkouts/*/src-cljs to the classpath the compiler still silently ignores them :/

9:56 clgv: that's mean!

9:57 ro_st: what are you trying to do, gfredericks?

9:58 and with which version of lein?

9:59 gfredericks: ro_st: just upgraded to lein2; I'm trying to use cljs deps in /checkouts

10:00 ro_st: so you have cljs projects in checkouts and you want to compile cljs namespaces from there as though they were in the containing project?

10:01 dgrnbrg: Is there a place to register to give unconj talks for this year's conj?

10:02 ro_st: i'd put an issue on github for cljsbuild, gfredericks

10:02 gfredericks: ro_st: yes

10:02 okay. I will do that.

10:03 ro_st: i'm using crossovers from a checkout just fine

10:06 ohpauleez: dgrnbrg: Usually the list opens up at the conj itself on the first day

10:07 ro_st: ohpauleez: :-)

10:07 did you see i fixed the demo up?

10:08 ohpauleez: ro_st: I just got settled from all of my traveling/moving - the demo totally works?!

10:08 ro_st: totally works now

10:08 ohpauleez: That's awesome! Thanks so much!

10:08 ro_st: i should inform creighton as well

10:08 ohpauleez: Do you mind if I link to it and mention it in the Clojure mailing list when I announce Shoreleave

10:09 ro_st: that's why i built it :-)

10:10 ohpauleez: ro_st: Awesome

10:10 dgrnbrg: ohpauleez: thanks!

10:14 magopian: ro_st: what demo are you talking about?

10:14 ro_st: why, i thought someone would never ask :-)

10:15 https://github.com/robert-stuttaford/demo-enfocus-pubsub-remote/

10:17 magopian: ro_st: ;)

10:18 ro_st: mmm, it's like chinese to me !

10:18 ro_st: haha oh dear

10:18 bOR_: hmm. getting an integer-or-mark-p, nil error when I'm trying to type in the nrepl buffer (its not showing a prompt in emacs23).

10:19 anyone knows what I am doing wrong? (leiningen, nrepl beta9, nrepl.el

10:19 magopian: ro_st: well, i'm just a clojure noob, you know ;)

10:19 ro_st: you do any html/js work?

10:20 maybe with some php or ruby or python on the back?

10:21 magopian: ro_st: i'm a web dev (django atm)

10:21 bOR_: ah. found it. have to open a valid .clj file before nrepl works

10:22 ro_st: then you have enough background to grok that demo

10:22 magopian: i understand pubsub, but not enfocus, remotes, and i only vaguely know what is cljs for the moment ;)

10:22 ro_st: cljs is clojure compiled down to javascript. so it's loading a minified js app into the page, and running it

10:23 magopian: yup, i groked that ;)

10:23 ro_st: that app uses enfocus to render views with html templating and listen for user events

10:23 magopian: noir is clojure's most known web framework i believe

10:23 ro_st: remotes to encapsulate calls to the server-side clojure code (in noir, in this demo)

10:23 magopian: (i've just finished viewing bodil stokke's talk, awesome ;

10:24 ro_st: and pubsub (in the cljs) to bind the ui (views and event handlers) to the 'model', which in this case is just the remotes

10:24 magopian: ok ;)

10:24 ro_st: looks nice ;)

10:24 ro_st: i suggest reading through all the code, and then getting it running and interacting with it, watching the network and console in chrome dev tools

10:24 you'll pick it up quickly

10:25 magopian: sure ;)

10:25 ro_st: src-cljs folder: all runs in js in the browser. src folder: runs on the server in on top of noir

10:25 boom-chicka-pow.

10:26 feel free to ask q's etc

10:30 managed to get code-reloading with ring working with checkouts. damned handy

10:31 magopian: ro_st: i will ask, as soon as i get around to try it ;)

10:31 mmm, i've just finished applying for job positions at kodowa and relevance

10:31 as a clojure noob, i'm not sure yet if that is brave, useless, or full stupid

10:32 duck1123: magopian: are you in range of those companies, or are you just looking for a clojure job and don't care where?

10:34 magopian: duck1123: in range, you mean "close to, geographically" ?

10:34 duck1123: I was really hoping I could find something in my area when I was last looking. There are some good clojure jobs out there, but I didn't want to have to leave the state

10:34 magopian: yes

10:34 magopian: i'm from france, so no

10:34 jamiltron: Is there a function that given two (or more vectors) applies a function requiring the first element of both, then the second element of both, etc. without needing to do something like (map (apply (partition (interleave … ?

10:34 magopian: i won't mind moving, if i have to

10:34 but for relevance, it seems they have remote employees

10:35 i've worked remotely for two years now, and i just love it

10:35 gfredericks: jamiltron: sounds like map

10:35 magopian: jamiltron: just "map" is enough

10:36 &(map vector [1 2 3] [4 5 6])

10:36 lazybot: ⇒ ([1 4] [2 5] [3 6])

10:36 gfredericks: ,(map hash-set [1 2 3] [:a :b :c] [[] [[]] [[[]]]])

10:36 clojurebot: (#{1 [] :a} #{[[]] 2 :b} #{3 :c [[[]]]})

10:36 jamiltron: Ah, thanks!

10:36 I guess I never checked the docs for map and just assumed it would only take one coll.

10:37 magopian: jamiltron: if you're learning to program in clojure (like i am ;), i highly recommend reading through http://java.ociweb.com/mark/clojure/article.html and playing with 4clojure.org ;)

10:37 sorry, 4clojure.com

10:38 it's both fun and challenging

10:38 some of the problems just made my brain hurt ;)

10:38 clgv: magopian: I would setup a dev environment and use that instead of 4clojure ^^

10:39 magopian: clgv: well, i will, eventually ;)

10:39 for now, my dev environment is the LT playground :D

10:39 scriptor: that's perfectly fine

10:39 jamiltron: magopian: Thanks - I've used Clojure off and on here and there and have worked through some of 4clojure. It's just that Haskell is my default functional language and map in haskell is a function taking a single list.

10:39 I guess I should have checked the docs to compare differences.

10:39 clgv: magopian: uuuh somehow I interpolated tryclojure website into your post - but its not in there on second read ;)

10:39 magopian: mmm, clojure is my first "real" functional language (by real, i mean "other than scheme i used at school")

10:40 clgv: ;)

10:40 clgv: it was my first "dev environment" to be honest, but now that i have the playground, ...

10:40 well, let's put it that way: tryclojure isn't as attractive as it once was :)

10:42 bOR_: jamiltron: I tend to use (source nameoffunction) rather than (doc nameoffunction). You get to see both the doc, and the source code of the function

10:42 helps me understand what it is doing underneath :-)

10:42 for (source function) to work, you might need to load clojure.repl though.

10:43 jamiltron: bOR_: That's a great suggestion. The only reason I know Haskell somewhat ok is because I read the source of the main list library.

10:43 bOR_: &(source source)

10:43 lazybot: java.lang.RuntimeException: Unable to resolve symbol: source in this context

10:43 bOR_: ,(source source)

10:43 clojurebot: Source not found

10:44 clgv: clojurebot has no sources. they have to be present as sourcefiles

10:44 bOR_: ,(source frequencies)

10:44 clojurebot: Source not found

10:44 bOR_: noticing that.

10:45 has anyone run into trouble trying to get nrepl + nrepl.el to load incanter libraries?

10:45 I can load core and stats, but not charts

10:45 clgv: that's weird.

10:45 bOR_: what's the error?

10:46 bOR_: testing now

10:47 so, no errors or problems when I load incanter in the repl prompt (lein repl)

10:47 (or when I draw a chart)

10:48 java.io.FileNotFoundException: Could not locate incanter/charts__init.class or incanter/charts.clj on classpath: (NO_SOURCE_FILE:0)

10:48 and that one after I nrepl-jack-in into emacs and do a (use '(incanter core stats charts))

10:49 nrepl.middleware.interruptible_eval$run_next

10:51 clgv: bOR_: do you have the complete incanter as dependency or only incanter-core?

10:51 algernon: ro_st: that demo is awesome

10:51 bOR_: incanter core, charts, io, pdf

10:51 jamiltron: gfredericks: magopian: Thanks for the hint to use map, cleaned up my code very nicely.

10:51 bOR_: weird thing is. If I start a lein repl in the project library, and do (use '(incanter core stats charts)) in there

10:51 clgv: bOR_: sure? and incanter-charts.jar is on your classpath?

10:52 michaelr`: hello

10:52 ro_st: algernon: thanks! i'm keen to expand on it. any areas you think would be good to do that?

10:52 bOR_: then I can do (view (xy-plot)) in the repl in the emacs (which I connected to with M-x nrepl)

10:52 I'll check for nrepl-jack-in what is in the classpath.

10:53 magopian: jamiltron: you're welcome! i believe it's the first time i can actually provide a (correct ;) answer to someone here :)

10:53 clgv: bOR_: core and stats are namespaces of incanter-core.jar. so it sounds pretty much like incanter-charts.jar is not on your classpath

10:54 bOR_: you are right for when I do nrepl-jack-in

10:54 algernon: ro_st: not sure yet, I just had a quick glimpse. I'll have a closer look as soon as I have some more clojure-time

10:54 bOR_: there is no charts on the classpath then

10:55 ro_st: cool

10:55 bOR_: I'm not sure why not though, as it is in the project file, and it is available to me when I do lein repl in the project directory.

10:56 clgv: bOR_: maybe you need to restart the nrepl-server? I dont know any specifics of nrepl.el

10:56 algernon: ro_st: timbre is a very nice touch in the demo by the way :)

10:57 clgv: bOR_: could be that you added charts as dep when the nrepl-server was already running

10:57 ro_st: -grin-

10:58 still need to 'solve' logging

10:58 abalone: ro_st: can i ask what you're demo-ing?

10:58 ro_st: the integration of the four elements to make a whole: enfocus, pubsub, remotes, crossovers

10:59 bOR_: clgv: hmm. then it should be something that is happening automatically. I now just put the whole incanter as a dependency in my projects.clj, and it is still only core and stats loading

10:59 abalone: ro_or: where is the demo?

10:59 ro_st: https://github.com/robert-stuttaford/demo-enfocus-pubsub-remote/

11:00 abalone: oops s/ro_or/ro_st sorry

11:01 bOR_: clgv: I'll send a message to nrepl.el maintainer.

11:02 magopian: ro_or looks like a funny smiley ;)

11:02 clgv: bOR_: did you restart the nrepl server? or is that the usual workflow for nrepl.el?

11:03 bOR_: I never start it. I just open my src/projectname/core.clj file in emacs and do a nrepl-jack-in

11:04 clgv: bOR_: in CCW I have to restart the repl when I added a new dependency. it's also using nrepl

11:05 bOR_: how does restarting work? is it a command?

11:06 clgv: bOR_: no idea what it is in nrepl.el or if you have to do it. check its docs

11:06 bOR_: will do.

11:07 clgv: ro_st: uhh, that cljs stuff explodes with warnings ...

11:08 ro_st: yay

11:08 my evil plan has come to fruition

11:09 when building, or when running in the browser?

11:13 clgv: ro_st: when building ^^

11:14 ro_st: your demo is currently only "adding items" - or does my browser hide something?

11:16 ro_st: in the browser, you should see 3 items listed

11:16 clicking add item should add more, once per click

11:17 you probably saw lots of WARNINGs?

11:17 clgv: yup that works

11:17 just checking the source ^^

11:17 ohpauleez: those should be fixed in Enfocus' release

11:18 ro_st: So, I'm going to cut 0.2.2 stable Shoreleave releases today, unless you have any objections

11:18 ro_st: sorry, you should have seen 5 items to begin with

11:19 clgv: so check the source to see where the items are created and how both clj and cljs can use model/make-item

11:19 ohpauleez: none from me :-)

11:19 are you wrapping localstorage now?

11:20 clgv: i suppose i can bootstrap the ui so it doesn't look so darn shite

11:21 clgv: ro_st: *g* some css can do magic ^^

11:21 ohpauleez: ro_st: I was going to leave localstorage for 0.2.3

11:21 ro_st: indeed it can

11:23 abalone: hm. looking for ac-nrepl in my marmalade package list but cannot find it

11:24 duck1123: ohpauleez: I don't know if you're aware of it, but the shoreleave readme points to the marg docs for -worker, but I get a 404

11:25 ohpauleez: duck1123: Thank you, I'll fix that up today too. I appreciate the heads up

11:26 duck1123: Fwiw, I'd stay away from the worker stuff, it's going to change a lot in the future, but it's cool to play around with nonetheless

11:27 duck1123: I decided I needed to take another look at what shoreleave has to offer, and I noticed that

11:33 bOR_: abalone its in melpa

11:33 abalone: bOR_: thanks!

11:44 is it true that light table does not yet have paredit?

11:44 scriptor: I'm not sure if there are plans to have paredit soon

11:45 besides maybe through plugins

11:50 ro_st: light table is cljs based

11:50 so they'd have to build paredit in cljs first

11:52 duck1123: I would think that the browser would step on most of the key sequences you'd really want to use

11:54 abalone: duck1123: that's a good point. would it step on something like F2?

11:55 duck1123: abalone: looks like you can catch the F-keys https://groups.google.com/forum/#!topic/objectivej/ff5ZypwkEPw

11:56 if that 2nd post can be trusted

11:56 clgv: duck1123: afair lighttable is a webapp but shall be also shipped wrapped in a program. so there you should be able to use any key sequences

11:58 duck1123: There's a js library that let you assign key chords to js functions. I've been tempted to use it to define as many of the emacs commands as are relevant in my app

11:58 but I wouldn't want to overwrite stuff like C-x or C-c as that might cause more confusion

12:07 Frozenlo`: Does (goog.dom.getDocument) gives me the entire content, such that I could store it in a variable and recreate it, or it is a pointer to the document?

12:12 dnolen: Frozenlock: it can be used to traverse the DOM, but things are usually done that way. Probably best to use something like domina if you aren't already using jayq.

12:14 Frozenlock: dnolen: Usually done which way?

12:17 dnolen: Frozenlock: querying the DOM for particular elements.

12:18 and I meant "thing are not usually done that way"

12:18 Frozenlock: I would use domina or jayq. domina is a bit nicer in some respects since it can be GClosure optimized.

12:19 Frozenlock: I see. Still, if I do (goog.dom.getDocument), is this a copy of the entire document?

12:20 nDuff: Frozenlock: Changes to the results given you from getDocument will have side effects, if that's what you're asking.

12:21 dnolen: Frozenlock: it's just a node.

12:21 Frozenlock: with pointers to other nodes.

12:21 Frozenlock: No, I'm thinking of storing some stuff in a map where the keys are the dom-objects.

12:22 For example: {#<[object HTMLDocument]> {"ctrl-f" (print "hello")}}

12:22 But now I don't how to eval the stored function... I miss eval :(

12:23 nDuff: Frozenlock: Don't store code there, store a _function_.

12:23 dnolen: Frozenlock: I don't see why you need eval here.

12:23 nDuff: Frozenlock: ...if this were real Clojure, you'd want an IFn, not to use eval in that case either.

12:23 dnolen: Frozenlock: also why do you need DOM references as keys in the map?

12:24 Frozenlock: Well in my case I'm trying to make key-bindings as in emacs, meaning I can have different ones depending of where I am in the dom.

12:25 So my listener would look in the map and choose what function to execute.

12:25 nDuff: You could just attach a property to the DOM elements themselves, and walk up the tree to find the most recent one.

12:26 ...that's the approach I'd take, anyhow. Granted, it's not very Clojure-y.

12:26 Frozenlock: I don't know enough about the DOM yet for this to have even occured to me :(

12:27 dnolen: Frozenlock: you definitely want to attach events to DOM elements.

12:30 Frozenlock: I `think' that's what I'm doing, but I need to differentiate between the keypresses. If I follow this example, every key registered call the same function. http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/keyboardshortcuts.html

12:30 It's then its job to check which key was pressed.

12:32 dnolen: Frozenlock: so handle the different key cases inside the key press handler fn.

12:33 Frozenlock: another option would be call a multimethod. But I'm not sure about the performance of multimethods in CLJS, it may not matter for what you are attempting.

12:34 Frozenlock: Well yeah, but If I want to be able to redefine these bindings on-the-fly, I can't hardcode them in function... Thus my handler would look in the map and call the associated function. Unless I'm missing something...

12:34 Which is more than probable :)

12:34 dnolen: Frozenlock: why do you think you need to redefine them on the fly?

12:36 Frozenlock: Because that's the goal I've given myself to learn cljs. It would also make REPL change a breeze: (global-set-key "ctrl+shift+a" random-function)

12:37 Granted, it might never be used in a true app development.

12:40 dnolen: Frozenlock: OK, but I still think this can be done w/ one key handler + hash map of listener fns for particular key/key combos.

12:44 duck1123: Frozenlock: have you seen this? https://github.com/AndreasKostler/dyscord

12:45 Frozenlock: I have not! Thanks!

12:58 duck1123: Is it me or dyscord.events is missing from the repo?

12:59 duck1123: Frozenlock: to tell the truth, I've never used it. it's just been sitting in my starred repos section

13:00 that's a bit upsetting

13:01 Frozenlock: Shame, it looked very nice. I might try to patch the missing part.

13:01 duck1123: there was a similar js-only library, but I can't seem to find it atm

13:02 Frozenlock: duck1123: Well there's the google keyboard shortcut library I was basing my code on. But it's far less emacs-like.

13:07 Might as well ask here: Is there a browser REPL for inside the browser?

13:16 scriptor: is there a way to show line numbers or go to a line listed in the traceback?

13:16 *stack trace

13:16 er, in light table, that is

13:35 chouser: Frozenlock: http://himera.herokuapp.com/index.html

13:41 duck11231: so is there a cljs library that doesn't implement converting a clojurescript map into a js object?

13:41 it seems like every library I've seen has re-invented that particular wheel

13:43 sh10151: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

13:44 when running lein self-install, any ideas?

13:45 nm probably something wrong in curl

13:45 technomancy_: sh10151: make sure you don't have an outdated libssl

13:47 sh10151: unfortunately i don't administer this machine

13:47 scriptor: is there a function that checks if the given argument can support metadata?

13:47 technomancy_: sh10151: you can set HTTP_CLIENT to disable certificate checks; check bin/lein

13:48 hoover_damm: also openssl seems to be wanting -CApath in 12.04.1 for wget

13:48 which is bizzare

13:48 it's not loading the root CA's without it, so the Verisign CA's go untrusted

13:48 for example

13:49 technomancy_: ugh; very strange

13:49 sh10151: i did find a typo in https://raw.github.com/technomancy/leiningen/preview/bin/lein :)

13:50 bin/lein: line 179: downoad_failed_message: command not found

13:50 technomancy_: sh10151: yeah, fixed within minutes of the release; unfortunately too late

13:50 hoover_damm: i'm hoping it's not new behavior as my Gentoo servers don't exhibit that behavior

13:50 technomancy_: hoover_damm: do you know a link I can point people to?

13:53 hoover_damm: technomancy_, google brought up https://github.com/zendframework/zf2/pull/2223

13:53 technomancy_, I only experienced it, resolved it and didn't report a bug because I was unsure if the behavior was desired or not

13:54 technomancy_, I guess it could be http://rt.openssl.org/Ticket/Display.html?id=2700&user=guest&pass=guest

13:54 technomancy_, I haven't hit it again so I really don't know how it's occuring

13:55 feels quite weird

14:00 technomancy_: the openssl bug is about breakage specifying a custom capath rather than requiring one when you should be able to omit it

14:00 clojurebot: c'est bon!

14:00 technomancy_: clojurebot: shut up

14:00 clojurebot: Huh?

14:00 technomancy_: clojurebot: forget the openssl bug |is| about breakage specifying a custom capath rather than requiring one when you should be able to omit it

14:00 clojurebot: I forgot that the openssl bug is about breakage specifying a custom capath rather than requiring one when you should be able to omit it

14:00 * uvtc loves it when clojurebot has to get the last word. :)

14:01 uvtc: ~performance

14:01 clojurebot: http://clojure.org/java_interop#toc46

14:01 uvtc: Why does clojurebot link there?

14:01 S11001001: uvtc: I bet it links to the bit about how you shouldn't worry about annotation until you actually find a performance problem

14:02 linked

14:06 uvtc: S11001001: thanks.

14:09 hoover_damm: technomancy_, exactly... so either it's a weird ubuntu bug that no one has reported, or I don't know

14:10 technomancy_, only hit it with lxc a few times

14:10 technomancy_: I'll try it on my 12.04 machine when I get home

14:30 pepijndevos: wait, what? So drip launches a ton of jvms and then uses one every time you need a new one?

14:40 `fogus: core.cache docs available. Feedback much appreciated. https://github.com/clojure/core.cache/wiki

14:45 antares_: `fogus: https://github.com/clojure/core.cache/wiki/Including does not explain what repository artifacts are published to

14:46 https://github.com/clojure/core.cache/wiki/Using does not explain what clojure.core.cache/hit and /miss do

14:49 `fogus: antares: Do you mean that they exist in Maven Central?

14:50 antares_: https://github.com/clojure/core.cache/wiki/Extending does not demonstrate how to properly require/import the protocol, so without reading the code it will be very challenging to implement your own cache

14:50 speaking from my own experience with https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/cache.clj#L24 and another implementation in Welle

14:50 `fogus: yes, for cases when a version cannot be found and people are confused about if they need to add a repo or a particular version wasn't published after all

14:53 «hit signifies that the item was found» still does not explain much

14:54 I think they are best explained as "return this value from the cache" and "put this value to the cache"

14:56 `fogus: antares: "return value from cache" is for lookup. hit return a cache

14:56 which reminds me, I should mention lookup

14:57 pjstadig: `fogus: i noticed in one of the release notes that it said the soft cache is immutable, which it's not

14:57 since it is based on CHM

14:58 `fogus: pjstadig: True

14:59 pjstadig: I will make sure to mention that when I create its wiki page

15:07 antares_: Monger docs and such are awe inspiring. Very nice work.

15:07 amalloy: pepijndevos: more or less, yeah

15:08 antares_: `fogus: thank you. Take a look at other clojurewerkz.org projects, they sometimes have even better guides (I think).

15:09 `fogus: antares_: What is Clojurewerks? In a nutshell.

15:09 antares_: `fogus: a collection of Clojure libraries for practical stuff

15:09 `fogus: http://clojurewerkz.org/articles/about.html

15:10 `fogus: antares_: How did CW form?

15:12 antares_: `fogus: me and my coworker needed a few libraries, most for data store clients. So we developed a few, open sourced them, written the guides and keep improving them and keep adding libraries as we need them or want to experiment with something.

15:13 `fogus: antares_: Very inspiring work. Nice job. I'm very motivated to work on docs now

15:14 antares_: there is no commercial entity behind CLJW, some projects are experimental. One (Romulan) is a dead end at this point.

15:14 I find CLJW guides a great way to learn about, say, the details of ElasticSearch features

15:15 `fogus: antares_: I imagine so.

15:15 antares_: so instead of blogging I dig ES docs or source and document what I find

15:15 we have a doc guides template and worked out a nice efficient way of writing and posting code examples

15:15 * algernon just finished moving a soon-to-be open source project from non-cljw libs to cljw, primarily because the docs (and code) quality are amazing.

15:15 antares_: so it does not take as much effort as one may think

15:16 alcy: antares_: an outsider here, but an es-user, appreciate that view point re: docs !

15:17 antares_: alcy: our pleasure. Did you see Elastisch docs?

15:17 http://clojureelasticsearch.info

15:17 scriptor: antares_: any chance of open sourcing of the doc guides themselves?

15:17 `fogus: I love the idea of a dedicated .info domain!

15:17 antares_: scriptor: they are open source, the base template: https://github.com/clojurewerkz/docslate

15:17 scriptor: ah, awesome

15:17 antares_: all doc sites are open source under https://github.com/clojurewerkz/

15:17 `fogus: antares_: You guys are rocking my world

15:18 antares_: `fogus: thank you. Feel free to spread the word ;) Clojure needs documentation like no other thing, IMO.

15:18 alcy: antares_: heh yea, i bought the clojure few days back, thought of getting down with it by using elasitsch - but leiningrad kinda troubled me (or maybe I troubled it)...nevertheless, with enoguh clojure basics, pretty sure I am gonna play with es rather than solve math problems, if you understand what i mean ;)

15:18 `fogus: (inc _antares)

15:18 lazybot: ⇒ 1

15:18 antares_: books are great but library guides are just as important

15:18 alcy: antares_: s/clojure/clojure-book ;)

15:19 antares_: alcy: if you need help with lein, just ask

15:19 several active lein contributors are in here and in #leiningen

15:19 uvtc: antares_: Looks like, in your documentation, you use the word "guide" in place of "chapter".

15:20 I tend to think of a guide as something containing multiple chapters.

15:20 alcy: antares_: ah sure, will spend some time first to figure out the warts n all from a learning perspective, 99.9& sure its not a lein problem but mine ;)

15:21 uvtc: antares_: and in the url, instead of guide/page-name.html, you have articles/page-name.html...

15:22 Hm.

15:22 antares_: uvtc: you are probably right. I am not a native English speaker and may use some terminology incorrectly.

15:22 the /articles part is unfortunate but too late to change by now

15:23 it originated with http://rubyamqp.info

15:23 which was the first guides site of that kind we did with my coworker

15:23 uvtc: antares_: I could see "Article" ≅ "chapter".

15:23 nz-: `fogus: is it possible to mix cache factories somehow? e.g LRU cache that also evicts stuff based on time to live

15:23 antares_: and for some reasons we used /articles there

15:24 `fogus: nz-: Yes, although all combinations have not been tested.

15:24 antares_: uvtc: but honestly, that's not that important as long as we have the content :)

15:24 nz-: `fogus: is there an example of that?

15:24 `fogus: nz-: The base cache just needs to be something associative, which core.caches are

15:24 uvtc: antares_: "articles" to me mean standalone, like they could be read in any order (like a Clojure set), whereas "chapters" imply ordering (like a Clojure vector).

15:24 `fogus: nz-: Not yet. Thanks for the reminder.

15:24 antares_: uvtc: CLJW guides are supposed to be read in order

15:25 we even have "What to read next" at the end of each chapter

15:26 nz-: `fogus: I'd like also a more full blown example: e.g how to cache some DAO like thing

15:27 Frozenlock: chouser: this one evaluates on the server side?

15:28 `fogus: nz-: You mean, an example of extending the protocol to some db?

15:28 nz-: `fogus: e.g how to cache this kind of method (def get-user [user-id] ...)

15:31 `fogus: nz-: I'll think about how/what to add for that

15:35 nz-: `fogus: great

15:36 `fogus: Function backed cache page is missing: https://github.com/clojure/core.cache/wiki/FN , Link to FN is in https://github.com/clojure/core.cache/wiki/Using

15:37 `fogus: nz-: WiP

15:53 ninjudd: pepijndevos: drip only keeps one spare JVM running per unique hash of JVM options

15:53 pepijndevos: ninjudd: but, when I use one... it does need to laucn another one, right? But I assume that could happen in the background

15:54 ninjudd: pepijndevos: right

15:57 pepijndevos: ninjudd: pretty neat. :)

15:59 ggenikus`: Hello guys, i am new to clojure and try to use it in practice. I am in situation when i need use (case) inside (->), is it posible? For example (-> (one) (case (expr) 1 (two) 2 (three))(four)).

16:00 pepijndevos: ggenikus`: macroexpand is your friend

16:00 hyPiRion: ,(require 'clojure.pprint)

16:00 clojurebot: nil

16:00 hyPiRion: ,(clojure.pprint/macroexpand-all '(-> (one) (case 1 (two) 2 (three)) (four)))

16:00 clojurebot: #<CompilerException java.lang.RuntimeException: No such var: clojure.pprint/macroexpand-all, compiling:(NO_SOURCE_PATH:0)>

16:01 pepijndevos: ,(require 'clojure.walk)

16:01 clojurebot: nil

16:01 hyPiRion: oh right

16:01 ,(clojure.walk/macroexpand-all '(-> (one) (case 1 (two) 2 (three)) (four)))

16:01 clojurebot: (four (let* [G__270 (one)] (case* G__270 0 0 (throw (new java.lang.IllegalArgumentException (clojure.core/str "No matching clause: " G__270))) ...)))

16:02 pepijndevos: Clojure needs interactive expansion...

16:03 emezeske: pepijndevos: In Vim with vimclojure, "\me" macroexpands the form under the cursor, and I'm sure that slime in emacs does the same thing

16:03 pepijndevos: emezeske: amazing :)

16:03 emezeske: pepijndevos: It is *very* handy!

16:05 pepijndevos: emezeske: I barely use vimclojure, shame. It needs better installation and a cheatsheet

16:05 S11001001: When gigamonkey told me to imagine a junior employee hand-expanding macros over email for the compiler, that sounded cooler than what actually happens

16:05 fenton: how do i make clojure functions available as instance methods for accessing from java?

16:06 hyPiRion: fenton: Take a look at gen-class and reify.

16:06 emezeske: pepijndevos: The cheatsheet is ":help vimclojure"

16:06 S11001001: http://gigamonkeys.com/book/macros-defining-your-own.html#the-story-of-mac-a-just-so-story

16:06 pepijndevos: emezeske: to much information

16:07 emezeske: pepijndevos: Just scroll to the hotkeys, it's really not that bad

16:07 fenton: hyPiRion: thx. what does reify mean?

16:07 Apage43: I've used vimclojure for a while, but it is awkward to set up at times

16:07 I'm seeing if I can get myself used to emacs/evil

16:08 pepijndevos: Apage43: there is also a slimev thing if you want to do that. It does not aloow you to type unbalanced parens

16:08 emezeske: Apage43: Do you frequently have to set up vimclojure?

16:09 Apage43: pepijndevos: it's not so much the editing parts that bother me, it's more that if I accidentally fire off a thing that will never finish in a vimclojure REPL I basically kill Vim

16:09 pepijndevos: emezeske: I'm just back from hacker school, and I set up vimclojure like, 5 times. Twice for myself and a few times for other people starting clojure dev

16:09 Apage43: I really like my Vim editing setup

16:10 emezeske: Apage43: REPLs in vim will always suck. Vim just is not built for that, unfortunately

16:10 Apage43: emezeske: not anymore =P. I used to use it on Windows even.

16:10 emezeske: Apage43: I recommend using lein-tarsier and running a command-line repl next to vimclojure

16:10 pepijndevos: Apage43: you can kill the server and vim wil unfreeze

16:10 nz-: `fogus: If I have understood correctly, all the cache instances are immutable? Then in the case where you are caching a dao like function you probably need to store cache state to a atom or something like that

16:10 * Apage43 is using lein-tarsier

16:10 pepijndevos: emezeske: why does nREPL not work on vim?

16:10 emezeske: pepijndevos: Vim does not support asynchronous buffer updates

16:11 Apage43: I find the best experience to be just turning on the lein-tarsier repl and using that

16:12 gzmask: hey folks , where is \sr key in vim?

16:13 pepijndevos: emezeske: I'm not sure I understand what that means... I was under the impression nrepl was designed to be compatible with all the needs of tool authors

16:14 emezeske: pepijndevos: It means that Vim cannot be made to properly display an interactive REPL.

16:15 pepijndevos: Vim buffers can't be updated as the REPL prints lines out -- they have to poll or do something else horrible

16:15 pepijndevos: It's just not possible to have a good REPL experience in a Vim buffer.

16:17 pepijndevos: emezeske: that sucks... someone should go ahead and fix vim

16:17 emezeske: pepijndevos: I think you might find that to be a rather monstrously insurmountable problem

16:18 pepijndevos: lol

16:36 Frozenlock: I find it creepy to find this afternoon's #clojure log of myself when searching on google.

16:42 fenton: any idea why I get an airity error when trying to call clojure from java? http://pastie.org/4605825

16:43 hiredman: fenton: you are missing a "this" parameter

16:44 fenton: hiredman: thank you!!!

16:45 hiredman: does the this go into the :gen-class or the call from java?

16:46 hiredman: fenton: in the function

16:46 the function takes this+args, so a function backing a single arg method needs to take 2 args

16:47 fenton: hiredman: thx

16:49 SegFaultAX|work2: What's the correct way to compare a float and an int?

16:50 Actually, nevermind.

16:50 jkkramer: ,(== 0 0.0)

16:50 clojurebot: true

16:58 justinleitgeb: Hey folks - anyone know where I can find the seq-utils for Clojure 1.4? I'm looking for the `separate` function in particular: http://clojuredocs.org/clojure_contrib/clojure.contrib.seq-utils/separate

16:59 Raynes: I think it might have just disappeared in the contrib -> standalone library transition.

16:59 It is a really simple function though.

16:59 S11001001: justinleitgeb: some things are in core; others were deemed unimportant

16:59 Raynes: (defn separate [f s] [(filter f s) (remove f s)])

16:59 technomancy_: Raynes: I am disappoint.

16:59 Raynes: Untested, but should work.

16:59 * emezeske summons the cult of juxt.

17:00 Raynes: emezeske: I mostly just copied the implementation on clojuredocs

17:00 (def separate (juxt filter remove))

17:00 yey

17:00 technomancy_: that's more like it

17:00 justinleitgeb: Nice :)

17:00 thanks guys!

17:01 emezeske: Raynes: Six of one, half-dozen of the other. I say it's fine both ways, but I knew someone was gonna mention juxt :)

17:01 Raynes: juxt is so pretty in this situation though.

17:01 emezeske: I wonder if there is a simple one-pass solution, or if you have to do a reduce for that

17:01 Raynes: And if I hadn't done the juxt example, amalloy would have killed me.

17:02 emezeske: That is true.

17:02 Raynes: He is nuts for it, you know.

17:03 jkkramer: (inc juxt)

17:03 lazybot: ⇒ 2

17:03 SegFaultAX|work2: 4clojure #74 is a horrible problem.

17:05 emezeske: jkkramer: I had to do a double take on that to figure out why the hell (inc juxt) would return 2 :)

17:05 Raynes: 4clojure/4clojure#74

17:05 lazybot: Less retarded Leagues link -- https://github.com/4clojure/4clojure/issues/74 is closed

17:05 Raynes: Yeah, lazybot can do that. Send payments to...

17:06 SegFaultAX|work2: Haha, not issue #74

17:06 Problem 74.

17:06 http://www.4clojure.com/problem/74

17:06 amalloy: Raynes: go back to bed, man

17:06 Raynes: amalloy: Doesn't matter. I got to show off a new feature.

17:07 SegFaultAX|work2: My solution: https://www.refheap.com/paste/4684

17:07 Raynes: Even if I did look stupid in the process.

17:07 SegFaultAX|work2: How could it be improved?

17:07 scriptor: Kodowa/Light-Table-Playground#113

17:07 lazybot: Namespace filtering -- https://github.com/Kodowa/Light-Table-Playground/issues/113 is open

17:08 Frozenlock: Is it possible that some parts of closure aren't in clojurescript?

17:08 jkkramer: SegFaultAX|work2: see clojure.string/join

17:08 SegFaultAX|work2: jkkramer: Derp, forgot about that.

17:09 Ok, so other than re-inventing join, how is it?

17:10 ohpauleez: Frozenlock: some of the APIs are not in the Closure jar cljs ships with

17:10 but they constantly update the jar, and recently rolled in the "third-party" jar, which has a lot of the newer closure stuff in it

17:10 jkkramer: SegFaultAX|work2: looks fine. stylistically, I would indent psqaure?

17:11 ohpauleez: Frozenlock: What specifically are you looking for?

17:11 Frozenlock: http://closure-library.googlecode.com/svn/docs/class_goog_events_KeyHandler.html

17:12 I was naively expecting (goog.events.KeyHandler. element) to work.

17:12 So I should download the js and add it to my :extern?

17:12 SegFaultAX|work2: jkkramer: I put it at the same level as the other let-bound locals, is that wrong?

17:12 ohpauleez: Frozenlock: That should work, I would imagine

17:13 the stuff that doesn't work is some of the HTML5 stuff

17:13 jkkramer: SegFaultAX|work2: I just mean spreading it across more than one line, so it's easier to read

17:13 SegFaultAX|work2: jkkramer: Oh the function itself. Yea I wrote it literally in the textbox on 4clojure.

17:14 jkkramer: If it were in vim I would have kept it cleaner. But since it's a throwaway anyway, I didn't care.

17:14 emezeske: SegFaultAX|work2: Your solution looks eminently reasonable to me.

17:14 SegFaultAX|work2: I feel like the problem is doing 3 things at once which makes your solution necessarily ugly.

17:15 emezeske: SegFaultAX|work2: Your solution is not ugly at all.

17:15 SegFaultAX|work2: Eg process the text, do the real calculation, convert it back to text.

17:15 emezeske: That's very encouraging, thank you.

17:19 devn: Every bit of code I've ever written or read becomes ugly at some point.

17:21 brehaut: devn: for me that point is about 15 seconds after i stop typing

17:22 Raynes: Before, during, and after.

17:23 scriptor: I just redefine my idea of ugly with every newline

17:24 also, is there any way to check whether something supports metadata?

17:24 or do I need to manually check for each meta-able data type?

17:26 naeg: scriptor: not sure whether this is clever, but how about just trying (with-meta) with some nonsense?

17:26 scriptor: naeg: would have to catch the exception then, I think

17:27 ,(with-meta 2 {})

17:27 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IObj>

17:27 scriptor: not sure if that's idiomatic? Seems rather hacky personally

17:27 naeg: right. not sure whether this is considered good style in cljoure though

17:28 yeah, same concerns here. just an idea I had (python programmers would do so I think)

17:30 TimMc: scriptor: IMeta

17:30 naeg: scriptor: btw, finished that blog post about the code from last time. though I'm not comparing it to other python implementations, it was under the top 10 for half a day on HN: http://programmablelife.blogspot.co.at/2012/08/conways-game-of-life-in-clojure.html

17:31 TimMc: &(instance? clojure.lang.IMeta [])

17:31 lazybot: ⇒ true

17:31 scriptor: ah, thanks TimMc

17:31 saw that naeg, great post

17:32 naeg: gave my blog quite some reads in two days - the people on HN are really curious about stuff written in Clojure

17:33 firesofmay: Hi, what is the best way to send email attachments of screenshots taken from testing using email in clojure?

17:35 SegFaultAX|work2: naeg: I did a more literal translation a while back.

17:35 naeg: https://gist.github.com/3190354 if you're interested.

17:35 naeg: SegFaultAX|work2: from what to what?

17:35 oh, yeah

17:36 SegFaultAX|work2: I stumbled upon that one when I was looking for mapcat in Python

17:36 SegFaultAX|work2: naeg: Neat! :)

17:37 naeg: I used chain from itertools though. Also, Python 3 offers the Counter dictionary, which does exactly what frequencies does in Clojure

17:37 SegFaultAX|work2: naeg: Sure. That wasn't the point of the exercise though.

17:38 naeg: SegFaultAX|work2: what was the point of your exercise?

17:39 oh, that comparison to lua?

17:39 SegFaultAX|work2: naeg: Lulz, mostly.

17:39 naeg: And I also wrote it in Lua first.

17:39 naeg: Yea.

17:39 naeg: yeah, same here. I was just curious whether Python can go that far and still be reasonable good

17:40 SegFaultAX|work2: naeg: I make note that the Python in that document is purposefully not idiomatic and doesn't take advantage of what Python offers.

17:40 It's a Python port of a Lua port of Clojure code.

17:41 naeg: SegFaultAX|work2: I made that clear too. Otherwhise the guys at #python would have probably stoned me

17:41 some of them weren't too happy when they saw what I was doing. One was very helpful though

17:41 SegFaultAX|work2: naeg: I enjoy re-writing stuff from Clojure in other languages. I'm not sure why.

17:41 https://gist.github.com/3373635

17:42 technomancy_: hoover_damm: so I wasn't able to reproduce any issues with curl or wget on the latest ubuntu at home

17:42 was there something specific needed to trigger that?

17:42 naeg: SegFaultAX|work2: I enjoyed doing so too. probably because I secretly compare my "old main language" with my "probably soon new main language"

17:42 even though that comparison between Python and Clojure isn't fair in general

17:42 eggsby: SegFaultAX|work2: the sad part is that FP in python is very slow

17:42 SegFaultAX|work2: naeg: If I did that, my gist would be filled with Clojure wannabe Erlang.

17:43 eggsby: that thread fn is cute though :)

17:43 SegFaultAX|work2: eggsby: And Python is very "objecty". I don't know what that means, I just made it up. But I think you know what I mean.

17:43 eggsby: 'of course you can have rich lambdas! just give them names!'

17:44 s/names/nouns

17:45 naeg: there are probably other reasons why most people don't really use FP in Python than performance

17:45 scriptor: imperative is just more idiomatic in it, might as well use everything python gives you

17:46 SegFaultAX|work2: I have mixed emotions about FP in Python. I will say this though: Clojure's persistent data structures are a dream.

17:46 And the lack of those in Python is painful to say the least.

17:47 eggsby: clojure is one of the slower jvm guys though, I think it's just the penalty of being dynamic

17:47 naeg: I like Python much more than e.g. Java though. OOP is not bad, but there are simply just problems around where OOP doesn't fit - if you still use the OO langauge, you're going to have a bad time

17:47 SegFaultAX|work2: Although pysistence is a pretty neat little project.

17:47 naeg: Python on the other hand doesn't force OOP on you as e.g. Java does

17:48 eggsby: ya python is a lot more pragmatic than java, but also a lot slower

17:49 SegFaultAX|work2: Java vs. Python is a fairly apples and oranges comparison.

17:50 scriptor: speed is probably not a major issue for a lot of the things python is used for

17:50 web dev, command-line scripts, etc.

17:50 pbostrom: technomancy_: hoover_damm mentioned "only hit it with lxc a few times" so maybe from inside a container?

17:51 naeg: yeah, probably right SegFaultAX|work2. Just reduced both of them to OOP-style

17:51 eggsby: ya, that's true.. both play the OO game tho, i'm not sure how beneficial OO is for simple cli scripts, if it's not just for cli scripts it implies its in the same game as java

17:51 naeg: I don't think that a lot of people use OOP for CLI stuff

17:51 the web stuff is mostly OO though

17:52 magopian: can somebody who already solved the 4clojure problem 125 let me know if their solution is still working right now?

17:52 technomancy_: pbostrom: oh, that's right

17:53 naeg: SegFaultAX|work2: I think I'll start using gist too - do quite some proof-of-concepts from time to time and just keep them for myself, but it's interesing to read them

17:53 magopian: i have some strange error (java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn) that i don't have in my playground nor in tryclojure

17:53 dnolen: eggsby: idiomatic Clojure perhaps is slower - but Clojure has the necessary escape hatches to get perf w/o resorting to the verbosity of Java.

17:54 eggsby: dnolen: those escape hatches are somewhat of a black art, just a lot of typecasting and hinting, right? I made a (bad) app in clojure and scala, the scala version was almost 4x as performant (this was after clojure typecasting/hinting)

17:55 dnolen: eggsby: the perf costs don

17:55 't really have anything to do w/ being dynamic.

17:55 eggsby: I was interested in what caused it, it was the classic double tail recursive fib, one of the worst programs you can write but I was shocked how much slower clojure was than the scala version. I don't know nearly enough to say *why* though.

17:55 dnolen: eggsby: typecasting / hinting isn't really what's required for fast code. That said, it's not obvious - Scala benefits in that the imperative style is easy to express.

17:57 magopian: amalloy: are you there by any chance?

17:57 amalloy: indeed

17:58 eggsby: dnolen: some of the scala advocates around the office have argued that scala could be classified as *more* functional than clojure because it allows invariant refs (i.e. vals) where clojure allows everything to be dynamically redefined

17:58 It seemed like a bit of a red herring, since in order to dynamically redefine you'd have to intentionally do that but...

17:58 amalloy: problem 125 is still working fine, magopian

17:58 eggsby: I do wish we had something like (def-and-prevent-redef ..)

17:59 dnolen: eggsby: dynamic redefinition outside of development w/o an incredibly good reason makes little sense.

17:59 eggsby: defonce.

17:59 technomancy_: defonce doesn't prevent redefinition

17:59 definline, maybe

17:59 magopian: amalloy: mmm ok then, strange that i have this issue only in 4clojure, not in my repl

18:00 i'll keep digging then, thanks a lot amalloy for your responsiveness ;)

18:00 scriptor: you *could* redefine everything in clojure, just in the same way you *could* not use invariants at all in scala

18:00 dnolen: technomancy_: does anything really prevent redefinition? you can always recompile a larger compilation unit.

18:01 technomancy_: yeah, it quickly devolves into nonsense

18:02 which is kinda the expected outcome of a "my language is more functional than yours" argument

18:03 eggsby: my lang is bigger than your lang it has more fns than a fn convention

18:05 arohner: clojurebot: separate

18:05 clojurebot: separate is in clojure.contrib.seq-utils, but just use (juxt filter remove) instead

18:05 eggsby: technomancy_: it is interesting in the context of what the language encourages and which is the Correct(tm) way to do things. In a language like clojure I feel like I'd prefer if the defs were final and have a special syntax for the other case (which we kind of have with ^:dynamic)

18:06 Sgeo: AFAICT, with-redefs is often used to aide testing

18:06 hiredman: eggsby: that's dumb

18:07 the whole point of vars as an indirect linking construct is to allow for that

18:07 technomancy_: I appreciate having the flexibility to help during development. it's obvious when it's abused in non-development contexts.

18:07 Sgeo: You shouldn't need to include in your main code things designed only to make it easier to test... I think

18:07 hiredman: it is useful in all kinds of cases

18:07 e.g. repl dev, hot patching, etc

18:07 Sgeo: I remember writing C# code and realizing I had no idea how to do automated testing on any of it

18:08 eggsby: but isn't it weird that we don't even have a `final`?

18:08 Sgeo: Although that could also be the fault of a bunch of globals lurking around

18:08 hiredman: why?

18:08 clojurebot: why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

18:10 dnolen: eggsby: most things are effectively final if you're not dev'ing at the REPL. There are real problems and imaginary ones, no?

18:13 eggsby: yes, it is an imaginary problem because in practice you simply don't redef without an explicit need to, and if you're being particularly vigilant you'd use earmuffs. It still irks me that I have no defense against people saying it's a language bug and is ~dangerous~ and makes everything possibly ~impure~ other than 'yes but we dont do that'

18:14 maybe it has to do with simplicity to just have a single construct for defining a reference

18:14 dnolen: eggsby: well tell them if they're worried about they can just AOT all the time - from sound of Scala compile times I don't think they'll notice much of a difference ;)

18:15 hiredman: eggsby: there is a defense

18:15 eggsby: "what do you want that for?"

18:15 "what is the use of that?"

18:15 there is no reason to include every feature under the sun without justification

18:16 eggsby: ha, *that* certainly flies in the face of scala

18:16 hiredman: a "final" facility causes much more pain then not having one

18:17 programming is about getting things done, is it a feature if the library you are using denies you access to the thing you need to make it work?

18:17 technomancy_: one word... unsafePerformIO

18:17 Raynes: That's three words.

18:17 Actually four.

18:17 Frozenlock: ^^

18:18 hiredman: you often end up with the choice of forking, or using reflection

18:18 (in java)

18:18 just to use a library slightly differently then the creators intended

18:19 because stuff is private or final or otherwise "encapsulated"

18:19 hoover_damm: technomancy_, gimme a few i'm back i can fire up another lxc guest (fresh) and see if it's isolated to lxc

18:20 imeredith: hiredman: programming is about getting stuff done - but there is a lot of debate over the best method to get things done :)

18:20 hoover_damm: technomancy_, I admit most of the problem is just related to SNI and github's SSL certificates

18:20 Bronsa: sono molto simili

18:20 ops wrong channel

18:20 hoover_damm: technomancy_, and weird openssl handshake errors

18:21 hiredman: imeredith: sure, but final/private/etc limit your choices

18:21 eggsby: but I thought clojure was a conservative language

18:21 ;)

18:22 imeredith: hiredman: well, im sure that people that like them would say that it leads to less pain in the future because you cant do things by accident or something (i dont really understand it myself)

18:22 eggsby: WHERE ARE MY MULTIPLE PASS COMPILATIONS AND CYCLIC DEPENDENCIES

18:22 hiredman: every var in your clojure program is an indirect link and provides leverage and choice

18:23 eggsby: ya imeredith I always hear described in terms of 'your code lives beyond you, using explicit declarations allows you to express intended usage to future devs'

18:23 technomancy_: more power isn't necessarily good, (the power to malloc/free, the power to bash your data structures in place) but you have to show that it's easy to abuse the power by mistake to make a case for removing it.

18:24 "you have a def in column not-zero" is the easiest thing in the world to catch

18:24 hiredman: the power from the indirect changable linkage from vars is effectively infinite, so how do you trade that off?

18:24 imeredith: eggsby: all that said, some constructs are useful - personally im a scala person and using monads in scala is cool because general if it compiles its going to be correct

18:25 but private? meh

18:25 hiredman: clojurebot: tell us about scala

18:25 clojurebot: scala is also<reply>"we are completely screwed on ==." -- seen in #scala

18:25 hiredman: touche

18:25 clojurebot: tell us about scala

18:25 clojurebot: Unfortunately the standard idiom of consuming an infinite/unbounded resource as a stream can be problematic unless you're really careful -- seen in #scala

18:25 imeredith: lol

18:25 hiredman: yeah well

18:25 imeredith: #scala is useless

18:26 lol

18:26 hiredman: clojurebot: tell us more about scala

18:26 clojurebot: Scala often gets in the way when trying to write neat code -- seen in #scala

18:26 eggsby: I was talking to a scala advocate today about private and specifically whether a function can be considered pure if it internally memoizes some value, even it is idempotent

18:26 if another ~thing~ can reference that memoized reference then it would be impure since something could rely on that being in one state or another (this is an *extremely* contrived example), but if it was private that wouldn't be the case

18:26 hiredman: eggsby: sure

18:27 but in a real world program, you always end up wanting access to the cache

18:27 for one reason or another

18:27 imeredith: eggsby: i think it would depend if anything else can change that momized reference - because then the function would return the wrong thing

18:27 eggsby: right, and the STM is amazing for that sort of thing

18:28 imeredith: eggsby: but im not sure

18:28 hiredman: but the stm isn't magic, it is managing impurity, not removing it

18:28 eggsby: yes, it's largely eliminating the warts and gotchyas from dealing w/ mutation

18:28 Anyhow it's all lofty and idealogical and not really founded in actual programming re: getting shit done

18:29 imeredith: the scala community is hugely diverse

18:29 hiredman: that's one way to put it

18:29 eggsby: not the STM, 'purity'

18:29 imeredith: heh

18:29 eggsby: ya imeredith

18:29 I'm interested in learning scala but part of my love for clojure is a love for lisp.

18:30 hiredman: if the scala community cared about getting stuff done they would use a simpler language

18:30 imeredith: i almost started on clojure but got really into scalaz first heh

18:30 lol

18:30 hiredman: if you care about getting stuff done you cannot treat your langauge and runtime as a blackbox

18:30 imeredith: scala is a simple langauge

18:30 eggsby: hiredman: my take on scala is that it's a better java with comparable performance

18:30 hiredman: you have to know how they work

18:30 imeredith: well, the scala runtime isnt all that awesome

18:31 mk: I'm not sure what it means to treat the language itself as a black box

18:31 nDuff: mk: To not know/care about its implementation

18:31 imeredith: one of the problems scala has is that people come from java and move from OO -> FP progressively - but scala gets complicated for heavy FP

18:32 hiredman: your language is just another library, which library do you pick? the one with the source code you can scan through easily to find out why something isn't working, or the library with implicits?

18:32 mk: as for the runtime, it can be a black box, as long as you've got decent enough abstractions to model it. Obviously I need to know about the performance characteristics of my structures

18:32 imeredith: implicits are not the problem people say they are

18:32 eggsby: btw #clojure is probably the best language channel i'm aware of

18:33 mk: eggsby: I agree

18:33 hoover_damm: indeed

18:33 hyPiRion: #clojure is the only language channel I'm aware of.

18:33 wjlroe: There are other language channels?

18:33 eggsby: it's crazy to have a convo about this sort of stuff without it devolving into YA BUT MY WAY

18:33 hiredman: didn't they used to be a github graph on repos that would give you a line of code count?

18:33 imeredith: eggsby: thats the problem with #scala lol

18:34 technomancy_: hiredman: they removed a bunch of graphs for some reason

18:34 hiredman: :/

18:35 technomancy_: hiredman: ohloh has those graphs though

18:35 hiredman: the code freq graph may work for me

18:35 imeredith: people mistake complexity for unfamiliarity - i am unfamiliar with clojure - to the point of it seeming complex - but i would never say its complex

18:35 hiredman: https://github.com/scala/scala/graphs/code-frequency https://github.com/scala/scala/graphs/code-frequency

18:35 whoops

18:35 Frozenlock: dnolen: Thanks for the domina cue, it's very nice!

18:35 hiredman: https://github.com/clojure/clojure/graphs/code-frequency

18:36 technomancy_: I wish it would distinguish between implementation and test source, but I understand why that's hard

18:36 hiredman: which library are you going to want to wade through when something doesn't work?

18:36 mk: imeredith: what counts as complex, then?

18:37 technomancy_: hiredman: I'd take clojure circa late 2009 =)

18:37 dnolen: Frozenlock: glad you like it!

18:37 mk: imeredith: in most contexts, complex is "I have to know a lot to use this"

18:37 hiredman: technomancy_: request denied

18:37 technomancy_: sure line count can't be the only metric

18:37 imeredith: mk: well, in that context clojure is complex

18:38 eggsby: ~simple v. easy~

18:38 hiredman: but, when you are talking about reading the codebase, it is a decent one

18:38 clojurebot: forget ~paste is gist

18:38 technomancy_: hiredman: reminds me of https://github.com/technomancy/bludgeon

18:38 imeredith: mk: i think things are simple when you can reason over them - referential transperncy for example is easy to reason over

18:39 mk: eggsby: good presentation, but I think that that particular distinction is more marketing than substance

18:40 imeredith: maybe... I mean, in general, we want a the language to correspond as much as possible to good ways of thinking about programs

18:40 eggsby: really? if only for the distinction between simplicity as a lack of logical interweaving and easiness as familiarity I thought it was huge (but maybe it's because I previously wasnt so aware of the disctintion)

18:41 imeredith: mk: right, but you can find examples in any language that is terrible

18:41 thorbjornDX: Thread thread = new Thread()

18:42 imeredith: mk: but java vs scala, in scala people generally use vals, so dont end up mutating variables, just because it has the construct 'val'

18:42 technomancy_: Malkovitch malkovitch = new Malkovitch();

18:42 imeredith: so you are right

18:42 but only to a point

18:44 mk: eggsby: yeah, agreed. But the two opposites were stuck together in a "complected" way, from what I recall. What does familiarity have to do with non-interweaving? I thought it was a great and justified attack on oo, and on choosing to stick with it because it's something you know well

18:44 imeredith: one day ill get around to clojure, i refuse to comment for/against clojure specifically until ive used it a bit.

18:47 mk: hiredman: what do those charts represent?

18:55 jkkramer: been doing a project in scala play framework lately. no comparison - ring/compojure is vastly simpler and easier to understand, write code for, etc

18:56 imeredith: jkkramer: unforunatly there is lots of play that is crap - there is no really good scala framework

18:56 jkkramer: in play, they say it's basically request -> fn(s) -> response, but in practice everything is locked inside types and class/object hierarchies

18:56 imeredith: ?

18:56 SegFaultAX|work2: This is my answer to 4clojure 75, how can I make it better? https://www.refheap.com/paste/4687

18:56 imeredith: that is the one thing of play that is good Request => Response

18:57 jkkramer: conceptually yes. in practice it's Controller/Action/Response, which all have peculiarities and can be difficult to compose

18:57 mk: SegFaultAX|work2: if you've submitted, you can subscribe to other people, and view their answers

18:58 jkkramer: in ring, you get a request map - just a plain hash map. a function operates on it, and returns another simple map. so simple.

18:58 SegFaultAX|work2: mk: Real-time feedback is useful for my learning.

18:58 mk: SegFaultAX|work2: yep, probably for everyone's. But if you haven't already, check those out, you'll see some pretty cool and weird solutions

18:58 technomancy_: heroku's play support strips out the repl at deploy time =(

18:59 imeredith: jkkramer: well, ill disagree on this point :)

19:00 jkkramer: that's the other thing - the play console stinks. you can't even query the DB easily. runtime config is a big hairball

19:00 imeredith: yes ill aggree with that

19:00 its a real pita

19:00 as i said, Request => Response is the one good thing play has

19:00 heh

19:01 jkkramer: but the feedback loop is slow and cumbersome

19:01 it's hard(er) to build small, composable pieces

19:01 imeredith: well, thats because the scala compiler is slow - but i dont aggree with composable

19:02 jkkramer: in play1/play2 with java the feedback is really good - but yeah...java

19:03 i dont like the whole refresh thing anyway, i just have the compiler in the background validating the code as i save

19:03 jkkramer: it's a matter of degree. it's composable, yes, but full of warts and weirdness

19:03 enough grousing form me. gotta run

19:03 *from

19:22 gfredericks: emezeske: ping

19:27 emezeske: gfredericks: pong

19:28 gfredericks: emezeske: was wondering if you could give me some tips to debugging my checkouts issue (mentioned on github)

19:28 `lein classpath` includes the relevant src-cljs directories

19:29 emezeske: Yeah, that is a weird problem

19:30 A tricky thing is that the compiler runs in "eval-in-subproject", which may have a slightly different classpath

19:30 I forget the easiest way to hack things to print the CP in the subproject

19:30 This is lein2 right?

19:30 gfredericks: yeah

19:30 is it normal for the compiler not to fail when a ns isn't found?

19:31 emezeske: I think so

19:32 gfredericks: hmm

19:32 oh wait

19:32 it might be working now

19:32 now that I've specifically bothered you about it

19:33 hm; now it's missing a transitive dep (jayq)

19:33 curiouser and curiouser

19:34 emezeske: haha

19:35 gfredericks: well the jayq jar isn't in lib so I guess that's not cljsbuild's fault

19:35 * gfredericks scrounges

19:37 emezeske: With lein2, the jars don't get copied into lib anymore, though, right?

19:37 gfredericks: oh that sounds right

19:37 must be a stale lib

19:37 * gfredericks checks `lein classpath`

19:38 gfredericks: nope not there

19:38 emezeske: What jar does your project depend on that transitively depends on jayq?

19:38 gfredericks: an unpublished one

19:38 I installed it locally just so mvn would shutup

19:38 so I should probably double-check that jar

19:39 emezeske: I would.

19:40 gfredericks: the pom.xml in there definitely mentions jayq

19:40 does lein have a dep tree thing yet? or do I just use maven's?

19:41 * gfredericks uses maven's

19:41 technomancy_: gfredericks: geez; welcome to four months ago =)

19:41 lein deps :tree

19:41 gfredericks: maven misses it

19:42 as does lein

19:47 ssurgnier: \part

19:48 gfredericks: how does lein/mvn tell from a jar that it has deps?

19:48 technomancy_: gfredericks: deps come from poms

19:48 gfredericks: the project.clj? the META-INF/maven/group/artifact/pom.xml?

19:48 technomancy_: the jar often happens to contain a non-canonical pom

19:49 but it's the top-level pom artifact that's used

19:49 gfredericks: there is no top-level pom in this case

19:49 does that explain it?

19:49 technomancy_: yeah

19:49 gfredericks: I'll try to re-jar

19:51 technomancy_: I believe installing with mvn install:install-file will never get you dependencies

19:52 gfredericks: o_O isn't getting dependencies a separate issue from getting your pom.xml to the top-level of your jar?

19:52 technomancy_: by "top-level" I mean "not inside a jar"

19:52 emezeske: gfredericks: Does this mean I'm off the hook? :)

19:53 gfredericks: emezeske: I think so ;)

19:53 technomancy_: okay so you're saying it's impossible to get transitive deps without deploying a jar to a proper maven repo?

19:54 technomancy_: without deploying a pom

19:54 gfredericks: oh I can deploy that locally

19:54 right they go separate

19:54 okay phew

19:54 I expect THAT's my issue then :)

19:54 technomancy_: thank you sir

19:54 technomancy_: np

19:55 this is why I tell people to stay away from bare jars

19:55 way more trouble than it's worth

19:55 gfredericks: it didn't occur to me that maven wouldn't pull the pom out of my jar

19:56 oh man lein2 deps doesn't tell me the maven cmd for local installation anymore

19:56 technomancy_: that's because install:install-file is hell of sketchy

19:57 gfredericks: even if you install the pom with it?

19:57 technomancy_: for anything but experimentation, yes

19:57 because as soon as you try to hack the project on someone else's machine it'll break

19:58 gfredericks: it's an alternative to running your own private maven thinger

19:58 technomancy_: yes, just not a good alternative =)

19:58 s3 is super cheap

19:59 hiredman: maven repos are just dumb http end points

19:59 technomancy_: that too

19:59 even nexus is easy to set up

19:59 hiredman: running one is super simple

19:59 you can even act as a maven repo from s3 without using the s3-wagon or whatever

20:00 just server the files from s3 over http

20:00 technomancy_: hiredman: is that easy to do with basic-auth?

20:00 gfredericks: step 0: set up s3

20:00 hiredman: technomancy_: no

20:00 actaully I dunno

20:00 never tried

20:00 just public stuff

20:00 you can literally just upload the directory out of your .m2 to create a maven repo

20:01 technomancy_: eh... I don't think you get checksums that way

20:01 better to lein deploy to /tmp/myrepo and rsync that

20:01 hiredman: *shrug*

20:01 technomancy_: I should look into documenting the scp wagon; that would probably be simpler for a lot of people

20:02 hiredman: my .m2 seems to contain .sha1 and .md5 files

20:02 technomancy_: huh; maybe that's new with aether

20:02 that's cool

20:02 someone should document that

20:02 gfredericks: (inc technomancy)

20:02 lazybot: ⇒ 39

20:02 gfredericks: thanks folks

20:03 * gfredericks scrambles off

20:13 casion: so since swank-clojure is depreciated, is there any good explanations of an nrepl workflow with emacs?

20:13 technomancy_: casion: it's very similar; just replace clojure-jack-in with nrepl-jack-in

20:15 casion: guess I need to move to lein 2 then

20:39 Raynes: casion: Should have already done that.

21:58 cjfrisz: Man, how come it's so quiet around here lately?

21:59 casion: in my experience it's usually quiet around this time

22:00 talios: Afternoon

22:00 brehaut: hi talios

22:00 talios: 'lo brehaut

22:01 cjfrisz: casion: Huh...I must have used to get on earlier

22:01 Or later, not sure which

22:05 mk: you can always run stats on the logs to know for sure

22:21 jacobsen: Hi all, is there a standard way to address "return code 405" errors when deploying to Clojars with leiningen 1.7?

22:24 xeqi: jacobsen: hm, 405 should happen when deploying to clojars.org/ instead of clojars.org/repo

22:24 jacobsen: in case it's helpful, https://gist.github.com/3506189

22:25 It does say it's trying to deploy to clojars.org/repo ...

22:25 xeqi: doesn't look like thats the case for that...

22:30 cjfrisz: In the course of writing CTCO, I think I've written and scrapped 3 versions of alpha-renaming

22:30 And I'm just about to write another one

22:30 But I think this one is actually going to stay

22:31 akhudek: ctco?

22:31 casion: ctco?

22:31 uvtc: CTCO?

22:31 emezeske: C T C O ?

22:31 casion: eieio?

22:31 cjfrisz: C

22:31 T

22:31 C

22:31 O

22:31 ?

22:31 emezeske: ^_^

22:32 cjfrisz: https://github.com/cjfrisz/clojure-tco

22:32 akhudek: Nice. That's what I hoped you meant! :-)

22:33 casion: oh, you're the guy who did that presentation on tail calls in cojure

22:33 cjfrisz: I am

22:33 emezeske: cjfrisz: Wow, that's crazy!

22:33 casion: 'that guy'

22:33 I enjoyed the presentation

22:34 cjfrisz: Thanks

22:34 xeqi: jacobsen: hmm, I see the GETs in the server logs, but not a PUT. Are you using a proxy perchance?

22:34 mk: link to presentation?

22:34 cjfrisz: I submitted to do an expanded version at Clojure/Conj

22:34 akhudek: cool, would like to see that

22:34 cjfrisz: http://www.chrisfrisz.com/blog/?p=220

22:35 yeah, I've been working both on improving CTCO and writing a whole-program compiler that'll do some smarter analysis and hopefully produce noticeably faster code

22:35 So hopefully I have the snazzy compiler ready for my talk...if it gets picked

22:36 And at some point, I'm supposed to write tools.cps

22:37 xeqi: jacobsen: oh, I notice its pushing to http, you need to use https. check out https://github.com/ato/clojars-web/wiki/Pushing

22:37 amalloy: cjfrisz: is CTCO basically resolving down to (trampoline (lambdas....)), or is it doing smarter stuff to avoid creating functions entirely via eg loop/recur?

22:38 cjfrisz: amalloy: It's a somewhat smarter version of the former

22:38 amalloy: Part of the point is to allow arbitrary mutual recursion, so loop/recur won't work for that case

22:39 amalloy: if they're actual tail-calls, can't you rewrite that as a loop-recur?

22:40 jacobsen: xeqi: thanks, I'll check that out

22:40 cjfrisz: amalloy: That's certainly possible

22:41 amalloy: And I was thinking about that in the last few days

22:41 amalloy: cool! i can just barely write my own CPS programs, and transform them to CPS w/loop-recur with some effort; just interested in seeing how all your stuff works

22:46 gfredericks: woah lazybot monitors pings

22:46 (inc lazybot)

22:46 lazybot: ⇒ 6

22:47 mk: monitors pings?

22:47 Raynes: mk: Type 'Raynes: ping'

22:47 mk: Raynes: ping

22:48 Raynes: Hi there.

22:48 gfredericks: it happened in my freenode buffer so I didn't notice till much later

22:48 Raynes: You should now have a NOTICE, mk.

22:48 cjfrisz: amalloy: Yeah, when I stopped and thought about it, I realized that loop/recur without the thunks could be a noticeable savings

22:48 gfredericks: ,(println "gfredericks: ping")

22:48 clojurebot: gfredericks: ping

22:48 mk: in fact I do have a notice. That's neat

22:48 cjfrisz: amalloy: But in compilers, you never know. Things that seem like obvious wins sometimes turn out to only marginally help

22:49 TimMc: TimMc: ping

22:49 mk: I like how it gives me the turnaround time down to the millisecond

22:49 amalloy: true

22:49 cjfrisz: And then sometimes you mess up the code layout just enough with an optimization that you get caching effects that actually make things slower

22:49 TimMc: :-(

22:49 amalloy: mk: only because it was recent. if you ping rhickey and he gets back to you two days later, you just get days/hours

22:49 Raynes: Raynes: ping

22:49 hi self

22:49 Cool, I can ping myself.

22:49 TimMc: Ah, I see.

22:50 mk: amalloy: right. Still, though

22:50 gfredericks: keep that to yourself

22:50 cjfrisz: gfredericks: I lol'd

22:50 Raynes: Hah

22:50 gfredericks: cjfrisz: phew

22:50 Raynes: gfredericks: You and are are in constant competition for the most snark, aren't we?

22:51 gfredericks: are are are are

22:51 and

22:51 Raynes: I'm sorely insufficient.

22:52 gfredericks: and now your grandchildren will be able to read about it on clojure-log.n01se.net

22:53 tmciver: TimMc: were you looking for 'the other' Tim Mc?

22:53 TimMc: Nope.

22:53 tmciver: would the real Tim Mc please stand up?

22:54 TimMc: But both of us do!

22:54 (Explanation for the rest of the channel: We both have standing workstations.)

22:55 casion: people actually use those?

22:55 I thought that was some sort of april fools thing

22:55 cjfrisz: Not at all

22:55 We've got a few in my office, and I am jealous

22:56 I'm even more jealous of the one walking desk

22:56 casion: why?

22:56 clojurebot: why not?

22:56 amalloy: ninjudd and lancepantz both use standing desks; ninjudd has a treadmill

22:56 casion: because!

22:56 really though, why would anyone want to use a standing workstation?

22:56 TimMc: One of the execs at my office has a treadmill!

22:56 mk: I've got a standing desk as well, small world

22:56 cjfrisz: casion: Good for the circulation

22:56 amalloy: and posture

22:57 wmealing_: Ive got a squat rack.

22:57 TimMc: casion: It really helped my RSI, it forces me to take typing breaks, I get less sleepy...

22:57 cjfrisz: casion: Also fights off a number of teh problems associated with sitting at a desk 8+ per day

22:57 tmciver: because we weren't meant to sit in front of a keyboard all day.

22:57 TimMc: RSI was the main thing.

22:57 cjfrisz: Yes, all of those things

22:57 metellus: we weren't really meant to stand in front of a keyboard all day either

22:57 casion: tmciver: we also weren't meant to stand in one place for 8+ hours a day

22:57 cjfrisz: I'm planning on setting up a standing desk in the near future

22:57 casion: Most people I know don't use them for the whole day

22:58 casion: cjfrisz: well that'd be useful I guess

22:58 mk: casion: a standing desk forces you to take breaks if you're not up for it, a chair doesn't

22:58 casion: I understand why someone else may want to use it now, thank you for the responses

22:58 tmciver: casion: true, but hopefully standing AND sitting for 8+ hours a day is better than doing just one of those.

22:59 TimMc: casion: There are also sit/stand workstations, although I prefer being forced by leg fatigue to sit down and stop typing periodically.

22:59 cjfrisz: Though I'm pretty impressed that the guy who has the walking desk pretty well uses it all day every day

22:59 casion: I get up from my chair constantly through the day

22:59 TimMc: cjfrisz: No kidding? That's gotta be good for him.

22:59 casion: it never occured to me that there's people who don't take constant breaks and move around

22:59 * casion has always worked alone

23:00 cjfrisz: casion: I'm also like you, which is part of what draws me to it, actually

23:00 I move around enough that I think the idea of standing for a while is more freeing than sitting all the time

23:00 I've done some time at the walking desk and I find it really nice

23:01 TimMc: I used to sit on an exercise ball, which kept me a moving a bit.

23:01 casion: it sounds useful for some folks

23:01 I would never do it though

23:01 TimMc: Unfortunately, it's also easy to have *terrible* posture on those.

23:01 cjfrisz: TimMc: I'm afraid I'd fall into that category

23:01 casion: I sit on a chair with no back, and no arms

23:01 mk: TimMc: how's that?

23:01 casion: sometimes I sit on the floor

23:02 maybe if one day I can get comfortable shoes I'll try the standing

23:02 TimMc: mk: Hard to describe in text. :-)

23:02 casion: Barefoot. Seriously.

23:02 mk: TimMc: ascii art? ;)

23:03 TimMc: mk: Well... butt far back on the ball, torso leaned forward, forearms resting on desk edge, elbows splayed.

23:03 It's not a very dignified posture either. :-P

23:03 casion: TimMc: I'd love to but I have to walk through my metal shop all day long

23:03 TimMc: casion: Oof. Got it.

23:04 casion: I've done it once...

23:04 stitches were involved

23:04 gfredericks: Raynes: if I'm in a snark competition with you, I consider that to be a success already

23:05 casion: do you guys use purpose built standing desks? or just rig something together

23:05 mk: TimMc: I see. Yeah, I think the easiest way to go wrong is to rely on something to prop yourself

23:07 jacobsen: xeqi: thanks again, migrating to lein2 seems to have done the trick

23:07 TimMc: casion: Jerry-rigged. Monitor on cube shelf, mouse on a pile of boxes, keyboard on a LapDawg the CEO dug out of a corner of his office.

23:08 The LapDawg is slightly more bouncy than I'd like, but it's hella adjustable.

23:09 casion: TimMc: sounds good

23:32 hoover_damm: technomancy_, still can reproduce it in lxc... openssl s_client -conect github.com:443 without -CApath fails

23:33 technomancy_, curl seems to be adding the capath by default where wget isn't

23:33 weird

23:35 feels like new behavior

23:42 gfredericks: any guesses why org-html-slideshow depends on clojurescript-one? what does that provide?

23:43 emezeske: gfredericks: Oh god...

23:43 gfredericks: emezeske: I was aiming to port this to lein-cljsbuild

23:43 but it'd help if I understood it first :)

23:44 emezeske: Yeah, that's mighty weird

23:44 gfredericks: it's not a proper lein dep

23:44 I'm not sure how they pull it in

23:44 emezeske: Maybe it uses some utility namespace or something

23:45 gfredericks: one.dispatch is the ns they use

23:46 looks like a bunch of eventing; they use it a lot

23:52 that namespace is about 30 lines of actual code, and that's the only thing it uses from one; would it be bad form to just paste it in to get rid of the dep?

23:54 also cljsbuild is crashing saying it can't find cljs/analyzer.clj; it's doing that in two different projects now

23:54 emezeske: Regarding the 30-line file, I'm pretty sure they never intended for clojurescript-one to be used as a library. Pasting it is probably the best choice.

23:54 Regarding the crash, I've never seen that before.

23:55 gfredericks: I bet it will once again somehow turn out to be maven

23:55 oh maybe this is because org-html-slideshow declares a particular CLJS version?

23:56 in particular, "0.0-971"

23:57 what version does cljsbuild want?

23:57 emezeske: Oh god, that is so. ridiculously. old.

23:57 cljsbuild will pull in 0.0-1450 if left to its own devices

23:58 gfredericks: cool thx

23:58 emezeske: You shouldn't use anything but 0.0-1450 unless you're prepared to debug differences between lein-cljsbuild and clojurescript

23:58 (i.e. that's the version combo I've tested) :)

Logging service provided by n01se.net