#clojure log - May 23 2012

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

0:16 scottj: dnolen: would be nice to add a link to synonym page on main himera page.

0:22 brainproxy: +1 ^

0:23 * Raynes is still trying to figure out the name 'himera'

0:25 dnolen: scottj: brainproxy: fork, fix, and send fogus a pull request.

0:29 scottj: Raynes: "Химера was a Russian band that I liked very much as a younger man." I figured it was from chimera because it's part clojure, part clojurescript, part javascript.

0:30 brainproxy: fork in progress

0:30 scottj: brainproxy: thanks

0:41 brainproxy: scottj: done, https://github.com/fogus/himera/pull/19

0:42 dnolen: brainproxy: scottj: sweet!!!

0:43 brainproxy: btw, if anyone knows the answer... http://news.ycombinator.com/item?id=4011404

0:44 someone in this chan suggested earlier today that andy fingerhut is the author of the paredit cheat sheet, but I exchanged emails w/ him and he is not the author

0:45 aperiodic: brainproxy: hah, i brain-farted and thought you meant the clojure cheatsheet

0:45 apologies

0:46 brainproxy: aperiodic: np, andy kindly replied and went hunting for the source file but he couldn't find it either

1:38 omasanori: hi, does anyone see me?

1:39 * ivan peers at omasanori

1:39 brainproxy: omasanori: is that a wig?

1:42 omasanori: no, I just worried there in no user here now

1:45 s/in/is/ ... maybe I'm so tired...

1:50 I'd like to ask about clojure.repl/doc

1:51 doc expects that docstrings have 2 spaces every line except the first line, right?

2:08 I'm very sorry if my manner is poor...

2:10 ivan: omasanori: #clojure is less idle during US business hours ;)

2:11 I don't think doc expects any specific format for your paragraphs

2:13 oh never mind, I see that's not the question

2:13 well, it looks like print-doc prints two spaces and then the docstring

2:14 so, "yes"

2:15 omasanori: Ah, I see. I forget timezone...

2:18 So, I'll post a RFC patch to the ML, but I'm unsure whether my direction is right or not.

2:20 My thought is that the algorithm described in http://docs.python.org/tutorial/controlflow.html#documentation-strings makes `doc` free from indentation details.

2:28 I'm sorry, my client crashed.

2:30 For example, clojure.core/conj is with 4 spaces for indent, so (doc conj) looks weird.

2:37 So I'm writing a patch implementing the algorithm for formatting docstrings consistently, but I'm unsure whether it's right or not. any opinions?

3:13 pepijndevos: Raynes: ping

3:31 $mail Raynes Maybe sexpbot was not a good idea. I have no control over it, and people want logging disabled.

3:31 lazybot: Message saved.

3:33 Raynes: pepijndevos: amalloy asked you if you wanted logging.

3:33 pepijndevos: Raynes: I wanted, but some other people don't, apparently.

3:33 Raynes: I'll happily disable it though, and I can delete the existing logs.

3:34 Do you want me to remove him from the channel?

3:34 pepijndevos: Raynes: That'd be cool. But I don;t want to keep bothering you for every... whatever, so maybe I should just host my own instance.

3:34 Raynes: FYI, people have attitudes about bots for no particular reason.

3:34 Just a heads up.

3:35 Even if you host it, people will find something to bitch about until you start telling them to bug off.

3:35 ro_st: #firstworldbotproblems

3:35 Raynes: pepijndevos: Anyways, do you want me to take him out so you can host your own instance or just disable logging?

3:35 pepijndevos: There are a few people who are bots themselves in that channel, so they know how it feels, I guess.

3:35 amalloy: damn irc bots taking all our jobs

3:37 Raynes: pepijndevos: What is this channel again?

3:37 pepijndevos: Raynes: If you want to sleep at night, i think it'd be better if you remove it. I have no problem with bugging you all the time.

3:37 Raynes: #hackernews

3:37 school

3:37 Raynes: I'm not sure what else I'd have to do besides disable logging.

3:37 pepijndevos: ok, go for it then :)

3:37 Raynes: I mean, are people complaining about other things?

3:38 :p

3:38 pepijndevos: well, if it starts randomy killing people with fire someday, we'll have to get one of you to kill it with fire.

3:38 Raynes: Haha

3:38 pepijndevos: Okay, I'll just disable logs. If you decide to host your own instance, just let me or amalloy know and we'll pop him out.

3:38 $mail

3:39 pepijndevos: Raynes: ok, thanks :)

3:39 Raynes: (he wouldn't shut up)

3:44 ro_st: do i need to restart my slime repl every time i change project.clj deps?

3:44 Raynes: pepijndevos: If lazybot offends the sensibilities of any other young girls, let me know.

3:44 pepijndevos: ok, thanks

3:44 ro_st: it seems that i do, and it's annoying

3:52 ivan: https://news.ycombinator.com/item?id=4011359 wants to know what code to read

3:52 ro_st: so, i have a seq of N items. i want to get a new seq of up to M items from that first seq

3:52 pepijndevos: ro_st: Do you have logging enabled? Or exclaim all commit on your git repo?

3:53 ivan: &(take 5 (range))

3:53 lazybot: ⇒ (0 1 2 3 4)

3:53 ro_st: take, thanks

3:53 ivan: &(take 5 [1 2 3])

3:53 lazybot: ⇒ (1 2 3)

3:53 ro_st: pepijndevos: i don't understand the context of your question?

3:55 pepijndevos: "it seems that i do, and it's annoying" I placed that in the "offending young girls context"

3:56 ro_st: oh, right :)

4:03 pepijndevos: Is anyone else flying to euroclojure tonight with ryanair?

4:03 ro_st: looking forward to seeing that HN post grow

4:03 pepijndevos: ?

4:04 the code to read one?

4:06 vijaykiran: pepijndevos: I'm leaving at 1645 via schiphol - klm not ryanair though

4:06 pepijndevos: I lave a lot later as well

4:07 Borkdude: pepijndevos: vijaykiran have fun there!

4:08 ro_st: does anyone have a working clojure-jack-in repl-init setup?

4:08 yes pepi. be interesting to see what gets listed

4:09 pepijndevos: ro_st: clojure itself, some other clj impls, overtone, .... hm I don't know

4:09 Borkdude: I find the clojure code itself sometimes hard to read, because a lot of times it involves the bootstrapping process

4:10 nevertheless interesting

4:10 ro_st: clojure core isn't idiomatic clojure, because idiomatic clojure isn't possible at that point

4:10 pepijndevos: Ring?

4:10 clojurebot: ring is http://github.com/mmcgrana/ring/tree/master

4:11 ro_st: ring, enlive, korma, monger

4:12 i'm struggling to find docs on lein's repl-init

4:13 ahhhh, never mind. just found lein help sample

4:14 Borkdude: a lot of clojure libraries are wrappers around java libraries

4:14 I think those are not so nice examples to read

4:14 wink: depends if they expose the apis in a sane manner

4:17 bobry: Can someone give me a hint why this might happen? 'java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Named'

4:17 what's 'Named' in clojure terms?

4:18 Borkdude: ,(let ["foo" 1] "foo")

4:18 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: foo>

4:18 Borkdude: hmm, that isn't the one ;)

4:18 bobry: :)

4:18 vijaykiran: ro_st: :repl-init [whatever.ns] in project.clj should work

4:18 ro_st: oh, you said you found it already :)

4:18 ro_st: vijay, weird. the lein sample project says it should be :repl-options { :init-ns … }

4:19 is your way for lein2?

4:19 vijaykiran: ro_st: I'm using lein2 - yes.

4:21 ro_st: ok thank you

4:22 Borkdude: bobry: clojure version?

4:25 bobry: https://github.com/clojure/clojure/commit/4bea7a529bb14b99d48758cfaf0d71af0997f0ff

4:25 amalloy: ,(ns-name "x")

4:25 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol>

4:25 amalloy: ,(namespace "x")

4:25 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Named>

4:28 bobry: Borkdude: 1.4

4:30 ro_st: is it possible to write the output of pprint to a file?

4:30 Borkdude: there should be a table on clojuredocs with on the left hand side a list of exceptions and the right hand side some examples which produce those exceptions and explanations what goes wrong in that code :)

4:31 the first one being: ,(count (1 2 3))

4:31 ,(count (1 2 3))

4:31 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

4:35 Borkdude: bobry: Named is an interface: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Named.java

4:35 vijaykiran: ,(doc pprint)

4:35 clojurebot: Titim gan éirí ort.

4:36 vijaykiran: ro_st: pprint takes writer as second arg

4:36 Borkdude: bobry: for example Symbol implements this interface: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Symbol.java

4:41 vijaykiran: ro_st: try this (with-open [w (clojure.java.io/writer "file:///tmp/test.txt")] (pprint {:one 1 :two "two2"} w))

4:41 ro_st: awesome!

4:41 i was trying to use (spit)

4:42 vijaykiran: ro_st: that can be tricky because pprint just returns nil

4:42 Borkdude: ah keyword also implements named

4:43 ro_st: that worked beautifully, thanks vijay (once again)

4:44 vijaykiran: yw :)

4:46 is blah# a convention for files/dirs ?

4:47 Borkdude: vijaykiran: it is the notation for an autogensymmed name in a syntax quote

4:47 , `(let [foo# 10] foo#)

4:47 clojurebot: (clojure.core/let [foo__27__auto__ 10] foo__27__auto__)

4:48 vijaykiran: I'm looking at this: https://github.com/immutant/immutant/blob/master/modules/web/src/main/clojure/immutant/web.clj#L68

4:48 Borkdude: vijaykiran: yes, f# is an autogensymmed name, which is to say a fairly uniquely generated name

4:49 vijaykiran: note the `, it means syntax-quote, all names get fully qualified within it, except autogensymmed ones

4:49 ,`+

4:49 clojurebot: clojure.core/+

4:50 Borkdude: ,`+#

4:50 clojurebot: +__80__auto__

4:50 vijaykiran: Borkdude: okies, thx. I still need wrap/slice/splice/unwrap/synquote my brain :)

4:50 Borkdude: vijaykiran: just to make sure, what do you mean with wrap?

4:52 vijaykiran: nm ;)

4:52 vijaykiran: :)

5:09 Borkdude: is there a faculty function in clojure? ##(reduce * (range 1 10))

5:09 lazybot: ⇒ 362880

5:10 vijaykiran: faculty ?

5:13 pepijndevos: Borkdude: hehe, I'm not sure you can translate it that literally.

5:13 Borkdude: haha

5:13 vijaykiran: factorial ? :)

5:14 Borkdude: vijaykiran: ah, of course :)

5:16 pepijndevos: I know the concept as "whaming"

5:17 * pepijndevos like

5:17 pepijndevos: (defn ! [n] (reduce * (range 1 n)))

5:17 ro_st: does emacs clojure-mode support refactorings like rename? i ask because i see that it already does mark-occurences

5:22 Borkdude: pepijndevos: it should be (range 1 (inc n)), detail

5:23 pepijndevos: ok

5:23 Borkdude: pepijndevos: because the last value is non-inclusive

5:23 pepijndevos: ... right

5:24 apply would also work... eternal dilemma

5:32 amalloy: pepijndevos: "whaming"?

5:33 pepijndevos: amalloy: http://www.bol.com/nl/s/boeken/zoekresultaten/Ntt/De+Telduivel/search/true/searchType/qck/N/8299/sI/true/sA/300/sc/books_all/index.html

5:34 amalloy: Great book for kids to learn arithmetic, but they use funny names for some things.

5:34 amalloy: welp, i definitely don't speak enough...dutch? i'm ashamed to say i can't remember what language you speak

5:34 oh, that's his name for factorial?

5:34 pepijndevos: dutch

5:35 yea

5:35 telduivel = counting devil

5:36 amalloy: it makes a little sense, given the english slang "bang" for !

5:36 pepijndevos: yea

5:36 It's about a boy who sucks at mathc and has nightmares, and then the telduivel shows up in his dreams and starts questioning him about numbers and stuff.

5:37 haha, at some point his whole dream is full of rabbits, because he explained fibonacci.

5:41 Borkdude: pepijndevos: what is the dutch name in telduivel for factorial?

5:41 pepijndevos: Borkdude: wham, I think.

5:41 Borkdude: pepijndevos: why?

5:41 pepijndevos: can;t remember

5:42 Borkdude: pepijndevos: I remember my wife speaking about this book, maybe it inspired her to become a mathematician

5:43 pepijndevos: Borkdude: Amazing, but yea, inspiring book. Do you have kids?

5:43 Borkdude: pepijndevos: nope, no fibonacci like procreation here

5:43 pepijndevos: haha

5:44 They where all metaphors for visual surealistic things that happened in the drea

5:44 m

5:46 Borkdude: pepijndevos: did you know the limit of fib n / fib n-1 for n -> infinity is the golden ratio?

5:47 pepijndevos: yea...

5:48 You don;t even need to start at a valid number

5:48 Borkdude: pepijndevos: ha cool, didn't know that

5:49 pepijndevos: ... I think

5:53 ok, maybe I was wrong....

5:53 no!

5:57 Borkdude: https://gist.github.com/2774339

5:58 Borkdude: ,(let [fib-seed (fn [a b] (fn ([n] (fib n a b)) ([n f1 f2] (if (= n 1) f1 (recur (dec n) f2 (+ f1 f2)))))), fib-1-1 (fib-seed 1 1), fib-10-10 (fib-seed 10 10)] [(/ (float (fib-1-1 10)) (fib-1-1 9)) (/ (float (fib-10-10 10)) (fib-10-10 9))])

5:58 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: fib in this context, compiling:(NO_SOURCE_PATH:0)>

5:58 Borkdude: ,(let [fib-seed (fn [a b] (fn fib ([n] (fib n a b)) ([n f1 f2] (if (= n 1) f1 (recur (dec n) f2 (+ f1 f2)))))), fib-1-1 (fib-seed 1 1), fib-10-10 (fib-seed 10 10)] [(/ (float (fib-1-1 10)) (fib-1-1 9)) (/ (float (fib-10-10 10)) (fib-10-10 9))])

5:58 clojurebot: [1.6176470588235294 1.6176470588235294]

6:00 pepijndevos: I'm pretty sure it's 618

6:00 Borkdude: did you see my gist?

6:00 Borkdude: pepijndevos: yes, the golden ratio is 1.618.. though

6:01 pepijndevos: hm... right :(

6:01 Borkdude: look this is better, the further you go in the fib sequence the closer it will get:

6:01 ,(let [fib-seed (fn [a b] (fn fib ([n] (fib n a b)) ([n f1 f2] (if (= n 1) f1 (recur (dec n) f2 (+ f1 f2)))))), fib-1-1 (fib-seed 1 1), fib-10-10 (fib-seed 10 10)] [(/ (float (fib-1-1 20)) (fib-1-1 19)) (/ (float (fib-10-10 20)) (fib-10-10 19))])

6:01 clojurebot: [1.6180339631667064 1.6180339631667064]

6:02 Borkdude: the second one being the fibonacci with other start values

6:02 10 10 in this case

6:02 michaelr`: rrr

6:02 pepijndevos: Borkdude: Your code is a bit dense...

6:02 michaelr`: anyone knows how is (defpartial) in noir deiffers from a regular (defn)?

6:03 Borkdude: michaelr`: not much, look at the src

6:03 pepijndevos: yes… fib-seed is a function which takes two values and provides them as the two starting values to the fibonacci function

6:03 pepijndevos: and I call fib-seed with 11 (normal) and 10 10

6:04 pepijndevos: it shows that it indeed doesn't make much difference, but what if I choose different (absurd) values?

6:05 pepijndevos: Borkdude: It just takes longer to converge

6:05 Borkdude: pepijndevos: amazing, I guess a mathematical proof is more in place here than just trying numbers :)

6:06 pepijndevos: fixed my code:https://gist.github.com/2774339

6:07 michaelr`: Borkdude: yeah, i looked at the source and saw that i doesn't do much

6:08 Borkdude: michaelr`: I think defpartial says: this function will return something which will be embedded in a page

6:08 michaelr`: and not much more than that

6:08 michaelr`: (it doesn't even allow multiple function bodies)

6:09 pepijndevos: cool

6:13 michaelr`: i'm trying to find out why the rendering function here takes 140ms

6:25 damn

6:26 pepijndevos: michaelr`: Thread/sleep?

6:28 michaelr`: hmm nope

6:28 i don't know what slows it down. do you know whether it's reasonable for hiccup to take 100 ms to render a page?

6:28 of course it depends on what functions i call in the rendering process, but it seems i didn't use anything heavy just string concatenation

6:29 pepijndevos: michaelr`: that can be very expensive, depending on how you do it.

6:29 michaelr`: i also use map destructuring on most of the partials, could this be the reason?

6:30 Borkdude: michaelr`: you can analyze each part with the time macro in a repl?

6:30 pepijndevos: michaelr`: meten is weten (to measure is to know). You could run a profiler.

6:31 michaelr`: well yes, i timed all the parts and it looks like most of the time is spent somewhere in the html compiler.

6:31 profiler is probably the next thing i'm going to try

6:32 what are you using, yourkit?

6:32 pepijndevos: visualvm

6:32 bit yourkit seems to be what all the sponsored oss projects are using :P

6:33 michaelr`: :)

6:34 pepijndevos: can visualvm profile a remote process?

6:34 pepijndevos: michaelr`: I don't know... how remote? Like on a server remote?

6:35 michaelr`: yup

6:51 Borkdude: I'm trying out visualvm and I see a remote thing in the menu

6:54 pepijndevos: What is the timezone difference between the 2 ends of america?

6:55 I'm beginning to suspect some people just never sleep

6:55 Borkdude: pepijndevos: http://everytimezone.com/

6:55 clgv: oh someone changed his nick to his real name ;)

6:57 pepijndevos: clgv: yea

6:58 It happened way to often that people who read stuff by pepijndevos on twitter or elswhere on the interwebs never made the connection to fliebel on irc.

6:59 clgv: *g*

6:59 pepijndevos: g?

6:59 clgv: *grin*

7:00 * pepijndevos loves flying, hates airports

7:01 clgv: pepijndevos: you arrived in london?

7:01 pepijndevos: clgv: No, I'm flying this evening

7:01 clgv: ah right

7:01 I guess most do

7:02 pepijndevos: clgv: are you coming/already there?

7:02 clgv: pepijndevos: no. maybe next year.

7:05 pepijndevos: oh, sht, do I need to print some sort of ticket fro then conf?

7:07 yea, I do... phew

7:09 Borkdude: pepijndevos: I read that VirtualVM is bundled with the newest JDKs

7:09 pepijndevos: would that mean I would already have it on my system, if so, where? (OSX)

7:09 pepijndevos: oh?

7:09 Borkdude: pepijndevos: it looks pretty easy to use, I'm going to recommend to it a student who has heap memory problems right now

7:09 pepijndevos: no idea... /library or /developer probably

7:09 clgv: Borkdude: you mean JVisualVM?

7:10 Borkdude: clgv: http://visualvm.java.net/download.html

7:11 clgv: Borkdude: ok you meant it. yeah that one is in one of your jdk folders. it has been there already in java 6 as well

7:11 at least on linux

7:13 Borkdude: I guess it has to do with apple's jdk

7:14 clgv: openjdk is missing some tools as well

7:14 e.g. javaws

7:14 Borkdude: not a problem, I can just install it

7:29 piranha: hi all. Just installed lein2 and in 'lein2 repl' I cannot execute any command - it doesn't react to 'enter' key. It doesn't react properly to C-c either (though it prints ^C). It does react properly to other keys (including C-d). Any ideas what can cause this?

7:30 pepijndevos: piranha: No idea... try lein2 trampoline repl

7:30 piranha: sure

7:31 doesn't work either :(

7:32 pepijndevos: piranha: Update readline or jline? I have no clue what I'm saying btw...

7:32 piranha: I have tried REPLy yesterday (I had lein 1.7.1) and same problem was present. I understand that lein2 uses reply, but I have no idea how to fix this...

7:32 hm, update readline... well, I'm on osx, and I think I'm using system one

7:32 clgv: lein2 uses REPLy? not nrepl?

7:33 Borkdude: piranha: on what OS are you?

7:33 piranha: mac os x

7:33 clgv: I think both of them

7:33 that's what it prints for me on start: http://paste.in.ua/4272/

7:33 Borkdude: piranha: try this one https://www.dropbox.com/s/mw9fo73bueimtcm/leiningen-2.0.0-SNAPSHOT-bugfixed-reply-standalone.jar

7:34 piranha: Borkdude: thanks, how do I install this? :-)

7:34 (I'm sorry, I'm very new to clojure and java worlds)

7:34 Borkdude: piranha: put it in the folder ~/.lein/self-installs

7:34 piranha: should I remove current one there?

7:35 Borkdude: piranha: and update the version in the lein script

7:35 piranha: no, shouldn't hurt

7:35 piranha: or should I rename this one to replace? Or maybe just edit ~/bin/lein?

7:35 ah ok

7:35 :-)

7:35 Borkdude: piranha: I just wonder if you have the same bug that is fixed in this version

7:35 piranha: there were some concurrency problems with reply

7:36 piranha: Borkdude: http://paste.in.ua/4273/

7:36 Borkdude: piranha: can you show me your lein script?

7:36 piranha: sure

7:37 http://paste.in.ua/4274/

7:37 Borkdude: ^ here it is

7:37 Borkdude: piranha: remove the first LEIN_VERSION line

7:37 piranha: well, it should hurt :)

7:37 Borkdude: piranha: wait, that shouldn't matter of course

7:37 piranha: yep, just tried - nothing changes

7:37 Borkdude: piranha: what happens if you type "lein version" ?

7:38 piranha: Borkdude: same output (with ClassNotFound)

7:38 Borkdude: piranha: where did you put the jar?

7:38 full path

7:38 just to make sure

7:39 piranha: ~/.lein/self-installs/...jar

7:39 clojurebot: Excuse me?

7:39 piranha: but!

7:39 Borkdude: it's very small, 31k :)

7:39 Borkdude: haha

7:39 piranha: omg, you downloaded html I guess

7:39 piranha: probably, one moment

7:39 yeah I did :D

7:39 clgv: lol :D

7:39 piranha: ah, thanks, dropbox :D

7:40 Borkdude: well, it starts, but has the same problem :)

7:41 C-j doesn't work either

7:41 Borkdude: piranha: interesting...

7:41 piranha: are you in a project or not?

7:41 piranha: not, just in my home dir

7:41 Borkdude: piranha: are you using a ~/.lein/profiles.clj ?

7:41 piranha: hm, I'm wondering if it looks at my ~/.inputrc...

7:41 nope, I don't have it

7:42 ha!

7:42 got it fixed

7:42 by editing ~/.inputrc

7:42 Borkdude: piranha: what was it?

7:42 piranha: I had "Control-j: menu-complete" in my ~/.inputrc

7:43 now I'm even not sure why did I put it there...

7:43 Borkdude: piranha: what do you use control-j for ?

7:44 piranha: I guess I tried to get some fancy zsh-like autocompletion in bash...

7:44 well, doesn't matter, I think I can remove it

7:44 sorry to bother you :)

7:44 Borkdude: piranha: I guess you can get rid of the custom jar then, but if you run into a hanging repl, you will need it until the next preview release

7:44 piranha: ok, sure :) thanks a lot!

7:45 Borkdude: piranha: ok, also we have #leiningen channel

7:45 piranha: if you have any other questions

7:45 piranha: oh, ok :) will go there next time :)

8:48 ro_st: argh. could anyone using clojure-jack-in please tell me how to automatically (use 'clojure.repl) and (use 'clojure.pprint) when my slime repl starts up? i'm going round in circles trying to get :repl-init working

8:50 actually, is there a way to always have those two available regardless of what namespace my repl is in?

8:59 foxdonut: nice gadget on Google's home page today..

9:01 kilon: moog forever :D

9:03 gtrak: that's awesome, JS stuff?

9:04 kilon: hello by the way , I am new to clojure coming from common lisp and python (mainly python developer) is this the proper channel for all Clojure implementation including the javascript one ?

9:05 gtrak: kilon: yessir

9:06 * ro_st can't wait for some intrepid adventurer to add Clojure support to Dash

9:06 kilon: I ask because when I aks for other python implementations (see jython) except cpython in #python and other lisp implementations of lisp excpet common lisp in #lisp people turn blue and treat me like an alien :D

9:06 ro_st: kilon: that's ok. people can not act beyond their current level of consciousness :)

9:07 kilon: yeah I have some problem undestanding the reasoning behind this, but I am optimistic one day I will.

9:08 so you think its relative easy for a pythonista like me (glanced through common lisp with "Land of Lisp" book) to learn clojure ? or should i embrace myself ?

9:08 ro_st: very easy. you're not so much learning new stuff as unlearning old stuff

9:08 clojurebook.com joyofclojure.com vimeo.com/channels/fulldisclojure/

9:08 pick one and get stuck in

9:08 kilon: great, I have already read partial the documentation on the website

9:09 oh you are fast i was about to ask for links :D

9:09 foxdonut: kilon: well it was good of you to ask, I respect that. Indeed, discussions of ClojureScript are welcome here as well.

9:09 ro_st: i've got both the books (first two links) and i've read the first and am about 10% into the 2nd. can't recommend both of them enough

9:09 kilon: also watch all of rich hickey's talks on infoq and blip.tv

9:09 kilon: foxdonut: thanks i feel already welcomed

9:10 ro_st: cant thank you enough will bookmark all of them

9:10 ro_st: particularly "Are we there yet" and "Clojure Concurrency". you'll get a good sense of WHY clojure rather than HOW

9:10 knowing the why really helps me to discover the how

9:11 kilon: i'm about 3 weeks in, now. most fun i've had as a coder in years

9:11 coming from php ruby js

9:12 and an embarrassing amount of actionscript

9:12 kilon: common lisp has been a frustration, mainly because of the cryptic documenation

9:12 ah ruby is great and very similar to python , but better :D

9:15 foxdonut: ro_st: are you a flex developer?

9:15 kilon: how clojure fairs in terms of speed, I know speed is relative , but for example jython is probably very slow on JVM

9:15 ro_st: foxdonut: i used to be

9:16 vowed to stop investing my time into the Flash runtime in november last year, haven't look back since

9:17 kilon: jvm startup time is a pain, which is largely mitigated by doing in-repl development (in a hot JVM instance) i've done no benchmarking on production code, yet, but i've seen reports of favourable speed comparisons

9:18 foxdonut: ro_st: I understand. But, in previous years when you were in the flex world, how was it? From the outside looking it, the concept looked pretty good.

9:18 kilon: another question , does slojure has a cool debugger like most common lisps, I am extremely interested in live coding and that is what brough me to common lisp in the first place

9:18 foxdonut: I know that now they sent the framework to die over at Apache..

9:18 ro_st: foxdonut: it made a lot of promises that it never quite kept.

9:18 performance was always horrific for anything but the simplest of apps

9:19 kilon: saying that Overtone has made me interested in Clojure as well ;)

9:19 ro_st: huge SWFs. we have a v1 app that clocks in at 3.2mb. i'm about 40% of the way through implementing v2 with gclosure style javascript, and the resultant js 'binary' is 150kb. and it's stupid fast compared to the flash version

9:20 and, being static-typed OO just like java, you write lots and lots of code

9:21 kilon: ah nice that vimeo videos is what i needed, clojure in action

9:21 ro_st: awesome. just got my mysql to mongo converter clj code working. converting a 30 table sql db into a 7 collection mongo db using korma and monger

9:21 foxdonut: ro_st: that's all very interesting. Dare I ask if at least there were no browser issues?

9:22 ro_st: great learning experience

9:23 foxdonut: once you had the right flash version, no, no browser issues. getting to the right flash version could be tricky, though. to give you some idea of how much of a ghost town flash has become, the state of the art of flash detection is expressed in a blog post dated 2008

9:23 also, paying $500 for a dev tool? ridiculous.

9:24 gtrak: ro_st: I thought flex UI stuff was pretty nice, though

9:24 pandeiro: ,(apply str (interpose \. (partition-all 3 "12345678910")))

9:24 clojurebot: "clojure.lang.LazySeq@13291.clojure.lang.LazySeq@13e34.clojure.lang.LazySeq@149d7.clojure.lang.LazySeq@9e0"

9:24 gtrak: in terms of development

9:25 ro_st: it was ok. nice for trivial stuff. gets hairy quickly for anything bigger

9:25 pandeiro: ,(apply str (interpose \. (doall (partition-all 3 "12345678910"))))

9:25 clojurebot: "clojure.lang.LazySeq@13291.clojure.lang.LazySeq@13e34.clojure.lang.LazySeq@149d7.clojure.lang.LazySeq@9e0"

9:25 gtrak: ro_st: I enjoyed Mate

9:25 pandeiro: ,(apply str (interpose \. (map doall (partition-all 3 "12345678910"))))

9:25 clojurebot: "clojure.lang.LazySeq@13291.clojure.lang.LazySeq@13e34.clojure.lang.LazySeq@149d7.clojure.lang.LazySeq@9e0"

9:25 ro_st: you had to use stuff like robotlegs and friends to keep things tame

9:25 pandeiro: k i give up

9:25 ro_st: and again, performance sucks

9:25 Mate?

9:26 G0SUB: ,(apply str (interpose \. (apply concat (partition-all 3 "12345678910"))))

9:26 clojurebot: "1.2.3.4.5.6.7.8.9.1.0"

9:26 G0SUB: pandeiro, ^^^

9:26 gtrak: ro_st: http://mate.asfusion.com/ It's like an event-handling DSL and dependency injection framework

9:26 ro_st: ahh, like squiz and robotlegs

9:26 pandeiro: G0SUB: i want 123.456.789.10

9:26 ro_st: swiz, i mean

9:26 G0SUB: pandeiro, ok. just a sec.

9:27 pandeiro: actually i want 123.456.789-10 but there's no interpoleave fn

9:27 kilon: i wonder is there is any clojure javascript game engine out there for 2d games ? or should I stick to existing javascript libraries and call them in clojure ?

9:28 ro_st: kilon: the latter. clojurescript is still very young

9:28 gtrak: ro_st: an example of an eventmap: http://code.google.com/p/mate-examples/source/browse/trunk/examples/WeatherWidget/src/com/asfusion/weather/maps/MainEventMap.mxml

9:28 kilon: ah ok, I am trying to make a small isometric 2d rpg

9:28 foxdonut: ro_st: I was always interested in Flex but it never really took off in my area, so I only did small examples.

9:28 kilon: so far this seems my best choice ---> http://rpgjs.com/

9:29 G0SUB: ,(apply str (flatten (interpose \. (partition-all 3 "12345678910"))))

9:29 clojurebot: "123.456.789.10"

9:29 G0SUB: pandeiro, ^^^

9:29 ro_st: foxdonut: consider yourself lucky. i firmly believe FOSS HTML/CSS/JS is the way to go

9:29 kilon: i am new with javascript too :D

9:29 ro_st: kilon: javascript, the good parts by douglas crockford

9:30 gtrak: ro_st: anyway I miss the declarative style a bit, it was nice if you have good xml autocomplete

9:30 foxdonut: ro_st: no disagreement here. However, to be fair, I'd venture that "gets hairy quickly for anything bigger" applies to all development environments including HTML/CSS/JS -- it's up to the developers to find a way to keep the code well-organized.

9:30 kilon: anyone knows a irc channel for javascript game developers ? ro_st any recommendations ? yes I heard about that book , I have already bough a small reference on the language (pocket book)

9:30 ro_st: gtrak: yeah. it was certainly a good idea, but the flash player was never meant to do what they asked of it

9:31 pandeiro: G0SUB: that works, thanks

9:31 gtrak: yea

9:31 ro_st: foxdonut: of course. the difference is that with html/css/js, the runtimes are improving dramatically every day. flash player only just added support for the middle mouse button in v11

9:31 uvtc: pandeiro, don't get me confused ... there's no interpolate function! :)

9:32 ro_st: it's a great example of why open is better than closed source

9:32 pandeiro: uvtc: there's interpose and interleave but what i really want is an interpoleavelate :)

9:33 G0SUB: pandeiro, how do you want it to behave?

9:33 ro_st: what's the trick for measuring how long a function call takes?

9:34 gtrak: &(time 5)

9:34 lazybot: java.lang.ClassNotFoundException: clojure.core

9:34 gtrak: ,(time 5)

9:34 clojurebot: "Elapsed time: 0.064 msecs"

9:34 duck11231: ro_st: (time (function-to-test))

9:34 clojurebot: 5

9:34 gtrak: what's up pwith lazybot?

9:34 jsabeaudry_: begin lazy again...

9:35 being*

9:35 gtrak: &(println 3)

9:35 lazybot: ⇒ 3 nil

9:35 gtrak: &(time (println 3))

9:35 lazybot: java.lang.ClassNotFoundException: clojure.core

9:35 gtrak: Raynes: why doesn't 'time' work?

9:36 pandeiro: G0SUB: what i want is to be able to interpose a sequence of chars, not just one

9:36 G0SUB: pandeiro, show me an example invocation and the expected result.

9:37 foxdonut: ro_st: true

9:37 pandeiro: (format-id "12345678910") ;=> "123.456.789-10"

9:38 foxdonut: ro_st: earlier you said "most fun i've had as a coder in years" -- that's exactly how I feel as well, and last time Rich was here, I couldn't thank him enough.

9:38 Borkdude: ehm, conjing onto a vector doesn't really take n steps right?

9:38 G0SUB: pandeiro, that doesn't look like a general function. which sequence of chars are you interposing?

9:38 Borkdude, should be ~O(1)

9:38 pandeiro: G0SUB: '(\. \. \-)

9:39 ro_st: why do i always get these using jdbc and mysql? Message: Communications link failure

9:39 if i rerun, it works agaion

9:39 G0SUB: pandeiro, ok.

9:40 Borkdude: Gosub: where can I see this in the clojure source?

9:40 jsabeaudry_: pandeiro, interleave?

9:40 pandeiro: jsabeaudry_: yeah, i am thinking interleave but the problem is realizing the lazy-seq created by partition-all

9:41 (and also i want to interpose, not interleave, but i can just trim the final whitespace char or something)

9:41 jsabeaudry_: pandeiro, interpose can take a list of separators?

9:41 pandeiro: can it?

9:42 jsabeaudry_: I assumed you knew since you said you want interpose and not interleave

9:42 pandeiro: ,(interpose (list \. \. \-) (partition-all 3 "12345678910"))

9:42 clojurebot: ((\1 \2 \3) (\. \. \-) (\4 \5 \6) (\. \. \-) (\7 \8 \9) ...)

9:42 pandeiro: hmm yeah getting colder

9:43 here's my favorite so far: ##(mapcat str (partition-all 3 "12345678910") "..- ")

9:43 G0SUB: Borkdude, the RT side of things.

9:43 lazybot: ⇒ (\c \l \o \j \u \r \e \. \l \a \n \g \. \L \a \z \y \S \e \q \@ \1 \3 \2 \9 \1 \. \c \l \o \j \u \r \e \. \l \a \n \g \. \L \a \z \y \S \e \q \@ \1 \3 \e \3 \4 \. \c \l \o \j \u \r \e \. \l \a \n \g \. \L \a \z \y \S \e \q \@ \1 \4 \9 \d \7 \- \c \l \o \j \u \r ... https://www.refheap.com/paste/2843

9:44 Borkdude: GOSUB yes, this one? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L548

9:44 G0SUB: Borkdude, yeah

9:44 Borkdude: G0SUB: I don't understand what is happening there, it returns coll.cons?

9:45 G0SUB: so when I go look at PersistentVector.java, there should be a cons method?

9:45 G0SUB: Borkdude, yes. see how cons is implemented for APersistentVector

9:46 Borkdude, https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentVector.java#L543

9:47 Borkdude: G0SUB: so cons on APersistenVector is implemented as: make a new one with the value appended to the right?

9:48 G0SUB: Borkdude, should be something like that.

9:49 jsabeaudry_: ,(apply str (flatten (interleave (partition-all 3 "12345678910") (list \. \. \- \.))))

9:49 clojurebot: "123.456.789-10."

9:49 Borkdude: G0SUB: ok tnx. it's a bit confusing because cons is also something with sequences: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L554

9:49 G0SUB: jsabeaudry_, you cheated by punching that extra \. in ;-)

9:50 Borkdude: G0SUB: but I think I understand now

9:50 G0SUB: Borkdude, yes. conj is polymorphic, as you know.

9:50 jsabeaudry_: G0SUB, oops ;)

9:50 G0SUB: Borkdude, and conj ultimately calls cons.

9:50 Borkdude: G0SUB: yes, it's just a bit confusing why collection don't implement conj instead of cons, naming

9:50 pandeiro: ,(clojure.string/trim (apply str (map str (map #(apply str %) (partition-all 3 "12345678910")) "..- ")))

9:50 clojurebot: "123.456.789-10"

9:51 pandeiro: yeah both map and interleave shortcircuit on the longer of the seqs, that's the problem

9:51 G0SUB: Borkdude, I think that's because on the concrete collection it's indeed a consing that happens while to the caller it need not be cons as we expect.

9:52 Borkdude, cons to a vector is different from a cons to a seq, for example.

9:52 Borkdude: G0SUB: in terms of java implementation yes, but not from "our sequence side of the world"

9:52 G0SUB: sounds reasonable

9:52 dnolen: Borkdude: conj is the name of the polymorphic function we call in Clojure, cons is how collections implement it (in Java)

9:53 G0SUB: dnolen, +1

9:53 dnolen: Borkdude: fwiw the confusion of name is removed in ClojureScript, conj -> -conj

9:53 Borkdude: ,(cons [1 2 3] 0)

9:53 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

9:53 G0SUB: Borkdude, order is different in cons.

9:53 Borkdude: ,(cons 0 [1 2 3]) ;; damn ;)

9:53 clojurebot: (0 1 2 3)

9:53 G0SUB: Borkdude, it's all about semantics vs. implementation.

9:54 Borkdude: dnolen: do you mean the concrete collections in cljs have an implementation fn called -conj?

9:54 dnolen: Borkdude: yes, instead of cons as it's called in Java.

9:54 Borkdude: dnolen: great improvement ;)

10:38 clgv: do type hints on protocol methods help the clojure compiler or are they just ignored?

10:45 rhc: clgv: they help

10:45 clgv: when you call java methods, clojure uses reflection, but with type hints, its a regular java call (just as fast as vanilla java)

10:46 clgv: its my understand, they're meant to be added to performance sensitive areas.. no necessarily for type correctness

10:50 S11001001: I think clgv might mean one of the numerous other meanings of "help" in this context

10:51 clgv: I meant preventing reflection on call site

10:51 dnolen: clgv: type hints on protocol methods are completely ignored last I checked. If anything they just cause problems.

10:51 clgv: dnolen: ok, thx.

10:52 matthavener: wow, i completely missed "protocol methods" and just read "functions".. need more coffee

10:52 dnolen: clgv: type hints on definterface of course very useful.

10:58 dougs87: what conferences are best for clojure & FP?

10:58 bobry: does anyone know the status of domina? github repo seems abandoned ..

10:59 cgag: strangeloop is lookin good

11:03 si14: why ClojureScript complains about use of functions before their definition?

11:03 looks like 80s to me

11:04 matthavener: si14: doesn't clojure do that as well?

11:05 S11001001: yes

11:05 I recently discovered a great benefit to that

11:05 prevents people from just sticking functions in random order

11:05 si14: oh, then it's just my ignorance. sorry

11:05 matthavener: si14: you can use (declare fun-name) to work around it

11:05 S11001001: which is what actually happens, not the delightful "logical" order usually imagined

11:05 matthavener: if you have two functions calling each other

11:06 si14: matthavener: yeah, I can, thanks.

11:06 Borkdude: in Clean Code an auther recommends it the other way

11:06 first write the function that calls other functions and define them below

11:06 si14: it's just the consequence of my erlang-ish habit to put "helper" functions to the end of file.

11:06 Borkdude: author

11:07 S11001001: I rather like the other order

11:07 matthavener: me too, but i could just be extremely used to it

11:08 the benefit of Borkdude's way is typically the interface to a module is all the "root" functions

11:08 so when someone reads the code they're seeing all the functions they'll probably be calling at the top

11:09 Borkdude: what is the reason behind clojure's one pass style again?

11:09 S11001001: the way we have is like introducing lemma(s?) to build towards our principal theorems

11:09 macroexpand

11:09 raek: Borkdude: one reason to evaluate namespaces incrementally is macros

11:10 Borkdude: ah, the same in common lisp right?

11:10 raek: they can be used in all following expressions and can use all previous definitions

11:11 S11001001: not quite, but an observation of the trade-offs CL takes to let you write functions in any order, and how that interacts with macros, is worthwhile

11:11 Borkdude: this is nice: http://www.youtube.com/watch?v=tSnnfUj1XCQ

11:13 so one pass is not the case in CL?

11:13 S11001001: no, it's quite a lot more complicated

11:14 Borkdude: I guess they way Clojure handles it is the same as it would be if you typed it all yourself in the REPL one by one

11:14 S11001001: ok, I can't remember it

11:15 * pepijndevos nervous

11:16 Borkdude: (meanwhile I'm trying Entity Framework in Visual Studio to work with an Oracle Database…)

11:17 S11001001: that's not to say I don't like the CL rules; I prefer them to clojure's, which do seem to simplify at the expense of not letting you do stuff

11:17 CL's rules have the interesting effect that you can compile without loading, for example

11:18 it's just that there are a lot of them, and their consequences can confuse occasionally

11:21 Borkdude: pepijndevos: are you presenting smth?

11:22 pepijndevos: Borkdude: no

11:22 The weather forecast has tempest in it.

11:24 http://www.weather.com/weather/today/Dusseldorf+GMXX0028:1:GM

11:25 Borkdude: pepijndevos: good luck then (don't like flying)

11:25 TimMc: pepijndevos: I just see t-storms.

11:25 pepijndevos: I like flying, it's the part that comes before it.

11:26 TimMc: What is T-storms?

11:26 TimMc: thuderstorms

11:26 Borkdude: pepijndevos: yeah, the waiting, checking in, pff

11:26 TimMc: thunderstorms, even

11:26 clgv: pepijndevos: you are flying from düsseldorf?

11:26 pepijndevos: TimMc: Oh, is that different from a tempest?

11:26 clgv: yea, closer and cheaper than schiphol.

11:27 TimMc: I never hear people talk about tempests. I don't really know what they're supposed to be, beyond a strong windstorm.

11:27 pepijndevos: als, smaller, so less of the waiting and hurying

11:27 TimMc: windy thunderstorm, maybe?

11:27 uvtc: storms brew, tempests are in teapots. (!)

11:27 pepijndevos: TimMc: afaik, it's the same, but borrowd from french

11:27 TimMc: uvtc: !

11:28 pepijndevos: TimMc: It has a betetr sound to it that thunderstorm, imo

11:28 TimMc: So tempests... steep?

11:28 pepijndevos: steep?

11:28 TimMc: like a tea bag

11:28 uvtc: TimMc, ha ha ha. :)

11:32 pepijndevos: tempête: http://www.cinoa.org/gfx/60333.jpg

11:32 kima: hello #clojure

11:32 uvtc: hi kima

11:33 kima: I'm relatively new to clojure and used it for a few toy-mid-size projects and now i want to be also a part of the clojure community I guess this is the right place to start

11:38 S11001001: #clojure is also good if you don't want to be part of the community :)

11:38 kima: ok :)

11:41 i'm reading PAIP now and am translating the code to clojure would anyone be interested when I write that in blogposts like onlisp to clojure

11:47 kilon: #lisp deleted #clojure added, a new chapter has begun :D

11:48 clgv: :D

11:48 kilon: besides emacs , what kinds of IDE works well with clojure ?

11:48 clgv: CCW

11:48 kilon: first time i hear this, googling

11:48 clgv: => counterclockwise

11:49 TimMc: kilon: Vim, apparently.

11:49 Well, not an IDE...

11:49 kilon: ah clojure works with vim , thats nice to know

11:49 cgag: i remember trying to set up vimclojure with nailgun and it being pretty painful

11:50 kilon: no i do consider emacs and vim ides with the right extensions

11:50 but I am more a GUI dude

11:50 and recently trying Pharo and Squeak (Smalltalk) ruined me forever :D

11:51 gfredericks: are there any clojure libs similar to the ruby vrc lib, for recording and playing back http in tests?

11:51 Borkdude: (meanwhile visualstudio/entityframework/oracle combination is driving me mad)

11:51 kilon: Eclipse + CCW

11:51 uvtc: kilon, ccw is an Eclipse plug-in.

11:52 Incidentally, it's interesting that not many editors support smart-lispy style indenting.

11:52 kilon: Borkdude: uvtc oh sorry guys did not realise thanks, I kinda like Eclipse, good experience with pyDev

11:52 TimMc: I've heard some talk about IntelliJ being really good for Clojure.

11:52 kilon: and the added advantage is that Eclipse is made with Java

11:52 Do I dare assume that Clojure can script Eclipse realitivly easy ? like jython can for pydev

11:53 uvtc: kilon, someone did a screencast recently using Eclipse with Clojure ...

11:53 kilon: marvelous

11:53 uvtc: Ah. Here we are: http://cemerick.com/2012/05/02/starting-clojure/

11:54 kilon: I know it suppose to work in theory, Clojure running on VM and being java bytecode , but practice has its own suprises

11:54 TimMc: Oh, wow! It's a Clojure how-to on the web that isn't years old!

11:54 * kilon clicks

11:55 kilon: that link has my favorite 2 words "live coding" :D

11:55 thanks uvtc and everyone else

11:55 Borkdude: kilon: it's relatively easy and it plays nice with leiningen now as well

11:56 kilon: leiningen is ?

11:56 Borkdude: kilon: the build tool for clojure

11:56 dan`b: I wonder if anyone is doing live coding with TDD

11:56 kilon: ah i see, something like ant and cmake then , i assume

11:56 uvtc: kilon, I wrote this, maybe it might be helpful: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/

11:57 bderooms: can someone check whether I made a mistake on the transaction here? http://pastebin.com/CHxrGFd7

11:57 Borkdude: kilon: there is a leiningen plugin for eclipse that pulls in dependencies and puts the on the project's classpath

11:57 kilon: marvelous

11:57 Borkdude: kilon: also you can connect from the console to a running repl in eclipse

11:57 dan`b: leiningen is not just for building but also for managing external dependencies (3rd party libraries etc)

11:57 bderooms: if I run the whole application on a file of 10 million lins now and then the program erros with 'max retry reached'

11:57 kilon: uvtc: bookmarked, and i am watching the screencast

11:58 Borkdude: leiningen is the emacs of building tools ;)

11:58 kilon: that powerful ? wow

11:58 Borkdude: maybe I'm exaggerating

11:58 but it can do a lot of stuff

11:59 kilon: is it similar to Cake ? I heard that when watching a video on Overtone (Clojure library for Supercollider)

11:59 TimMc: kilon: Cake merged into lein.

11:59 kilon: oh

12:00 will certainly look into all that , thanks guys

12:00 TimMc: They were quite similar.

12:01 kilon: I was not wrong ? thats pleasantly surprising :D

12:03 dan`b: replying to your question, in Squeak / Pharo 90% of the coding is live TDD coding

12:04 and I would like to do something similar with clojure too if i can

12:04 S11001001: checkouts, I miss checkouts

12:04 kilon: I hope Clojure debugger is as powerful as Squeak's/Pharo's/ Common lisp

12:04 dnolen: kilon: fat chance

12:05 alexyakushev: Have anyone tried to integrate non-text resource (e.g. images) into a lein-newnew template?

12:05 kilon: dnolen: fat chance means, like or unlikely ?

12:05 english is not my mother tongue

12:05 TimMc: Very unlikely.

12:05 kilon: oh

12:05 :(

12:05 oh well

12:05 clgv: kilon: you have some of the basic debugging as for java

12:05 dnolen: kilon: unlikely. Clojure is hosted (JVM, JS) so in general must rely on the host debugging infrastructure.

12:06 kilon: well there is a way

12:06 Field

12:06 clgv: kilon: breakpoints and watchlist and variables in scope

12:06 kilon: it supports Clojure too

12:06 but yeah , no powerful debnugger there too

12:07 but no problemo

12:07 dnolen: kilon: which isn't to say tools can't provide a good "reasoning" experience, but I don't think you'll find CL or Smalltalk level of debugging anytime soon. Maybe one day if somebody really spends time on it.

12:07 kilon: Clojure offers already enough

12:07 yeah i know those things look simple in practice and complicated in design

12:09 alexyakushev: OK, is it possible that clojure.java.io/resource crumbles non-text resources (if argument provided has an URL type)?

12:09 Borkdude: unbelievable.. a bug in visual studio caused a setting which I could provide through a properties view not being saved into the underlying xml

12:09 this cost me another hour

12:10 alexyakushev: As far as I can see, the implementation of Coercions protocol for URLs does some string replacement magic which might not be very good for PNGs:) Of course it is magic and I don't understand what it does but still

12:10 TimMc: Borkdude: Let's yell at ibdknox about it! :-P

12:11 Borkdude: TimMc: let's hope light table will be better ;)

12:11 TimMc: alexyakushev: Link to source?

12:11 Borkdude: first some rest (installing Visual Studio SP1...)

12:12 uvtc: Borkdude, not sure if (first some rest) is legal syntax.

12:12 ;)

12:13 alexyakushev: https://github.com/clojure/clojure/blob/master/src/clj/clojure/java/io.clj, line 53

12:14 Borkdude: ,(first (some rest []))

12:14 clojurebot: nil

12:15 uvtc: Borkdude, teehehe. :)

12:15 mwillhite: hey all, trying to figure out the syntax here:

12:15 (defn from-sql-date

12:15 [#^java.sql.Date sql-date]

12:15 (from-long (.getTime sql-date)))

12:16 what is the #^java.sql.Date thing doing?

12:16 alexyakushev: mwillhite: it's a type tag

12:16 TimMc: mwillhite: That's a type hint.

12:16 technomancy: alexyakushev: you should be able to safely call input-stream on an io/resource

12:16 alexyakushev: *hint, right

12:16 TimMc: An old-style one, specifically.

12:16 mwillhite: does it have any impact on the argument?

12:16 what if I pass in something not of that type?

12:16 uvtc: TimMc, what's the modern style?

12:16 TimMc: Drop the #.

12:17 alexyakushev: technomancy: I'm calling io/reader on io/resource (just like in lein-newnew)

12:17 mwillhite: cool thanks

12:17 TimMc: mwillhite: It doesn't have an impact on the function, just on the .getTime callsite

12:17 alexyakushev: technomancy: but for some reason in the end my PNGs from resources are not PNGs anymore

12:17 technomancy: alexyakushev: reader will not work on binary data

12:17 it turns everything into strings

12:17 you need input-stream

12:18 TimMc: mwillhite: A cast to Date will be inserted at the location where .getTime is used instead of JVM reflection calls.

12:19 pandeiro: anyone familiar with the java tools for converting Date objects into localized strings?

12:19 alexyakushev: technomancy: Great, thanks. I guess this could also be a good thing to add in lein-newnew, what do you think?

12:19 TimMc: mwillhite: Things like ^long do something different -- they allow (under some circumstances) the use of primitives in function calls and local bindings.

12:19 uvtc: TimMc, what is ^java.sql.Date short for? Something like ^{:type java.sql.Date} ?

12:19 TimMc: uvtc: s/:type/:tag/, yes

12:20 uvtc: TimMc, Ah, :tag. Thank you.

12:20 technomancy: alexyakushev: add what?

12:20 TimMc: That's probably where alexyakushev got "tag hint". :-)

12:20 technomancy: input-stream is available

12:20 oh, you mean for documentation?

12:20 alexyakushev: technomancy: I mean that the default (renderer ...) functions calls io/reader by default

12:21 technomancy: well you have to have strings for templating to work

12:21 alexyakushev: technomancy: to be more specific, I mean the renderer function from leiningen.new.templates

12:22 technomancy: templating doesn't work with binary data

12:22 alexyakushev: technomancy: yes, but there is a feature that you could just copy the file (by not providing the second argument)

12:23 technomancy: sure, but that's built-in to clojure already

12:23 alexyakushev: technomancy: I thought it would work for any kind of data since it is not altered in any way

12:23 technomancy: though it should be better documented

12:27 alexyakushev: technomancy: I think you are right that new.templates module is for templates but... What would change if io/reader in `renderer` was changed to io/input-stream? This line only is called when no data is provided, so the file should be just copied as is.

12:28 technomancy: oh, I didn't realize renderer already had a 1-argument arity

12:28 alexyakushev: Yes, exactly what I was pointing at:)

12:29 technomancy: gotcha.

12:29 good point, feel free to open a ticket for that.

12:30 arguably it's not a renderer if it just copies verbatim, but if that arity already exists we might as well make the most of it

12:31 alexyakushev: technomancy: Thank you, I would. And since we are already speaking about new.templates would you mind one more question?

12:31 technomancy: sure thing

12:32 Raynos: why does clojurebot annoy me with its pings

12:32 alexyakushev: technomancy: I actually had do copy the `renderer` function into my project and modify it since it searches for resources in the hardcoded path "leiningen/new/"

12:32 Raynos: I guess I can just leave the channel :D

12:32 goodbye clojure

12:32 TimMc: Raynos: Who are you and what have you done with Raynes?

12:33 alexyakushev: technomancy: since my resource I'd like to create the new project with contain more than just source code, I've put it into different folder

12:33 TimMc: (and why do you have a shitty IRC client that puts NOTICE above MSG?)

12:33 alexyakushev: technomancy: does it make sense to make the resource in path in `renderer` customizable?

12:34 technomancy: alexyakushev: I'm not sure I understand. Why does whether you're rendering more than just source code affect the path you use?

12:34 do you mean the resources will be used by something other than Leiningen?

12:35 alexyakushev: No, I just don't want to put the resources into src/leiningen/new/... folder because I don't have anything else there

12:36 And it would be a bit confusing to keep resources (which are not only source files, but also some XMLs, PNGs etc.) in the source folder

12:36 technomancy: you can put them in resources/leiningen/new

12:36 once the jar is generated they'll all be in the same place

12:38 alexyakushev: Hm, that sounds like a solution, thank you

12:38 technomancy: sure

13:09 brainproxy: so cool that lein repl keeps history across sessions

13:09 wish the nodejs and coffee repls did that

13:11 TimMc: I think rlwrap is the thing that does that.

13:13 batasrki: is there a reason why lein repl doesn't confirm matching parentheses in ubuntu. It does so in os x

13:13 uvtc: batasrki, works for me in Ubuntu (using lein 2)

13:14 batasrki: ah, lein 2

13:14 I've lein 1.7.1

13:14 ok, cool, I'll try lein 2

13:14 banseljaj: batasrki: lein 1,7 owrks for me in ubuntu

13:15 foxdonut: perhaps a terminal issue?

13:16 banseljaj: Possibly.

13:16 batasrki: I'm running zsh

13:16 banseljaj: I am using bash

13:16 batasrki: more precisely, oh-my-zsh

13:18 uvtc: batasrki, I'm using bash as well.

13:34 gtrak: how do you kill swank after a clojure-jack-in?

13:37 tmciver: gtrak: one way is to kill the *swank* buffer.

13:42 llasram: gtrak: I can't seem to figure out the actual command name, but in the REPL you can hit , on a fresh line, then enter the command 'quit' at the minibuffer prompt

13:42 tmciver: llasram: that quits slime not swank.

13:44 llasram: Are there further implications to quitting SLIME? Because it definitely also kills the swank pracess

13:44 process even

13:44 p_l: llasram: depends on whether swank was started by slime or not

13:45 llasram: Fair enough. In this case, gtrak specifically mentioned clojure-jack-in, so...

13:46 p_l: take what I'm saying with a grain of salt, though - I haven't used such ancient version of SLIME in a looong time

13:46 tmciver: llasram: hmm, so it does. I thought I've seen cases where it didn't, but maybe I just killed the repl buffer and then reconnected to the running swank with 'slime-connect'.

13:54 jweiss: I notice there are nice options for lein repls, like :init-ns and :init (to set the initial namespace and run some arbitrary expression on startup). What about swank? Is this possible when running lein swank?

13:54 the repl options appear to be ignored

13:56 llasram: jweiss: Last I looked, the closest you could get was sending over some eval forms in a function hanging off of `slime-connected-hook`

13:56 jweiss: llasram: doh that kinda sucks, that would not be project specific :)

13:57 ah well, right now my users have to type (load "bootstrap") which isn't so bad

13:57 but thought i could even get rid of that

13:57 technomancy: you can load code in swank, but I haven't figured out how to set the initial namespace

13:58 jweiss: technomancy: i could just use 'user', how do i load code?

13:59 technomancy: jweiss: I don't remember; maybe :repl-init

14:00 jweiss: technomancy: the github page is a little confusing - https://github.com/technomancy/leiningen/blob/preview/sample.project.clj is that a sample for 1.x or 2.0?

14:00 technomancy: jweiss: the preview branch is 2.x

14:01 jweiss: technomancy: the master README links to the preview sample

14:01 so that is why i was confused

14:02 technomancy: yes, master is 2.x as well

14:02 I'll add a note at the top of sample.project.clj though

14:02 KirinDave: Hrrm. I hate to ask a specific framework question here… but...

14:02 Anyone here using Storm and clojure and transactional topologies?

14:03 technomancy: KirinDave: it can't be worse than inconsistent use of ellipses.

14:03 edw: I believe there's a #storm channel, though I imagine many of the users may not be Clojure developers.

14:03 technomancy: =)

14:03 KirinDave: technomancy: Bitch to colloquy, brah. ;)

14:03 technomancy: nah, Colloquy's got enough people yelling at it as it is

14:04 KirinDave: When OSX has a decent irc client somewhere anytime, let me know.

14:04 Basically they're all terrible. Colloquy's brand of terrible is at least manageable.

14:04 dnolen: KirinDave: I don't see nathanmarz around but you might want to check on #cascalog as well

14:04 KirinDave: /digression. My apologies.

14:05 technomancy: just messing with you =)

14:05 edw: technomancy: I've tried to stop using ellipses since considering the way their presence in original material complicates using them to indicate ellided passages. People used to write "The road to hell...good intentions." But now we need to write "The road to hell [...] good intentions." Or something similar. Chaois.

14:05 s/Chaois/Chaos./

14:06 KirinDave: Chaois is the new French word for chaos. Use it in France or be fined and jailed.

14:08 llasram: edw: So when you quote someone saying "[...]" and need to elide a portion, do you bump up the level of [] nesting on all existing uses and introduce your own as "[...]", or do you pick the next level of nesting and use that for your own elision?

14:08 edw: "The road to hell [[...]] good [...]"

14:08 muhoo: shit's getting esoteric up in here.

14:20 Guest84632: Hi, would you please tell me why I'm getting this runtime error? http://pastie.org/3956864

14:21 Chiron_: Hi, would you please tell me why I'm getting this runtime error? http://pastie.org/3956864

14:21 nDuff: Chiron_: put the finally just inside the try, rather than nested inside a let

14:22 Chiron_: any more idiomatic way to code this function?

14:22 hiredman: Chiron_: :| there are 4-5 errors easily seen

14:22 Chiron_: sorry, still learning :)

14:22 hiredman: calling server-socket as a function in the finally

14:23 binding server-socket to nil for no reason in the let

14:23 you don't need the when, they will be bound to something in the finally

14:24 nDuff: Chiron_: you might also consider with-open to force the close to eventually happen.

14:24 Chiron_: ...should be both more readable and idiomatic than the try/finally thing.

14:25 (granted, with-open is a macro that uses try/finally itself, but readability counts)

14:25 * S11001001 wishes with-open bound its var to an uncloseable thing

14:26 batasrki: why does clojure even have try/finally? That seems...wrong, somehow

14:27 Chiron_: thanks for help, will try (no pun intended :D) the suggested changes

14:27 gtrak: batasrki: clojure integrates with the host lang

14:27 pipeline: even if there was no real use for try/finally in clojure itself it would be important for java interop

14:29 batasrki: OK, so really, this is a misuse of a language feature

14:30 gtrak: misuse?

14:30 bhenry: ibdknox: ping

14:30 anyone else who might know: is there an implicit do here? https://gist.github.com/1d2f02a1a4683879c42a

14:30 it doesn't seem to clear the session

14:31 S11001001: unwind-protection (and rewind-protection in scheme's case) are well-established in many systems long preceding java

14:33 Chiron_: It is better now?

14:33 (defn health [request]

14:33 (with-open [server-socket (ServerSocket. *nimbus-port*) datagram-socket (DatagramSocket. *nimbus-port*)]

14:33 (.setReuseAddress server-socket true)

14:33 (.setReuseAddress datagram-socket true)

14:33 true))

14:34 gtrak: Chiron_: use a pastebin like refheap

14:34 Chiron_: ok, sorry

14:36 it is better now? http://pastie.org/3956931

14:38 S11001001: Chiron_: assuming you're going to add a parameter being a function to be called with your sockets

14:39 Chiron_: health-2 is a ring handler

14:40 gfredericks: so there's no built in data reader for byte-arrays yet?

14:40 oh wait there's the defaults map

14:40 I can find out for myself.

15:04 p_l: puchacz: here too? :)

15:06 puchacz: p_l: just watching now :)

15:06 p_l: heh.

15:07 puchacz: I sense the potential, but transition from CL is not straightforward one week of reading howtos....

15:07 p_l: I think I'm giving up my current clojure adventure. Maybe after I upgrade my PC few generations forward ;)

15:08 batasrki: puchacz: I bought programming clojure and joy of clojure books; Also, I'm doing the problems on 4clojure.com

15:08 still not straightforward, but easier

15:09 puchacz: batasrki: sure, but it is a new programming language, not common lisp with slightly different flavour

15:09 and has its own ecosystem of libraries too

15:10 p_l: yeah, and there's no compatibility with curret SLIME

15:10 nDuff: (?)

15:11 batasrki: puchacz: I guess it depends where you're coming from. My exposure to lisp/scheme is little schemer books and SICP

15:11 p_l: nDuff: SLIME used with Clojure is few years out of date

15:11 batasrki: otherwise, I've been an OO programmer my whole career

15:11 nDuff: p_l: ahh, missed that "current" was the key word there.

15:12 (as SLIME is quite certainly the best thing Clojure has going right now; I switched over to nREPL+CCW to bypass some compatibility issues, and it's considerably more painful)

15:12 ibdknox: what do you like about SLIME?

15:12 p_l: well, I can't use SLIME with Clojure, because I'm not willing to do crazy reloading to keep two different slime versions

15:13 ibdknox: workflow, speed

15:13 ibdknox: explain?

15:13 matthavener: two different slime versions?

15:13 ibdknox: I've watched people using emacs and the only thing I see used regularly is evaling a file or an expression

15:13 is there something more there?

15:13 puchacz: ibdknox: google for some slime videos

15:13 p_l: matthavener: Clojure requires an ancient slime version which uses old protocol

15:14 ibdknox: it's the practice of it. I test something quickly in REPL, write code in files, etc.

15:14 puchacz: go to definition, sensible autocomplete, who calls, who macroexpands, debugger, object presentation/inspection

15:14 p_l: it "flows"

15:14 and yes, M-. etc.

15:14 debugger

15:14 well, debugger is borked with java anyway, I suspect

15:16 but given that my current try at clojure was related to a project that is in CL, having to disconnect from CL to work with Clojure was jarring

15:17 ibdknox: I was just curious if there was something specific to SLIME

15:17 it doesn't sound like there really is

15:17 just that it has been nicely honed over the years :)

15:18 p_l: ibdknox: I can't explain it, it requires showing :)

15:18 and well... Clojure isn't best-supported

15:18 jweiss: there's got to be a better way to call a fn signature like [& {:keys [a b]}] with a map, other than using (apply myfn (apply (concat (seq mymap)))) right

15:18 ?

15:18 ibdknox: Yeah, I've only seen it in the context of Clojurians

15:18 llasram: screen cast?

15:19 emezeske: jweiss: Nope, that's why functions that destructure rest maps are annoying.

15:19 jweiss: emezeske: doh, oh well

15:19 ibdknox: we should stop using them

15:19 I still maintain unrolling options is an anti-pattern

15:19 emezeske: Yeah, it is really more convenient overall to just pass in a map

15:19 llasram: ibdknox: Unrolling options?

15:20 ibdknox: (defn foo [& {:as args}] ...)

15:20 so that you can write (foo :a 4 :v 6)

15:20 it looks like that would be nice

15:20 but it breaks in a number of cases where you want to thread things

15:20 TimMc: ~mapply

15:20 clojurebot: You could (defn mapply [f & args] (apply f (apply concat (butlast args) (last args))))

15:20 emezeske: Yeah.. it's not much harder to write (foo {:a 4 :v 6}), and then you can bring all of the tools to bear on that map arg

15:20 TimMc: ^ but you shouldn't have to.

15:21 ibdknox: that's busted :p

15:21 I shouldn't have to use another function

15:21 rkz: who's going to EuroClojure tomorrow?

15:21 llasram: Ah, ok. ibdknox, emezeske, that makes sense. *immediately adopts as a best-practice*

15:22 * emezeske does a fist pump.

15:22 ibdknox: lol

15:24 llasram: Real keyword argument are nice, and I've been thought occasionally about the "best" way to fake them, but just now it seems obvious -- just don't

15:24 s,been,,

15:24 ibdknox: it's not worth adding the complexity to save two characters

15:24 that's all you get

15:24 lol

15:25 gtrak: i just think it looks really awkward to have (func-call :arg1 val1 :arg2 val2)

15:26 (func-call {:arg1 val1 :arg2 val2}) isn't as vague

15:26 ibdknox: me too, though I think that firmly in the realm of personal preference

15:26 is*

15:27 gtrak: we should personally prefer simplicity

15:27 ibdknox: hahaa

15:27 it's true :)

15:29 matthavener: hmm, what about the implications of forcing (func-call {:arg1 val1}) on (partial func-call {:arg1 val1}) ?

15:30 gtrak: ah, interesting, you could have a partial-merge instead

15:30 solussd: is there a clojurescript function that converts a map to an associative-array?

15:30 matthavener: basically breaks it, and now you have two classes of functions for two classes of partial, like you're saying gtrak

15:30 dnolen_: solussd: there is not - and I assume you mean js object when you say associative array.

15:31 solussd: dnolen_: yeah

15:31 dnolen_: so how does one hand javascript a map?

15:31 dnolen_: solussd: in whatever way is suitable for you application.

15:32 your

15:32 pandeiro: solussd: https://gist.github.com/1658431

15:32 gtrak: matthavener, I think that's probably alright, since you'd have control over all your functions

15:32 solussd: I have an ^:export ed function that I'd like to return a javascript object from…

15:33 pandeiro: thanks!

15:33 pandeiro: actually i think .strobj is deprecated

15:33 dnolen_: solussd: pandeiro: relying on .strobj is not recommended.

15:33 solussd: :(

15:33 pandeiro: dnolen_: do you have a better example for the general use-case map->obj?

15:33 dnolen_: call seq on the map if you want to iterate kvs.

15:33 gtrak: matthavener: and you could bridge it by partitioning

15:33 dnolen_: pandeiro: I do not

15:34 matthavener: gtrak: what do you mean?

15:34 pandeiro: solussd: https://github.com/fogus/himera/blob/master/src/cljs/himera/client/repl.cljs#L16

15:34 matthavener: gtrak: like (my-fun {:a 1} {:b 2}) is the same as (my-fun {:a 1 :b 2}) ?

15:35 solussd: pandeiro: well that's simple. thanks

15:35 gtrak: matthavener: kinda... you could have (named-partial :a1 :b2) that uses partition to build a map, you can make your glue complicated without making the functions themselves complicated that way

15:35 solussd: doesn't work for deeper data structures though..

15:36 gtrak: :a1 v1 :a2 v2 I mean

15:36 pandeiro: yeah i realize that

15:36 solussd: guess I can add it to the first one

15:36 pandeiro: right, it seems pretty essential for interop to have that fn

15:37 emezeske: matthavener: #(func-call (merge {:arg1 val1} %)) is not that much worse than partial, and it handles duplicate keys gracefully

15:39 &(let [f (fn [{:keys [a]}] a)] (#(f (merge {:a 1} %)) {:a 2})

15:39 lazybot: java.lang.RuntimeException: EOF while reading, starting at line 1

15:39 emezeske: Oops

15:39 &(let [f (fn [& {:keys [a]}] a)] ((partial f :a 1) :a 2))

15:39 lazybot: java.lang.IllegalArgumentException: Duplicate key: :a

15:39 emezeske: &(let [f (fn [& {:keys [a]}] a)] ((partial f :a 1) :a 2))

15:39 lazybot: java.lang.IllegalArgumentException: Duplicate key: :a

15:40 emezeske: matthavener: ^

15:40 nDuff: Anyone have a feel for typical turnaround on moderator reviews for posts to clojure-tools?

15:40 clojurebot: forget clojurescript is Chouser's baby

15:40 emezeske: I am doing really bad at copy/paste today

15:40 &(let [f (fn [{:keys [a]}] a)] (#(f (merge {:a 1} %)) {:a 2}))

15:40 lazybot: ⇒ 2

15:41 matthavener: emezeske: yeah i was just pointing out that if you have some opaque function and want to add some arg to it, then you'd have two ways: merge the map or use partial

15:41 i don't know enough to say if either way is wrong or better :)

15:42 emezeske: Well if it's unknown, merge is much better, because you can't know if adding :a 2 to the arguments will break things or not

15:42 Whereas with merge, it will work, and the semantics are obvious

15:42 gfredericks: what's the literal for ##(type (into-array Byte/TYPE []))?

15:42 lazybot: ⇒ [B

15:43 amalloy: ain't no such thang

15:43 &(Class/forName "[B") is closest, i suppose

15:43 lazybot: ⇒ [B

15:44 gtrak: ,Byte/TYPE

15:44 clojurebot: byte

15:44 hyPiRion: Not exactly the same there.

15:44 &(type (byte-array 0))

15:44 lazybot: ⇒ [B

15:45 gfredericks: so if I want to define a #bytes data reader, and I want a function for printing things as well, am I supposed to define print-dup for byte arrays?

15:45 gtrak: ,[B

15:45 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

15:45 gtrak: ,\[B

15:45 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unsupported character: \[B>

15:45 TimMc: &(class (java.lang.reflect.Array/newInstance Byte/TYPE 0))

15:45 lazybot: ⇒ [B

15:45 TimMc: &(class (java.lang.reflect.Array/newInstance Byte/TYPE 15))

15:45 lazybot: ⇒ [B

15:46 TimMc: &(class (java.lang.reflect.Array/newInstance Byte/TYPE (int-array 15)))

15:46 lazybot: ⇒ [[[[[[[[[[[[[[[B

15:46 llasram: gfredericks: You can inject a literal reference to the class object with the read-time eval reader macro: #=(java.lang.Class/forName "[B")

15:46 That works for multi-methods

15:47 gfredericks: ah ha

15:47 alfborge: I'm doing some screen scraping using enlive-html and for one of the things I'm extracting I believe the best tool is a plain regex. Is there a good way to do that given a seq of nodes?

15:47 gfredericks: print-dup is unideal though since it prints normal things all funny :/

15:47 llasram: For protocols you can use extend-type with just the normal compile-time top-level evaluation of (Class/forName "[B")

15:48 alfborge: As in, I have the result of a (html-resource input) and I want to run a regexp against input however I don't have input anymore.

15:49 llasram: Now that I think about it, the latter should probably work fine for multimethods too... I think it was just extend-protocol which needs the reader literal, because it's explicitly looking for lits vs other things to identify sections for particular types

15:50 gfredericks: Any reason not just extend `print-method` ?

16:03 solussd: can I pass a javascript function to a clojurescript function and then call it from clojurescript?

16:04 alfborge: Speaking of enlive: Anyone know a way to join this into one selector: (select (select r [:table :td :div]) [(attr-contains :title "flummoxed")])

16:05 Chousuke: solussd: I don't see why not :/

16:05 pandeiro: solussd: yep

16:06 i just tried it on himera, define a javascript function in the console and call it at the repl

16:06 Chousuke: it seems to me clojurescript interop is a lot better integrated than clojure interop

16:06 solussd: ok, trying to call a javascript function passed as an argument to a clojurescript function that calls the server using the fetch libs fm/remote macro-- appears that my callback is never called.. :/

16:07 Chousuke: less impedance mismatch I suppose.

16:07 solussd: is "this" involved? :P it's always problematic

16:07 solussd: Chousuke: no

16:08 pandeiro: solussd: i had a fun time trying to use fetch as well, it had to do with how the remotes are stored by key, can't remember specifics

16:11 alfborge: Answering my own question: (select r [:table :td #{:div (attr-contains :title "flummoxed")}])

16:11 nDuff: What's the counterclockwise equivalent to ctrl+right in paredit? That is, if I have "(foo (bar|) baz)" (cursor being the |), and I want "(foo (bar| baz))", is there a keybinding to do that?

16:12 TimMc: slurp-sexp-right

16:14 nDuff: TimMc: I'm not seeing that in the counterclockwise keybinding docs (http://code.google.com/p/counterclockwise/wiki/EditorKeyBindingsFeatures)

16:15 TimMc: Sorry, I was just giving the name for it.

16:15 nDuff: ahh; graci.

16:15 (incidentally, it's not a name that gets the most work-safe Google results, even when combined with "counterclockwise")

16:15 TimMc: snrk

16:16 Well, does barf-sexp-right give less-sketchy results?

16:17 hsteak: hello

16:17 TimMc: nDuff: Huh. I guess it isn't there? I regard it as a pretty basic gesture...

16:18 * nDuff does too, and is having serious trouble figuring out how to work effectively without it.

16:18 TimMc: You'd have to compose at least 3 existing gestures to get the same effect.

16:18 s/compose/sequence/

16:19 hsteak: i have a small issue, i am looking for a way to do For i, j in R x R: if i != j function(i, j), without doing the symetry. for example : say R = (a, b, c), a want to get Res = ((a, b), (a, c), (b, c))

16:19 any idea?

16:20 TimMc: hsteak: (for [i (range 10) j (range 0 i)] ...)

16:20 raek: hsteak: ##(let [r [:a :b :c]] (for [i r, j r, :when (not= i j)] (vector i j)))

16:20 lazybot: ⇒ ([:a :b] [:a :c] [:b :a] [:b :c] [:c :a] [:c :b])

16:21 hsteak: TimMc, raek thx

16:21 TimMc: raek: Not quite.

16:21 [:b :c] conflicts with [:c :b]

16:21 raek: &(let [r [:a :b :c]] (for [i r, j r, :when (neg? (compare i j))] (vector i j)))

16:21 lazybot: ⇒ ([:a :b] [:a :c] [:b :c])

16:21 raek: there :)

16:21 hyPiRion: It's already implemented in clojure.math.combinatorics.

16:21 TimMc: nice

16:22 S11001001: ,(doc tails)

16:22 clojurebot: Excuse me?

16:22 matthavener: hyPiRion: i was waiting for that :)

16:22 llasram: ##(do (use '[clojure.math.combinatorics :only [combinations]]) (combinations [:a :b :c] 2))

16:22 lazybot: java.lang.ClassNotFoundException: clojure.math.combinatorics

16:22 llasram: Oh, of course

16:33 pandeiro: ibdknox: something about SLIME i like - at the end of the day, I have a buffer with everything i did at the repl, which i can save and revisit or grep when i need to

16:33 ibdknox: that doesn't seem specific to SLIME to me

16:34 out of curiosity do you eval from a buffer or actually use a repl?

16:35 p_l: ibdknox: in CL it depends what I want to do

16:35 pandeiro: ibdknox: no not saying it's slime specific, just an aspect of the workflow i like.. i eval from buffers and at the repl

16:35 p_l: usually I eval from repl, but code in buffer ;)

16:35 technomancy: ibdknox: apart from the debugger the main nontrivial thing I miss from slime when I use lein repl is the inspector, which is a hyperlinked object pretty-printer/browser

16:35 p_l: (that is, I use "compile last expression/defun")

16:36 ibdknox: technomancy: I see

16:36 technomancy: jump-to-definition is definitely my most commonly-used command other than compile, but that's trivial to implement

16:36 ibdknox: technomancy: is that basically just the output of pprint that is clickable?

16:37 technomancy: ibdknox: no, it's much more capable; it works on classes, methods, interfaces, and constructors too

16:37 p_l: ibdknox: another thing I like about SLIME is presentations - something lifted from LispM/CLIM

16:37 ibdknox: technomancy: for Java stuff?

16:37 pandeiro: technomancy: can i use that to inspect a java class? how do i do that?

16:37 technomancy: ibdknox: yeah, in 90% of cases it can replace javadoc

16:37 pandeiro: C-c S-i

16:37 ibdknox: p_l: presentations?

16:39 p_l: ibdknox: when you have something returned in REPL, it's a presentation, not text - you can copy it around and it will contain an actual reference to the object

16:39 (might be a weak ref)

16:39 ibdknox: oh neat

16:39 jhulten: Hey. If I have a vector in a ref and I want to empty it how would I do that?

16:40 ibdknox: probably less useful in CLJ since you're working with values

16:45 jhulten: ref-set … got it.

16:48 * PeregrinePDX imagines ibdknox making notes of things to try to include in light-table

16:48 ibdknox: just gathering information :)

16:48 technomancy: I have a feeling an inspector could be mostly implemented as an nrepl middleware so it'd be usable from a variety of clients

16:48 ibdknox: if you're around me for any length of time you'll find out that I'm *very* inquisitive

16:49 Chiron_: Any Clojure web framework that let us pass objects/structures to a template to render? you know just like Django, SpringMVC ..

16:49 ibdknox: comb

16:49 or mustache

16:49 http://github.com/weavejester/comb

16:50 or https://github.com/davidsantiago/stencil

16:50 nDuff: Doesn't enlive also work that way?

16:50 https://github.com/cgrand/enlive

16:50 technomancy: no, enlive enforces view/logic separation

16:51 ibdknox: enlive is also not actively maintained :p

16:51 comb is like 60 lines

16:51 so it doesn't need to be :)

16:51 metajack: enlive isn't maintained? what? i figured it was just "mature"

16:52 ibdknox: lol

16:52 technomancy: stencil seems nice, but I would hesitate to recommend the logic-in-views approach to a newcomer

16:52 Raynes: I wouldn't say it isn't maintained.

16:53 I had a bug a while back and cgrand fixed it.

16:53 ibdknox: technomancy: hm? stencil is mustache no logic

16:53 cemerick: surely comparing comb and enlive is a category error.

16:53 technomancy: ibdknox: right; I would recommend stencil but not comb.

16:53 Chiron_: technomancy: true for logic-in-views. I'm a heavy JSTL user :)

16:53 ibdknox: yeah stencil is great :)

16:54 technomancy: I mean I'm glad comb is there; sometimes you need it.

16:54 ibdknox: yeah

16:54 also it's just so damn clever :p

16:54 technomancy: or so I'm told =)

16:54 cemerick: technomancy: BTW, you made me think of Clojure while watching Les Miserables last night. :-P

16:54 technomancy: cemerick: Javert?

16:55 cemerick: technomancy: yup

16:56 technomancy: ok, PSA: if anyone ports slime's inspector to nrepl, they have to call it Javert.

16:56 that is all.

16:56 zerokarmaleft: Hugo's Javert?

16:57 * wink tries to remember Les Miserables from 1996

16:57 zerokarmaleft: nvm, reading the scrollback is good

16:58 * p_l would be happy if someone simply updated swank-clojure and co. to current SLIME. IntelliJ by itself is pretty big, using leiningen kills the machine... ;)

16:58 technomancy: p_l: only going to happen if someone cares enough to do it.

16:59 p_l: might work on that if I get a java-centric job, I guess

16:59 right now CL support is more important to me

17:01 Borkdude: finally entity framework/visual studio/.NET and oracle are friends now...

17:08 jtoy: can I use require so that the namespace is added into the current namespace so i don't need to type out a path?

17:12 Borkdude: jtoy: you need use for that

17:13 jtoy: (use 'clojure.repl)

17:13 jtoy: ok, is it that refer that actually does that or use? i

17:13 Borkdude: jtoy: or in the ns-macro: (:use clojure.repl), but even better is with only: (:use [clojure.repl :only [varx vary varz])

17:14 ,(doc use)

17:14 clojurebot: "([& args]); Like 'require, but also refers to each lib's namespace using clojure.core/refer. Use :use in the ns macro in preference to calling this directly. 'use accepts additional options in libspecs: :exclude, :only, :rename. The arguments and semantics for :exclude, :only, and :rename are the same as those documented for clojure.core/refer."

17:14 Borkdude: ,(doc require)

17:14 clojurebot: "([& args]); Loads libs, skipping any that are already loaded. Each argument is either a libspec that identifies a lib, a prefix list that identifies multiple libs whose names share a common prefix, or a flag that modifies how all the identified libs are loaded. Use :require in the ns macro in preference to calling this directly. Libs A 'lib' is a named set of resources in classpath whose contents...

17:15 Borkdude: ,(doc refer)

17:15 clojurebot: "([ns-sym & filters]); refers to all public vars of ns, subject to filters. filters can include at most one each of: :exclude list-of-symbols :only list-of-symbols :rename map-of-fromsymbol-tosymbol For each public interned var in the namespace named by the symbol, adds a mapping from the name of the var to the var to the current namespace. Throws an exception if name is already mapped to somethin...

17:15 Raynes: &(doc require)

17:15 lazybot: ⇒ "([& args]); Loads libs, skipping any that are already loaded. Each argument is either a libspec that identifies a lib, a prefix list that identifies multiple libs whose names share a common prefix, or a flag that modifies how all the identified libs are loaded.... https://www.refheap.com/paste/2847

17:15 Raynes: If you're using Clojure 1.4, you also have :refer that you can give to require to do the same thing that `use` does.

17:15 gfredericks: pprint is a lot slower than pr

17:17 Borkdude: Raynes: you mean like this? (:require [foo :refer [x] :as bar]), so you can write (bar/y) but (x ..)?

17:25 Chiron_: why in the repl we need to quote symbols (require ['bang.core :as 'bang]) and we don't have to quote when inside clj files?

17:25 dnolen: Chiron_: nothing to do with files. It's because (ns ...) is a macro.

17:26 Chiron_: so it won't evaluate (hence no need to quote)?

17:26 dnolen: Chiron_: yes

17:27 Chiron_: I find myself prefer require over use, it allows more documented code. is it a good practice?

17:28 technomancy: Chiron_: I'd say yes

17:31 Borkdude: since require has refer and it's a good custom to use use only with only, I guess there is even less use for use

17:31 jtoy: is there a way from the repl I can see what names spaces I have loaded?

17:32 technomancy: jtoy: (all-ns) I think

17:32 jtoy: I loaded a namespace with use but am unable to use the method i want

17:33 Borkdude: jtoy: java method?

17:34 jtoy: for Java classes you need import

17:35 use is no longer required, require is of much use

17:35 technomancy: heh

17:35 use is still good for backwards-compatibility in libraries

17:35 jtoy: it seems (all-ns) shows the namespace

17:35 Borkdude: and for REPL-sessions

17:35 I tend to use use, because I have to type less

17:36 technomancy: reqTAB =)

17:36 Borkdude: that's four keystrokes

17:36 technomancy: oh, but :refer :all is more; true

17:38 I wonder why slime's tab completion doesn't put a space after completed tokens when it knows they are fully-completed

17:38 jtoy: so from the repl I do (use :reload-all 'interests.core) which in interests.core it calls (use 'interests.test) shouldn't interests.test methods be available from the repl?

17:38 Borkdude: technomancy: because maybe you want to type ) or / or . ?

17:38 jtoy: no

17:38 raek: jtoy: no, you only refered the functions from interests.core. refer is not transitive. (use = require + refer)

17:39 Borkdude: jtoy: it doesn't work transitively

17:39 technomancy: Borkdude: sometimes. not for function names though.

17:40 jtoy: so is there a way to do what I want?

17:40 TimMc: Hopefully not.

17:40 Borkdude: jtoy: don't do it…

17:40 jtoy: TimMc: to me?

17:40 TimMc: yeah

17:40 jtoy: I want to have one namespace that loads everything up, how does one structure that?

17:40 Borkdude: jtoy: you must also use interest.test

17:41 TimMc: Maintenance nightmare.

17:41 Borkdude: jtoy: go read about the namespace macro

17:41 TimMc: Readability nightmare too.

17:41 Borkdude: jtoy: http://clojuredocs.org/clojure_core/clojure.core/ns

17:42 aaelony: lein2 exec -e is damn cool :)

17:42 technomancy: top-level side-effects =(

17:42 Borkdude: jtoy: for example this one http://clojuredocs.org/clojure_core/clojure.core/ns#example_527

17:43 technomancy: aaelony: you can do that without a plugin: lein run -m clojure.main -e

17:43 Borkdude: I renamed lein 1.7 to lein1, lein2 is now just lein ;)

17:44 jtoy: Borkdude: what is good about that example? i don't fully understand

17:44 aaelony: technomancy: nice stuff

17:46 technomancy: Borkdude: wooo

17:47 Borkdude: jtoy: it just shows you can require/use multiple other namespaces.

17:47 I gtg

17:50 samedhi: I am attempting to get running in my emacs, from slime I type (d/create-database uri) I get, "Unknown location: error: java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.Util.equiv(CC)Z", does anyone have any ideas?

17:50 *get datomic*

17:50 zaiste: hi

17:51 amalloy: incompatible clojure versions, samedhi

17:51 you're probably running 1.3 or lower, with code compiled against 1.4?

17:51 samedhi: I am 1.4.beta3

17:52 let me make sure though

17:54 I have "clojure-1.4.0.jar" in my lib directory, and I have it written as [org.clojure/clojure "1.4.0-beta3"] in my project.clj, is any of that wrong?

17:55 S11001001: samedhi: run lein deps :tree to examine the results of lib resolution

17:56 (that's a thing now right?)

17:57 samedhi: S11001001, WARNING: passing an argument to deps is deprecated. is all I got back, is this a lein2 feature?

17:58 yeah, it appears to be a line 2 thing, because it works with that.

17:58 *lein2

17:58 S11001001: for lein 1 try lein pom; mvn dependency:tree, assuming you've got mvn installed

17:58 but lein2's output probably good enough

18:06 dwierenga: is the clojure-csv the canonical library for writing CSV files? it looks like there are lots of csv libraries on clojars

18:06 Raynes: Try it free for 30 days or your money back.

18:06 Or something like that.

18:06 samedhi: S11001001, sorry sort of took a while to run, I do see "[INFO] +- org.clojure:clojure:jar:1.3.0:compile", that does not seem right, does a different dependency of mine supersede the clojure version I specify in project.clj?

18:07 dwierenga: Raynes: um. thanks..

18:07 S11001001: samedhi: first thing, why are you asking for 1.4.0-beta3, when 1.4.0 is out?

18:08 Raynes: dwierenga: Yeah, sorry. dsantiago's stuff is always good, so go for it.

18:08 S11001001: samedhi: anyway with maven, shallowest, then leftmost wins, unless someone's speccing a hard range

18:08 samedhi: umm, I actually though beta3 would be after just 1.4.0.

18:08 I guess that makes sense

18:08 S11001001: hard ranges are relatively rare, though some did accidentally think they were good to use (e.g. me)

18:09 samedhi: Ok, I will see if just [org.clojure/clojure "1.4.0"] makes a difference

18:09 dwierenga: Raynes: ok cool thx!

18:09 S11001001: I think there is 1.5.0-alpha1 if you'd like to try that :)

18:09 moreover misspelling will lead to rejection, so check search.maven.org for exact version specs

18:21 seancorfield: I know this is probably a long shot but does anyone here use iChat for screen sharing / pair programming (on a Mac) and also use Emacs?

18:22 (and I know that's a very generic question)

18:23 technomancy: I believe fully-visual screen sharing is still too high-latency to support pairing unless you have a crazyfast connection.

18:23 seancorfield: Reason for question: my team has noticed some oddities with remote editing via iChat in several editors and, in particular, with Emacs, the various command keys don't appear to be transmitted correctly via iChat... Curious if anyone has run into that and/or found a solution?

18:23 technomancy: well, it's certainly less than ideal but with cable modem speeds it's not _too_ painful... so the benefits outweigh the downsides right now...

18:24 but i want to move the team to emacs and the fact it doesn't play nice with iChat is an obstacle right now :)

18:24 technomancy: everyone's different I guess. I couldn't stand it.

18:24 I could see using full-screen sharing for something other than emacs

18:25 but half the fun of emacs is that it works great over SSH

18:25 seancorfield: yeah, i know :)

18:25 S11001001: but you don't get emacs image display or speedbar over ssh :)

18:25 technomancy: haha; speedbar

18:26 I guess if you're going for a gradual transition it might make sense

18:27 seancorfield: every member of the team has a full self-contained dev environment so we essentially have to have ssh into each other's machines - and we're all remote with dynamic IP addresses :)

18:27 unless i set up a shared dev server we can all ssh into... which does have some benefits :)

18:28 technomancy: at sonian we had ~/.ssh/config kept in git so everyone could keep their shared usernames and dyndns entries in sync

18:28 seancorfield: interesting idea

18:28 technomancy: which kind of sucks because there's no ~/.ssh/config.d/* support; you have to stitch files together by hand if you want to keep personal settings in there too

18:29 what we really need to do is convince zkim to get http://pair.io out of alpha =)

18:29 * nDuff had his own script for doing that (in a past life)

18:31 zaiste: can I ask a question about compojure/ring here ? =)

18:34 emezeske: zaiste: You betcha!

18:34 zaiste: ;)

18:35 i'm trying to figure how to read POST params from a form

18:35 (POST "/" {params :params} (...)) gives empty map

18:36 but (POST "/" {body :body} (slurp body)) gives the params in a raw format

18:36 not sure how should I read them...

18:36 emezeske: zaiste: It sounds like maybe you aren't using the necessary middleware

18:37 zaiste: I think you need to set up the wrap-params middleware

18:37 zaiste: I wrapped routes with handler/site from compojure

18:38 emezeske: I think that newer versions of compojure do not add wrap-params by default

18:39 zaiste: not sure about it, but reading from compojure source

18:40 if it's wrapped with handler/site

18:40 it should be automatically wrapped with wrap-params as well

18:40 https://github.com/weavejester/compojure/blob/master/src/compojure/handler.clj

18:40 emezeske: Looks like you're correct!

18:41 zaiste: =)

18:42 emezeske: In which case, I've got no idea what's going wrong

18:42 :(

18:42 zaiste: thanks anyway!

21:19 seancorfield: technomancy: fwiw, i decided the "simple" solution to my problem, at least in part, was to start an emacs daemon at login time and use emacsclient -t in Terminal to connect to it :)

22:06 muhoo: pandeiro: i'm poking around in this couch-session stuff atm. found where it's blowing up, now trying to fix it

22:14 pandeiro: muhoo: cool where is it blowing up?

22:14 muhoo: pandeiro: https://www.refheap.com/paste/2850

22:15 i think it's an incompatibility with latest clutch, not ring

22:16 pandeiro: makes sense, did put-document change?

22:18 muhoo: not since 2011

22:19 oh wait, it did, 4/08/12

22:19 to-byte-array

22:21 but that's not the problem, the data passed in to write-session is an emty map. will track down

22:27 arrgh... noir won't reload namespaces from checkouts, even if i (require :reload) them

22:28 * muhoo restarts the jvm again

22:28 muhoo: actually (require :reload) ignores the checkouts completely, and pulls stuff from a jar instead.

22:36 pandeiro: muhoo: sorry i

22:36 ... havent been able to look

22:37 kwertii: Is it possible to get the project.clj version string from within the project's code?

22:45 muhoo: pandeiro: np, i got this :-)

23:20 pandeiro: fixed.

23:21 well, sort of. there's a bug in clutch where if you do (get-document db nil), you get back a document with a map of the db's status

23:21 and couch-session expects it to return nil

23:22 * muhoo considers blowing off all this nosql stuff and just using postgres instead

23:27 ro_st: anyone using live-coding-emacs?

Logging service provided by n01se.net