#clojure logs

2012-05-23

00:16scottjdnolen: would be nice to add a link to synonym page on main himera page.
00:22brainproxy+1 ^
00:25dnolenscottj: brainproxy: fork, fix, and send fogus a pull request.
00:29scottjRaynes: "Химера 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.
00:30brainproxyfork in progress
00:30scottjbrainproxy: thanks
00:41brainproxyscottj: done, https://github.com/fogus/himera/pull/19
00:42dnolenbrainproxy: scottj: sweet!!!
00:43brainproxybtw, if anyone knows the answer... http://news.ycombinator.com/item?id=4011404
00:44brainproxysomeone 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
00:45aperiodicbrainproxy: hah, i brain-farted and thought you meant the clojure cheatsheet
00:45aperiodicapologies
00:46brainproxyaperiodic: np, andy kindly replied and went hunting for the source file but he couldn't find it either
01:38omasanorihi, does anyone see me?
01:39brainproxyomasanori: is that a wig?
01:42omasanorino, I just worried there in no user here now
01:45omasanoris/in/is/ ... maybe I'm so tired...
01:50omasanoriI'd like to ask about clojure.repl/doc
01:51omasanoridoc expects that docstrings have 2 spaces every line except the first line, right?
02:08omasanoriI'm very sorry if my manner is poor...
02:10ivanomasanori: #clojure is less idle during US business hours ;)
02:11ivanI don't think doc expects any specific format for your paragraphs
02:13ivanoh never mind, I see that's not the question
02:13ivanwell, it looks like print-doc prints two spaces and then the docstring
02:14ivanso, "yes"
02:15omasanoriAh, I see. I forget timezone...
02:18omasanoriSo, I'll post a RFC patch to the ML, but I'm unsure whether my direction is right or not.
02:20omasanoriMy thought is that the algorithm described in http://docs.python.org/tutorial/controlflow.html#documentation-strings makes `doc` free from indentation details.
02:28omasanoriI'm sorry, my client crashed.
02:30omasanoriFor example, clojure.core/conj is with 4 spaces for indent, so (doc conj) looks weird.
02:37omasanoriSo I'm writing a patch implementing the algorithm for formatting docstrings consistently, but I'm unsure whether it's right or not. any opinions?
03:13pepijndevosRaynes: ping
03:31pepijndevos$mail Raynes Maybe sexpbot was not a good idea. I have no control over it, and people want logging disabled.
03:31lazybotMessage saved.
03:33Raynespepijndevos: amalloy asked you if you wanted logging.
03:33pepijndevosRaynes: I wanted, but some other people don't, apparently.
03:33RaynesI'll happily disable it though, and I can delete the existing logs.
03:34RaynesDo you want me to remove him from the channel?
03:34pepijndevosRaynes: 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.
03:34RaynesFYI, people have attitudes about bots for no particular reason.
03:34RaynesJust a heads up.
03:35RaynesEven if you host it, people will find something to bitch about until you start telling them to bug off.
03:35ro_st#firstworldbotproblems
03:35Raynespepijndevos: Anyways, do you want me to take him out so you can host your own instance or just disable logging?
03:35pepijndevosThere are a few people who are bots themselves in that channel, so they know how it feels, I guess.
03:35amalloydamn irc bots taking all our jobs
03:37Raynespepijndevos: What is this channel again?
03:37pepijndevosRaynes: 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.
03:37pepijndevosRaynes: #hackernews
03:37pepijndevosschool
03:37RaynesI'm not sure what else I'd have to do besides disable logging.
03:37pepijndevosok, go for it then :)
03:37RaynesI mean, are people complaining about other things?
03:38Raynes:p
03:38pepijndevoswell, if it starts randomy killing people with fire someday, we'll have to get one of you to kill it with fire.
03:38RaynesHaha
03:38Raynespepijndevos: 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.
03:38Raynes$mail
03:39pepijndevosRaynes: ok, thanks :)
03:39Raynes(he wouldn't shut up)
03:44ro_stdo i need to restart my slime repl every time i change project.clj deps?
03:44Raynespepijndevos: If lazybot offends the sensibilities of any other young girls, let me know.
03:44pepijndevosok, thanks
03:44ro_stit seems that i do, and it's annoying
03:52ivanhttps://news.ycombinator.com/item?id=4011359 wants to know what code to read
03:52ro_stso, i have a seq of N items. i want to get a new seq of up to M items from that first seq
03:52pepijndevosro_st: Do you have logging enabled? Or exclaim all commit on your git repo?
03:53ivan&(take 5 (range))
03:53lazybot⇒ (0 1 2 3 4)
03:53ro_sttake, thanks
03:53ivan&(take 5 [1 2 3])
03:53lazybot⇒ (1 2 3)
03:53ro_stpepijndevos: i don't understand the context of your question?
03:55pepijndevos"it seems that i do, and it's annoying" I placed that in the "offending young girls context"
03:56ro_stoh, right :)
04:03pepijndevosIs anyone else flying to euroclojure tonight with ryanair?
04:03ro_stlooking forward to seeing that HN post grow
04:03pepijndevos?
04:04pepijndevosthe code to read one?
04:06vijaykiranpepijndevos: I'm leaving at 1645 via schiphol - klm not ryanair though
04:06pepijndevosI lave a lot later as well
04:07Borkdudepepijndevos: vijaykiran have fun there!
04:08ro_stdoes anyone have a working clojure-jack-in repl-init setup?
04:08ro_styes pepi. be interesting to see what gets listed
04:09pepijndevosro_st: clojure itself, some other clj impls, overtone, .... hm I don't know
04:09BorkdudeI find the clojure code itself sometimes hard to read, because a lot of times it involves the bootstrapping process
04:10Borkdudenevertheless interesting
04:10ro_stclojure core isn't idiomatic clojure, because idiomatic clojure isn't possible at that point
04:10pepijndevosRing?
04:10clojurebotring is http://github.com/mmcgrana/ring/tree/master
04:11ro_string, enlive, korma, monger
04:12ro_sti'm struggling to find docs on lein's repl-init
04:13ro_stahhhh, never mind. just found lein help sample
04:14Borkdudea lot of clojure libraries are wrappers around java libraries
04:14BorkdudeI think those are not so nice examples to read
04:14winkdepends if they expose the apis in a sane manner
04:17bobryCan someone give me a hint why this might happen? 'java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Named'
04:17bobrywhat's 'Named' in clojure terms?
04:18Borkdude,(let ["foo" 1] "foo")
04:18clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: foo>
04:18Borkdudehmm, that isn't the one ;)
04:18bobry:)
04:18vijaykiranro_st: :repl-init [whatever.ns] in project.clj should work
04:18vijaykiranro_st: oh, you said you found it already :)
04:18ro_stvijay, weird. the lein sample project says it should be :repl-options { :init-ns … }
04:19ro_stis your way for lein2?
04:19vijaykiranro_st: I'm using lein2 - yes.
04:21ro_stok thank you
04:22Borkdudebobry: clojure version?
04:25Borkdudebobry: https://github.com/clojure/clojure/commit/4bea7a529bb14b99d48758cfaf0d71af0997f0ff
04:25amalloy,(ns-name "x")
04:25clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol>
04:25amalloy,(namespace "x")
04:25clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Named>
04:28bobryBorkdude: 1.4
04:30ro_stis it possible to write the output of pprint to a file?
04:30Borkdudethere 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 :)
04:31Borkdudethe first one being: ,(count (1 2 3))
04:31Borkdude,(count (1 2 3))
04:31clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
04:35Borkdudebobry: Named is an interface: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Named.java
04:35vijaykiran,(doc pprint)
04:35clojurebotTitim gan éirí ort.
04:36vijaykiranro_st: pprint takes writer as second arg
04:36Borkdudebobry: for example Symbol implements this interface: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Symbol.java
04:41vijaykiranro_st: try this (with-open [w (clojure.java.io/writer "file:///tmp/test.txt")] (pprint {:one 1 :two "two2"} w))
04:41ro_stawesome!
04:41ro_sti was trying to use (spit)
04:42vijaykiranro_st: that can be tricky because pprint just returns nil
04:42Borkdudeah keyword also implements named
04:43ro_stthat worked beautifully, thanks vijay (once again)
04:44vijaykiranyw :)
04:46vijaykiranis blah# a convention for files/dirs ?
04:47Borkdudevijaykiran: it is the notation for an autogensymmed name in a syntax quote
04:47Borkdude, `(let [foo# 10] foo#)
04:47clojurebot(clojure.core/let [foo__27__auto__ 10] foo__27__auto__)
04:48vijaykiranI'm looking at this: https://github.com/immutant/immutant/blob/master/modules/web/src/main/clojure/immutant/web.clj#L68
04:48Borkdudevijaykiran: yes, f# is an autogensymmed name, which is to say a fairly uniquely generated name
04:49Borkdudevijaykiran: note the `, it means syntax-quote, all names get fully qualified within it, except autogensymmed ones
04:49Borkdude,`+
04:49clojurebotclojure.core/+
04:50Borkdude,`+#
04:50clojurebot+__80__auto__
04:50vijaykiranBorkdude: okies, thx. I still need wrap/slice/splice/unwrap/synquote my brain :)
04:50Borkdudevijaykiran: just to make sure, what do you mean with wrap?
04:52Borkdudevijaykiran: nm ;)
04:52vijaykiran:)
05:09Borkdudeis there a faculty function in clojure? ##(reduce * (range 1 10))
05:09lazybot⇒ 362880
05:10vijaykiranfaculty ?
05:13pepijndevosBorkdude: hehe, I'm not sure you can translate it that literally.
05:13Borkdudehaha
05:13vijaykiranfactorial ? :)
05:14Borkdudevijaykiran: ah, of course :)
05:16pepijndevosI know the concept as "whaming"
05:17pepijndevos(defn ! [n] (reduce * (range 1 n)))
05:17ro_stdoes emacs clojure-mode support refactorings like rename? i ask because i see that it already does mark-occurences
05:22Borkdudepepijndevos: it should be (range 1 (inc n)), detail
05:23pepijndevosok
05:23Borkdudepepijndevos: because the last value is non-inclusive
05:23pepijndevos... right
05:24pepijndevosapply would also work... eternal dilemma
05:32amalloypepijndevos: "whaming"?
05:33pepijndevosamalloy: 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
05:34pepijndevosamalloy: Great book for kids to learn arithmetic, but they use funny names for some things.
05:34amalloywelp, i definitely don't speak enough...dutch? i'm ashamed to say i can't remember what language you speak
05:34amalloyoh, that's his name for factorial?
05:34pepijndevosdutch
05:35pepijndevosyea
05:35pepijndevostelduivel = counting devil
05:36amalloyit makes a little sense, given the english slang "bang" for !
05:36pepijndevosyea
05:36pepijndevosIt'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.
05:37pepijndevoshaha, at some point his whole dream is full of rabbits, because he explained fibonacci.
05:41Borkdudepepijndevos: what is the dutch name in telduivel for factorial?
05:41pepijndevosBorkdude: wham, I think.
05:41Borkdudepepijndevos: why?
05:41pepijndevoscan;t remember
05:42Borkdudepepijndevos: I remember my wife speaking about this book, maybe it inspired her to become a mathematician
05:43pepijndevosBorkdude: Amazing, but yea, inspiring book. Do you have kids?
05:43Borkdudepepijndevos: nope, no fibonacci like procreation here
05:43pepijndevoshaha
05:44pepijndevosThey where all metaphors for visual surealistic things that happened in the drea
05:44pepijndevosm
05:46Borkdudepepijndevos: did you know the limit of fib n / fib n-1 for n -> infinity is the golden ratio?
05:47pepijndevosyea...
05:48pepijndevosYou don;t even need to start at a valid number
05:48Borkdudepepijndevos: ha cool, didn't know that
05:49pepijndevos... I think
05:53pepijndevosok, maybe I was wrong....
05:53pepijndevosno!
05:57pepijndevosBorkdude: https://gist.github.com/2774339
05:58Borkdude,(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))])
05:58clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: fib in this context, compiling:(NO_SOURCE_PATH:0)>
05:58Borkdude,(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))])
05:58clojurebot[1.6176470588235294 1.6176470588235294]
06:00pepijndevosI'm pretty sure it's 618
06:00pepijndevosBorkdude: did you see my gist?
06:00Borkdudepepijndevos: yes, the golden ratio is 1.618.. though
06:01pepijndevoshm... right :(
06:01Borkdudelook this is better, the further you go in the fib sequence the closer it will get:
06:01Borkdude,(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))])
06:01clojurebot[1.6180339631667064 1.6180339631667064]
06:02Borkdudethe second one being the fibonacci with other start values
06:02Borkdude10 10 in this case
06:02michaelr`rrr
06:02pepijndevosBorkdude: Your code is a bit dense...
06:02michaelr`anyone knows how is (defpartial) in noir deiffers from a regular (defn)?
06:03Borkdudemichaelr`: not much, look at the src
06:03Borkdudepepijndevos: yes… fib-seed is a function which takes two values and provides them as the two starting values to the fibonacci function
06:03Borkdudepepijndevos: and I call fib-seed with 11 (normal) and 10 10
06:04Borkdudepepijndevos: it shows that it indeed doesn't make much difference, but what if I choose different (absurd) values?
06:05pepijndevosBorkdude: It just takes longer to converge
06:05Borkdudepepijndevos: amazing, I guess a mathematical proof is more in place here than just trying numbers :)
06:06pepijndevosfixed my code:https://gist.github.com/2774339
06:07michaelr`Borkdude: yeah, i looked at the source and saw that i doesn't do much
06:08Borkdudemichaelr`: I think defpartial says: this function will return something which will be embedded in a page
06:08Borkdudemichaelr`: and not much more than that
06:08Borkdudemichaelr`: (it doesn't even allow multiple function bodies)
06:09Borkdudepepijndevos: cool
06:13michaelr`i'm trying to find out why the rendering function here takes 140ms
06:25michaelr`damn
06:26pepijndevosmichaelr`: Thread/sleep?
06:28michaelr`hmm nope
06:28michaelr`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?
06:28michaelr`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
06:29pepijndevosmichaelr`: that can be very expensive, depending on how you do it.
06:29michaelr`i also use map destructuring on most of the partials, could this be the reason?
06:30Borkdudemichaelr`: you can analyze each part with the time macro in a repl?
06:30pepijndevosmichaelr`: meten is weten (to measure is to know). You could run a profiler.
06:31michaelr`well yes, i timed all the parts and it looks like most of the time is spent somewhere in the html compiler.
06:31michaelr`profiler is probably the next thing i'm going to try
06:32michaelr`what are you using, yourkit?
06:32pepijndevosvisualvm
06:32pepijndevosbit yourkit seems to be what all the sponsored oss projects are using :P
06:33michaelr`:)
06:34michaelr`pepijndevos: can visualvm profile a remote process?
06:34pepijndevosmichaelr`: I don't know... how remote? Like on a server remote?
06:35michaelr`yup
06:51BorkdudeI'm trying out visualvm and I see a remote thing in the menu
06:54pepijndevosWhat is the timezone difference between the 2 ends of america?
06:55pepijndevosI'm beginning to suspect some people just never sleep
06:55Borkdudepepijndevos: http://everytimezone.com/
06:55clgvoh someone changed his nick to his real name ;)
06:57pepijndevosclgv: yea
06:58pepijndevosIt 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.
06:59clgv*g*
06:59pepijndevosg?
06:59clgv*grin*
07:01clgvpepijndevos: you arrived in london?
07:01pepijndevosclgv: No, I'm flying this evening
07:01clgvah right
07:01clgvI guess most do
07:02pepijndevosclgv: are you coming/already there?
07:02clgvpepijndevos: no. maybe next year.
07:05pepijndevosoh, sht, do I need to print some sort of ticket fro then conf?
07:07pepijndevosyea, I do... phew
07:09Borkdudepepijndevos: I read that VirtualVM is bundled with the newest JDKs
07:09Borkdudepepijndevos: would that mean I would already have it on my system, if so, where? (OSX)
07:09pepijndevosoh?
07:09Borkdudepepijndevos: it looks pretty easy to use, I'm going to recommend to it a student who has heap memory problems right now
07:09pepijndevosno idea... /library or /developer probably
07:09clgvBorkdude: you mean JVisualVM?
07:10Borkdudeclgv: http://visualvm.java.net/download.html
07:11clgvBorkdude: ok you meant it. yeah that one is in one of your jdk folders. it has been there already in java 6 as well
07:11clgvat least on linux
07:13BorkdudeI guess it has to do with apple's jdk
07:14clgvopenjdk is missing some tools as well
07:14clgve.g. javaws
07:14Borkdudenot a problem, I can just install it
07:29piranhahi 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?
07:30pepijndevospiranha: No idea... try lein2 trampoline repl
07:30piranhasure
07:31piranhadoesn't work either :(
07:32pepijndevospiranha: Update readline or jline? I have no clue what I'm saying btw...
07:32piranhaI 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...
07:32piranhahm, update readline... well, I'm on osx, and I think I'm using system one
07:32clgvlein2 uses REPLy? not nrepl?
07:33Borkdudepiranha: on what OS are you?
07:33piranhamac os x
07:33piranhaclgv: I think both of them
07:33piranhathat's what it prints for me on start: http://paste.in.ua/4272/
07:33Borkdudepiranha: try this one https://www.dropbox.com/s/mw9fo73bueimtcm/leiningen-2.0.0-SNAPSHOT-bugfixed-reply-standalone.jar
07:34piranhaBorkdude: thanks, how do I install this? :-)
07:34piranha(I'm sorry, I'm very new to clojure and java worlds)
07:34Borkdudepiranha: put it in the folder ~/.lein/self-installs
07:34piranhashould I remove current one there?
07:35Borkdudepiranha: and update the version in the lein script
07:35Borkdudepiranha: no, shouldn't hurt
07:35piranhaor should I rename this one to replace? Or maybe just edit ~/bin/lein?
07:35piranhaah ok
07:35piranha:-)
07:35Borkdudepiranha: I just wonder if you have the same bug that is fixed in this version
07:35Borkdudepiranha: there were some concurrency problems with reply
07:36piranhaBorkdude: http://paste.in.ua/4273/
07:36Borkdudepiranha: can you show me your lein script?
07:36piranhasure
07:37piranhahttp://paste.in.ua/4274/
07:37piranhaBorkdude: ^ here it is
07:37Borkdudepiranha: remove the first LEIN_VERSION line
07:37piranhawell, it should hurt :)
07:37Borkdudepiranha: wait, that shouldn't matter of course
07:37piranhayep, just tried - nothing changes
07:37Borkdudepiranha: what happens if you type "lein version" ?
07:38piranhaBorkdude: same output (with ClassNotFound)
07:38Borkdudepiranha: where did you put the jar?
07:38Borkdudefull path
07:38Borkdudejust to make sure
07:39piranha~/.lein/self-installs/...jar
07:39clojurebotExcuse me?
07:39piranhabut!
07:39piranhaBorkdude: it's very small, 31k :)
07:39Borkdudehaha
07:39Borkdudepiranha: omg, you downloaded html I guess
07:39piranhaprobably, one moment
07:39piranhayeah I did :D
07:39clgvlol :D
07:39piranhaah, thanks, dropbox :D
07:40piranhaBorkdude: well, it starts, but has the same problem :)
07:41piranhaC-j doesn't work either
07:41Borkdudepiranha: interesting...
07:41Borkdudepiranha: are you in a project or not?
07:41piranhanot, just in my home dir
07:41Borkdudepiranha: are you using a ~/.lein/profiles.clj ?
07:41piranhahm, I'm wondering if it looks at my ~/.inputrc...
07:41piranhanope, I don't have it
07:42piranhaha!
07:42piranhagot it fixed
07:42piranhaby editing ~/.inputrc
07:42Borkdudepiranha: what was it?
07:42piranhaI had "Control-j: menu-complete" in my ~/.inputrc
07:43piranhanow I'm even not sure why did I put it there...
07:43Borkdudepiranha: what do you use control-j for ?
07:44piranhaI guess I tried to get some fancy zsh-like autocompletion in bash...
07:44piranhawell, doesn't matter, I think I can remove it
07:44piranhasorry to bother you :)
07:44Borkdudepiranha: 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
07:44piranhaok, sure :) thanks a lot!
07:45Borkdudepiranha: ok, also we have #leiningen channel
07:45Borkdudepiranha: if you have any other questions
07:45piranhaoh, ok :) will go there next time :)
08:48ro_stargh. 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
08:50ro_stactually, is there a way to always have those two available regardless of what namespace my repl is in?
08:59foxdonutnice gadget on Google's home page today..
09:01kilonmoog forever :D
09:03gtrakthat's awesome, JS stuff?
09:04kilonhello 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 ?
09:05gtrakkilon: yessir
09:06kilonI 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
09:06ro_stkilon: that's ok. people can not act beyond their current level of consciousness :)
09:07kilonyeah I have some problem undestanding the reasoning behind this, but I am optimistic one day I will.
09:08kilonso 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 ?
09:08ro_stvery easy. you're not so much learning new stuff as unlearning old stuff
09:08ro_stclojurebook.com joyofclojure.com vimeo.com/channels/fulldisclojure/
09:08ro_stpick one and get stuck in
09:08kilongreat, I have already read partial the documentation on the website
09:09kilonoh you are fast i was about to ask for links :D
09:09foxdonutkilon: well it was good of you to ask, I respect that. Indeed, discussions of ClojureScript are welcome here as well.
09:09ro_sti'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
09:09ro_stkilon: also watch all of rich hickey's talks on infoq and blip.tv
09:09kilonfoxdonut: thanks i feel already welcomed
09:10kilonro_st: cant thank you enough will bookmark all of them
09:10ro_stparticularly "Are we there yet" and "Clojure Concurrency". you'll get a good sense of WHY clojure rather than HOW
09:10ro_stknowing the why really helps me to discover the how
09:11ro_stkilon: i'm about 3 weeks in, now. most fun i've had as a coder in years
09:11ro_stcoming from php ruby js
09:12ro_stand an embarrassing amount of actionscript
09:12kiloncommon lisp has been a frustration, mainly because of the cryptic documenation
09:12kilonah ruby is great and very similar to python , but better :D
09:15foxdonutro_st: are you a flex developer?
09:15kilonhow clojure fairs in terms of speed, I know speed is relative , but for example jython is probably very slow on JVM
09:15ro_stfoxdonut: i used to be
09:16ro_stvowed to stop investing my time into the Flash runtime in november last year, haven't look back since
09:17ro_stkilon: 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
09:18foxdonutro_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.
09:18kilonanother 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
09:18foxdonutI know that now they sent the framework to die over at Apache..
09:18ro_stfoxdonut: it made a lot of promises that it never quite kept.
09:18ro_stperformance was always horrific for anything but the simplest of apps
09:19kilonsaying that Overtone has made me interested in Clojure as well ;)
09:19ro_sthuge 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
09:20ro_stand, being static-typed OO just like java, you write lots and lots of code
09:21kilonah nice that vimeo videos is what i needed, clojure in action
09:21ro_stawesome. 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
09:21foxdonutro_st: that's all very interesting. Dare I ask if at least there were no browser issues?
09:22ro_stgreat learning experience
09:23ro_stfoxdonut: 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
09:23ro_stalso, paying $500 for a dev tool? ridiculous.
09:24gtrakro_st: I thought flex UI stuff was pretty nice, though
09:24pandeiro,(apply str (interpose \. (partition-all 3 "12345678910")))
09:24clojurebot"clojure.lang.LazySeq@13291.clojure.lang.LazySeq@13e34.clojure.lang.LazySeq@149d7.clojure.lang.LazySeq@9e0"
09:24gtrakin terms of development
09:25ro_stit was ok. nice for trivial stuff. gets hairy quickly for anything bigger
09:25pandeiro,(apply str (interpose \. (doall (partition-all 3 "12345678910"))))
09:25clojurebot"clojure.lang.LazySeq@13291.clojure.lang.LazySeq@13e34.clojure.lang.LazySeq@149d7.clojure.lang.LazySeq@9e0"
09:25gtrakro_st: I enjoyed Mate
09:25pandeiro,(apply str (interpose \. (map doall (partition-all 3 "12345678910"))))
09:25clojurebot"clojure.lang.LazySeq@13291.clojure.lang.LazySeq@13e34.clojure.lang.LazySeq@149d7.clojure.lang.LazySeq@9e0"
09:25ro_styou had to use stuff like robotlegs and friends to keep things tame
09:25pandeirok i give up
09:25ro_stand again, performance sucks
09:25ro_stMate?
09:26G0SUB,(apply str (interpose \. (apply concat (partition-all 3 "12345678910"))))
09:26clojurebot"1.2.3.4.5.6.7.8.9.1.0"
09:26G0SUBpandeiro, ^^^
09:26gtrakro_st: http://mate.asfusion.com/ It's like an event-handling DSL and dependency injection framework
09:26ro_stahh, like squiz and robotlegs
09:26pandeiroG0SUB: i want 123.456.789.10
09:26ro_stswiz, i mean
09:26G0SUBpandeiro, ok. just a sec.
09:27pandeiroactually i want 123.456.789-10 but there's no interpoleave fn
09:27kiloni 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 ?
09:28ro_stkilon: the latter. clojurescript is still very young
09:28gtrakro_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
09:28kilonah ok, I am trying to make a small isometric 2d rpg
09:28foxdonutro_st: I was always interested in Flex but it never really took off in my area, so I only did small examples.
09:28kilonso far this seems my best choice ---> http://rpgjs.com/
09:29G0SUB,(apply str (flatten (interpose \. (partition-all 3 "12345678910"))))
09:29clojurebot"123.456.789.10"
09:29G0SUBpandeiro, ^^^
09:29ro_stfoxdonut: consider yourself lucky. i firmly believe FOSS HTML/CSS/JS is the way to go
09:29kiloni am new with javascript too :D
09:29ro_stkilon: javascript, the good parts by douglas crockford
09:30gtrakro_st: anyway I miss the declarative style a bit, it was nice if you have good xml autocomplete
09:30foxdonutro_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.
09:30kilonanyone 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)
09:30ro_stgtrak: yeah. it was certainly a good idea, but the flash player was never meant to do what they asked of it
09:31pandeiroG0SUB: that works, thanks
09:31gtrakyea
09:31ro_stfoxdonut: 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
09:31uvtcpandeiro, don't get me confused ... there's no interpolate function! :)
09:32ro_stit's a great example of why open is better than closed source
09:32pandeirouvtc: there's interpose and interleave but what i really want is an interpoleavelate :)
09:33G0SUBpandeiro, how do you want it to behave?
09:33ro_stwhat's the trick for measuring how long a function call takes?
09:34gtrak&(time 5)
09:34lazybotjava.lang.ClassNotFoundException: clojure.core
09:34gtrak,(time 5)
09:34clojurebot"Elapsed time: 0.064 msecs"
09:34duck11231ro_st: (time (function-to-test))
09:34clojurebot5
09:34gtrakwhat's up pwith lazybot?
09:34jsabeaudry_begin lazy again...
09:35jsabeaudry_being*
09:35gtrak&(println 3)
09:35lazybot⇒ 3 nil
09:35gtrak&(time (println 3))
09:35lazybotjava.lang.ClassNotFoundException: clojure.core
09:35gtrakRaynes: why doesn't 'time' work?
09:36pandeiroG0SUB: what i want is to be able to interpose a sequence of chars, not just one
09:36G0SUBpandeiro, show me an example invocation and the expected result.
09:37foxdonutro_st: true
09:37pandeiro(format-id "12345678910") ;=> "123.456.789-10"
09:38foxdonutro_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.
09:38Borkdudeehm, conjing onto a vector doesn't really take n steps right?
09:38G0SUBpandeiro, that doesn't look like a general function. which sequence of chars are you interposing?
09:38G0SUBBorkdude, should be ~O(1)
09:38pandeiroG0SUB: '(\. \. \-)
09:39ro_stwhy do i always get these using jdbc and mysql? Message: Communications link failure
09:39ro_stif i rerun, it works agaion
09:39G0SUBpandeiro, ok.
09:40BorkdudeGosub: where can I see this in the clojure source?
09:40jsabeaudry_pandeiro, interleave?
09:40pandeirojsabeaudry_: yeah, i am thinking interleave but the problem is realizing the lazy-seq created by partition-all
09:41pandeiro(and also i want to interpose, not interleave, but i can just trim the final whitespace char or something)
09:41jsabeaudry_pandeiro, interpose can take a list of separators?
09:41pandeirocan it?
09:42jsabeaudry_I assumed you knew since you said you want interpose and not interleave
09:42pandeiro,(interpose (list \. \. \-) (partition-all 3 "12345678910"))
09:42clojurebot((\1 \2 \3) (\. \. \-) (\4 \5 \6) (\. \. \-) (\7 \8 \9) ...)
09:42pandeirohmm yeah getting colder
09:43pandeirohere's my favorite so far: ##(mapcat str (partition-all 3 "12345678910") "..- ")
09:43G0SUBBorkdude, the RT side of things.
09:43lazybot⇒ (\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
09:44BorkdudeGOSUB yes, this one? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L548
09:44G0SUBBorkdude, yeah
09:44BorkdudeG0SUB: I don't understand what is happening there, it returns coll.cons?
09:45BorkdudeG0SUB: so when I go look at PersistentVector.java, there should be a cons method?
09:45G0SUBBorkdude, yes. see how cons is implemented for APersistentVector
09:46G0SUBBorkdude, https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentVector.java#L543
09:47BorkdudeG0SUB: so cons on APersistenVector is implemented as: make a new one with the value appended to the right?
09:48G0SUBBorkdude, should be something like that.
09:49jsabeaudry_,(apply str (flatten (interleave (partition-all 3 "12345678910") (list \. \. \- \.))))
09:49clojurebot"123.456.789-10."
09:49BorkdudeG0SUB: 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
09:49G0SUBjsabeaudry_, you cheated by punching that extra \. in ;-)
09:50BorkdudeG0SUB: but I think I understand now
09:50G0SUBBorkdude, yes. conj is polymorphic, as you know.
09:50jsabeaudry_G0SUB, oops ;)
09:50G0SUBBorkdude, and conj ultimately calls cons.
09:50BorkdudeG0SUB: yes, it's just a bit confusing why collection don't implement conj instead of cons, naming
09:50pandeiro,(clojure.string/trim (apply str (map str (map #(apply str %) (partition-all 3 "12345678910")) "..- ")))
09:50clojurebot"123.456.789-10"
09:51pandeiroyeah both map and interleave shortcircuit on the longer of the seqs, that's the problem
09:51G0SUBBorkdude, 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.
09:52G0SUBBorkdude, cons to a vector is different from a cons to a seq, for example.
09:52BorkdudeG0SUB: in terms of java implementation yes, but not from "our sequence side of the world"
09:52BorkdudeG0SUB: sounds reasonable
09:52dnolenBorkdude: conj is the name of the polymorphic function we call in Clojure, cons is how collections implement it (in Java)
09:53G0SUBdnolen, +1
09:53dnolenBorkdude: fwiw the confusion of name is removed in ClojureScript, conj -> -conj
09:53Borkdude,(cons [1 2 3] 0)
09:53clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
09:53G0SUBBorkdude, order is different in cons.
09:53Borkdude,(cons 0 [1 2 3]) ;; damn ;)
09:53clojurebot(0 1 2 3)
09:53G0SUBBorkdude, it's all about semantics vs. implementation.
09:54Borkdudednolen: do you mean the concrete collections in cljs have an implementation fn called -conj?
09:54dnolenBorkdude: yes, instead of cons as it's called in Java.
09:54Borkdudednolen: great improvement ;)
10:38clgvdo type hints on protocol methods help the clojure compiler or are they just ignored?
10:45rhcclgv: they help
10:45rhcclgv: when you call java methods, clojure uses reflection, but with type hints, its a regular java call (just as fast as vanilla java)
10:46rhcclgv: its my understand, they're meant to be added to performance sensitive areas.. no necessarily for type correctness
10:50S11001001I think clgv might mean one of the numerous other meanings of "help" in this context
10:51clgvI meant preventing reflection on call site
10:51dnolenclgv: type hints on protocol methods are completely ignored last I checked. If anything they just cause problems.
10:51clgvdnolen: ok, thx.
10:52matthavenerwow, i completely missed "protocol methods" and just read "functions".. need more coffee
10:52dnolenclgv: type hints on definterface of course very useful.
10:58dougs87what conferences are best for clojure & FP?
10:58bobrydoes anyone know the status of domina? github repo seems abandoned ..
10:59cgagstrangeloop is lookin good
11:03si14why ClojureScript complains about use of functions before their definition?
11:03si14looks like 80s to me
11:04matthavenersi14: doesn't clojure do that as well?
11:05S11001001yes
11:05S11001001I recently discovered a great benefit to that
11:05S11001001prevents people from just sticking functions in random order
11:05si14oh, then it's just my ignorance. sorry
11:05matthavenersi14: you can use (declare fun-name) to work around it
11:05S11001001which is what actually happens, not the delightful "logical" order usually imagined
11:05matthavenerif you have two functions calling each other
11:06si14matthavener: yeah, I can, thanks.
11:06Borkdudein Clean Code an auther recommends it the other way
11:06Borkdudefirst write the function that calls other functions and define them below
11:06si14it's just the consequence of my erlang-ish habit to put "helper" functions to the end of file.
11:06Borkdudeauthor
11:07S11001001I rather like the other order
11:07matthavenerme too, but i could just be extremely used to it
11:08matthavenerthe benefit of Borkdude's way is typically the interface to a module is all the "root" functions
11:08matthavenerso when someone reads the code they're seeing all the functions they'll probably be calling at the top
11:09Borkdudewhat is the reason behind clojure's one pass style again?
11:09S11001001the way we have is like introducing lemma(s?) to build towards our principal theorems
11:09S11001001macroexpand
11:09raekBorkdude: one reason to evaluate namespaces incrementally is macros
11:10Borkdudeah, the same in common lisp right?
11:10raekthey can be used in all following expressions and can use all previous definitions
11:11S11001001not 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:11Borkdudethis is nice: http://www.youtube.com/watch?v=tSnnfUj1XCQ
11:13Borkdudeso one pass is not the case in CL?
11:13S11001001no, it's quite a lot more complicated
11:14BorkdudeI 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:14BorkdudeS11001001: ok, I can't remember it
11:16Borkdude(meanwhile I'm trying Entity Framework in Visual Studio to work with an Oracle Database…)
11:17S11001001that'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:17S11001001CL's rules have the interesting effect that you can compile without loading, for example
11:18S11001001it's just that there are a lot of them, and their consequences can confuse occasionally
11:21Borkdudepepijndevos: are you presenting smth?
11:22pepijndevosBorkdude: no
11:22pepijndevosThe weather forecast has tempest in it.
11:24pepijndevoshttp://www.weather.com/weather/today/Dusseldorf+GMXX0028:1:GM
11:25Borkdudepepijndevos: good luck then (don't like flying)
11:25TimMcpepijndevos: I just see t-storms.
11:25pepijndevosI like flying, it's the part that comes before it.
11:26pepijndevosTimMc: What is T-storms?
11:26TimMcthuderstorms
11:26Borkdudepepijndevos: yeah, the waiting, checking in, pff
11:26TimMcthunderstorms, even
11:26clgvpepijndevos: you are flying from düsseldorf?
11:26pepijndevosTimMc: Oh, is that different from a tempest?
11:26pepijndevosclgv: yea, closer and cheaper than schiphol.
11:27TimMcI never hear people talk about tempests. I don't really know what they're supposed to be, beyond a strong windstorm.
11:27pepijndevosals, smaller, so less of the waiting and hurying
11:27TimMcwindy thunderstorm, maybe?
11:27uvtcstorms brew, tempests are in teapots. (!)
11:27pepijndevosTimMc: afaik, it's the same, but borrowd from french
11:27TimMcuvtc: !
11:28pepijndevosTimMc: It has a betetr sound to it that thunderstorm, imo
11:28TimMcSo tempests... steep?
11:28pepijndevossteep?
11:28TimMclike a tea bag
11:28uvtcTimMc, ha ha ha. :)
11:32pepijndevostempête: http://www.cinoa.org/gfx/60333.jpg
11:32kimahello #clojure
11:32uvtchi kima
11:33kimaI'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:38S11001001#clojure is also good if you don't want to be part of the community :)
11:38kimaok :)
11:41kimai'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:47kilon#lisp deleted #clojure added, a new chapter has begun :D
11:48clgv:D
11:48kilonbesides emacs , what kinds of IDE works well with clojure ?
11:48clgvCCW
11:48kilonfirst time i hear this, googling
11:48clgv=> counterclockwise
11:49TimMckilon: Vim, apparently.
11:49TimMcWell, not an IDE...
11:49kilonah clojure works with vim , thats nice to know
11:49cgagi remember trying to set up vimclojure with nailgun and it being pretty painful
11:50kilonno i do consider emacs and vim ides with the right extensions
11:50kilonbut I am more a GUI dude
11:50kilonand recently trying Pharo and Squeak (Smalltalk) ruined me forever :D
11:51gfredericksare there any clojure libs similar to the ruby vrc lib, for recording and playing back http in tests?
11:51Borkdude(meanwhile visualstudio/entityframework/oracle combination is driving me mad)
11:51Borkdudekilon: Eclipse + CCW
11:51uvtckilon, ccw is an Eclipse plug-in.
11:52uvtcIncidentally, it's interesting that not many editors support smart-lispy style indenting.
11:52kilonBorkdude: uvtc oh sorry guys did not realise thanks, I kinda like Eclipse, good experience with pyDev
11:52TimMcI've heard some talk about IntelliJ being really good for Clojure.
11:52kilonand the added advantage is that Eclipse is made with Java
11:52kilonDo I dare assume that Clojure can script Eclipse realitivly easy ? like jython can for pydev
11:53uvtckilon, someone did a screencast recently using Eclipse with Clojure ...
11:53kilonmarvelous
11:53uvtcAh. Here we are: http://cemerick.com/2012/05/02/starting-clojure/
11:54kilonI know it suppose to work in theory, Clojure running on VM and being java bytecode , but practice has its own suprises
11:54TimMcOh, wow! It's a Clojure how-to on the web that isn't years old!
11:55kilonthat link has my favorite 2 words "live coding" :D
11:55kilonthanks uvtc and everyone else
11:55Borkdudekilon: it's relatively easy and it plays nice with leiningen now as well
11:56kilonleiningen is ?
11:56Borkdudekilon: the build tool for clojure
11:56dan`bI wonder if anyone is doing live coding with TDD
11:56kilonah i see, something like ant and cmake then , i assume
11:56uvtckilon, I wrote this, maybe it might be helpful: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/
11:57bderoomscan someone check whether I made a mistake on the transaction here? http://pastebin.com/CHxrGFd7
11:57Borkdudekilon: there is a leiningen plugin for eclipse that pulls in dependencies and puts the on the project's classpath
11:57kilonmarvelous
11:57Borkdudekilon: also you can connect from the console to a running repl in eclipse
11:57dan`bleiningen is not just for building but also for managing external dependencies (3rd party libraries etc)
11:57bderoomsif I run the whole application on a file of 10 million lins now and then the program erros with 'max retry reached'
11:57kilonuvtc: bookmarked, and i am watching the screencast
11:58Borkdudeleiningen is the emacs of building tools ;)
11:58kilonthat powerful ? wow
11:58Borkdudemaybe I'm exaggerating
11:58Borkdudebut it can do a lot of stuff
11:59kilonis it similar to Cake ? I heard that when watching a video on Overtone (Clojure library for Supercollider)
11:59TimMckilon: Cake merged into lein.
11:59kilonoh
12:00kilonwill certainly look into all that , thanks guys
12:00TimMcThey were quite similar.
12:01kilonI was not wrong ? thats pleasantly surprising :D
12:03kilondan`b: replying to your question, in Squeak / Pharo 90% of the coding is live TDD coding
12:04kilonand I would like to do something similar with clojure too if i can
12:04S11001001checkouts, I miss checkouts
12:04kilonI hope Clojure debugger is as powerful as Squeak's/Pharo's/ Common lisp
12:04dnolenkilon: fat chance
12:05alexyakushevHave anyone tried to integrate non-text resource (e.g. images) into a lein-newnew template?
12:05kilondnolen: fat chance means, like or unlikely ?
12:05kilonenglish is not my mother tongue
12:05TimMcVery unlikely.
12:05kilonoh
12:05kilon:(
12:05kilonoh well
12:05clgvkilon: you have some of the basic debugging as for java
12:05dnolenkilon: unlikely. Clojure is hosted (JVM, JS) so in general must rely on the host debugging infrastructure.
12:06kilonwell there is a way
12:06kilonField
12:06clgvkilon: breakpoints and watchlist and variables in scope
12:06kilonit supports Clojure too
12:06kilonbut yeah , no powerful debnugger there too
12:07kilonbut no problemo
12:07dnolenkilon: 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:07kilonClojure offers already enough
12:07kilonyeah i know those things look simple in practice and complicated in design
12:09alexyakushevOK, is it possible that clojure.java.io/resource crumbles non-text resources (if argument provided has an URL type)?
12:09Borkdudeunbelievable.. a bug in visual studio caused a setting which I could provide through a properties view not being saved into the underlying xml
12:09Borkdudethis cost me another hour
12:10alexyakushevAs 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:10TimMcBorkdude: Let's yell at ibdknox about it! :-P
12:11BorkdudeTimMc: let's hope light table will be better ;)
12:11TimMcalexyakushev: Link to source?
12:11Borkdudefirst some rest (installing Visual Studio SP1...)
12:12uvtcBorkdude, not sure if (first some rest) is legal syntax.
12:12uvtc;)
12:13alexyakushevhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/java/io.clj, line 53
12:14Borkdude,(first (some rest []))
12:14clojurebotnil
12:15uvtcBorkdude, teehehe. :)
12:15mwillhitehey all, trying to figure out the syntax here:
12:15mwillhite(defn from-sql-date
12:15mwillhite [#^java.sql.Date sql-date]
12:15mwillhite (from-long (.getTime sql-date)))
12:16mwillhitewhat is the #^java.sql.Date thing doing?
12:16alexyakushevmwillhite: it's a type tag
12:16TimMcmwillhite: That's a type hint.
12:16technomancyalexyakushev: you should be able to safely call input-stream on an io/resource
12:16alexyakushev*hint, right
12:16TimMcAn old-style one, specifically.
12:16mwillhitedoes it have any impact on the argument?
12:16mwillhitewhat if I pass in something not of that type?
12:16uvtcTimMc, what's the modern style?
12:16TimMcDrop the #.
12:17alexyakushevtechnomancy: I'm calling io/reader on io/resource (just like in lein-newnew)
12:17mwillhitecool thanks
12:17TimMcmwillhite: It doesn't have an impact on the function, just on the .getTime callsite
12:17alexyakushevtechnomancy: but for some reason in the end my PNGs from resources are not PNGs anymore
12:17technomancyalexyakushev: reader will not work on binary data
12:17technomancyit turns everything into strings
12:17technomancyyou need input-stream
12:18TimMcmwillhite: A cast to Date will be inserted at the location where .getTime is used instead of JVM reflection calls.
12:19pandeiroanyone familiar with the java tools for converting Date objects into localized strings?
12:19alexyakushevtechnomancy: Great, thanks. I guess this could also be a good thing to add in lein-newnew, what do you think?
12:19TimMcmwillhite: Things like ^long do something different -- they allow (under some circumstances) the use of primitives in function calls and local bindings.
12:19uvtcTimMc, what is ^java.sql.Date short for? Something like ^{:type java.sql.Date} ?
12:19TimMcuvtc: s/:type/:tag/, yes
12:20uvtcTimMc, Ah, :tag. Thank you.
12:20technomancyalexyakushev: add what?
12:20TimMcThat's probably where alexyakushev got "tag hint". :-)
12:20technomancyinput-stream is available
12:20technomancyoh, you mean for documentation?
12:20alexyakushevtechnomancy: I mean that the default (renderer ...) functions calls io/reader by default
12:21technomancywell you have to have strings for templating to work
12:21alexyakushevtechnomancy: to be more specific, I mean the renderer function from leiningen.new.templates
12:22technomancytemplating doesn't work with binary data
12:22alexyakushevtechnomancy: yes, but there is a feature that you could just copy the file (by not providing the second argument)
12:23technomancysure, but that's built-in to clojure already
12:23alexyakushevtechnomancy: I thought it would work for any kind of data since it is not altered in any way
12:23technomancythough it should be better documented
12:27alexyakushevtechnomancy: 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:28technomancyoh, I didn't realize renderer already had a 1-argument arity
12:28alexyakushevYes, exactly what I was pointing at:)
12:29technomancygotcha.
12:29technomancygood point, feel free to open a ticket for that.
12:30technomancyarguably 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:31alexyakushevtechnomancy: Thank you, I would. And since we are already speaking about new.templates would you mind one more question?
12:31technomancysure thing
12:32Raynoswhy does clojurebot annoy me with its pings
12:32alexyakushevtechnomancy: 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:32RaynosI guess I can just leave the channel :D
12:32Raynosgoodbye clojure
12:32TimMcRaynos: Who are you and what have you done with Raynes?
12:33alexyakushevtechnomancy: 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:33TimMc(and why do you have a shitty IRC client that puts NOTICE above MSG?)
12:33alexyakushevtechnomancy: does it make sense to make the resource in path in `renderer` customizable?
12:34technomancyalexyakushev: I'm not sure I understand. Why does whether you're rendering more than just source code affect the path you use?
12:34technomancydo you mean the resources will be used by something other than Leiningen?
12:35alexyakushevNo, I just don't want to put the resources into src/leiningen/new/... folder because I don't have anything else there
12:36alexyakushevAnd 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:36technomancyyou can put them in resources/leiningen/new
12:36technomancyonce the jar is generated they'll all be in the same place
12:38alexyakushevHm, that sounds like a solution, thank you
12:38technomancysure
13:09brainproxyso cool that lein repl keeps history across sessions
13:09brainproxywish the nodejs and coffee repls did that
13:11TimMcI think rlwrap is the thing that does that.
13:13batasrkiis there a reason why lein repl doesn't confirm matching parentheses in ubuntu. It does so in os x
13:13uvtcbatasrki, works for me in Ubuntu (using lein 2)
13:14batasrkiah, lein 2
13:14batasrkiI've lein 1.7.1
13:14batasrkiok, cool, I'll try lein 2
13:14banseljajbatasrki: lein 1,7 owrks for me in ubuntu
13:15foxdonutperhaps a terminal issue?
13:16banseljajPossibly.
13:16batasrkiI'm running zsh
13:16banseljajI am using bash
13:16batasrkimore precisely, oh-my-zsh
13:18uvtcbatasrki, I'm using bash as well.
13:34gtrakhow do you kill swank after a clojure-jack-in?
13:37tmcivergtrak: one way is to kill the *swank* buffer.
13:42llasramgtrak: 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:42tmciverllasram: that quits slime not swank.
13:44llasramAre there further implications to quitting SLIME? Because it definitely also kills the swank pracess
13:44llasramprocess even
13:44p_lllasram: depends on whether swank was started by slime or not
13:45llasramFair enough. In this case, gtrak specifically mentioned clojure-jack-in, so...
13:46p_ltake what I'm saying with a grain of salt, though - I haven't used such ancient version of SLIME in a looong time
13:46tmciverllasram: 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:54jweissI 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:54jweissthe repl options appear to be ignored
13:56llasramjweiss: Last I looked, the closest you could get was sending over some eval forms in a function hanging off of `slime-connected-hook`
13:56jweissllasram: doh that kinda sucks, that would not be project specific :)
13:57jweissah well, right now my users have to type (load "bootstrap") which isn't so bad
13:57jweissbut thought i could even get rid of that
13:57technomancyyou can load code in swank, but I haven't figured out how to set the initial namespace
13:58jweisstechnomancy: i could just use 'user', how do i load code?
13:59technomancyjweiss: I don't remember; maybe :repl-init
14:00jweisstechnomancy: 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:00technomancyjweiss: the preview branch is 2.x
14:01jweisstechnomancy: the master README links to the preview sample
14:01jweissso that is why i was confused
14:02technomancyyes, master is 2.x as well
14:02technomancyI'll add a note at the top of sample.project.clj though
14:02KirinDaveHrrm. I hate to ask a specific framework question here… but...
14:02KirinDaveAnyone here using Storm and clojure and transactional topologies?
14:03technomancyKirinDave: it can't be worse than inconsistent use of ellipses.
14:03edwI believe there's a #storm channel, though I imagine many of the users may not be Clojure developers.
14:03technomancy=)
14:03KirinDavetechnomancy: Bitch to colloquy, brah. ;)
14:03technomancynah, Colloquy's got enough people yelling at it as it is
14:04KirinDaveWhen OSX has a decent irc client somewhere anytime, let me know.
14:04KirinDaveBasically they're all terrible. Colloquy's brand of terrible is at least manageable.
14:04dnolenKirinDave: I don't see nathanmarz around but you might want to check on #cascalog as well
14:04KirinDave /digression. My apologies.
14:05technomancyjust messing with you =)
14:05edwtechnomancy: 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:05edws/Chaois/Chaos./
14:06KirinDaveChaois is the new French word for chaos. Use it in France or be fined and jailed.
14:08llasramedw: 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:08llasramedw: "The road to hell [[...]] good [...]"
14:08muhooshit's getting esoteric up in here.
14:20Guest84632Hi, would you please tell me why I'm getting this runtime error? http://pastie.org/3956864
14:21Chiron_Hi, would you please tell me why I'm getting this runtime error? http://pastie.org/3956864
14:21nDuffChiron_: put the finally just inside the try, rather than nested inside a let
14:22Chiron_any more idiomatic way to code this function?
14:22hiredmanChiron_: :| there are 4-5 errors easily seen
14:22Chiron_sorry, still learning :)
14:22hiredmancalling server-socket as a function in the finally
14:23hiredmanbinding server-socket to nil for no reason in the let
14:23hiredmanyou don't need the when, they will be bound to something in the finally
14:24nDuffChiron_: you might also consider with-open to force the close to eventually happen.
14:24nDuffChiron_: ...should be both more readable and idiomatic than the try/finally thing.
14:25nDuff(granted, with-open is a macro that uses try/finally itself, but readability counts)
14:26batasrkiwhy does clojure even have try/finally? That seems...wrong, somehow
14:27Chiron_thanks for help, will try (no pun intended :D) the suggested changes
14:27gtrakbatasrki: clojure integrates with the host lang
14:27pipelineeven if there was no real use for try/finally in clojure itself it would be important for java interop
14:29batasrkiOK, so really, this is a misuse of a language feature
14:30gtrakmisuse?
14:30bhenryibdknox: ping
14:30bhenryanyone else who might know: is there an implicit do here? https://gist.github.com/1d2f02a1a4683879c42a
14:30bhenryit doesn't seem to clear the session
14:31S11001001unwind-protection (and rewind-protection in scheme's case) are well-established in many systems long preceding java
14:33Chiron_It is better now?
14:33Chiron_(defn health [request]
14:33Chiron_ (with-open [server-socket (ServerSocket. *nimbus-port*) datagram-socket (DatagramSocket. *nimbus-port*)]
14:33Chiron_ (.setReuseAddress server-socket true)
14:33Chiron_ (.setReuseAddress datagram-socket true)
14:33Chiron_ true))
14:34gtrakChiron_: use a pastebin like refheap
14:34Chiron_ok, sorry
14:36Chiron_it is better now? http://pastie.org/3956931
14:38S11001001Chiron_: assuming you're going to add a parameter being a function to be called with your sockets
14:39Chiron_health-2 is a ring handler
14:40gfredericksso there's no built in data reader for byte-arrays yet?
14:40gfredericksoh wait there's the defaults map
14:40gfredericksI can find out for myself.
15:04p_lpuchacz: here too? :)
15:06puchaczp_l: just watching now :)
15:06p_lheh.
15:07puchaczI sense the potential, but transition from CL is not straightforward one week of reading howtos....
15:07p_lI think I'm giving up my current clojure adventure. Maybe after I upgrade my PC few generations forward ;)
15:08batasrkipuchacz: I bought programming clojure and joy of clojure books; Also, I'm doing the problems on 4clojure.com
15:08batasrkistill not straightforward, but easier
15:09puchaczbatasrki: sure, but it is a new programming language, not common lisp with slightly different flavour
15:09puchaczand has its own ecosystem of libraries too
15:10p_lyeah, and there's no compatibility with curret SLIME
15:10nDuff(?)
15:11batasrkipuchacz: I guess it depends where you're coming from. My exposure to lisp/scheme is little schemer books and SICP
15:11p_lnDuff: SLIME used with Clojure is few years out of date
15:11batasrkiotherwise, I've been an OO programmer my whole career
15:11nDuffp_l: ahh, missed that "current" was the key word there.
15:12nDuff(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:12ibdknoxwhat do you like about SLIME?
15:12p_lwell, I can't use SLIME with Clojure, because I'm not willing to do crazy reloading to keep two different slime versions
15:13p_libdknox: workflow, speed
15:13ibdknoxexplain?
15:13matthavenertwo different slime versions?
15:13ibdknoxI've watched people using emacs and the only thing I see used regularly is evaling a file or an expression
15:13ibdknoxis there something more there?
15:13puchaczibdknox: google for some slime videos
15:13p_lmatthavener: Clojure requires an ancient slime version which uses old protocol
15:14p_libdknox: it's the practice of it. I test something quickly in REPL, write code in files, etc.
15:14puchaczgo to definition, sensible autocomplete, who calls, who macroexpands, debugger, object presentation/inspection
15:14p_lit "flows"
15:14p_land yes, M-. etc.
15:14p_ldebugger
15:14p_lwell, debugger is borked with java anyway, I suspect
15:16p_lbut 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:17ibdknoxI was just curious if there was something specific to SLIME
15:17ibdknoxit doesn't sound like there really is
15:17ibdknoxjust that it has been nicely honed over the years :)
15:18p_libdknox: I can't explain it, it requires showing :)
15:18p_land well... Clojure isn't best-supported
15:18jweissthere'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:18jweiss?
15:18ibdknoxYeah, I've only seen it in the context of Clojurians
15:18llasramscreen cast?
15:19emezeskejweiss: Nope, that's why functions that destructure rest maps are annoying.
15:19jweissemezeske: doh, oh well
15:19ibdknoxwe should stop using them
15:19ibdknoxI still maintain unrolling options is an anti-pattern
15:19emezeskeYeah, it is really more convenient overall to just pass in a map
15:19llasramibdknox: Unrolling options?
15:20ibdknox(defn foo [& {:as args}] ...)
15:20ibdknoxso that you can write (foo :a 4 :v 6)
15:20ibdknoxit looks like that would be nice
15:20ibdknoxbut it breaks in a number of cases where you want to thread things
15:20TimMc~mapply
15:20clojurebotYou could (defn mapply [f & args] (apply f (apply concat (butlast args) (last args))))
15:20emezeskeYeah.. 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:20TimMc^ but you shouldn't have to.
15:21ibdknoxthat's busted :p
15:21ibdknoxI shouldn't have to use another function
15:21rkzwho's going to EuroClojure tomorrow?
15:21llasramAh, ok. ibdknox, emezeske, that makes sense. *immediately adopts as a best-practice*
15:22ibdknoxlol
15:24llasramReal 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:24llasrams,been,,
15:24ibdknoxit's not worth adding the complexity to save two characters
15:24ibdknoxthat's all you get
15:24ibdknoxlol
15:25gtraki just think it looks really awkward to have (func-call :arg1 val1 :arg2 val2)
15:26gtrak(func-call {:arg1 val1 :arg2 val2}) isn't as vague
15:26ibdknoxme too, though I think that firmly in the realm of personal preference
15:26ibdknoxis*
15:27gtrakwe should personally prefer simplicity
15:27ibdknoxhahaa
15:27ibdknoxit's true :)
15:29matthavenerhmm, what about the implications of forcing (func-call {:arg1 val1}) on (partial func-call {:arg1 val1}) ?
15:30gtrakah, interesting, you could have a partial-merge instead
15:30solussdis there a clojurescript function that converts a map to an associative-array?
15:30matthavenerbasically breaks it, and now you have two classes of functions for two classes of partial, like you're saying gtrak
15:30dnolen_solussd: there is not - and I assume you mean js object when you say associative array.
15:31solussddnolen_: yeah
15:31solussddnolen_: so how does one hand javascript a map?
15:31dnolen_solussd: in whatever way is suitable for you application.
15:32dnolen_your
15:32pandeirosolussd: https://gist.github.com/1658431
15:32gtrakmatthavener, I think that's probably alright, since you'd have control over all your functions
15:32solussdI have an ^:export ed function that I'd like to return a javascript object from…
15:33solussdpandeiro: thanks!
15:33pandeiroactually i think .strobj is deprecated
15:33dnolen_solussd: pandeiro: relying on .strobj is not recommended.
15:33solussd:(
15:33pandeirodnolen_: do you have a better example for the general use-case map->obj?
15:33dnolen_call seq on the map if you want to iterate kvs.
15:33gtrakmatthavener: and you could bridge it by partitioning
15:33dnolen_pandeiro: I do not
15:34matthavenergtrak: what do you mean?
15:34pandeirosolussd: https://github.com/fogus/himera/blob/master/src/cljs/himera/client/repl.cljs#L16
15:34matthavenergtrak: like (my-fun {:a 1} {:b 2}) is the same as (my-fun {:a 1 :b 2}) ?
15:35solussdpandeiro: well that's simple. thanks
15:35gtrakmatthavener: 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:35solussddoesn't work for deeper data structures though..
15:36gtrak:a1 v1 :a2 v2 I mean
15:36pandeiroyeah i realize that
15:36solussdguess I can add it to the first one
15:36pandeiroright, it seems pretty essential for interop to have that fn
15:37emezeskematthavener: #(func-call (merge {:arg1 val1} %)) is not that much worse than partial, and it handles duplicate keys gracefully
15:39emezeske&(let [f (fn [{:keys [a]}] a)] (#(f (merge {:a 1} %)) {:a 2})
15:39lazybotjava.lang.RuntimeException: EOF while reading, starting at line 1
15:39emezeskeOops
15:39emezeske&(let [f (fn [& {:keys [a]}] a)] ((partial f :a 1) :a 2))
15:39lazybotjava.lang.IllegalArgumentException: Duplicate key: :a
15:39emezeske&(let [f (fn [& {:keys [a]}] a)] ((partial f :a 1) :a 2))
15:39lazybotjava.lang.IllegalArgumentException: Duplicate key: :a
15:40emezeskematthavener: ^
15:40nDuffAnyone have a feel for typical turnaround on moderator reviews for posts to clojure-tools?
15:40clojurebotforget clojurescript is Chouser's baby
15:40emezeskeI am doing really bad at copy/paste today
15:40emezeske&(let [f (fn [{:keys [a]}] a)] (#(f (merge {:a 1} %)) {:a 2}))
15:40lazybot⇒ 2
15:41matthaveneremezeske: 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:41matthaveneri don't know enough to say if either way is wrong or better :)
15:42emezeskeWell 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:42emezeskeWhereas with merge, it will work, and the semantics are obvious
15:42gfrederickswhat's the literal for ##(type (into-array Byte/TYPE []))?
15:42lazybot⇒ [B
15:43amalloyain't no such thang
15:43amalloy&(Class/forName "[B") is closest, i suppose
15:43lazybot⇒ [B
15:44gtrak,Byte/TYPE
15:44clojurebotbyte
15:44hyPiRionNot exactly the same there.
15:44hyPiRion&(type (byte-array 0))
15:44lazybot⇒ [B
15:45gfredericksso 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:45gtrak,[B
15:45clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
15:45gtrak,\[B
15:45clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unsupported character: \[B>
15:45TimMc&(class (java.lang.reflect.Array/newInstance Byte/TYPE 0))
15:45lazybot⇒ [B
15:45TimMc&(class (java.lang.reflect.Array/newInstance Byte/TYPE 15))
15:45lazybot⇒ [B
15:46TimMc&(class (java.lang.reflect.Array/newInstance Byte/TYPE (int-array 15)))
15:46lazybot⇒ [[[[[[[[[[[[[[[B
15:46llasramgfredericks: You can inject a literal reference to the class object with the read-time eval reader macro: #=(java.lang.Class/forName "[B")
15:46llasramThat works for multi-methods
15:47gfredericksah ha
15:47alfborgeI'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:47gfredericksprint-dup is unideal though since it prints normal things all funny :/
15:47llasramFor protocols you can use extend-type with just the normal compile-time top-level evaluation of (Class/forName "[B")
15:48alfborgeAs 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:49llasramNow 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:50llasramgfredericks: Any reason not just extend `print-method` ?
16:03solussdcan I pass a javascript function to a clojurescript function and then call it from clojurescript?
16:04alfborgeSpeaking of enlive: Anyone know a way to join this into one selector: (select (select r [:table :td :div]) [(attr-contains :title "flummoxed")])
16:05Chousukesolussd: I don't see why not :/
16:05pandeirosolussd: yep
16:06pandeiroi just tried it on himera, define a javascript function in the console and call it at the repl
16:06Chousukeit seems to me clojurescript interop is a lot better integrated than clojure interop
16:06solussdok, 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:07Chousukeless impedance mismatch I suppose.
16:07Chousukesolussd: is "this" involved? :P it's always problematic
16:07solussdChousuke: no
16:08pandeirosolussd: 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:11alfborgeAnswering my own question: (select r [:table :td #{:div (attr-contains :title "flummoxed")}])
16:11nDuffWhat'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:12TimMcslurp-sexp-right
16:14nDuffTimMc: I'm not seeing that in the counterclockwise keybinding docs (http://code.google.com/p/counterclockwise/wiki/EditorKeyBindingsFeatures)
16:15TimMcSorry, I was just giving the name for it.
16:15nDuffahh; graci.
16:15nDuff(incidentally, it's not a name that gets the most work-safe Google results, even when combined with "counterclockwise")
16:15TimMcsnrk
16:16TimMcWell, does barf-sexp-right give less-sketchy results?
16:17hsteakhello
16:17TimMcnDuff: Huh. I guess it isn't there? I regard it as a pretty basic gesture...
16:18TimMcYou'd have to compose at least 3 existing gestures to get the same effect.
16:18TimMcs/compose/sequence/
16:19hsteaki 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:19hsteakany idea?
16:20TimMchsteak: (for [i (range 10) j (range 0 i)] ...)
16:20raekhsteak: ##(let [r [:a :b :c]] (for [i r, j r, :when (not= i j)] (vector i j)))
16:20lazybot⇒ ([:a :b] [:a :c] [:b :a] [:b :c] [:c :a] [:c :b])
16:21hsteakTimMc, raek thx
16:21TimMcraek: Not quite.
16:21TimMc[:b :c] conflicts with [:c :b]
16:21raek&(let [r [:a :b :c]] (for [i r, j r, :when (neg? (compare i j))] (vector i j)))
16:21lazybot⇒ ([:a :b] [:a :c] [:b :c])
16:21raekthere :)
16:21hyPiRionIt's already implemented in clojure.math.combinatorics.
16:21TimMcnice
16:22S11001001,(doc tails)
16:22clojurebotExcuse me?
16:22matthavenerhyPiRion: i was waiting for that :)
16:22llasram##(do (use '[clojure.math.combinatorics :only [combinations]]) (combinations [:a :b :c] 2))
16:22lazybotjava.lang.ClassNotFoundException: clojure.math.combinatorics
16:22llasramOh, of course
16:33pandeiroibdknox: 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:33ibdknoxthat doesn't seem specific to SLIME to me
16:34ibdknoxout of curiosity do you eval from a buffer or actually use a repl?
16:35p_libdknox: in CL it depends what I want to do
16:35pandeiroibdknox: no not saying it's slime specific, just an aspect of the workflow i like.. i eval from buffers and at the repl
16:35p_lusually I eval from repl, but code in buffer ;)
16:35technomancyibdknox: 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:35p_l(that is, I use "compile last expression/defun")
16:36ibdknoxtechnomancy: I see
16:36technomancyjump-to-definition is definitely my most commonly-used command other than compile, but that's trivial to implement
16:36ibdknoxtechnomancy: is that basically just the output of pprint that is clickable?
16:37technomancyibdknox: no, it's much more capable; it works on classes, methods, interfaces, and constructors too
16:37p_libdknox: another thing I like about SLIME is presentations - something lifted from LispM/CLIM
16:37ibdknoxtechnomancy: for Java stuff?
16:37pandeirotechnomancy: can i use that to inspect a java class? how do i do that?
16:37technomancyibdknox: yeah, in 90% of cases it can replace javadoc
16:37technomancypandeiro: C-c S-i
16:37ibdknoxp_l: presentations?
16:39p_libdknox: 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:39p_l(might be a weak ref)
16:39ibdknoxoh neat
16:39jhultenHey. If I have a vector in a ref and I want to empty it how would I do that?
16:40ibdknoxprobably less useful in CLJ since you're working with values
16:45jhultenref-set … got it.
16:48ibdknoxjust gathering information :)
16:48technomancyI have a feeling an inspector could be mostly implemented as an nrepl middleware so it'd be usable from a variety of clients
16:48ibdknoxif you're around me for any length of time you'll find out that I'm *very* inquisitive
16:49Chiron_Any Clojure web framework that let us pass objects/structures to a template to render? you know just like Django, SpringMVC ..
16:49ibdknoxcomb
16:49ibdknoxor mustache
16:49ibdknoxhttp://github.com/weavejester/comb
16:50ibdknoxor https://github.com/davidsantiago/stencil
16:50nDuffDoesn't enlive also work that way?
16:50nDuffhttps://github.com/cgrand/enlive
16:50technomancyno, enlive enforces view/logic separation
16:51ibdknoxenlive is also not actively maintained :p
16:51ibdknoxcomb is like 60 lines
16:51ibdknoxso it doesn't need to be :)
16:51metajackenlive isn't maintained? what? i figured it was just "mature"
16:52ibdknoxlol
16:52technomancystencil seems nice, but I would hesitate to recommend the logic-in-views approach to a newcomer
16:52RaynesI wouldn't say it isn't maintained.
16:53RaynesI had a bug a while back and cgrand fixed it.
16:53ibdknoxtechnomancy: hm? stencil is mustache no logic
16:53cemericksurely comparing comb and enlive is a category error.
16:53technomancyibdknox: right; I would recommend stencil but not comb.
16:53Chiron_technomancy: true for logic-in-views. I'm a heavy JSTL user :)
16:53ibdknoxyeah stencil is great :)
16:54technomancyI mean I'm glad comb is there; sometimes you need it.
16:54ibdknoxyeah
16:54ibdknoxalso it's just so damn clever :p
16:54technomancyor so I'm told =)
16:54cemericktechnomancy: BTW, you made me think of Clojure while watching Les Miserables last night. :-P
16:54technomancycemerick: Javert?
16:55cemericktechnomancy: yup
16:56technomancyok, PSA: if anyone ports slime's inspector to nrepl, they have to call it Javert.
16:56technomancythat is all.
16:56zerokarmaleftHugo's Javert?
16:57zerokarmaleftnvm, reading the scrollback is good
16:58technomancyp_l: only going to happen if someone cares enough to do it.
16:59p_lmight work on that if I get a java-centric job, I guess
16:59p_lright now CL support is more important to me
17:01Borkdudefinally entity framework/visual studio/.NET and oracle are friends now...
17:08jtoycan I use require so that the namespace is added into the current namespace so i don't need to type out a path?
17:12Borkdudejtoy: you need use for that
17:13Borkdudejtoy: (use 'clojure.repl)
17:13jtoyok, is it that refer that actually does that or use? i
17:13Borkdudejtoy: or in the ns-macro: (:use clojure.repl), but even better is with only: (:use [clojure.repl :only [varx vary varz])
17:14Borkdude,(doc use)
17:14clojurebot"([& 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:14Borkdude,(doc require)
17:14clojurebot"([& 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:15Borkdude,(doc refer)
17:15clojurebot"([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:15Raynes&(doc require)
17:15lazybot⇒ "([& 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:15RaynesIf 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:15gfrederickspprint is a lot slower than pr
17:17BorkdudeRaynes: you mean like this? (:require [foo :refer [x] :as bar]), so you can write (bar/y) but (x ..)?
17:25Chiron_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:25dnolenChiron_: nothing to do with files. It's because (ns ...) is a macro.
17:26Chiron_so it won't evaluate (hence no need to quote)?
17:26dnolenChiron_: yes
17:27Chiron_I find myself prefer require over use, it allows more documented code. is it a good practice?
17:28technomancyChiron_: I'd say yes
17:31Borkdudesince 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:31jtoyis there a way from the repl I can see what names spaces I have loaded?
17:32technomancyjtoy: (all-ns) I think
17:32jtoyI loaded a namespace with use but am unable to use the method i want
17:33Borkdudejtoy: java method?
17:34Borkdudejtoy: for Java classes you need import
17:35Borkdudeuse is no longer required, require is of much use
17:35technomancyheh
17:35technomancyuse is still good for backwards-compatibility in libraries
17:35jtoyit seems (all-ns) shows the namespace
17:35Borkdudeand for REPL-sessions
17:35BorkdudeI tend to use use, because I have to type less
17:36technomancyreqTAB =)
17:36Borkdudethat's four keystrokes
17:36technomancyoh, but :refer :all is more; true
17:38technomancyI wonder why slime's tab completion doesn't put a space after completed tokens when it knows they are fully-completed
17:38jtoyso 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:38Borkdudetechnomancy: because maybe you want to type ) or / or . ?
17:38Borkdudejtoy: no
17:38raekjtoy: no, you only refered the functions from interests.core. refer is not transitive. (use = require + refer)
17:39Borkdudejtoy: it doesn't work transitively
17:39technomancyBorkdude: sometimes. not for function names though.
17:40jtoyso is there a way to do what I want?
17:40TimMcHopefully not.
17:40Borkdudejtoy: don't do it…
17:40jtoyTimMc: to me?
17:40TimMcyeah
17:40jtoyI want to have one namespace that loads everything up, how does one structure that?
17:40Borkdudejtoy: you must also use interest.test
17:41TimMcMaintenance nightmare.
17:41Borkdudejtoy: go read about the namespace macro
17:41TimMcReadability nightmare too.
17:41Borkdudejtoy: http://clojuredocs.org/clojure_core/clojure.core/ns
17:42aaelonylein2 exec -e is damn cool :)
17:42technomancytop-level side-effects =(
17:42Borkdudejtoy: for example this one http://clojuredocs.org/clojure_core/clojure.core/ns#example_527
17:43technomancyaaelony: you can do that without a plugin: lein run -m clojure.main -e
17:43BorkdudeI renamed lein 1.7 to lein1, lein2 is now just lein ;)
17:44jtoyBorkdude: what is good about that example? i don't fully understand
17:44aaelonytechnomancy: nice stuff
17:46technomancyBorkdude: wooo
17:47Borkdudejtoy: it just shows you can require/use multiple other namespaces.
17:47BorkdudeI gtg
17:50samedhiI 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:50samedhi*get datomic*
17:50zaistehi
17:51amalloyincompatible clojure versions, samedhi
17:51amalloyyou're probably running 1.3 or lower, with code compiled against 1.4?
17:51samedhiI am 1.4.beta3
17:52samedhilet me make sure though
17:54samedhiI 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:55S11001001samedhi: run lein deps :tree to examine the results of lib resolution
17:56S11001001(that's a thing now right?)
17:57samedhiS11001001, WARNING: passing an argument to deps is deprecated. is all I got back, is this a lein2 feature?
17:58samedhiyeah, it appears to be a line 2 thing, because it works with that.
17:58samedhi*lein2
17:58S11001001for lein 1 try lein pom; mvn dependency:tree, assuming you've got mvn installed
17:58S11001001but lein2's output probably good enough
18:06dwierengais the clojure-csv the canonical library for writing CSV files? it looks like there are lots of csv libraries on clojars
18:06RaynesTry it free for 30 days or your money back.
18:06RaynesOr something like that.
18:06samedhiS11001001, 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:07dwierengaRaynes: um. thanks..
18:07S11001001samedhi: first thing, why are you asking for 1.4.0-beta3, when 1.4.0 is out?
18:08Raynesdwierenga: Yeah, sorry. dsantiago's stuff is always good, so go for it.
18:08S11001001samedhi: anyway with maven, shallowest, then leftmost wins, unless someone's speccing a hard range
18:08samedhiumm, I actually though beta3 would be after just 1.4.0.
18:08samedhiI guess that makes sense
18:08S11001001hard ranges are relatively rare, though some did accidentally think they were good to use (e.g. me)
18:09samedhiOk, I will see if just [org.clojure/clojure "1.4.0"] makes a difference
18:09dwierengaRaynes: ok cool thx!
18:09S11001001I think there is 1.5.0-alpha1 if you'd like to try that :)
18:09S11001001moreover misspelling will lead to rejection, so check search.maven.org for exact version specs
18:21seancorfieldI 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:22seancorfield(and I know that's a very generic question)
18:23technomancyI believe fully-visual screen sharing is still too high-latency to support pairing unless you have a crazyfast connection.
18:23seancorfieldReason 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:23seancorfieldtechnomancy: 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:24seancorfieldbut i want to move the team to emacs and the fact it doesn't play nice with iChat is an obstacle right now :)
18:24technomancyeveryone's different I guess. I couldn't stand it.
18:24technomancyI could see using full-screen sharing for something other than emacs
18:25technomancybut half the fun of emacs is that it works great over SSH
18:25seancorfieldyeah, i know :)
18:25S11001001but you don't get emacs image display or speedbar over ssh :)
18:25technomancyhaha; speedbar
18:26technomancyI guess if you're going for a gradual transition it might make sense
18:27seancorfieldevery 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:27seancorfieldunless i set up a shared dev server we can all ssh into... which does have some benefits :)
18:28technomancyat sonian we had ~/.ssh/config kept in git so everyone could keep their shared usernames and dyndns entries in sync
18:28seancorfieldinteresting idea
18:28technomancywhich 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:29technomancywhat we really need to do is convince zkim to get http://pair.io out of alpha =)
18:31zaistecan I ask a question about compojure/ring here ? =)
18:34emezeskezaiste: You betcha!
18:34zaiste;)
18:35zaistei'm trying to figure how to read POST params from a form
18:35zaiste(POST "/" {params :params} (...)) gives empty map
18:36zaistebut (POST "/" {body :body} (slurp body)) gives the params in a raw format
18:36zaistenot sure how should I read them...
18:36emezeskezaiste: It sounds like maybe you aren't using the necessary middleware
18:37emezeskezaiste: I think you need to set up the wrap-params middleware
18:37zaisteI wrapped routes with handler/site from compojure
18:38emezeskeI think that newer versions of compojure do not add wrap-params by default
18:39zaistenot sure about it, but reading from compojure source
18:40zaisteif it's wrapped with handler/site
18:40zaisteit should be automatically wrapped with wrap-params as well
18:40zaistehttps://github.com/weavejester/compojure/blob/master/src/compojure/handler.clj
18:40emezeskeLooks like you're correct!
18:41zaiste=)
18:42emezeskeIn which case, I've got no idea what's going wrong
18:42emezeske:(
18:42zaistethanks anyway!
21:19seancorfieldtechnomancy: 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:06muhoopandeiro: i'm poking around in this couch-session stuff atm. found where it's blowing up, now trying to fix it
22:14pandeiromuhoo: cool where is it blowing up?
22:14muhoopandeiro: https://www.refheap.com/paste/2850
22:15muhooi think it's an incompatibility with latest clutch, not ring
22:16pandeiromakes sense, did put-document change?
22:18muhoonot since 2011
22:19muhoooh wait, it did, 4/08/12
22:19muhooto-byte-array
22:21muhoobut that's not the problem, the data passed in to write-session is an emty map. will track down
22:27muhooarrgh... noir won't reload namespaces from checkouts, even if i (require :reload) them
22:28muhooactually (require :reload) ignores the checkouts completely, and pulls stuff from a jar instead.
22:36pandeiromuhoo: sorry i
22:36pandeiro... havent been able to look
22:37kwertiiIs it possible to get the project.clj version string from within the project's code?
22:45muhoopandeiro: np, i got this :-)
23:20muhoopandeiro: fixed.
23:21muhoowell, 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:21muhooand couch-session expects it to return nil
23:27ro_stanyone using live-coding-emacs?