#clojure logs

2012-02-22

00:24technomancybrehaut_: you may be interested in this: https://github.com/mmcgrana/clj-stacktrace/commit/5277a5d75298
00:24technomancyuse of :injections with a plugin
00:25amalloybrehaut_: incidentally, isn't #(-> [% (v %2)]) basically (*** identity v)?
00:28technomancywow, someone must have told The Java Masses to switch from jarvana to search.maven.org, because the latter finally became as slow as the former
00:33brehaut_amalloy: yes almost; except that it takes two args rather than a pair
00:42MenTaLguYhmm
00:45MenTaLguYhmm
00:46MenTaLguYso what's the best way to include extra files in the jar from a leiningen plugin?
00:48technomancyMenTaLguY: the resources/ dir is usually used for that
00:48MenTaLguYyeah, not sure I want to do that in this case
00:48MenTaLguYso, specifically what I'm trying to do is implement a leiningen plugin that sucks down Ruby gems and includes them in the classpath/jar
00:49emezeskeMenTaLguY: levand added an implementation of that to my lein-cljsbuild plugin
00:49emezeskeMenTaLguY: https://github.com/emezeske/lein-cljsbuild/blob/0.1.0/plugin/src/leiningen/cljsbuild.clj
00:49emezeskeMenTaLguY: Starting on line 256-ish
00:50MenTaLguYhmm
00:50MenTaLguYok, I see
00:51MenTaLguYon the classpath end, is hooking leiningen.classpath/get-classpath the right thing to do?
00:52technomancyyeah, probably
00:52technomancywell
00:52technomancyin leiningen 2, hooking leiningen.core.classpath/get-classpath will do it
00:52technomancyin lein1 it's more complicated
00:53callentechnomancy: what changes in leiningen 2 for the end-user?
00:53technomancycallen: I'm glad you asked!
00:53technomancycallen: you can run https://github.com/technomancy/lein-precate on your project to find out
00:53technomancythe main thing is the use of profiles, which are super great and described fairly well by the readme on leiningen's master branch
00:54technomancythe new task is totally rewritten
00:54technomancyaliases now support partial application
00:55technomancyand the project/plugin isolation is a lot better
00:56technomancyemezeske: have you gotten a chance to try lein-cljsbuild on lein2 yet?
00:56emezesketechnomancy: no, not yet, I've been working on a major release
00:56emezesketechnomancy: maybe after that, though
00:56technomancywould be super duper to get it in before the release
00:57emezeskewhen's the release?
00:57technomancystrategically, I mean, considering it could include breaking changes
00:57technomancyI mean before the lein-cljsbuild release
00:57emezeskeoh, gotcha
00:57emezeskemaybe I'll do that -- I think it might not be too bad, seeing as it's already 1.7 compatible
00:58technomancyactually just glancing over it, you might already be ok
00:58technomancyis there an easy way I could test it?
00:59emezesketechnomancy: yeah, if you clone the source and go into the example-projects/ dir
00:59emezeskehaha
00:59emezeskeyeah check out example-projects/simple/README.md, if that works I'd say things are peachy
01:00technomancycool
01:02emezesketechnomancy: is there an easy way to have lein1 and lein2 installed at the same time?
01:03technomancyemezeske: sure; I have lein2 symlinked to ~/bin/lein2 and lein1 as ~/bin/lein
01:03technomancynothing to it
01:04emezesketechnomancy: oh, maybe I should be less afraid of testing things against lein2
01:04dnolenanyone have suggestions for this improved handling of let scoping inside loops in CLJS? https://github.com/clojure/clojurescript/compare/154-bad-scope-in-loop
01:05technomancyemezeske: suspect the only change you'd have to make is adding in a compatibility shim for eval-in-project
01:05technomancyyou can probably just straight up copy what I've got in lein-swank
01:05emezesketechnomancy: so lein1 and lein2 can, e.g. "lein upgrade" independently?
01:05emezesketechnomancy: awesome, I'll take a look
01:05technomancyhttps://github.com/technomancy/swank-clojure/blob/master/lein-swank/src/leiningen/swank.clj#L47
01:06technomancyemezeske: hmm; hadn't thought of that
01:06technomancyat some point, "lein1 upgrade" will result in lein2
01:06technomancybut that doesn't have to happen right after 2.0.0 is released
01:07technomancyemezeske: simple example can't resolve compojure 0.6.5, which is weird
01:07technomancytrying with 1.0.1
01:07emezeskeoh I should probably update that anyway
01:07technomancyok, that's bizarre; it can't find compojure at all
01:08emezeskehrm..
01:09technomancytotally my fault though
01:10technomancyemezeske: oh, the other thing is that :extra-classpath-dirs is gone; you can now have :source-path and :resources-path just be a vector
01:10technomancyso anything that would go in :extra-classpath-dirs would just get concated onto that
01:11MenTaLguYtechnomancy: hm, so what do you mean by "more complicated"?
01:12emezesketechnomancy: right now, the cljs source dirs get added to :extra-classpath-dirs; I'm not sure if they should become :source-path or :resources-path
01:12MenTaLguYre: hooking get-classpath in 1.x?
01:12technomancyMenTaLguY: actually I'm wrong, get-classpath is the right level of abstraction for that
01:13MenTaLguYok
01:13technomancyemezeske: quick hack to get it working: http://p.hagelb.org/cljsbuild-diff.html
01:14emezesketechnomancy: cool. I'd need to check the leiningen version, though, right? and only do that if it's lein2?
01:15technomancyemezeske: yeah, the code to support both is a bit more complicated
01:15technomancysince it's just a single function it's probably not worth splitting it off into its own git branch though
01:15emezesketechnomancy: is there a def for leiningen version somewhere?
01:16technomancyemezeske: it's (System/getenv "LEIN_VERSION")
01:16technomancybut it's better to check for the vars themselves
01:16emezeskeoooh I see how to do that
01:16emezeskeyeah
01:17technomancy(try (require 'leiningen.core.eval) (resolve 'leiningen.core.eval/eval-in-project) (catch Exception _ (require 'leiningen.compile) (resolve 'leiningen.compile/eval-in-project)))
01:17technomancysomething like that
01:17emezeskeI can just hack up your eval-inproject
01:17emezeskeyeah cool
01:17technomancyok, just confirmed "hello from clojurescript"
01:18emezeskewow, awesome
01:18emezeskeyou applied the hacks above?
01:18technomancyjust the diff I pasted, not the 1.x fallback
01:18technomancyalso it might be worth noting that :dependencies are an ordered map now in 2.x rather than a vector of vectors
01:18emezeskegotcha
01:19emezesketechnomancy: does that mean the project.clj :dependencies format looks different?
01:20technomancyemezeske: well actually both forms should be supported
01:20technomancy(conj deps ['hello "1.0.0"]) ; <- works for both a vector and a map
01:20emezeskeah, niced
01:20technomancyit'll look different when you pprint it or whatever, but it should act the smae
01:20technomancysame
01:20emezeskenice*
01:20MenTaLguYI love little things like that in Clojure
01:24Apage43No matter what language I really like being able to change a bunch of stuff in once place and have other code not care
01:33accelIs it possible to do the following: after the JVM has been sgtarted, take a memory "snapshot" of the current state of the JVM and save it as a file to a disk - then in the future, instead of staring new JVMs, just memory map this file. (the problem intended to solve here is long jvm startup times)
01:34technomancyclojurebot: (save-lisp-and-die)
01:34clojurebotI don't understand.
01:35MenTaLguYthat would be the emacs solution, yes
01:35technomancyaccel: no, unfortunately that's a feature more or less unique to smalltalk/CL afaik
01:35MenTaLguYemacs does it too, doesn't it?
01:35acceltechnomancy: is there no OS level hacks to do this?
01:35MenTaLguYI think you'd need some support from the JVM
01:35technomancyMenTaLguY: not during normal operation, but probably as part of the build process
01:36MenTaLguY(because of file descriptors, etc.)
01:36accelwhy? what state does the JVM hold that the OS can not see?
01:36accelhmm
01:36MenTaLguYtechnomancy: yes
01:36MenTaLguYanyway, it's not a crazy idea, just not one that I think is easy to achieve without explicit JVM support
01:36accelit amazes me that java's been around for more than a decade; yet this is not possible
01:37MenTaLguYSun was a negligent parent
01:37technomancyaccel: the JVM is a strange combination of great engineering achievement and inexcusable laziness
01:37MenTaLguYIt still galls me that we have to explicitly size heaps, a la Mac OS 9
01:37acceltechnomancy: yeah, the VM + Hotspot + libraries ... I like. Some of the other things -- startup time, inability to violently kill threads -- not so much
01:38accelis there any decent open source java?
01:38technomancyexhibit a: the /usr/bin/java command-line launcher reads like someone who was raised on VAX read a book on unix and thought it didn't sound too hard
01:38technomancyaccel: if there were such a thing, Oracle would try its hardest to squash it
01:38MenTaLguYviolently killing threads tends to be a bad idea, becuase of deadlocks
01:39MenTaLguYthere *is* Thread.stop, mind you
01:39accelhmm; wrap everythign in STMs :-)
01:39MenTaLguYeven though it's deprecated
01:39technomancyaccel: you'd need static typing to isolate I/O
01:39accelI'm complaining too much; it just irritates me that I can _almost_ use the java VM as an OS ... but not quite
01:40technomancyit's a compromise
01:40acceldoes IBM/eclipse use Sun's JVM?
01:41acceland is the gnu java stuff gcj/kaffe/... any good, or are they not very production friendly?
01:41MenTaLguYI wouldn't recommend gcj
01:41technomancyIBM has put their weight behind openjdk
01:41technomancyfor what it's worth, it's the only game in town
01:41MenTaLguYit works great for most things, though static compliation has some performance disadvantages over JIT
01:42MenTaLguYthe big problem is the remaining few things that gcj can't support with AOT, and the incompleteness of the class library
01:42MenTaLguYthough now openjdk has that problem too
01:42MenTaLguY(re: incomplete class library)
01:43MenTaLguYI haven't had any experience with Kaffe
01:43technomancyavian is another experimental edge one
01:43accelOpenJDK = the Sun's implementation that they open sourced back in 2007, and what I now downoad from oracle's website?
01:43technomancyneat ideas, but too slow to be practical
01:45MenTaLguYsome day I'd like to take a stab at implementing clojure atop LLVM or something, though I imagine someone's already playing with that
01:46accelsadly, even if someone did; i wouldn't switch
01:46hiredmanaccel: openjdk is the reference jdk
01:46accelI find java's libraries too nice
01:46accelthey somehow seem safer/cleaner to use than C libraries
01:46technomancyMenTaLguY: some day I'll make elisp a compilation target
01:46accelthe lack of segmentation faults is too nice
01:46ibdknoxjust need CinC then it'll be a breeze ;)
01:46accelI just need Java to startup instantly :-)
01:46MenTaLguYwell, re: non-JVM Clojure, I think that'd be more for things you wouldn't use the JVM for anyway
01:47accellike waht? embedded computing?
01:48hiredmanthere is work underway to modularize the jdk, and interestingly I heard replace the horrible java me suff with a stripped down set of modules
01:48hiredmanthe jvm actually runs on a lot of embedded stuff
01:48MenTaLguYaccel: I don't know, maybe? It depends on what substrate we're talking about here (LLVM, versus something else)
01:48hiredmanthat was what it was designed for
01:48hiredmanset top boxes
01:49MenTaLguYthe JVM made a lot of strange decisions for that space though
01:49MenTaLguYDalvik makes some better decisions in that regard, I think
01:49technomancylearning from sun's mistakes, mostly
01:49hiredmanwell, dalvik's hindsight is 20/20
01:49accelyeah; I'm not yet convinced that my VCR needs to do JItting
01:50hiredmanaccel: jitting is not a requirement of the jvm
01:50hiredmanit is a performance optimization that the advanced ones do
01:50MenTaLguYthe first JVMs were interpreter-only
01:50MenTaLguYand then there were the JVM-on-silicon things
01:51hiredmanhttp://en.wikipedia.org/wiki/Java_processor
01:51accelhmm; can I run Dalvik on laptops (i.e. not phones)?
01:51technomancyjust updated clj-stacktrace, lein-tar, and lein-difftest for lein2 compatibility; woo
01:51acceland if so, can I run clojure on Dalvik?
01:52hiredmanI started looking at what it would cost to get a board with hardware support for jvm bytecode
01:52hiredmanbut it seemed like it would just be cheaper to get a 1ghz arm board and run a normal arm jvm
01:52hiredmanaccel: dalvik has it's own set of issues
01:52accel32bit?
01:52hiredmannot the least of which is immaturity
01:53hiredman(which shows in things like garbage collector performance)
01:53Apage43hiredman: there's a normal arm jvm?
01:53hiredmanthere are several options
01:54MenTaLguYI think openjdk hotspot can do arm, though absent a lot of assembly-level optimizations
01:54emezesketechnomancy: w00t
01:54acceldumb question: is there a way to start a "naked" Java VM, which loads nothing; just to see what the minimal time possible is, w/o modifhing the openjdk source code?
01:54emezesketechnomancy: so, I'm trying to get lein2 bootstrapped
01:54hiredmanaccel: let me ask you this, why are you stopping your jvm?
01:54emezesketechnomancy: maybe this is the wrong way to do it: I copied my lein script to lein2, and changed LEIN_VERSION to 2.0.0-SNAPSHOT
01:54technomancyaccel: "time java -version" is what I do
01:54emezesketechnomancy: this does not seem to have worked
01:54hiredmane.g. if startup time is an issue why not let it run?
01:55technomancyemezeske: no, you need to use the master branch from git
01:55technomancyemezeske: and the "building" section of the readme at the bottom
01:55accelhiredman: because I don't nkow how to unload clojure modules
01:55emezesketechnomancy: aha, thanks
01:55accelhiredman: so often times, it'll be using old definitions of functions
01:55accelwhich aren't in my *.clj files
01:55accel[when the proper behavior, would be to give me a run time error]
01:55acceltechnomancy: that is ridiciously fast
01:55technomancyman
01:56hiredmanhttp://openjdk.java.net/projects/zero/
01:56technomancywhy don't we just have swank clear the namespace before loading it?
01:56technomancymaybe just on C-c C-l rather than C-c C-k
01:56acceltechnomancy: how do I do that?
01:56technomancysomebody do that, ok?
01:56acceltechnomancy: how do I tell clojure to nuke all modules?
01:56Apage43hiredman: neat.
01:56technomancy,(doc ns-unmap)
01:56clojurebot"([ns sym]); Removes the mappings for the symbol from the namespace."
01:56technomancyaccel: ^
01:57hiredmanthere is also jamvm, which is kind of slow
01:57technomancyaccel: too annoying to do by hand without tool support though
01:57acceltechnomancy: not a proble
01:57accelm
01:57technomancyanyway, somebody go make swank do that, ok?
01:57technomancyI gotta head to bed
01:57accelthanks for the tip
01:57Apage43man
01:57hiredmanhttp://elinux.org/BeagleBoard#Java
01:57MenTaLguYhaha, yeah! I've got the jar including gems now
01:57technomancyemezeske: post to the mailing list if you have any more trouble
01:57MenTaLguYaaaand, the coffee shop is closing
01:57technomancyMenTaLguY: slick. same advice to you re: the maliing list =)
01:58Apage43i really need to learn emacs one day
01:58hiredmansome day I'll make a little robot, and it'll run clojure
01:58MenTaLguYtechnomancy: I don't do mailing lists anymore, I had to declare email bankruptcy :)
01:58technomancyhah; ok then
01:59technomancyhiredman: I was going to hook this up to my zaurus: http://technomancy.us/70
01:59technomancybut then I found out how serial ports are way more complicated than parallel ports and lost interest
02:00hiredmanis norbert a hatip to norby?
02:00hiredmanheh
02:00hiredmanhardware
02:00Apage43had a zaurus once, I busted the screen. Only the touch part though, could still boot into console mode and use it that way
02:00hiredmanwho needs it? right?
02:01G0SUBtechnomancy, can you please take a look at https://github.com/mmcgrana/clj-stacktrace/pull/8 ?
02:01G0SUBtechnomancy, it's been sitting in the queue for 2 months.
02:34emezesketechnomancy: so in lein2, :source-path may either be a string or a vector of strings?
02:35emezesketechnomancy: (btw, I have lein2 running, thanks)
02:38emezesketechnomancy: woooo, lein1/lien2 compatibility reached
03:40tjgilliesin swank-clojure how do i kill all running threads?
03:40luciani don't think threads can be killed
03:48callencan they be sent messages to sleep?
03:48luciancallen: afaik not if they don't cooperate
03:48lucianthere is an api in pthreads to outright interrupt a thread, but it's extremely unreliable. any such apis will be, by the nature of threads
03:49tjgilliesi don't want to kill specific threads
03:49tjgilliesjust kill all running threads
03:50callenwell you can stash thread state in a ref
03:51tjgillieshrm is it bad to have recursion without recur?
03:51tjgilliesi have a function that does Thread/sleep 1000 prints something, then calls itself again
03:51tjgilliesim assuming that will overflow
03:52llasramOnly if the recursion is deep / unbounded. So in your case, yes
03:53tjgillieshow come clojure isn't tail call optimized? isn't scala tail call optimized?
03:55llasramDoing *real* TCO on the JVM is difficult. I believe Erjang does it by having an internal trampoline-based calling convention, but that still breaks across interop boundaries
03:55llasramScala optimizes where it can and silently doesn't where it can't
03:55llasramClojure instead makes it explicit, so you know exactly what recursive calls are tail calls and which are not
03:56tjgilliesah
03:56tjgilliesthnx
03:56llasramnp
03:57callentrufax, it's easier to TCO in assembler than it is in a stack-oriented VM or C.
03:57callenthis is why Lisp implementations have traditionally generated machine code directly and done their own TCO on that.
03:57callenthe TCO issue is pretty much...never going to go away unless Hickey has an insight into the issue I'm not aware of.
03:59llasramOr a future version of the JVM bytecode supports tail-calls
04:00callenthey don't like us. :(
04:00callenthey only pander to JRuby.
04:00calleneven then, minimally.
04:01llasramWho only panders to JRuby?
04:55twem2__Anyone know how Kawa manages Full TCO?
04:58twem2ah, but its slower
05:55fliebelWhat is happening with pods? dev.clojure.org has very little on them, but rhickey talked about them in his conj keynote.
07:58osa1is using map destructuring with :or keyword only way to create a function with optional parameters?
08:01osa1I think I got disconnecting before sending my message: is using map destructuring with :or keyword only way to create a function with optional parameters?
08:20cemerickosa1: map destructuring can be applied to rest args; that is the basis for optional params
08:22osa1cemerick: thanks. I was wondering if there's a way to make functions with optional and non-keyword parameters, of course we can do that with some helper macros but is it possible with defn ?
08:22cemerickosa1: yes, but the mandatory/non-kwargs must come first
08:22cemerick(fn [mandatory & {:keys [optional optional2]}] ...)
09:25jsabeaudryAnything you would change in this before using it as an example of what a closure is? http://pastebin.com/M1dPUz7t
09:28clajjsabeaudry, clever application!
09:29clajonly that you have to keep the timer in some kind of closure itself to use it :)
09:38dnolentscheibl: you're on the CLJS keyword IE thread in JIRA right?
09:39tscheibldnolen: yep
09:39clajthe github.com/clojure/clojurescript wiki says that :use is not supported, but :use is used in clojurescriptone. The wiki must be wrong, no?
09:39tscheibldnolen: I've just tested your recent fix
09:40tscheibldnolen: as I've described their I'm now encountering CLJS-133
09:41tscheiblthere...
09:43jsabeaudryclaj, Where is :use used in clojurescriptone?
09:43maravillasclaj: i think the unrestricted use form isn't supported, but use :only is
09:43jsabeaudryoh ya what maravillas said
09:43clajok, it's in controller.cljs, but your right, it's [one.sample.model :only (state)]
09:44tscheibldnolen: ms may make things easier for users... but definitely not for us developers, developers, developers ;)
09:50tscheiblexactly at the point in time when I wrote the previous post I received an email from Microsoft Austria... funny isn't it :)
09:52dnolentscheibl: ah so 133 and 139 are related but different
09:52dnolentscheibl: so 139 works for you? but 133 does not?
09:53dnolentscheibl: ah ok so 139 seems resolved, will look more closely at 133
09:54tscheibldnolen: yes, the unicode literals (\u....) don't get converted to utf-8 any more
09:55tscheibldnolen: but as CLJ-133 wasn't fixed with this patch... but seems to be related
09:56tscheiblforget the "as" in the previous sentence... I hadn't much sleep tonight and my brains still isn't working, obviousely
09:57tscheibl..damn I can't write any more :)
09:57tscheibl.. I haven't had much sleep tonight and my brain still isn't working...
09:58tscheibl..obviously
09:58dnolentscheibl: thx, will look into
09:58dnolenit
10:00tscheibldnolen: I'll have a look, too.. after some more coffee... 4 eyes may see better than 2
10:01pjb3Has anyone else ran into issues like this before?
10:01pjb3https://gist.github.com/1885401
10:02Vinzenthm, I thought #|comments|# was added in 1.3!
10:02pjb3It seems that I'm using a macro that evaluates a body and in that body I'm trying to use recur
10:02pjb3to recur to a loop point outside of the macro
10:03pjb3but it recurs to the macro call, instead of the loop :(
10:04cemerickVinzent: it's been considered, but no.
10:04Vinzentwhy?
10:04clojurebothttp://clojure.org/rationale
10:07jsabeaudryIs there a way to have synchronous transactions that will not be retried?
10:08jsabeaudry(If it fails I just want to report that it failed)
10:08TimMcjsabeaudry: Not that I know of, but you could build that pretty easily.
10:11clajthere are ways to set how many times somethings retries as well - maybe you could set it to 1 or so?
10:11cemerickVinzent: I don't think it's clear that it's necessarily good, esp. given #_
10:11pjstadigpjb3: i'm guessing because the macro wraps it's body in a fn https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L337
10:11jsabeaudryTimMc, Hmmmm, thanks, I'll keep reading I haven't wrapped my head around the multithreaded constructs yet (too many years of locking)
10:11pjstadigwhich creates a recur target
10:11TimMcclaj: Oh, good call.
10:11pjb3scgilardi- seancorfield did you see the error I'm having in that gist I posted? Is there a reason why clojure.java.jdbc doesn't have something like a select-rows function instead of requiring you to use the macro?
10:12clajhttp://clojuredocs.org/clojure_core/clojure.core/ref-max-history
10:13TimMcHmm, that's not so clean.
10:13jsabeaudryclaj, Thanks for the link, too bad the doc is so short
10:14pjb3pjstadig: yeah, looks like what I want to call is actually with-query-results*, the internal function
10:14clajessentially (def no-retries-ref (ref-max-history (ref {}) 1)) should do
10:14pjstadigclaj: i don't think the ref-max-history determines the number of retries
10:14pjb3What's the point of the internal namespace?
10:14clajoh, you're right.
10:14pjb3Is that link, don't call this stuff directly, it might change?
10:14pjstadigit determines how many versions of the ref's value are kept around, and when you run out of history you trigger a retry upon reading a ref
10:15Vinzentcemerick, #_ is good, but too verbose if you need to comment more than one form. Also, #| would be easily used by IDEs co comment the region automatically. Although I agree that 4 ways to comment out code may be too much
10:15pjb3s/link/like/
10:15cemerickVinzent: yeah, there was a fifth suggestion floating around before.
10:15TimMc#_(comment ...)
10:16TimMcAlso...
10:16TimMc&[#_ #_ #_ 1 2 3 4 5]
10:16lazybot⇒ [4 5]
10:16cemerickwell, that, and an editor that cares to should be able to drop #_'s as needed to comment out selected forms, etc.
10:17cemerickTimMc: hah, didn't know about that
10:17cemerickThat could really burn someone badly.
10:17cemerickImagine if multiple semicolons commented multiple lines…
10:17pjstadigi was recently reading the STM code, it's quite an interesting read
10:20TimMccemerick: I don't know if that behavior is documented.
10:20TimMcs/documented/intended/
10:21pjb3Yeah, I'm totally baffled by why you would want the with-query-results macro. All it does is wrap the function and provide you a different way to bind the results to a variable
10:21pjb3so you get this
10:21pjb3(sql/with-query-results results ["SELECT * FROM mytable"] (prn results))
10:21pjb3instead of
10:21pjb3(let [results (sql/with-query-results* ["SELECT * FROM mytable"])])
10:21pjb3err
10:21pjb3(let [results (sql/with-query-results* ["SELECT * FROM mytable"])] (prn results))
10:22pjb3oh, and the body doesn't have to be a function, it can just be a form
10:23TimMcjsabeaudry: Off the top of my head: (defmacro dosync-once [& exprs] `(let [retried# (atom false)] (dosync (when @retried# (throw ...)) ~@exprs)))
10:23TimMcerm
10:24TimMcjsabeaudry: throw in a (swap! retried# (constantly true)) at the beginning of the dosync
10:24pjb3still, unless I'm missing something, I think just having a select-rows function that just returns the results make a lot more sense
10:25Vinzentcemerick, just curious, what the fifth was?
10:25VinzentTimMc, hm, thank you! #_(comment ...) looks very nice
10:26cemerickTimMc: hah, six
10:26cemerickVinzent: it was some transplant from another lisp; don't remember
10:26cemerick#; maybe?
10:26jsabeaudryTimMc, like this: http://pastebin.com/WwGxiLD4 ?
10:27TimMcjsabeaudry: Well, after the when
10:27jsabeaudryTimMc, Oh ya heheh
10:27TimMcmy bad
10:28jsabeaudryTimMc, So basically if I throw within the dosync it will not be retried?
10:28TimMcThat's my understanding, yes.
10:28jsabeaudryTimMc, However, if the dosync executes fines but the validator fn fails then it will get retried, is that right?
10:29TimMcOh, validators... I would *imagine* they are called at the end of dosync before it commits.
10:30TimMcand I think they wouldn't cause a retry, but a failure. But I have read up on this stuff recently.
10:31stuartsierraif the validation function doesn't pass, it throws an exception and the transaction aborts
10:32jsabeaudrystuartsierra, So the only time the transaction gets retried is when another thread mutates the ref/atom/agent while another one is also mutating it?
10:33stuartsierrayes
10:33TimMcI don't think atoms are affected by dosyncs.
10:34jsabeaudrystuartsierra, ahhhhh ok I guess it is becoming clearer
10:34TimMconly refs and sends to agents
10:35stuartsierraTimMc: yes, dosync transactions only apply to refs and agents. But Atoms can also have validation functions, which behave the same way for `swap!`.
10:35TimMcsure
10:39gtrak`where's the slides for the ants talk?
10:39gtrak`I think I'm on the verge of converting 2 more people
10:39TimMcThat demo really should be updated.
10:39TimMcMIght be a nice little project.
10:40gtrak`it was a 'wow' video for me
10:40tmcivergtrak`: which video is this? link?
10:40TimMcDon't have it on hand.
10:40Kototamawhen using ring/compojure how can I run my app/routes with run-jetty and at the same time running a WAR (the JSON webservice used by the app in this case) ?
10:40gtrak`http://blip.tv/clojure/clojure-concurrency-819147
10:40tmciverthanks
10:41gtrak`it says, "be sure to grab the slides and code in order to follow along"
10:41gtrak`where are they?
10:42TimMcCode is easy enough to find: http://www.lisptoronto.org/past-meetings/2009-05-clojure-ants-demo
10:43tmciverThat's an old talk. I assume it's still relevant?
10:44gtrak`it was before protocols/records
10:44gtrak`it's a good talk though
10:52TimMcSo, 1.2? 1.1?
10:56stuartsierraTimMc: I think ants.clj was pre-1.0
10:58TimMcfancy
10:59timvisherAnyone know if it's possible to tell emacs compilation buffers to respect color code sequences, i.e. `^[[1m^[[32m0`?
10:59jlftimvisher: try C-h f ansi-color-for-comint-mode-on
10:59stuartsierratimvisher: it's possible. Comint mode can do it
11:00jlftimvisher: you might try calling that from compilation-start-hook or somesuch
11:01KototamaOr how can I specify the context path for some routes?
11:02timvisherjlf stuartsierra: good points. I'll investigate. :)
11:16jsabeaudryIs there a function that will transform nil into "nil" ?
11:17TimMc&(pr-str nil)
11:17lazybot⇒ "nil"
11:17TimMc&(map {nil "nil"} [1 2 nil])
11:17lazybot⇒ (nil nil "nil")
11:17TimMc:-P
11:18TimMc$findfn nil "nil"
11:18lazybot[clojure.core/print-str clojure.core/pr-str]
11:19jsabeaudryTimMc, Whoa, what is this findfn black magic?
11:20gfredericksjsabeaudry: you give it some args and a return value and it looks for functions that do that
11:20gfredericks$findfn 2 3 4 5 6 20
11:20lazybot[clojure.core/+ clojure.core/+']
11:22TimMcjsabeaudry: You can also get it as a local REPL tool, but I find it more convenient to /msg lazybot ^_^
11:22jsabeaudry$findfn 2 10 1024
11:22lazybot[]
11:23TimMc$findarg map % [1 2 3] [true false true]
11:23lazybot[clojure.core/odd?]
11:24jsabeaudryGreat stuff, love that you can do it in private too
11:24gfredericksfor finding secret functions
11:26TimMc$findfn + 2 3 5
11:26lazybot[clojure.core/trampoline]
11:27gfredericks$findfn 7 8 false
11:27lazybot[clojure.core/== clojure.core/identical? clojure.core/isa? clojure.core/= clojure.core/> clojure.core/>= clojure.core/contains? clojure.core/bit-test]
11:27gfredericksgood to know that 7 isn't an 8
11:28TimMcand doesn't contain one as a key
11:29TimMc$findfn 2 1
11:29lazybot[clojure.core/unchecked-dec clojure.core/unchecked-dec-int clojure.core/dec' clojure.core/dec]
11:29TimMc$findfn 2 1
11:29lazybot[clojure.core/unchecked-dec clojure.core/unchecked-dec-int clojure.core/dec' clojure.core/dec]
11:29TimMc$findfn 2 1
11:29lazybot[clojure.core/unchecked-dec clojure.core/rand-int clojure.core/unchecked-dec-int clojure.core/dec' clojure.core/dec]
11:29tdrgabi$findfn 7 8 true
11:29lazybot[clojure.core/not= clojure.core/distinct? clojure.core/< clojure.core/<=]
11:29TimMc^ clojure.core/rand-int
11:29tdrgabiawesome. didn't know about this
11:29tdrgabiis it part of standard clojure?
11:30TimMcNope, just lazybot.
11:30TimMc(And sorry for spamming.)
11:31gfredericksTimMc: it just has to be done once a month or so
11:32TimMcand false, and true, and 0, and 1...
11:32gfredericksI think nil is the biggie
11:32TimMcYeah, but lazybot will truncate the response.
11:33TimMc$findfn [x 3] x 3 ;; just fns, or also macros?
11:33lazybotjava.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:0)
11:33TimMcjust functions
11:35gfredericks,(let* [x 3] x)
11:35gfredericks&(let* [x 3] x)
11:35lazybot⇒ 3
11:35clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
11:36gfredericksclojurebot: you might want to have that checked out
11:36clojurebotPardon?
11:36TimMcI'm sure that class isn't too important, I wouldn't worry.
11:51devnlol
11:54pyrcame across something weird
11:54pyr(let [pool (java.util.concurrent.Executors/newFixedThreadPool 10)] (.submit pool some-fn))
11:54pyrfails
11:54pyrwhereas
11:55pyr(def pool (java.util.concurrent.Executors/newFixedThreadPool 10)) (.submit pool some-fn) works
11:55hiredmanthere is a submit method which takes callables or runnables and fns are both
11:55pyryes, but how come it works when you def ?
11:55hiredmanso for the non-reflective case you need a cast or a hint
11:56tmciverhiredman: which of the two examples is reflective?
11:57hiredmansince the compiler knows the type of the local pool in the let case it is trying to compile the call non-reflectively
11:57TimMcpyr: What sort of failure do you get?
11:58pjb3https://gist.github.com/1886007
11:58pyrhold on, the repl isn't giving me errors
11:58pyrTimMc: it matched what hiredman is describing
11:58pyrTimMc: (multiple methods defined)
11:58pjb3I must not understand the difference between using multiple functions with different arities and using loop/recur
11:59hiredmanpjb3: you can't recur across a lazy-seq (which lazy-cat expands to)
11:59TimMcpjb3: That recur might be caught on something in lazy-cat
12:01pjb3hiredman: ok, is that just because lazy-cat is a macro that defines a recur target internally?
12:02pjb3so recur goes somewhere inside the macro instead of to the loop that I defined?
12:02TimMcpyr: The let version doesn't give me an error.
12:03pyrthere, reproduced, let me gist
12:03pyrTimMc: https://gist.github.com/1886044
12:03pyrgiven that namespace
12:04pyryou get a failure when requiring
12:04pyrCompilerException java.lang.IllegalArgumentException: More than one matching method found: submit
12:04pyrand indeed
12:04pyradding runnable
12:04pyr^Runnable
12:04pyrfixes the problem
12:05TimMcI wonder if this has something to do with reflection when using a var vs. a local.
12:08tmciverTimMc: what's the difference between a var defined using def and one created in a let?
12:08hiredmanlet doesn't create vars
12:09hiredmanhttp://clojure.org/vars
12:10gfrederickstmciver: let and function arguments create locals
12:11gfrederickstmciver: I think there's a clojure west talk about the topic
12:12tscheibldnolen: found it... look at my comment at http://dev.clojure.org/jira/browse/CLJS-133
12:13dnolentscheibl: so that fixes all cases?
12:15tscheibldnolen: well, it makes read-string work. To really fix probably all cases we need to change the "emit-constant" multimethod for String as explained
12:16tscheibldnolen: same as you did for the Character type .. but replace all \uFDD0 and \uFDD1 occurences in strings
12:17pyri suppose everybody new, but was somewhat surprise to see a huge time differnce between json-str/read-json and pr-str/read-string
12:17dnolentscheibl: can you demonstrate a case that doesn't work?
12:17hiredmanpyr: clojure.data.json is slow, use cheshire
12:18pyri do
12:18pyrit's two orders of mangnitude faster
12:18hiredmanoh
12:19pyrand i'm doing something wrong with carbonite
12:19pyrbecause it's slower than cheshire on my use case
12:20sritchiepyr: that's interesting, what are you serializing?
12:21hiredmancheshire is there to be fast, and it's built on top of jackson
12:21hiredmanI don't see any kind of speed benchmarks for carbonite
12:21tscheibldnolen: do you mean a case that doesn't work with your patch for 139?
12:22hiredmanhttps://github.com/revelytix/carbonite/blob/master/src/carbonite/serializer.clj <-- all proxies, proxy is slow
12:24jcrossley3if i have a protocol P with N functions, and an implementation of P called A, how should i define another impl B that works exactly like A except for one function?
12:25tscheibldnolen: one case is the symbol and keyword methods as currently implemented in core.cljs because they use e.g. "\uFDD0" which yields a String instead of just \uFDD0 which represents a Character literal
12:25pyrsritchie: maps and vectors
12:25tscheibldnolen: your patch only handles the character literal case
12:25pyrhold on
12:26dnolentscheibl: what I mean is what cases are broken after both 139 & 133 patches are applied
12:28sritchiehiredman: I reimplemented them in java on my fork
12:29tscheibldnolen: dunno, my quite complex web apps works on IE after applying both patches. However I would still fix the emit-constand multimethod for String to cover the case where unicode literals appear within strings
12:29tscheiblweb app (no plural) :)
12:29hiredmansritchie: was it faster?
12:29sritchiehiredman, pyr: I'll go ahead and benchmark those and submit a pull request for the conversions
12:30pyrsritchie: https://gist.github.com/1886194
12:30tscheibldnolen: anyway I would also apply my 133 patch because using character literals seems to me more idiomatic in this case :)
12:31hiredmanpyr: https://github.com/hugoduncan/criterium
12:32sritchiepyr: what are the versions on those deps?
12:32pyrsritchie: carbonite is yours (1.1.1), cheshire 2.2.2
12:33pyr2.2.0
12:33tscheibldnolen: or maybe even better using "\uFDD0'" because then you have the unicode char and the quote character in one string which is maybe more idiomatic and probably faster?
12:33sritchieah, so you're on 1.1.1
12:33sritchieI'll see if I can do anything to speed it up, or if that's just a limit w/ kryo
12:33tscheibldnolen: but this would of course need the fix for String (I could do that if you like)
12:34pyrsritchie: it looks as though
12:34dnolentscheibl: yes a patch for that would be welcome as well
12:34tscheibldnolen: ok
12:35pyrsritchie: the numbers i'm seeing make it seem as though pr-str was called
12:35sritchieoh, yeah, it is
12:35pyrsritchie: as in clj-print
12:35pyrsritchie: which wouldn't make sense, would it
12:35sritchiewell, some data structures get printed and the string gets serialized
12:36sritchieprobably every single serializer that uses that can be improved dramatically
12:36pyrif you look at make-payload
12:36sritchiehttps://github.com/sritchie/carbonite/blob/develop/src/clj/carbonite/serializer.clj#L25
12:36pyrsritchie: yes i was referring to that
12:37pyrsritchie: but my payloads are all stuff that should be handled by the clojure collections serializers
12:37sritchiethat'd get var, keyword, symbol
12:37sritchieyeha
12:38pyrah, wait, reading again
12:38sritchieyour keys will be serialized with clj-print
12:38pyrah, i get it
12:38sritchieso only the UUID escapes
12:39pyrthe problem is the fact
12:39pyrthat make-payload yields a LazySeq
12:39pyrah no
12:40sritchiewell, that's going to slow it down a little
12:40sritchieif you had a vector you'd use transients
12:41pyr18:38| sritchie| your keys will be serialized with clj-print
12:41pyri don't get that
12:41sritchiefor collection serialization, kryo will recursively look for serializers
12:42sritchiethe collection serializer asks kryo to serialize key and value -- kryo then looks up serializers for each of those
12:42sritchieso the keyword keys get the clj-print serializer,
12:42sritchiethe UUID gets the UUIDSerializer
12:42pyrwhy ? clojure-primitives catches keywords
12:43pyrhttps://github.com/sritchie/carbonite/blob/develop/src/clj/carbonite/serializer.clj#L99
12:43pyror maybe i'm misreading
12:43sritchiethat's a map of class to serializer
12:43sritchiehttps://github.com/sritchie/carbonite/blob/develop/src/jvm/carbonite/ClojureReaderSerializer.java
12:43pyrClojureReaderSerializer
12:43pyrgot it
12:43pyrok
12:43pyrso if i want to be faster
12:44sritchieyou'll get a nice bump if we do this: https://github.com/revelytix/carbonite/pull/3
12:44dnolentscheibl: a patch to string should make your patch to 133 moot right?
12:44sritchiefor keywords and symbols
12:44pyrwill try out
12:44sritchieawesome, let me know how it goes
12:44sritchieI'll get it into my branch too
12:45pyractually, i'll try out with a registry that just registers the needed serializers
12:45pyri was comparing serializers for my kafka flow, i'll admit i was surprised to see cheshire come out on top
12:46pyri need to include msgpack and friends in the mix
12:46pyrthe defrecord trick for kryo seems promising too
12:47sritchiethe trick I did recently with hierarchies?
12:47sritchieif there's another one, I'm really curious
12:47shaolynnCan someone point me to a tutorial on getting Noir running with Nginx?
12:48pyrsritchie: i mean just proxying serializer
12:48pyrsritchie: for a given record
12:49sritchiegot it
12:49sritchieI
12:49sritchie figu
12:49sritchiered out a way to write a serializer that'll work for every record
12:49sritchiein cascading.kryo, I (and some twitter folks) extended kryo to be able to handle more general registrations
12:50sritchieso it'll look at exact class matches first, then if none of those match, at "hierarchy registrations"
12:50shaolynnOr actually, what's the best way to get a Clojure webapp running on an Ubuntu server?
12:50sritchiepyr: that lets you register a serializer for "clojure.lang.IRecord"
12:51pyrsritchie: ack
12:52sritchiehaha, is that bad?
12:52sritchiemy goal here is to be able to serialize anonymous functions w/ kryo
12:52pyrnope, not bad
12:53pyrahah, that sounds bad though :)
12:53sritchiethat way we wouldn't need the defops in cascalog
12:53sritchieyou could use anonymous functions as cascalog ops
12:53technomancyshaolynn: easiest thing is to use jetty until it becomes a bottleneck
12:53pyrspeaking of which i was almost able to get cascalog work on cassandra
12:54sritchiewriting to cassandra?
12:54pyrreading + writing
12:54pyrbut no time to dig into it more lately, i'm going to need it though
12:54pyrlater on
12:54sritchienice, that'd make a great contrib module
12:54shaolynntechnomancy: thx!
12:54sritchiepyr I can add you to contrib, if you want to submit it
12:55pyrit's not ready yet, but i'll ping you when it is
12:55sritchiesounds good, man
13:03gfredericksThe advantage of naming your libraries /lib-\d\d\d\d/ is that you're instantly the top google hit
13:04tscheibldnolen: yes ... sorry for the delay, needed to feed
13:04ibdknoxhola
13:05ibdknoxto bad the game thing is in Germany
13:06ibdknoxthat sounds like fun :)
13:06ibdknoxtoo*
13:06dnolentscheibl: cool that would be awesome, would be nice to put this unicode stuff to rest
13:06tscheiblibdknox: what game thing? I live in Austria.. that'S not too far from germany.. ok depends on which part of germany :)
13:07ibdknoxBerlin!
13:07tscheibldnolen: definitely :)
13:07ibdknoxtscheibl: http://groups.google.com/group/clojure/msg/a843c8ea685551e7
13:11tscheiblibdknox: sounds cool...
13:12ibdknoxyeah, definitely a neat opportunity for someone
13:15tscheibltscheibl: unfortunately I'm not searching for a thesis but rather a job opportunity (possibly involving clojure) because I'm going to leave my old job in Summer
13:16tscheibllol.. I'm talking to myself
13:17duncanmhey dnolen_
13:17dnolen_duncanm: heya
13:18duncanmdnolen_: i was just gonna ask you something - what do you think of this djspiewak guy, he seems like a smart guy, but really against anything but Scala/Haskell, it seems
13:18duncanmi started learning Scala a little while back, it's kinda fun, but the combination of features gets pretty complicated and hairy very quickly
13:19dnolen_duncanm: Yes he does seem like a very smart fellow with lots of misconceptions about Lisp, are far too accepting of the absurdities modes type systems (all of them) foist upon programmers.
13:19dnolen_are -> and
13:19dnolen_modes -> modern
13:21dnolen_duncanm: I also just can't get into Scala. Way too much syntax compared to Standard ML / OCaml / Haskell
13:21ibdknoxdon't forget that this is a publicly logged channel :)
13:21duncanmoh?
13:21gfredericks$google clojure irc
13:21hiredman~logs
13:21clojurebotlogs is http://clojure-log.n01se.net/
13:21lazybot[#clojure log - Feb 22 2012] http://clojure-log.n01se.net/
13:22duncanmdnolen_: i felt the same way at first, but i'm starting to think there's a combination of features that could work well together
13:22duncanmthe key is not to try every single feature all together
13:22hiredmansounds like C++
13:22duncanmyeah, it's a bit like that
13:22ibdknoxyeah I think scale is headed down that path
13:22ibdknoxit's already employs monstrous complexity through its various features. Step 1, check.
13:23ibdknoxs/it's/it
13:23dnolen_duncanm: I think exposing OO at the upper levels of a system is just wrong (this is just my newly forming opinion)
13:23dnolen_duncanm: that's the mistake that Scala makes, adopting a whole paradigm that just stinks in it's current incarnation at putting at the top.
13:23ibdknoxdnolen_: I share it.
13:23dnolen_duncanm: better to put the whole object machinery at the bottom like Clojure - it's there for people who need it are willing to put up with the potential for really big mistakes
13:24duncanmhmm
13:24dnolen_all complexity in Scala seem to fall out of OO at top level
13:25dnolen_the rest is details
13:25duncanmit's true that i can recall the core abstractions of clojure must easier than scala
13:25duncanmin Clojure, we have IFn, ISeq, and that's kinda it
13:25ibdknoxthe point at which you *must* understand co- and contra-variance to use a language, you've failed
13:25duncanmin Scala, there are so many different traits, Traversable and what not.... and i don't even know how they do the object/function duality thing
13:25duncanmhow they call that
13:26duncanmibdknox: well, all the strongly-typed languages are like that, right? ML, Haskell, etc
13:26hiredmanat the bottom you are simulating the execution of your language on a machine, and oop does simulation pretty well
13:26duncanmdnolen_: btw, cool work on pred dispatch - i've read some of those papers before, and it's cool to see them applied in Clojure
13:27dnolen_duncanm: thx!
13:27duncanmhow active is clojure.net? i switched jobs a while back, and switched runtimes along with it
13:27duncanmnow i use Mono everyday, and i don't run the JVM anymore
13:27TimMcduncanm: You mean Clojure CLR?
13:28duncanmTimMc: right, that's the name
13:28dnolen_duncanm: it seems to be picking up some momentum based on the number of watchers as well the appearance of blogposts
13:29hagnawhat's the clojure idiomatic way to say capture input from a data source only for 5 seconds and put the data in a vector?
13:29dnolen_duncanm: we're quite a ways off but the possibility of libraries that work on JVM/CLR/JS seem eventually likely
13:30TimMchagna: Don't take this personally, but that's a terrible question.
13:30TimMc(It depends entirely on what the "data source" is and what API it provides.)
13:30hagnaTimMc: hehe thanks
13:31duncanmdnolen_: my understanding is that lein is fairly tied to maven, and .net doesn't really have anything quite like it
13:31TimMchagna: Is this hardware, or what? Are you polling it? Are there timestamps in a data stream?
13:32dnolen_duncanm: interesting - I really know nothing about .net
13:33hagnaTimMc: it's an irc bot so I would get strings over time
13:33dnolen_duncanm: I did try to play around for a moment with ClojureCLR to see if I could get core.logic working but didn't have time to really dig in.
13:33hagnaTimMc: in a callback fashion I suppose
13:34TimMchagna: conj into a vec in a ref until the time is up, I guess
13:40hagnaTimMc: yes, really I want to know how to do something until the time is up. A thread could sleep for 5 seconds and the rebind (with def) the callback method so it no longer conjs to the vector, but that seems wrong.
13:42jsabeaudryhagna, could future-cancel the thread after 5 seconds work?
13:43hagnajsabeaudry: maybe, is that a good way to get a function to behave one way and then another way based on time
13:43hagna?
13:45jsabeaudryhagna, I'm not sure, I'm new to clojure and have no java background
13:45jsabeaudryhagna, This might be of interest to you http://stackoverflow.com/questions/6694530/executing-a-function-with-a-timeout
13:46TimMcSet an atom, start a future that will sleep for 5 seconds and swap! the atom, loop until the atom has changed.
13:47ibdknoxalternatively, you could event loop it.
13:47hagnaibdknox: oh yeah?
13:47ibdknoxwhich I guess is basically what TimMc was suggesting
13:48TimMcAnd instead of a future, maybe you want j.u.Timer
13:48TimMcwhich will do the sleep for you.
13:50seancorfieldpjb3: sorry, was away when you were asking about java.jdbc
13:50pjb3seancorfield: no problem!
13:50seancorfieldi'm not fond of the current with... macro approach and will be providing a more functional API in a future release
13:51`fogusany tips for getting cljsbuild to execute on a heroku deployment?
13:52seancorfieldclojure/core have specifically said that in order to be eligible for a 1.0.0 release, java.jdbc needs an API that doesn't rely on dynamic vars and exposes everything as functions (instead of / as well as macros)
13:52ibdknox`fogus: I've been lazy so far and checked in the generated bootstrap.js :/
13:52technomancy`fogus: you can set LEIN_BUILD_TASK to "cljsbuild", but you have to enable the user_env_compile flag; lemme find the link
13:52seancorfieldat world singles, we've created a nice functional API over the top of java.jdbc so i'll probably rework that and fold it down into java.jdbc after clojure/west
13:52`fogustechnomancy: that would be great
13:53technomancy`fogus: see "Configuration" in https://github.com/heroku/heroku-buildpack-clojure/
13:53ibdknox`fogus: I'll probably revive noir-cljs at some point which would also solve this problem
13:53seancorfieldwell, after early may, more like since we're in "launch" mode at world singles thru the end of april :)
13:53technomancy^ anyone else deploying on Heroku would probably benefit from reading that too
13:54ibdknoxtechnomancy: can we chain tasks somehow?
13:55TimMcibdknox: You mean call one task from another?
13:55technomancyibdknox: sure, just use commas
13:55ibdknoxk
13:55TimMcoh, sequence them
13:56seancorfieldone of the things i don't like about with-query-results is that it behaves like a function of the entire result set rather than mapping a function across the rows so i want to expose that more easily, as well as just fetching an entire result set (i'm always passing doall into things to undo the laziness so i can cross a connection boundary)
13:56seancorfieldhappy to hear other suggestions pjb3
13:56ibdknoxTimMc: yeah, in that case you'd need to do deps and then build cljs
13:56ibdknoxseancorfield: that would be great
13:57ibdknoxI hate with-query-results
13:57pjb3seancorfield: +1 for the functional API
13:57pjb3yes, I learned that I hate with-query-results today too :)
13:57pjb3just give me a select-rows function :0
13:57ibdknoxit's nicely hidden in korma :)
13:57pjb3(defn select-rows [query] (sql/with-query-results rs query (into [] rs)))
13:58gfredericksdo I need to go look up that ssh command on clojars to update my lib or is there something baked into lein now?
13:58ibdknoxlein-clojars
13:59gfredericksthat's a plugin?
13:59ibdknox0.7.0, I think?
13:59TimMcscp pom.xml my-foo<TAB> clojars@clojars.org:
13:59ibdknoxgfredericks: yeah
13:59gfredericksTimMc: so you recommend memorizing it? :)
13:59tmciveror lein push
13:59TimMcWORKSFORME
13:59ibdknoxlol
14:00technomancyshell alias
14:01gfredericksalias .=lein push
14:03pjstadigshould have aliased ☃
14:03gfredericksman I can't even see what that is
14:03Scriptora cat?
14:03TimMcYeah, not from this terminal
14:04gfredericksmy terminal renders it, just not with enough resolution
14:04raekhttp://☃.net/
14:04`fogusI have a bookmark that performs a google search for "clojars lein scp" :-(
14:04TimMc>_<
14:04TimMcgfredericks: http://lab.brainonfire.net/whatchar/identify.php
14:04nishant_I get a ClassNotFoundException when I trying doing META - . on a namespace (http://pastebin.com/29ZKCUKZ), any ideas?
14:05jsabeaudryFunny that some functions added in Clojure 1.0 are still "alpha"
14:05pjstadigit is of course the unicode snowman
14:05TimMcah
14:05gfredericksjsabeaudry: it's "alpha" as in "alpha-male" sort of thing
14:05ibdknoxwhat's wrong with the lein-clojars plugin? :p
14:05nishant_this is after I have required the namespace
14:05technomancyibdknox: it doesn't work with dsa keys
14:06TimMcnishant_: What did you actually enter on the REPL?
14:06ibdknoxI see
14:06jsabeaudrygfredericks, Ah that explains it ;)
14:06nishant_TimMc: (require 'name.space)
14:07ibdknoxnishant_: he meant when you asked for meta
14:07pyryou guys can also use lein deploy
14:08technomancypyr: not to clojars unfortunately
14:08nishant_oh, I just typed <ESC>.
14:08pyrah sorry, didn't see the target was clojars
14:08technomancyhopefully clojars will accept that in the future though
14:08TimMcI'm not lazy enough.
14:08TimMcEvery time I actually need to publish, it is less work to type out the scp line than to do a one-time research-and-install of a lein plugin.
14:09pyrwell then, there's always alias echo "clojars-push='lein clean; lein pom; lein jar; scp *.jar pom.xml clojars@clojars.org:' >> ~/.bash_profile
14:11`fogustechnomancy: I didn't get it working, but I suspect I missed something in the read. Had to hack it for now, but will pick it back up after my demo. Thanks
14:12technomancyhmm; well let me know if you need help following it up
14:12`fogusk
14:12technomancyI haven't used cljsbuild yet myself, but I've spoken to folks who are using it
14:12technomancyhopefully user_env_compile becomes default soon so there are fewer manual steps in the future
14:13emezeske`fogus, technomancy: If there's anything in cljsbuild that could be improved to make that sort of thing easier, I'm all ears.
14:13emezeskeI haven't ever deployed to heroku, so I'm not sure what would make that easy
14:13gtrak`is there a way to pull dependencies directly from git from lein?
14:14gtrak`if-not, wouldn't that be cool?
14:14`fogusemezeske: I've only started using it yesterday, but love it so far
14:14jsabeaudrygtrak, would be pretty cool, curious to hear if there is already a way
14:14seancorfieldpjb3: ibdknox: at WS we have an execute function: (execute sql-string params f) which defaults to (execute sql-string [] doall) which is similar to what you'd want select-rows to do (except it works for any sql, not just selects) - that's something like what i'd put in java.jdbc
14:14technomancygtrak`: it would not be very cool IMO
14:15technomancytransitive dependencies would be an absolute nightmare
14:15`fogusgtrak`: I think the ClojureScript one has a lein task that does that, but I'm not entirely sure
14:15seancorfieldplus get-by-id, find-by-keys, delete-by-id and a few other "conveniences"
14:15muhoobetter to have a lein on your task than a lein on your car
14:15TimMclien
14:15gtrak`hmm, yea I'm just thinking as a temporary thing for new code, not for something you'd release
14:15technomancyit is probably somewhat workable on a small scale, but if it were to take off and be the de facto way of distributing dependencies I suspect it would be fairly disastrous.
14:15pjb3seancorfield: the main thing is I think I'd rather have select-rows return a seq of maps (rows) than pass it a function
14:16gtrak`technomancy: agreed
14:16ibdknox`fogus: the problem is probably that you need to have it download your dev dependencies too
14:16technomancygtrak`: do you know about checkout dependencies?
14:16gtrak`technomancy: yes, I've tried it once
14:16technomancythose give you 95% of the goodness of full-fledged git dependencies without the heartache
14:17`fogusibdknox: You're probably right. I'll tackle it later today
14:17technomancyit would be great to have a plugin that could set them up for you by inspecting your dependencies' <scm> elements inside project.clj; hint hint
14:17ibdknoxlol
14:18technomancyanyone looking for a fun learning project? there you go. easy but still useful.
14:18gtrak`set up checkout-dependencies?
14:18gtrak`interesting
14:18technomancygtrak`: yeah, like it could populate your checkouts/ dir for yout
14:18technomancyyou
14:18gtrak`that might be useful
14:18TimMcah, not with symlinks
14:18gtrak`is it something i could code up in a couple of hours?
14:19technomancydefinitely
14:19gtrak`i'll give it a go
14:19technomancysweet; let me know if you run into any issues
14:21lnostdal,pastebin
14:21clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: pastebin in this context, compiling:(NO_SOURCE_PATH:0)>
14:21lnostdal&paste
14:21lazybotjava.lang.RuntimeException: Unable to resolve symbol: paste in this context
14:21lnostdal&pastebin
14:21lazybotjava.lang.RuntimeException: Unable to resolve symbol: pastebin in this context
14:21lnostdalmeh
14:21ibdknox?
14:21lnostdal:]
14:22ibdknoxhttp://refheap.com
14:22lnostdali recall there being a bot here one could ask about ... ah yeah
14:22lnostdalthanks
14:22ibdknox~pastebin
14:22clojurebotPardon?
14:22ibdknoxis how it would've been triggered
14:23ibdknox~gist
14:23clojurebotgist is paste
14:23ibdknoxlol
14:24lnostdal~paste
14:24clojurebotpaste is http://www.refheap.com
14:24lnostdalso if gist is paste, and paste is that url .. what is then refheap? .. hmm
14:24lnostdal~refheap
14:24clojurebotGabh mo leithscéal?
14:24lnostdali see .... hehe
14:25TimMc~paste
14:25clojurebotpaste is http://www.refheap.com
14:25TimMcSometimes it says "paste is gist", too. :-(
14:25ibdknoxlol
14:25TimMcclojurebot's factoid module is half-broken.
14:25technomancybut always in entertaining ways
14:26lnostdalperhaps it's using rand-nth or something :)
14:26ibdknoxTimMc: you mean totally awesome.
14:26TimMclnostdal: The brokenness is partly that you can't remove some factoids.
14:26ibdknox~guards
14:26clojurebotSEIZE HIM!
14:26lnostdal~clojure
14:26clojurebotclojure is far closer to perfection then python
14:27lnostdalthen, then, _then_, THEN! .. it's, perfect!
14:27TimMcThere goes the next 5 minutes...
14:28amalloyibdknox: you missed the chance to give him a botsnack
14:28amalloyalso, i didn't really read the log very well, so that's not relevant
14:28ibdknoxlol
14:28RaynesIf amalloy would write the damned factoids lazybot plugin
14:29ibdknoxsrsly
14:29Raynesamalloy doesn't even write code anymore, I don't think.
14:29technomancyhas he ascended to Architect?
14:29amalloyAstronaut
14:30RaynesThe impossible astronaut.
14:33ibdknoxjimduey: the beta versions of korma remove the need for exec
14:34Raynesibdknox: You make every conversation about you.
14:34RaynesThey have pills for that these days.
14:34ibdknox:p
14:34ibdknoxI was reading his DSL examples thing which hit HN
14:34gtrak`technomancy: for that to work, though, I'd need the dependency to be on clojars already, yes?
14:34ibdknoxI'd be curious to hear what he has to say about making it less "lumpy"
14:35technomancygtrak`: clojars or ~/.m2, I think
14:35gtrak`ah, I see, so it would save me from having to dl/build myself except the first time
14:36m0smithhi all
14:36technomancygtrak`: no, you wouldn't have to clone or anything even the first time
14:36m0smith;(reversible? "asd")
14:36technomancyas long as the dependency is available in a repository and specified in project.clj, you can walk all the results you get and check for the pom.xml file inside the jar itself
14:36technomancygtrak`: not all jars will contain poms, and not all poms contain <scm> elements, but it's fairly common
14:37m0smith&(reversible? "asdf")
14:37lazybot⇒ false
14:37TimMc&(doc reversible?)
14:37lazybot⇒ ------------------------- clojure.core/reversible? ([coll]) Returns true if coll implements Reversible nil
14:37m0smithIs there some reason that strings aren't reversible?
14:38TimMcm0smith: Sure, they don't implement Reversible.
14:38TimMc(more importantly, they aren't collections)
14:38Raynes$login
14:38lazybotYou've been logged in.
14:38Raynes$reload
14:38gtrak`technomancy: ah, lein doesn't have an scm feature yet?
14:38dnolen_,(reverse "foo")
14:38lazybotReloaded successfully.
14:38clojurebot(\o \o \f)
14:38Raynes&(doc reversible?)
14:38lazybot⇒ "([coll]); Returns true if coll implements Reversible"
14:38technomancygtrak`: it emits <scm> into the poms, but it doesn't contain any mechanism for doing clones
14:39dnolen_,(reverse (range 0 10))
14:39clojurebot(9 8 7 6 5 ...)
14:39jimdueyibdknox: nice. Will have to get caught up. Too many irons in the fire ATM.
14:39technomancygtrak`: you actually might be able to steal from https://github.com/Seajure/melange
14:39TimMc&(doc reverse)
14:39lazybot⇒ "([coll]); Returns a seq of the items in coll in reverse order. Not lazy."
14:39m0smithI was actually thinking of rseq
14:39m0smith&(rseq "asd")
14:39lazybotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Reversible
14:39ibdknoxjimduey: I'd be interested to hear your thought on making it less "lumpy" at some point :)
14:39technomancygtrak`: melange is similar but goes the other way; it works with dependents rather than dependencies
14:39jimdueyibdknox: monads! :)
14:39m0smithOk, so String doesn't implement reversible
14:40ibdknoxjimduey: lol that's an implementation detail :p
14:40dnolen_m0smith: yeah the's the idea behind reversible, but you can't change Java Strings they are final.
14:40gtrak`technomancy: thanks, I'll take a look, though I don't want to shave a yak :-)
14:40m0smithBut if rseq were implemented as protocl, it would be able to handle Strings and other such goodies
14:40technomancygtrak`: feel free to copy as much as you like; melange is actually quite similar to what you want.
14:41dnolen_m0smith: possible in ClojureScript, not so easy in Clojure
14:41m0smith&(rseq (seq "asd))
14:41lazybotjava.lang.RuntimeException: EOF while reading string
14:41m0smith&(rseq (seq "asd"))
14:41lazybotjava.lang.ClassCastException: clojure.lang.StringSeq cannot be cast to clojure.lang.Reversible
14:42m0smithCouldn't StringSeq be reversible?
14:42dnolen_m0smith: oh yeah, probably
14:42m0smith&(rseq (vec "asd"))
14:42lazybot⇒ (\d \s \a)
14:43amalloydnolen_, m0smith: i filed an issue in jira for that months ago, asking if clojure/core would accept a patch by me to make strings rseqable
14:43m0smithso converting a string to a vector is reversible, but shouldn't a string itself be reversible?
14:43m0smithamalloy: which issue?
14:44TimMcamalloy: I wonder if you'd be better off just writing the patch and attaching it -- might get noticed more quickly.
14:44amalloyTimMc: hasn't helped any of my other patches
14:44TimMctrue :-/
14:44gtrak` technomancy: how does clojuresphere get the git urls? do all those projects have to have poms, I don't get it?
14:45technomancygtrak`: it uses both poms and github search
14:45RaynesIt assumes a lot of things.
14:45amalloyi actually can't find that jira issue; maybe i only asked on clj-dev
14:45gtrak`ah
14:45gtrak`that kinda sucks :-)
14:45technomancygtrak`: but for a checkouts plugin you can ignore clojuresphere and just use poms
14:45m0smithI was looking on DEV and couldn't find it
14:45dnolen_amalloy: well I'd vote for it, seems like a simple enough change - but why not ArraySeq then too?
14:45amalloydnolen_: i don't think seqs should be reversible
14:45amalloyjust strings
14:45dnolen_or IndexedSeq rather
14:46amalloyi doubt if vector-seqs are reversible either
14:46m0smithamalloy: I second the vote
14:46amalloy&(rseq (seq [1 2 3]))
14:46lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector$ChunkedSeq cannot be cast to clojure.lang.Reversible
14:46technomancygtrak`: basically if you call leiningen.deps/deps it will return a fileset that you can traverse with (-> deps-fileset (.getDirectoryScanner lancet/ant-project) (.getIncludedFiles))
14:46dnolen_amalloy: then why should StringSeq if not IndexedSeq?
14:46amalloyhttp://groups.google.com/group/clojure-dev/browse_frm/thread/6e92172038d2f41e/511ab0cccb2e418d?lnk=gst&amp;q=reversible#511ab0cccb2e418d for what t
14:46amalloyer
14:47amalloyanyway, i don't think stringseq should be. just String
14:48amalloy(in the same way that strings support nth)
14:48gtrak`well, the point is, the dep would have to have a pom already, or I'd have to emit one and mvn install it locally, I'm guessing lein uses the git binary to emit <scm> based on the metadata?
14:48dnolen_amalloy: ah, so special case Strings to call .reverse and wrap in seq on rseq?
14:49amalloyyes, or return an anonymous subclass of Seq that wraps the existing string
14:49amalloywhich is how i would have done it; more efficient than calling reverse, but perhaps not worth the effort
14:50hiredmanwell, if seq was a protocol you could just extend it to string insteand of needing a Seq type
14:50Somelauwseq is like a java interface, right?
14:50hiredmanISeq
14:50amalloysure, of course, hiredman. but that's not going to happen until CinC at the soonest, right?
14:51amalloybecause the compiler needs to work with seqs from java, and protocols would be a huge hassle
14:52technomancyit makes me want to use multimethods even when not appropriate
14:52hiredmanamalloy: actually it is not required
14:53amalloytechnomancy: i wrote a little cond+ that allows (cond+ test expr, [test expr])
14:53hiredmanyou can have a project that just aot compiles a bunch of protocol definitions (and corresponding java interfaces) for bootstrapping
14:54hiredmanand clojure would just depending on the clojure-bootstrap.jar for building
14:55dnolen_hiredman: or pick a superior host like JavaScript that makes protocols at the bottom easy *ducks* :D
14:56hiredmandnolen_: *shrug* it's not really that hard, I might pick definterface for the bottom on the jvm instead of defprotocol
14:57amalloyhiredman: and then pretend they're interfaces instead of protocols? that doesn't work for all cases, which i'm sure you know; are you saying it covers all the cases the compiler cares about, or that there's some way around it?
14:58amalloy(or saying something else entirely)
14:58amalloytechnomancy: also (let+ [name val (name val)])
14:58hiredmanamalloy: I think it would cover something like 70-80% where the rest would have to be worked around
15:00technomancyamalloy: I don't have trouble with let for some reason
15:00technomancyprobably because the local names can be a lot shorter than cond conditions
15:00amalloyyes, exactly. but it was nice for symmetry
15:00technomancythough sometimes I am guilty of picking short names just to keep it under 80
15:00amalloytechnomancy: i have had really-long names for let on occasion
15:00amalloynested destructuring
15:01amalloyit turns out clojure-mode doesn't always indent that stuff the way i would like
15:01TimMcamalloy: The line following a multiline map destructure is indented weirdly.
15:02amalloyright, though that's a special case of a more general weirdness
15:03amalloyeg, ((foo bar \n baz) bang \n sam) - sam lines up with baz instead of with (
15:04mylesbanyone here use cljr?
15:06technomancyI don't think cljr is maintained.
15:07mylesb:/ looks that way
15:08technomancyjark looks like a contender for the same space, but it's pretty immature right now
15:08mylesbI'm just getting into to clojure, want to mess around with some "sketch" files, is my best bet a lein project?
15:08mylesbI've got that working, just seems a bit heavyweight
15:08technomancyyeah, until jark stabilizes it's best to stick with that
15:09mylesbthanks
15:15tjgillieshow do i do a doseq without throwing away head?
15:16brehautby holding on to the head yourself
15:16TimMctjgillies: let
15:16TimMctjgillies: Or do you mean you want to collect results of an expr in the doseq body?
15:16amalloyyikes. sounds like correct answers to a bad question
15:16brehautyou probably need to do someting with the head after the doseq (such as return it) for it to not be discarded though
15:17TimMcamalloy: That's what I'm here for.
15:17brehautamalloy: im not drinking coffee for the next 40 days. expect more of this
15:17ibdknox|awaylol
15:17tjgilliesi don't need doseq
15:17brehaut(and worse: bad answers to bad questions)
15:18tjgilliesi want something that acts like doseq but returns a collection
15:18amalloyfor
15:18tjgilliesim a noob so i mosly know the side effect function because ive been a slave to OO most of my career ;)
15:24magnarsI'm using good old (clojure.test) - any super-simple way of stubbing a function?
15:29technomancymagnars: with-redefs
15:29magnarstechnomancy: excellent, thanks!
15:36magnarsIt seems like I'm not quite grasping this with-redefs.
15:36magnars,(with-redefs [- +] (- 3 4))
15:36clojurebot-1
15:37stuartsierramagnars: arithmetic is inlined
15:37magnarsI see, that makes sense. Thanks.
15:37`fogus,(with-redefs [println reverse] (println "hi"))
15:37clojurebot(\i \h)
15:38raek,(with-redefs [inc eval] inc)
15:38clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
15:40brehaut,(with-redefs [println (comp printlin reverse)] (println "hi"))
15:40clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: printlin in this context, compiling:(NO_SOURCE_PATH:0)>
15:40magnarsSeems like it was a bit optimistic of me to try (with-redefs [System/getProperty (fn [_] "/user/home")] aswell - not to worry, I'll just wrap it.
15:40brehaut,(with-redefs [println (comp println reverse)] (println "hi"))
15:40clojurebot(i h)
15:40brehautbah
15:41`fogus,(with-redefs [println (comp println #(apply str %) reverse))
15:41clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
15:42`fogus,(with-redefs [println (comp println #(apply str %) reverse)))
15:42clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
15:42TimMcmagnars: System/getProperty is a static method, not a clojure var
15:42`fogus,(with-redefs [println (comp println #(apply str %)] (println "hi"))
15:42clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: ]>
15:42`fogusi suck
15:42TimMcdefs make vars, refefs remake vars
15:42Bronsa,(with-redefs [println (comp println #(apply str %))] (println "hi"))
15:42clojurebothi
15:42`fogusthank you
15:43brehauthaha not quite
15:43brehaut,(with-redefs [println (comp println #(apply str %) reverse)] (println "hi"))
15:43clojurebotih
15:44`fogusI clearly need to go back to C++
15:44magnarsTimMc: yes, that makes sense, thanks - I'm just trying stuff out with an eager optimism :) clojure makes me happy
15:44brehaut`fogus: because you want the entire programming experience to be reversed?
15:44Raynes`fogus: I'll alert the men of your newly acquired suck.
15:45`fogusRaynes: More wedgies for me. :-(
15:45fliebelWhat is happening to pods?
15:46brehauti've seen Boost template compiler errors. thats the digital equivalent of wedgie
15:46amalloythey're being put behind an invisible wall and mutated before being revealed in a finished state, fliebel
15:47jodarobrehaut: totally.
15:47fliebelamalloy: You mean some big brains are still thinking about them, and then they will magically appear in Clojure 1.4 or 1.5?
15:47jodaroa wedgie and a purple nurple
15:47amalloywell, i was kinda making a joke about what pods are
15:49fliebelI realized they would be pretty neat for writing games in Clojure.
15:49mdeboard,((comp + -) 2 1)
15:50clojurebot1
15:51sritchietechnomancy, do you have advice on how to debug this? java.util.zip.ZipException: error in opening zip file
15:51sritchieit's coming form extract-native-deps
15:51brehautmdeboard: unary plus is the identity operation on numbers
15:51sritchieoh, I bet I know why
15:52mdeboardoh :(
15:52fliebel&(+ -1)
15:52lazybot⇒ -1
15:52brehautmdeboard: all the arguments to the composed function are sent to the right most operation in the (comp …) form; the result of that is fed back, so only the first fn gets multiple args
15:53mdeboardHuh
15:53mdeboardInteresting
15:53mdeboardThanks for that surprisingly articulate explanation for something I was doing on a lark
15:53brehautno problem :)
15:54brehautyou get to be a bit more magical if you start composing juxt and knit funcs (knit is from useful)
15:54brehautor alternatively if you switch over to using arrows (with say conduit) but thats a smidge more complicated
15:56fliebelNo pods on the mailinglist, no pods on IRC, no pods on dev.clojure... a little pods on blip. sad world.
15:56m0smithamalloy: are you interested in pursuing rseqable strings and whatnot?
15:58mdeboardbrehaut: I only just started getting into comp, juxt, and so forth over the weekend when I had a 4clojure marathon
15:59brehautim pretty sure you get to join a secret order now
15:59mdeboardOMG YES
15:59mdeboardI DID solve problem 53, nbg
15:59mdeboardnbd*
16:00amalloym0smith: if you want to do it, go ahead
16:01m0smithActually I had some thoughts but I was interested on what you were thinking
16:02amalloymeh. just add clojure.lang.RT/rseqFrom that mirrors clojure.lang.RT/seqFrom
16:03amalloyand then have clojure.core/rseq forward to that
16:04m0smithI also liked your thought of making anything Counted and Indexed as Reversible as well
16:06m0smithMaking the APersistentVector$RSeq more general purpose should do the trick
16:09amalloyoh yeah, i forgot about that. what a clever idea
16:17m0smithI think it would be a good enhancement ie rseq should mirror seq as far as possible
16:19technomancysritchie: 1.x or 2?
16:19sritchieturns out it was my fault, I borked a pom
16:20tmciverugh, 4clojure captures Ctl-L for line number goto.
16:20sritchietechnomancy: thanks for checking back :) I did find an issue with regexes and symbols in the :aot value
16:20sritchiefiled a ticket
16:20technomancyyup, saw that
16:21technomancyprobably won't get to it myself by the 2.0 preview but would be happy to get a patch
16:23amalloytmciver: i turned off the javascript input box entirely
16:23amalloyhate those keyboard "shortcuts"
16:24RaynesThat ace stuff isn't very helpful.
16:24ibdknox|awaymy experience with codemirror has been really good
16:25RaynesHuh. I've never heard of this.
16:25RaynesPerhaps this could be added to RefHeap.
16:25ibdknox|awayit was far easier to use than Ace
16:26aperiodic(half an hour late) I used juxt for the first time the other day
16:26aperiodicit was awesome
16:26RaynesSo you're… wait for it… nuts for juxt!?!?!!??!1!11!??
16:26lazybotRaynes: Definitely not.
16:27aperiodiccoocoo for juxt-o-puffs
16:27tmciveramalloy: you turned if off on the live 4clojure site?
16:27amalloyin my preferences
16:28amalloyhttp://www.4clojure.com/settings
16:28tmciverAh
16:28Raynestmciver: You'd have to work much harder to get him to actually make a commit to the website.
16:28callenamalloy: ooh, thank you for making me aware of them
16:28SomelauwHuh, how to reverse a lazy seq?
16:28tmciverI wasn't logged in. Personally I'd prefer that feature wasn't there at all.
16:29callenamalloy: I'm usually experimenting my repl and then copy-pasta into that input box, so the js stuff is irritating.
16:29Raynes&(reverse (range 10))
16:29lazybot⇒ (9 8 7 6 5 4 3 2 1 0)
16:29mdeboard&(reverse (take-while (partial > 10) (range 10)))
16:29lazybot⇒ (9 8 7 6 5 4 3 2 1 0)
16:29mdeboardlol
16:30mdeboard&(reverse (take-while (partial > 10) (iterate inc 0)))
16:30lazybot⇒ (9 8 7 6 5 4 3 2 1 0)
16:30Somelauw, (reverse '(3 4 5))
16:30clojurebot(5 4 3)
16:31mdeboard&(reduce * (reverse (take-while (partial > 10) (iterate inc 0))))
16:31lazybot⇒ 0
16:31SomelauwOh, wait. It didn't work for me because I globally imported something that overwrites reverse.
16:31mdeboard&(reduce * (reverse (take-while (partial > 10) (iterate inc 1))))
16:31lazybot⇒ 362880
16:31Somelauwin the repl
16:33amalloySomelauw: stop typing (use 'clojure.string) :P
16:34Somelauwamalloy: Yes, it was clojure.string.
16:34SomelauwThat's exactly what I did.
16:44hagnaok this is weird C-c C-k in emacs compiles with no warnings but lein compile fails with a null pointer exception
16:45juhu_chapais there a way to remove warnings like the following? Reflection warning, file.clj:23 - call to split can't be resolved.
16:46brehautjuhu_chapa: type hints
16:46brehaut(.split ^String s " ") for instance
16:47tjgillieswhen i run https://refheap.com/paste/801 it does what i expect, but the println output from increase doesn't how up in slime in the slime repl, if i call function manually i see the println output but not when called from floop
16:48juhu_chapabrehaut: thank you, let me see.
16:49brehauttjgillies: any reason for polarity being strings rather than keywords?
16:50tjgilliesbrehaut: because im a noob and i didn't think of it until you said that
16:50brehautaha :)
16:51TimMctjgillies: You should be using a lot more "when" instead of "cond"
16:52TimMctjgillies: "for" is lazy
16:52tjgilliesTimMc: i haven't learned when yet, cond is all i know
16:53brehaut,(map #(when % %) [true false nil 1 2 "hello"])
16:53clojurebot(true nil nil 1 2 ...)
16:54tjgilliesTimMc: floop is increasing the values of my neurons but its not prinlning when they reach 5
16:54tjgilliesprintlning
16:54brehaut,(let [n {:polarity :+}] (case (:polarity n) :+ "positive" :- "negative"))
16:54clojurebot"positive"
16:54brehauttjgillies: ^
16:54tjgilliesbrehaut: thnx
16:55brehautcase is a special case of condp which is a special case of cond
16:55tjgilliesheh
16:55brehaut,(let [n {:polarity :+}] (condp = (:polarity n) :+ "positive" :- "negative")) ; eg
16:55clojurebot"positive"
16:56brehautand when is a special case of if
16:56tjgilliesi haven't learned condp yet either
16:56brehautas is when-not
16:56brehauttjgillies: if your test predicate is consistent across all your cond clauses, then you can use condp
16:57tjgilliesok
16:57brehautif your condp predicate is = then you can use case
16:57tjgilliesthnx
16:58brehauttjgillies: you could also hoist your cond out of the doseq
16:58aperiodicbrehaut: not necessarily; case only accepts compile-time literals as tests
16:58brehautaperiodic: ah good catch
16:59jsabeaudryAnyone aware of a CRC-CCITT algorithm in clojure?
16:59aperiodicbrehaut: that's bitten me before :)
17:00TimMcIn case, 'foo becomes (quote foo) which is interpreted as (list 'quote 'foo)
17:01TimMc(a list of possible matches)
17:02hagnamy bad I thought emacs slime mode compile was the same as lein compile, but it isn't
17:04pjb3Question for anyone that has used any of the various clojure redis libraries that wrap jedis
17:04pjb3Is it possible to specify the initial database you want it to use?
17:04pjb3Seems like it will always default to 0
17:04pjb3and there's no way in a config to say start with 1 or 2, etc.
17:05pjb3you would have to just call the select command after it's made the connection
17:08pjb3that seems to be what the ruby library does
17:08pjb3https://github.com/ezmobius/redis-rb/blob/master/lib/redis/client.rb#L26
17:13pjb3ah, looks like redis-clojure actually does it
17:13di-csuehsWhat is the state of Cake? I've seen some mention of it being folded into lein, but I don't see a clear declaration of intent. I've also seen a comment left yesterday.
17:15aperiodicdi-csuehs: as far is I know, the dev team is teaming up with leiningen, but I don't think Cake itself is
17:15aidyDoes clojure have an equivalent to scheme's (begin ...) construct? I'm finding it really hard to write clean code with side effects without it...
17:15TimMcaidy: do
17:16aidyTimMc: thanks!
17:17AimHere,(loop [] (println "spam") (recur))
17:17TimMcaidy: http://clojure.org/special_forms
17:17clojurebotExecution Timed Out
17:17_philhey whats a better way of doing (if (k layout) (conj a k) a)?
17:19_philor more specifically (reduce (fn [a k] (if (k layout) (conj a k) a)) [] sorted-keys)
17:19amalloy(filter #(% layout) sorted-keys)?
17:19ibdknox|away(filter {:a true :b false :c true} [:a :b :c :d])
17:20amalloyor just filter layout, if layout/k are actually a map/keys; it's not a strictly accurate converstion if they're something else
17:20nishant_I'm trying to jump to the definition of a namespace using META-. in SLIME. I'm able to require the namespace with success, so I guess it's not a problem with the classpath, but it gives me a ClassNotFoundException when I try to jump to the definition of the ns, any ideas? (http://pastebin.com/GJcn4x6y)
17:22TimMcnishant_: Oh, I didn't understand the "META - ." in your question before. For future reference, M-. is a more standard way of writing it.
17:22TimMc(but I'm not familiar with SLIME, so I'm no help beyond that)
17:22nishant_TimMc: Thanks
17:24tmcivernishant_: I generally use M-. to jump to the definition of a function. What are you expecting to see when jumping to the definition of a namespace?
17:24_philamalloy: god, it seems so obvious now :)
17:24_philthanks!
17:24nishant_tmciver:doing M-. on a namespace's name usually takes me to the source file where that namespace is defined
17:25tmcivernishant_: hmm, https://github.com/technomancy/swank-clojure says that it jumps to the definition of a var, is a namespace a var?
17:25tmciverI don't think so
17:28nishant_tmciver: I think not, but I've used this feature in the past. It works.
17:29nishant_tmciver: In fact, I have another clojure project, where I am able to use it even now.
17:29stuartsierratmciver: a Var is a globally-visible definition, it has a namespace and a name.
17:29technomancyit should work on namespaces too, but that's a newer feature and not as well-tested
17:30jsabeaudryAny elegant way of transforming a byte array in a bit array?
17:30nishant_technomancy: Thanks, it seems that the classloader is not able to find the class when I try M-. But require is able to find it.
17:31amalloyit's not a class
17:32technomancyamalloy: does this still occur in the 1.7.0 release? https://github.com/technomancy/leiningen/issues/393
17:32amalloyand require finds it because it doesn't look for a class
17:42nishant_amalloy:Thanks
17:43technomancyemezeske: interested in your input on https://github.com/technomancy/leiningen/issues/421 if you have a moment
17:45emezesketechnomancy: I can't speak for the level of chaos it will bring, but I think it's a good idea otherwise
17:45technomancyemezeske: yeah, that's my only hesitation =\
17:45emezesketechnomancy: I felt awkward writing :source-path ["more" "than" "one"]
17:45technomancyemezeske: but on the other hand, strings->vectors is already fairly chaotic
17:45emezesketechnomancy: yeah
17:45technomancyso it's really only the poor folks like you who have already adapted who will feel the pain =\
17:46emezeskemeh, I actually found out that I wasn't done adapting cljsbuild last night, so I have more to do anyway :)
17:46technomancyok, cool =)
17:46technomancyI have 421 implemented on a branch; will probably merge it soon.
17:46technomancyshall I give you a heads up once it lands?
17:47emezeskedef. :)
17:47Raynesmos def
17:47technomancywill do
17:47TimMcjsabeaudry: By bit array, do you mean a BitSet?
17:51lnostdalgen-and-load-class is missing from 1.3? .. i'm following some wikipage on user-defined exceptions
17:59pjb3redis-clojure uses a style that seems common to other libraries (clojure.java.jdbc) where it has a resource, a connection, and instead of providing it to you, they define a function/macro that you pass a function into where your code can be executed within the scope of that connection
18:00pjb3I get that the idea is to take care of opening and then closing the connection when done
18:00pjb3but for some programs, you don't want to do that
18:01pjb3you want to open one connection to redis when the program starts, and just use that one connection for the life of the process
18:01pjb3of course you can wrap your whole main function in a call like redis/with-server
18:02TimMcThat sounds like the right solution.
18:02pjb3but stylistically I don't like that
18:02TimMcWhy?
18:02clojurebotTimMc: because you can't handle the truth!
18:02TimMc>_<
18:02pjb3because I want to write a namespace of functions
18:02tmciverha!
18:02pjb3that abstract away the notion of redis
18:02pjb3and that namespace can take care of instantiating that connection
18:02hiredmanpjb3: and your namespace has a with-storage macro
18:03pjb3hiredman: ?
18:03TimMcpjb3: Make one of those a wrapper for with-server
18:03pjb3but then that has to open/close the connection on every call
18:03TimMcthat's what hiredman is suggesting
18:03pjb3I want to do
18:03hiredmanpjb3: it doesn't
18:04TimMcpjb3: You still wrap your main fn, but with your own macro.
18:04pjb3hiredman: oh, how does it work then?
18:04hiredmanthe real problem is a lot of things like with-server etc don't account for retries and connection errors etc
18:04pjb3I would like to do
18:04pjb3(ns scoring)
18:04pjb3(def connection (redis/make-connection { … } ))
18:04hiredmanbleh
18:05hiredmana top level def like that for a connection is almost always a mistake
18:05pjb3(defn add-score [person value] (redis/set person value))
18:05pjb3hiredman: why
18:05pjb3now, callers of my function can just do
18:05pjb3(add-score "x" 42)
18:05hiredmanbecause what happens when the connection dies? who has resonsibility for closing it?
18:06pjb3it never closes
18:06hiredmanit is a resource without a livecycle
18:06pjb3if it dies, the process dies
18:06hiredmanpjb3: when you close your app?
18:06pjb3nothing
18:06hiredmanlifecycle
18:07pjb3I want a process that starts up, connects to redis, stays connected to redis forever, and if the redis connection drops, then the process just blows up
18:07pjb3I understand you might not always want that, but I think there are cases where that makes sense
18:08pjb3but I don't see how to design an API that uses redis-clojure, keeps a connection alive forever, but doesn't expose those details to the rest of the app
18:08pjb3I think I have to do either
18:09TimMcpjb3: I told you, your API demands that everything be wrapped in a certain macro it provides.
18:09pjb3(redis/with-server {} (add-score "x" 42))
18:09pjb3or
18:09pjb3(with-scoring (add-score "x" 42))
18:09mylesbtechnomancy: are the instructions for getting syntax highlighting in a repl buffer here: https://github.com/technomancy/swank-clojure still current?
18:10technomancymylesb: as far as I know, but I don't use them myself
18:10pjb3TimMc: Well, my API is forced to do that because of the design of redis-clojure
18:11mylesbtechnomancy: is your repl uncolored or do you do something else?
18:11technomancyI don't have coloring in my repl
18:11technomancyI guess I should set that up
18:24muhooheh HAS_JOSH_K_SEAL_OF_APPROVAL=true
18:26callentechnomancy: weird, you don't?
18:26callentechnomancy: you're like the power user to end all power users, hahaha.
18:28amalloytechnomancy's hidden shame: he sometimes uses the mouse
18:28technomancyamalloy: calumny!
18:28amalloy$dict calumny
18:28lazybotamalloy: noun: A false statement maliciously made to injure another's reputation.
18:28technomancycallen: I had paredit on in the repl for a while
18:29callentechnomancy: I've been writing lisps/schemes of various sorts in emacs for so long that I never got acclimated to paredit
18:29callentechnomancy: I've been attempting to get accustomed to it for...gods, since like Emacs 21 or something. can't do it.
18:29technomancyyou just have to believe in yourself
18:29callendon't believe in yourself, believe in me, who believes in you.
18:30callenI'm just used to relying on indentation to demonstrate structure and I edit it that way.
18:30technomancythat or suffer through the shame of having a paredit user watching over your shoulder wishing you would just hand him the keyboard because geez this is taking too long and I've got places to be...
18:30muhoowhat'd be the clojure equivalent to something like this: http://www.phantomjs.org/
18:31emezeskemuhoo: I'm not sure there is one. There's Rhino, but it just interprets JS, it doesn't provide a whole browser environment
18:31callenblah, I'll try it again, fine fine.
19:03devncallen: I don't use so much of what paredit provides -- I pretty much use: C-), C-(, M-s, and then really like it when I can C-k and not kill my parens
19:03callenmy problem is that it fucks with me when I'm trying to indent.
19:03devncallen: there's a small subset of things you *can* do in paredit that I actually do -- I would imagine the same is true for most
19:03clojurebotc'est bon!
19:03callenI'll see if I can settle into a pattern.
19:03devnDo you indent by hand? I just hit tab.
19:05devnI also have grown really fond of hitting ) to pull hanging parens or brackets up from the line below, it seems slightly better then M-^
19:06technomancyM-^ is such an awful binding for a really useful command
19:06aperiodictechnomancy: paredit in the repl? does that rely on emacs?
19:06aperiodiccause if not, how do i set that up?
19:06callendevn: I don't indent by hand.
19:06callendevn: you'd have to see me fighting paredit to know what I'm talking about.
19:06technomancyaperiodic: it does
19:07aperiodicblast
19:07technomancycallen: is it when you're adding comments?
19:08callentechnomancy: or when I'm trying to break an outer paren to the next line to start the next form.
19:10amalloywhat on earth, M-^
19:10callenamalloy: ?
19:10amalloyi've never used it, or knew about it
19:11amalloyand it seems like a crazy keybinding for anything useful
19:11technomancyamalloy: yeah! I didn't notice it for like five years
19:11technomancyI couldn't start using it till I rebound it to C-c q
19:11amalloyi can see how it might be useful. i'm pretty sure i've been regularly doing stuff with the same intent, but badly
19:12hiredmanI M-^ all the time
19:12jjcomerI'm using clojure-mode in emacs, and can't seem to get yasnippets to complete my snippits. Yasnippets works in other modes. Has anyone else had a similar issue?
19:12technomancydo you need snippets for clojure?
19:12technomancywrite a macro =D
19:13hiredmanI had yasnippets turned on for clojure for a day or two
19:13jjcomertechnomancy: lol
19:13hiredmanmeh
19:14jjcomerIt sounds like it might not be worth the effort to fix :)
19:14amalloythe lol there is baffling. that is literally what macros are for: if you have something so well-defined you want it to be a snippet, make it a macro
19:14jjcomeramalloy: the lol was more of a touche
19:15ibdknox|awaythere are occasionally times when I'd want a snippet
19:16ibdknox|awaywriting ns forms is one
19:17scottjtests is another. snippets work better than macros when editing other people's projects.
19:17ibdknox|awayyeah tests were another one I was thinking about
19:17scottj(some snippets work better than some macros rather)
19:17hiredmanI rather clojure-mode developed some smarts for ns forms
19:18technomancyyeah, ns forms are specific enough that you'd want a dedicated defun for it
19:19technomancynot saying I wouldn't take a patch for whatever's breaking yasnippet, just saying that's why nobody's bothered to fix it so far
19:19hiredmantechnomancy: did you see https://gist.github.com/1880975? gives you a buffer narrowed to specific function with a nicer buffer name
19:20technomancyhiredman: cool; so your edits propagate back to the source?
19:20technomancythat's nifty
19:20hiredmanyeah
19:20technomancysometimes I'll C-x 2 to have 2 windows on the same buffer, but that looks better
19:20hiredmanI am not totally sold on it though, needs some field testing
19:21technomancyscottj: jjcomer mentioned it above
19:24scottjjjcomer: I use yasnippets w/ clojure. not doing anything special.
19:25callenditto.
19:25callenIt's not really for generating code such as you would write a macro for though.
19:25callenI use it for quickie-shims for extraneous stuff like my tests.
19:28jjcomerscottj: thanks, I will inspect my configurations, there must be something conflicting
19:29scottjjjcomer: are you using autocomplete to use your yasnippets? if so, could be that your not setting your ac-sources correctly
19:32jjcomerscottj: I'm not using autocomplete (probably should be though)
19:34muhooi'm think i'm weird or maybe old-skool that i prefer #(keyword (.toLowerCase (name %))) to (comp keyword #(.toLowerCase %) name)
19:34muhooit does tend to get a little crazy with the )))'s tho
19:35brehautif you have to define an anon fn anyway, comp is often extravagant
19:35clojurebotPardon?
19:35technomancyagreed; I only comp/partial when it's 2 or more existing functions
19:37muhooi could see (apply comp list-of-stuff-to-do) being useful though, or scary
19:38ibdknox|awayI would thread that though
19:38amalloyibdknox|away: ...apply? you would thread a runtime list at compile-time?
19:39ibdknox|awayno, his original
19:39ibdknox|away:p
19:39amalloyi guess that does make more sense, doesn't it
19:39ibdknox|awayI promise I'm only half-stupid ;)
19:50lynaghk``ibdknox or dnolen, you guys around? I have a clj<->cljs design question.
20:04ibdknox|awaylynaghk``: sup?
20:04lynaghk``yo
20:05ibdknox|awaythe stuff you sent looks awesome. I haven't had time to dig in quite yet
20:05lynaghk``So I'm thinking about how to structure C2 on the serverside
20:05ibdknox|awayk
20:05lynaghk``In cljs, it manipulates the DOM. In CLJ, I'd like to keep as much of the code the same as possible
20:05ibdknox|awayfor the same graphic?
20:06lynaghk``maybe even to the point of putting together another "dom" namespace that fakes a dom using atoms or some such
20:06lynaghk``the calling code, definitely
20:06lynaghk``but also the library code itself.
20:06ibdknox|awayhm
20:06ibdknox|awaythat strikes me as a blackhole problem
20:07lynaghk``as in, one from which no information can escape?
20:07ibdknox|awaypeople are always going to use it in ways you wouldn't expect
20:07ibdknox|awayand so you will never be able to adequately model a subset of the dom
20:07ibdknox|awayyou'd have to model SVG too, right?
20:07lynaghk``Ehhh. I don't know. The basic contract of "unify!" is: take this data, map it to the DOM. On CLJS, that's the DOM, on CLJ, it just returns a massive hiccup vector
20:08ibdknox|awayright
20:08ibdknox|awayoh
20:08lynaghk``it's not actually tied into anything about DOM nodes themselves.
20:08ibdknox|awayyou mean render it as html still?
20:08ibdknox|awaytotally misunderstood
20:08lynaghk``yeah. The entire library is just a declarative way to map data to a dom tree.
20:08ibdknox|awaygot it. And then you'll have something else that turns html to a picture or some such?
20:08lynaghk``oh, yeah, definitely not interested in making something like node's domenv or PhantomJS or anything.
20:09lynaghk``yeah
20:09lynaghk``so you could, for instance, generate the markup on the server, and send that to the client, instead of sending the data to the client and having it manipulate its DOM directly.
20:10ibdknox|awayso is the question how do you efficiently modify a giant hiccup structure?
20:10lynaghk``The problem is that, right now, the CLJS unify function is totally side effecting, because it bangs on the DOM. What I want is to be able to use that same code on the server
20:10ibdknox|awayright
20:11lynaghk``so the only thing I can think of right now is that you'd pass in an atom pointing to an empty vector (instead of a CSS selector or DOM node), and it would bang on that atom
20:11lynaghk``Or, I can try to maintain two sepearate definitions of the core functionality---one that hits the native DOM on the client, and one that builds a hiccup vector in a totally functional way.
20:12ibdknox|awaythe former would be more efficient speed-wise
20:12ibdknox|awayI would assume
20:13ibdknox|awayalternatively, have unify! return the result
20:13lynaghk``I'm not so sure; I wouldn't be surprised if (map) ended up faster than (doseq [] bang bang bang)
20:13ibdknox|awaywhich on the client would be a dom node but doesn't get used
20:14lynaghk``I thought about that briefly, but I think cljs needs to be destructive as much as possible for speed reasons
20:14ibdknox|awayit still would be, you wouldn't use the return on the client, just on the server
20:15lynaghk``so I'd have to fork the code then.
20:15lynaghk``that might be the best solution, actually. Just have a destructive and non-destructive version of the same function.
20:15ibdknox|awayI think that'd probably be best
20:16lynaghk``Okay, rad. Thanks for the suggestions.
20:16ibdknox|awaybtw, I'm not sure those two concepts are mutually exclusive: on the client the return could be the node identified by the css selector (or the one you pass in), so it's still effecty
20:17ibdknox|awayside-effecty
20:17ibdknox|awaylynaghk``: on the server it'd return the clj representation which is a hiccup structure
20:17lynaghk``I think they'd have to be separate functions though
20:18ibdknox|awayimplementation-wise, yes they should be
20:18ibdknox|awaybut as a consumer
20:18ibdknox|awayit's all just unify
20:19ibdknox|awaylynaghk``: potentially relevant: https://github.com/davidsantiago/tinsel
20:19ibdknox|awayhiccup + css selectors
20:19lynaghk``hmm
20:20lynaghk``I don't think there is any reason to use CSS selectors on the serverside.
20:22ibdknox|awaydepends on how serious you want to be about write once (I personally, wouldn't go down that whole too far)
20:22ibdknox|awayhole*
20:22lynaghk``Yeah, I agree with you there. Luckily, most of the problems this library solves are very data-oriented
20:23lynaghk``very little to do with browsers, events, &c.
20:23ibdknox|awayyep
20:23lynaghk``I'll take a crack at a JVM implementation of unify later tonight
20:23ibdknox|awaylet me know how it goes :)
20:23lynaghk``then maybe start prodding at cljsbuild's "crossover" stuff and then keep the actual .cljs as small as possible.
20:23lynaghk``will do, have a rad evening.
20:37technomancyemezeske: the plural-paths thing is in leiningen master now
20:37emezesketechnomancy: thanks for the heads-up!
20:37technomancyalso sent in a pull request that's not really 2.x related
20:40emezesketechnomancy: yeah, I saw that, thanks! Hopefully I can merge it later tonight
20:40technomancyanyone else want to help test with lein2?
20:40technomancyparticularly if you have a large and complicated project.clj file
20:40technomancyor are one of the plugin maintainers whose projects I haven't sent pull requests to in the last 24 hours =)
20:42bsteubertechnomancy: what's new in 2?
20:43technomancybsteuber: oh man; where do I start?
20:43brehautunicorns
20:43brehautand rainbows
20:43technomancythere are about 300 lines of code that are not new in lein 2
20:43technomancymainly it's profiles though
20:44bsteuberwow
20:44technomancyclojurebot: profiles in clj-http is https://gist.github.com/1846759 an example of the profiles feature in Leiningen 2
20:44clojurebotAck. Ack.
20:44technomancycheck that one out
20:45bsteubercool
20:45bsteuberany interesting architectural changes?
20:45bsteuberbesides that
20:46technomancythere's better leiningen/project isolation
20:46technomancyyou can have aliases perform partial application
20:46technomancyleiningen-core is a library now
20:47brehautreply!
20:47technomancyoh yeah
20:47technomancythat's the best!
20:47technomancythe new repl is great
20:47brehautfantastic even
20:47WraithanSo, this is a conversion of an IRC bot I wrote/use to clojure. https://github.com/wraithan/zenircbot-clojure I figured I'd get some feedback on it before I continued on in added the rest of the bot's features. http://zenircbot.readthedocs.org/en/latest/ -- docs for the node and python versions of the bot.
20:47bsteuberok I have to try :)
20:48technomancybsteuber: clone the master branch and check the "building" section at the bottom of the readme
20:50brehauttechnomancy: its getting announced at clj/w right?
20:50technomancybrehaut: yeah, just want to make sure it's a smooth transition
20:50technomancyespecially with plugins
20:51brehautsure :)
20:51technomancydon't want to make this another clojure 1.3
20:51ibdknox|awaytechnomancy: what was wrong with 1.3? ;)
20:51technomancyheh
20:51technomancyyes
20:51technomancywell
20:52technomancyyou know
20:54bsteuberso what about the repl?
20:54bsteubercan it replace emacs yet? :)
20:55technomancyheh... no, the excitement about the new repl is mostly limited to non-emacs-users
20:55aperiodicwhat's new?
20:55brehautit doesnt suck ;)
20:55technomancythe main thing is jline2 and completion
20:56aperiodicwoo, completion!
20:56brehautbuilt in clojuredocs support too
20:56bsteuberhad older checkout and symlink already in place, so "installing" wasn't that hard :)
20:56bsteubernice
20:56technomancybsteuber: probably want to keep an old lein1 install around, but with any luck you should be able to use this for day-to-day stuff
20:56bsteuberwhat does jline2?
20:57bsteubersure did that when I had troubles once
20:57brehautthe biggest change is that it does garble the crap out of long lines
20:58technomancyit actually understands unicode
20:58technomancyand acts like readline
20:59aperiodicbrehaut: i'm aware of clojuredocs, but fail to see why it's more useful than the doc macro. is the draw supposed to be community-contributed code examples?
20:59brehautyeah
20:59aperiodici already get readline features in the lein repl... what's different about jline2?
20:59brehautaperiodic: obviously the doc macro is still available
20:59arohner /join #resque
20:59bsteuberhow do I trigger completion?
20:59cemerickbsteuber: tab
21:00bsteuberweird
21:00brehautaperiodic: the big difference is that clojuredocs have examples
21:00cemerickbsteuber: also, the REPL in lein2 is nREPL, which is shared by ccw, jark, and (soon to be) vimclojure
21:01bsteuberI still hope getting rid of emacs one day :)
21:01aperiodicbrehaut: that doesn't seem like a huge help to me, but maybe i'll change my tune after i try it
21:01Wraithan<3 emcs.
21:02Wraithanemacs.
21:02cemerickbsteuber: ccw is getting lein support in the very near future, FWIW
21:02TimMcbsteuber: And use vim, or what?
21:02brehautaperiodic: if you already know the standard api, its probably not a big deal. if you are new to clojure though, i expect it is great
21:03technomancyaperiodic: rlwrap doesn't do live completion
21:03technomancycemerick: one of these days I'll have to take a look at that
21:03bsteuberah I wasn't in master lol
21:03cemericktechnomancy: it's going to be hard. Lots of emacsisms baked into the protocol.
21:04bsteubersome old stuff I played around with
21:04technomancycemerick: I meant ccw
21:04technomancyI'd rather leave the swank stuff to someone else
21:04bsteuberyes heard about ccw making good progress
21:04brehautcemerick: im really looking forward to lein in ccw
21:05bsteuberthough I still kind of hate eclipse
21:05bsteuberwell for java it is great
21:05bsteuberbut still :)
21:05bsteuberso dunno
21:05devnhm, my completion works in the repl, but not in my source buffer
21:05devnany ideas?
21:05bsteubermay cljmacs
21:05bsteuberor cljsmacs
21:06bsteubergithub with js live simultan editor would be nice
21:06bsteuber+ous
21:06devnI hope clooj continues to grow
21:06devni would love a Racket-esque editor for clojure
21:06cemericktechnomancy: oh, hah
21:06devnDr. Racket, that is
21:06cemerickthat'll be the day ;-)
21:06cemerickdevn: what would make something Racket-esque?
21:06devnthe debug mode for one
21:06cemerick'course, I'm using vim these days, so who knows
21:07ibdknox|awaycemerick: how's that going?
21:07devnthe arrows drawn when you hover a variable
21:07devnthose sorts of things
21:07cemerickah
21:07technomancycemerick: just so I can relate to the Heroku Java team a bit
21:07cemerickdevn: stuff like that actually isn't too far away
21:08cemerickibdknox|away: not bad. I think I'm safely committed to it for life as my general-purpose editor.
21:08ibdknox|awayit'd be pretty easy to do in cljs
21:08devncemerick: *nod* -- I think that's a really positive sign. I've stepped away from posting anything in that documentation thread, but people have talked about editors and so on
21:08ibdknox|awaythe hard part is doing all the anlysis
21:08ibdknox|awayonce someone has that done, building a nice editor shouldn't be *too* difficult
21:08cemericktechnomancy: well, Java is…Java. :-P
21:09devnI think clooj + some fancy clojure "explorer"-like tools in one nice, dead simple, packaged environment
21:09devnwill be a huge win for clojure in general
21:09ibdknox|awaydevn: how about that online ;)
21:09devnibdknox|away: im not opposed!
21:09aperiodictechnomancy: do you know if lein-daemon has been tested with lein2?
21:09devncemerick: yes, but with an attitude like that, who could have predicted ambrose?! :)
21:10ibdknox|awaycemerick: someone would have to care a lot
21:10devni have to say that i'
21:10devni'm optimistic on these fronts
21:10devni met someone at clojure/conj who was "sort of interested" -- next thing i know he's contributing to projects left and right, writing clojure like a mad man
21:10cemerickdevn: Ambrose is doing good stuff, but there's a fair distance between proofs of concept and something we can add into ccw, for example
21:11devncemerick: no question, not trying to say otherwise, it's just my nature to be optimistic about these sorts of things. sometimes people just sort of materialize and start doing incredible work
21:11devnit happens is all im saying
21:12bsteuberibdknox|away: yes once all basic stuff is in a library the actual editor can be simple
21:12bsteubermaybe even just inside goog.editor with rich text feeling if you like it
21:12bsteuberno pun intended
21:13arohneraperiodic: I can tell you lein-daemon has not been tested w/ lein2 yet
21:13bsteubercemerick: why that?
21:13bsteuberinstead of wrapped, I mean
21:14aperiodicarohner: righto, thanks
21:14cemerickbsteuber: oh, I don't mean abandoned by cljs; I mean shuttered by google
21:15bsteuberah
21:17bsteuberanything pointing in that direction, besides general google trends?
21:17arohneraperiodic: patch welcome for lein-daemon btw. I'll get back to maintaining it soon, I promise :-)
21:18cemerickbsteuber: not really; insofar as they hedge their bets, so shall I
21:18aperiodicarohner: yeah, if i have a few hours i'll definitely look into it, but no promises
21:19cemerickIt's especially tough to keep a straight face when they toss dart and NaCl out there.
21:21callenwhat is the *deal* with Dart anyway?
21:21callenCoffeeScript I can at least make a case for, Dart is totally left-field.
21:22cemerickNot sure anyone knows.
21:24cemerickibdknox|away: what's your take on dart, anyway? Not sure I've heard you say anything on it.
21:25callenthat's the thing, I haven't heard anyone make a serious case for Dart that's not being paid to say so.
21:25echo-areaDoes anyone here know Clojure's STM implementation? Every committed value is computed a millisecond-based commitment time, but it's never used. What's the purpose for this time? Isn't it slowing down transactions?
21:26echo-area(for a Ref object)
21:34bsteuberthe repl is great
21:35callenman. Korma looks amazing.
21:35callenAnyone have any experience with Korma?
21:35brehautcallen: i think ibdknox|away has had a litle
21:39arohnerdoes anyone remember a clojure library for dealing with times in the future? It had an api that would give you an infinite seq of times in the future?
21:39arohnerthere was a blog post about it? called chronos or something like that
21:39brehautmonotonic or something?
21:40arohnerbrehaut: yes! https://github.com/aredington/monotony
21:40arohnerthank you
21:40brehautno problem. there was a conj lightening talk about it i think
21:43arohnerthough it makes me nervous that it's not based on joda or jsr310
21:44cemericktechnomancy: exit and abort want to be in a core.misc ns; I need abort in project. Yea or nay?
21:44cemerickbah
21:45brehautarohner: that also worried me
21:55ibdknox|awaycallen: brehaut: a tad, I guess
21:56ibdknox|away:)
21:57sritchiedo you guys remember an announcement on the clojure list about a library that dealt with infinite sequences of time intervals?
21:57sritchieI remember this great demo
21:57sritchieof time intervals as streams
21:57brehautsritchie:monotony
21:57brehauthttps://github.com/aredington/monotony
21:58sritchieawesome, thanks, man
21:58brehautarohner had just found it :)
21:59sritchiehadoop data at twitter is bucketed in all of these wacky intervals --
22:00sritchiea monotony stream + a clj-time formatting parser gives me all I need to grab logs in arbitrarily complex patterns
22:00brehautexcept that montony uses java.util.Date :/
22:01callenibdknox|away: what was your experience?
22:01brehautcallen: he wrote it ;)
22:01ibdknox|awayhaha
22:01sritchiejust a format string, then, I can deal
22:01callenfml.
22:01callenibdknox|away: how many edge-cases in schema are covered, like that many-to-many on the mailing list?
22:02callenibdknox|away: is it a pure query generator, or is it closer to a full-blown ORM?
22:02ibdknox|awaythe former
22:02callenibdknox|away: then why do you have to define your schema?
22:03ibdknox|awayyou don't have to :)
22:03callenibdknox|away: oh, I'll do that then.
22:03callenibdknox|away: thx thx.
22:03callenibdknox|away: I just wanted a clean way to do SQL queries and parameterization.
22:03ibdknox|awaythe rest is there for convenience so you don't have to write all the joins all the time and such
22:03ibdknox|awaykorma should fit you perfectly then :)
22:05callenibdknox|away: SQLAlchemy, Django ORM, and ActiveRecord all made me lose my faith in ORMs. I'd rather just think in SQL.
22:05ibdknox|awayyep
22:05ibdknox|awayI've written 3 :)
22:05ibdknox|awayheh
22:05callenit's not like set theory is all that alien.
22:05callenibdknox|away: so I imagine you've bumped into the same ridiculous pain that I have.
22:05callenspending more time working around artifice than being productive, etc.
22:06ibdknox|awayhence korma :)
22:06callenibdknox|away: thanks for making it.
22:06ibdknox|awayQuite welcome!
22:14jimdueyI would love to be able to specify the schema in korma. I don't suppose that's been added while I wasn't looking?
22:15callenjimduey: defentity?
22:16jimdueyNo. ibdknox|away had some speculative stuff in once that let you specify columns and stuff.
22:17jimdueyAnd then you could do a create operation to build the tables.
22:17callenmaybe he learned the error of his ways.
22:17jimdueyAt least that's what I thought I saw.
22:17callenthat is the dark path! ;_;
22:17jimduey:) Yeah, but I NEEEEED it.
22:17callennoooooooo
22:17callenjimduey: haha :P
22:41TimMcI'm so old-fashioned.
22:41ibdknox|awayjimduey: it's in korma.incubator now :) https://github.com/ibdknox/korma.incubator
22:41TimMcI write up an honest-to-goodness database schema documentation file, then code to that.
22:42TimMcNone of this self-documenting code you youngsters are snorting these days.
22:42ibdknox|awayTimMc: it's a high you've never experienced ;)
22:43TimMcclojurebot: you kids is <reply>Get off my lawn!
22:44callenTimMc: luckily my code doesn't turn into gobbledegook, so it's not a bad blueprint to by.
22:44clojurebotIk begrijp
22:44callenHrm.
22:44ibdknox|awaylol
22:44callenclojurebot appears to has lost its marbles.
22:44ibdknox|away~you kids
22:44clojurebotGet off my lawn!
22:44TimMcclojurebot: kids these days is <reply>Get off my lawn!
22:44clojurebotYou don't have to tell me twice.
22:44TimMcfor good measure
22:45dgrnbrgIs there a way to get lein to use a single jvm and get it to load the tests in a separate class loader each time?
22:46TimMcdgrnbrg: Not entirely clear on what you want, but have you tried lein trampoline test?
22:46dgrnbrgI'd like to reduce the startup time of lein
22:46TimMcOh, that won't do it!
22:46dgrnbrgI know
22:47dgrnbrgI really want lein to run in the background
22:47ibdknox|awaylein interactive
22:47dgrnbrgand some C client to throw code at the JVM with a socket
22:47ibdknox|awayjark
22:47dgrnbrglike nail gun, but appserver-style isolation
22:47TimMcibdknox|away: Your nick makes you less credible. If you'd lie about away-ness...
22:47ibdknoxfine.
22:47dgrnbrgSo I can use lein-interactive with tests while changing protocol definitions?
22:47ibdknox~guards
22:47clojurebotSEIZE HIM!
22:48ibdknoxnope
22:48ibdknoxlol
22:48brehautTimMc: you've never given me a burger, how can i trust you?
22:48dgrnbrg:(
22:48TimMchaha, what
22:48dgrnbrgcan I write plugins for lein to automate other compilation toolchains?
22:48ibdknoxbrehaut: I see what you did there and I approve
22:48dgrnbrgI want to run the xilinx fpga toolchain w/ lein
22:48brehautTimMc: to explain the joke would ruin it
22:48TimMcOK, then I get it.
22:48brehauthigh five!
22:49TimMcI just wasn't sure if I was missing an outside cultural reference.
22:49ibdknoxfrom us kids? :p
22:49TimMc(I live under an oddly shaped rock.)
22:51TimMcdgrnbrg: You've investigated server vs. client VM?
22:51dgrnbrgI am specifically interested in this one technique
22:51dgrnbrgyou can't do it faster
22:51dgrnbrgyou run a persistent JVM
22:52dgrnbrgwhich can accept code on a socket, and loads it in an isolated classloader
22:52dgrnbrgand then you have another program that doesn't start a jvm send the code over to it via the socket protocol
22:52dgrnbrgand the other program is probably very low overhead/super fast, like C or OCaml
22:53dgrnbrgsince the startup cost and socket transmission times dominate
22:53dgrnbrgthen you can can run jvm applications instantly
22:53cemerickdgrnbrg: exactly what you're describing is fast approaching
22:53dgrnbrgI have seen a thing for groovy that does this
22:53dgrnbrgwonderful
22:53dgrnbrgeta?
22:53TimMcjark?
22:53dgrnbrglol
22:53clojurebotjark is a clojure daemon for scripting: http://icylisper.in/jark/
22:54cemerickdgrnbrg: jark works now, though I think you still need to build it yourself.
22:54dgrnbrglovely, that's exactly what I want
22:54dgrnbrgeven down to the languages
22:54dgrnbrglol
22:54cemerickBinaries will be coming very soon.
22:54dgrnbrgcan I use jark w/ lein?
22:54cemerickI hear rumors of a Haskell nREPL client as well.
22:54cemerickdgrnbrg: that's one of the few remaining sticking points.
22:54TimMccemerick: nrepl still blocking?
22:54cemerickblocking?
22:54TimMcblocking jark
22:54cemericknope
22:54TimMcnice
22:55dgrnbrgI really want lein test on jark
22:55ibdknoxcemerick: I haven't really gotten it working for scripts :(
22:56cemerickdgrnbrg: If you want to run tests instantly, you don't need to wait for lein and jark to get together
22:56dgrnbrgcemerick: how can I run the tests just using jark?
22:56cemerickAny persistent REPL environment will do; SLIME, ccw, reply…
22:56dgrnbrgI know how to use $() to get the claspath from lein
22:56dgrnbrgif i evaluate a test file, it doesn't run the tests
22:57cemerickibdknox: /me doesn't do scripts ;-)
22:57dgrnbrgis there something else I need to do to run the tests?
22:58cemerickdgrnbrg: IMO, if you're worrying about classpaths, you're probably doing it wrong.
22:58dgrnbrgif I wanted to start jark
22:58dgrnbrgsince it's like jark -cp $(lein classpath) or something
22:58TimMccemerick: I worry about classpaths all the time.
22:58TimMcI worry about them in my sleep.
22:59cemerickTimMc: you worry too much then
22:59TimMcThe other day, I think a classpath was following me around town.
23:00cemerickit probably wrapped around whole blocks and everything
23:02TimMcOK. I always imagined that a JVM was one big, happy space, and that classloaders were just things that knew how to add classes from different types of sources.
23:02TimMcIs this hopelessly naïve and far from the truth?
23:03brehautTimMc: well its certainly big…
23:03TimMcheh
23:03cemerickTimMc: that's mostly true, and why add-classpath is possible
23:04cemerickThe details are a bitch though.
23:04TimMcThis jark stuff makes it sound like you can partition things off.
23:05cemerickYeah, you can.
23:05brehautTimMc: class loaders do let you do things like have two instances of the same class loaded; clojurebot uses it to execute sandboxed clojure in 1.3 while being implemented in 1.2
23:06amalloyTimMc: when a classloader loads a class, that class is only visible in places that pay attention (somehow or other) to the aforementioned classloader
23:06amalloywhich is how that partitioning works
23:07TimMcAh, they get a reference to the classes and loaders, etc.
23:07TimMcwhich is how classes can get GC'd
23:08amalloysomething like that. it's all deep magic beyond my comprehension
23:08TimMcOh, I'm not even pretending to myself that I understand it.
23:09amalloyclojure creates a new classloader for every expression you evaluate at the repl, which is how you can wind up with multiple different classes named user.Foo if you (defrecord Foo) multiple times
23:39emezesketechnomancy: You around?