#clojure log - Feb 22 2012

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

0:24 technomancy: brehaut_: you may be interested in this: https://github.com/mmcgrana/clj-stacktrace/commit/5277a5d75298

0:24 use of :injections with a plugin

0:25 amalloy: brehaut_: incidentally, isn't #(-> [% (v %2)]) basically (*** identity v)?

0:28 technomancy: wow, 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

0:33 brehaut_: amalloy: yes almost; except that it takes two args rather than a pair

0:42 MenTaLguY: hmm

0:45 hmm

0:46 so what's the best way to include extra files in the jar from a leiningen plugin?

0:48 technomancy: MenTaLguY: the resources/ dir is usually used for that

0:48 MenTaLguY: yeah, not sure I want to do that in this case

0:48 so, specifically what I'm trying to do is implement a leiningen plugin that sucks down Ruby gems and includes them in the classpath/jar

0:49 emezeske: MenTaLguY: levand added an implementation of that to my lein-cljsbuild plugin

0:49 MenTaLguY: https://github.com/emezeske/lein-cljsbuild/blob/0.1.0/plugin/src/leiningen/cljsbuild.clj

0:49 MenTaLguY: Starting on line 256-ish

0:50 MenTaLguY: hmm

0:50 ok, I see

0:51 on the classpath end, is hooking leiningen.classpath/get-classpath the right thing to do?

0:52 technomancy: yeah, probably

0:52 well

0:52 in leiningen 2, hooking leiningen.core.classpath/get-classpath will do it

0:52 in lein1 it's more complicated

0:53 callen: technomancy: what changes in leiningen 2 for the end-user?

0:53 technomancy: callen: I'm glad you asked!

0:53 callen: you can run https://github.com/technomancy/lein-precate on your project to find out

0:53 the main thing is the use of profiles, which are super great and described fairly well by the readme on leiningen's master branch

0:54 the new task is totally rewritten

0:54 aliases now support partial application

0:55 and the project/plugin isolation is a lot better

0:56 emezeske: have you gotten a chance to try lein-cljsbuild on lein2 yet?

0:56 emezeske: technomancy: no, not yet, I've been working on a major release

0:56 technomancy: maybe after that, though

0:56 technomancy: would be super duper to get it in before the release

0:57 emezeske: when's the release?

0:57 technomancy: strategically, I mean, considering it could include breaking changes

0:57 I mean before the lein-cljsbuild release

0:57 emezeske: oh, gotcha

0:57 maybe I'll do that -- I think it might not be too bad, seeing as it's already 1.7 compatible

0:58 technomancy: actually just glancing over it, you might already be ok

0:58 is there an easy way I could test it?

0:59 * emezeske crosses his fingers.

0:59 emezeske: technomancy: yeah, if you clone the source and go into the example-projects/ dir

0:59 * technomancy has spent about 3 hours on cljs total, and 60% of it was just being annoyed with clojurescript one's ad-hoc build

0:59 emezeske: haha

0:59 yeah check out example-projects/simple/README.md, if that works I'd say things are peachy

1:00 technomancy: cool

1:02 emezeske: technomancy: is there an easy way to have lein1 and lein2 installed at the same time?

1:03 technomancy: emezeske: sure; I have lein2 symlinked to ~/bin/lein2 and lein1 as ~/bin/lein

1:03 nothing to it

1:04 emezeske: technomancy: oh, maybe I should be less afraid of testing things against lein2

1:04 dnolen: anyone have suggestions for this improved handling of let scoping inside loops in CLJS? https://github.com/clojure/clojurescript/compare/154-bad-scope-in-loop

1:05 technomancy: emezeske: suspect the only change you'd have to make is adding in a compatibility shim for eval-in-project

1:05 you can probably just straight up copy what I've got in lein-swank

1:05 emezeske: technomancy: so lein1 and lein2 can, e.g. "lein upgrade" independently?

1:05 technomancy: awesome, I'll take a look

1:05 technomancy: https://github.com/technomancy/swank-clojure/blob/master/lein-swank/src/leiningen/swank.clj#L47

1:06 emezeske: hmm; hadn't thought of that

1:06 at some point, "lein1 upgrade" will result in lein2

1:06 but that doesn't have to happen right after 2.0.0 is released

1:07 emezeske: simple example can't resolve compojure 0.6.5, which is weird

1:07 trying with 1.0.1

1:07 emezeske: oh I should probably update that anyway

1:07 technomancy: ok, that's bizarre; it can't find compojure at all

1:08 emezeske: hrm..

1:09 technomancy: totally my fault though

1:10 emezeske: oh, the other thing is that :extra-classpath-dirs is gone; you can now have :source-path and :resources-path just be a vector

1:10 so anything that would go in :extra-classpath-dirs would just get concated onto that

1:11 MenTaLguY: technomancy: hm, so what do you mean by "more complicated"?

1:12 emezeske: technomancy: 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

1:12 MenTaLguY: re: hooking get-classpath in 1.x?

1:12 technomancy: MenTaLguY: actually I'm wrong, get-classpath is the right level of abstraction for that

1:13 MenTaLguY: ok

1:13 technomancy: emezeske: quick hack to get it working: http://p.hagelb.org/cljsbuild-diff.html

1:14 emezeske: technomancy: cool. I'd need to check the leiningen version, though, right? and only do that if it's lein2?

1:15 technomancy: emezeske: yeah, the code to support both is a bit more complicated

1:15 since it's just a single function it's probably not worth splitting it off into its own git branch though

1:15 emezeske: technomancy: is there a def for leiningen version somewhere?

1:16 technomancy: emezeske: it's (System/getenv "LEIN_VERSION")

1:16 but it's better to check for the vars themselves

1:16 emezeske: oooh I see how to do that

1:16 yeah

1:17 technomancy: (try (require 'leiningen.core.eval) (resolve 'leiningen.core.eval/eval-in-project) (catch Exception _ (require 'leiningen.compile) (resolve 'leiningen.compile/eval-in-project)))

1:17 something like that

1:17 emezeske: I can just hack up your eval-inproject

1:17 yeah cool

1:17 technomancy: ok, just confirmed "hello from clojurescript"

1:18 emezeske: wow, awesome

1:18 you applied the hacks above?

1:18 technomancy: just the diff I pasted, not the 1.x fallback

1:18 also it might be worth noting that :dependencies are an ordered map now in 2.x rather than a vector of vectors

1:18 emezeske: gotcha

1:19 technomancy: does that mean the project.clj :dependencies format looks different?

1:20 technomancy: emezeske: well actually both forms should be supported

1:20 (conj deps ['hello "1.0.0"]) ; <- works for both a vector and a map

1:20 emezeske: ah, niced

1:20 technomancy: it'll look different when you pprint it or whatever, but it should act the smae

1:20 same

1:20 emezeske: nice*

1:20 MenTaLguY: I love little things like that in Clojure

1:24 Apage43: No matter what language I really like being able to change a bunch of stuff in once place and have other code not care

1:24 * MenTaLguY nods

1:33 accel: Is 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)

1:34 technomancy: clojurebot: (save-lisp-and-die)

1:34 clojurebot: I don't understand.

1:35 MenTaLguY: that would be the emacs solution, yes

1:35 technomancy: accel: no, unfortunately that's a feature more or less unique to smalltalk/CL afaik

1:35 MenTaLguY: emacs does it too, doesn't it?

1:35 accel: technomancy: is there no OS level hacks to do this?

1:35 MenTaLguY: I think you'd need some support from the JVM

1:35 technomancy: MenTaLguY: not during normal operation, but probably as part of the build process

1:36 MenTaLguY: (because of file descriptors, etc.)

1:36 accel: why? what state does the JVM hold that the OS can not see?

1:36 hmm

1:36 MenTaLguY: technomancy: yes

1:36 anyway, it's not a crazy idea, just not one that I think is easy to achieve without explicit JVM support

1:36 accel: it amazes me that java's been around for more than a decade; yet this is not possible

1:37 MenTaLguY: Sun was a negligent parent

1:37 technomancy: accel: the JVM is a strange combination of great engineering achievement and inexcusable laziness

1:37 MenTaLguY: It still galls me that we have to explicitly size heaps, a la Mac OS 9

1:37 accel: technomancy: yeah, the VM + Hotspot + libraries ... I like. Some of the other things -- startup time, inability to violently kill threads -- not so much

1:38 is there any decent open source java?

1:38 technomancy: exhibit 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

1:38 accel: if there were such a thing, Oracle would try its hardest to squash it

1:38 MenTaLguY: violently killing threads tends to be a bad idea, becuase of deadlocks

1:39 there *is* Thread.stop, mind you

1:39 accel: hmm; wrap everythign in STMs :-)

1:39 MenTaLguY: even though it's deprecated

1:39 technomancy: accel: you'd need static typing to isolate I/O

1:39 accel: I'm complaining too much; it just irritates me that I can _almost_ use the java VM as an OS ... but not quite

1:40 technomancy: it's a compromise

1:40 accel: does IBM/eclipse use Sun's JVM?

1:41 and is the gnu java stuff gcj/kaffe/... any good, or are they not very production friendly?

1:41 MenTaLguY: I wouldn't recommend gcj

1:41 technomancy: IBM has put their weight behind openjdk

1:41 for what it's worth, it's the only game in town

1:41 MenTaLguY: it works great for most things, though static compliation has some performance disadvantages over JIT

1:42 the big problem is the remaining few things that gcj can't support with AOT, and the incompleteness of the class library

1:42 though now openjdk has that problem too

1:42 (re: incomplete class library)

1:43 I haven't had any experience with Kaffe

1:43 technomancy: avian is another experimental edge one

1:43 accel: OpenJDK = the Sun's implementation that they open sourced back in 2007, and what I now downoad from oracle's website?

1:43 technomancy: neat ideas, but too slow to be practical

1:45 MenTaLguY: some day I'd like to take a stab at implementing clojure atop LLVM or something, though I imagine someone's already playing with that

1:46 accel: sadly, even if someone did; i wouldn't switch

1:46 hiredman: accel: openjdk is the reference jdk

1:46 accel: I find java's libraries too nice

1:46 they somehow seem safer/cleaner to use than C libraries

1:46 technomancy: MenTaLguY: some day I'll make elisp a compilation target

1:46 accel: the lack of segmentation faults is too nice

1:46 ibdknox: just need CinC then it'll be a breeze ;)

1:46 accel: I just need Java to startup instantly :-)

1:46 MenTaLguY: well, re: non-JVM Clojure, I think that'd be more for things you wouldn't use the JVM for anyway

1:47 accel: like waht? embedded computing?

1:48 hiredman: there is work underway to modularize the jdk, and interestingly I heard replace the horrible java me suff with a stripped down set of modules

1:48 the jvm actually runs on a lot of embedded stuff

1:48 MenTaLguY: accel: I don't know, maybe? It depends on what substrate we're talking about here (LLVM, versus something else)

1:48 hiredman: that was what it was designed for

1:48 set top boxes

1:49 MenTaLguY: the JVM made a lot of strange decisions for that space though

1:49 Dalvik makes some better decisions in that regard, I think

1:49 technomancy: learning from sun's mistakes, mostly

1:49 hiredman: well, dalvik's hindsight is 20/20

1:49 accel: yeah; I'm not yet convinced that my VCR needs to do JItting

1:50 hiredman: accel: jitting is not a requirement of the jvm

1:50 it is a performance optimization that the advanced ones do

1:50 MenTaLguY: the first JVMs were interpreter-only

1:50 and then there were the JVM-on-silicon things

1:51 hiredman: http://en.wikipedia.org/wiki/Java_processor

1:51 accel: hmm; can I run Dalvik on laptops (i.e. not phones)?

1:51 technomancy: just updated clj-stacktrace, lein-tar, and lein-difftest for lein2 compatibility; woo

1:51 accel: and if so, can I run clojure on Dalvik?

1:52 hiredman: I started looking at what it would cost to get a board with hardware support for jvm bytecode

1:52 but it seemed like it would just be cheaper to get a 1ghz arm board and run a normal arm jvm

1:52 accel: dalvik has it's own set of issues

1:52 accel: 32bit?

1:52 hiredman: not the least of which is immaturity

1:53 (which shows in things like garbage collector performance)

1:53 Apage43: hiredman: there's a normal arm jvm?

1:53 hiredman: there are several options

1:54 MenTaLguY: I think openjdk hotspot can do arm, though absent a lot of assembly-level optimizations

1:54 emezeske: technomancy: w00t

1:54 accel: dumb 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?

1:54 emezeske: technomancy: so, I'm trying to get lein2 bootstrapped

1:54 hiredman: accel: let me ask you this, why are you stopping your jvm?

1:54 emezeske: technomancy: 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

1:54 technomancy: accel: "time java -version" is what I do

1:54 emezeske: technomancy: this does not seem to have worked

1:54 hiredman: e.g. if startup time is an issue why not let it run?

1:55 technomancy: emezeske: no, you need to use the master branch from git

1:55 emezeske: and the "building" section of the readme at the bottom

1:55 accel: hiredman: because I don't nkow how to unload clojure modules

1:55 emezeske: technomancy: aha, thanks

1:55 accel: hiredman: so often times, it'll be using old definitions of functions

1:55 which aren't in my *.clj files

1:55 [when the proper behavior, would be to give me a run time error]

1:55 technomancy: that is ridiciously fast

1:55 technomancy: man

1:56 hiredman: http://openjdk.java.net/projects/zero/

1:56 technomancy: why don't we just have swank clear the namespace before loading it?

1:56 maybe just on C-c C-l rather than C-c C-k

1:56 accel: technomancy: how do I do that?

1:56 technomancy: somebody do that, ok?

1:56 accel: technomancy: how do I tell clojure to nuke all modules?

1:56 Apage43: hiredman: neat.

1:56 technomancy: ,(doc ns-unmap)

1:56 clojurebot: "([ns sym]); Removes the mappings for the symbol from the namespace."

1:56 technomancy: accel: ^

1:57 hiredman: there is also jamvm, which is kind of slow

1:57 technomancy: accel: too annoying to do by hand without tool support though

1:57 accel: technomancy: not a proble

1:57 m

1:57 technomancy: anyway, somebody go make swank do that, ok?

1:57 I gotta head to bed

1:57 accel: thanks for the tip

1:57 Apage43: man

1:57 hiredman: http://elinux.org/BeagleBoard#Java

1:57 MenTaLguY: haha, yeah! I've got the jar including gems now

1:57 technomancy: emezeske: post to the mailing list if you have any more trouble

1:57 MenTaLguY: aaaand, the coffee shop is closing

1:57 technomancy: MenTaLguY: slick. same advice to you re: the maliing list =)

1:58 Apage43: i really need to learn emacs one day

1:58 hiredman: some day I'll make a little robot, and it'll run clojure

1:58 MenTaLguY: technomancy: I don't do mailing lists anymore, I had to declare email bankruptcy :)

1:58 technomancy: hah; ok then

1:59 hiredman: I was going to hook this up to my zaurus: http://technomancy.us/70

1:59 but then I found out how serial ports are way more complicated than parallel ports and lost interest

2:00 hiredman: is norbert a hatip to norby?

2:00 heh

2:00 hardware

2:00 Apage43: had a zaurus once, I busted the screen. Only the touch part though, could still boot into console mode and use it that way

2:00 hiredman: who needs it? right?

2:01 G0SUB: technomancy, can you please take a look at https://github.com/mmcgrana/clj-stacktrace/pull/8 ?

2:01 technomancy, it's been sitting in the queue for 2 months.

2:34 emezeske: technomancy: so in lein2, :source-path may either be a string or a vector of strings?

2:35 technomancy: (btw, I have lein2 running, thanks)

2:38 technomancy: woooo, lein1/lien2 compatibility reached

3:40 tjgillies: in swank-clojure how do i kill all running threads?

3:40 lucian: i don't think threads can be killed

3:48 callen: can they be sent messages to sleep?

3:48 lucian: callen: afaik not if they don't cooperate

3:48 there 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

3:49 tjgillies: i don't want to kill specific threads

3:49 just kill all running threads

3:50 callen: well you can stash thread state in a ref

3:51 tjgillies: hrm is it bad to have recursion without recur?

3:51 i have a function that does Thread/sleep 1000 prints something, then calls itself again

3:51 im assuming that will overflow

3:52 llasram: Only if the recursion is deep / unbounded. So in your case, yes

3:53 tjgillies: how come clojure isn't tail call optimized? isn't scala tail call optimized?

3:55 llasram: Doing *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

3:55 Scala optimizes where it can and silently doesn't where it can't

3:55 Clojure instead makes it explicit, so you know exactly what recursive calls are tail calls and which are not

3:56 tjgillies: ah

3:56 thnx

3:56 llasram: np

3:57 callen: trufax, it's easier to TCO in assembler than it is in a stack-oriented VM or C.

3:57 this is why Lisp implementations have traditionally generated machine code directly and done their own TCO on that.

3:57 the TCO issue is pretty much...never going to go away unless Hickey has an insight into the issue I'm not aware of.

3:59 llasram: Or a future version of the JVM bytecode supports tail-calls

4:00 callen: they don't like us. :(

4:00 they only pander to JRuby.

4:00 even then, minimally.

4:01 llasram: Who only panders to JRuby?

4:55 twem2__: Anyone know how Kawa manages Full TCO?

4:58 twem2: ah, but its slower

5:55 fliebel: What is happening with pods? dev.clojure.org has very little on them, but rhickey talked about them in his conj keynote.

7:58 osa1: is using map destructuring with :or keyword only way to create a function with optional parameters?

8:01 I think I got disconnecting before sending my message: is using map destructuring with :or keyword only way to create a function with optional parameters?

8:20 cemerick: osa1: map destructuring can be applied to rest args; that is the basis for optional params

8:22 osa1: cemerick: 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 ?

8:22 cemerick: osa1: yes, but the mandatory/non-kwargs must come first

8:22 (fn [mandatory & {:keys [optional optional2]}] ...)

9:25 jsabeaudry: Anything you would change in this before using it as an example of what a closure is? http://pastebin.com/M1dPUz7t

9:28 claj: jsabeaudry, clever application!

9:29 only that you have to keep the timer in some kind of closure itself to use it :)

9:38 dnolen: tscheibl: you're on the CLJS keyword IE thread in JIRA right?

9:39 tscheibl: dnolen: yep

9:39 claj: the github.com/clojure/clojurescript wiki says that :use is not supported, but :use is used in clojurescriptone. The wiki must be wrong, no?

9:39 tscheibl: dnolen: I've just tested your recent fix

9:40 dnolen: as I've described their I'm now encountering CLJS-133

9:41 there...

9:43 jsabeaudry: claj, Where is :use used in clojurescriptone?

9:43 maravillas: claj: i think the unrestricted use form isn't supported, but use :only is

9:43 jsabeaudry: oh ya what maravillas said

9:43 claj: ok, it's in controller.cljs, but your right, it's [one.sample.model :only (state)]

9:44 tscheibl: dnolen: ms may make things easier for users... but definitely not for us developers, developers, developers ;)

9:50 exactly at the point in time when I wrote the previous post I received an email from Microsoft Austria... funny isn't it :)

9:52 dnolen: tscheibl: ah so 133 and 139 are related but different

9:52 tscheibl: so 139 works for you? but 133 does not?

9:53 tscheibl: ah ok so 139 seems resolved, will look more closely at 133

9:54 tscheibl: dnolen: yes, the unicode literals (\u....) don't get converted to utf-8 any more

9:55 dnolen: but as CLJ-133 wasn't fixed with this patch... but seems to be related

9:56 forget the "as" in the previous sentence... I hadn't much sleep tonight and my brains still isn't working, obviousely

9:57 ..damn I can't write any more :)

9:57 .. I haven't had much sleep tonight and my brain still isn't working...

9:58 ..obviously

9:58 dnolen: tscheibl: thx, will look into

9:58 it

10:00 tscheibl: dnolen: I'll have a look, too.. after some more coffee... 4 eyes may see better than 2

10:01 pjb3: Has anyone else ran into issues like this before?

10:01 https://gist.github.com/1885401

10:02 Vinzent: hm, I thought #|comments|# was added in 1.3!

10:02 pjb3: It seems that I'm using a macro that evaluates a body and in that body I'm trying to use recur

10:02 to recur to a loop point outside of the macro

10:03 but it recurs to the macro call, instead of the loop :(

10:04 cemerick: Vinzent: it's been considered, but no.

10:04 Vinzent: why?

10:04 clojurebot: http://clojure.org/rationale

10:07 jsabeaudry: Is there a way to have synchronous transactions that will not be retried?

10:08 (If it fails I just want to report that it failed)

10:08 TimMc: jsabeaudry: Not that I know of, but you could build that pretty easily.

10:11 claj: there are ways to set how many times somethings retries as well - maybe you could set it to 1 or so?

10:11 cemerick: Vinzent: I don't think it's clear that it's necessarily good, esp. given #_

10:11 pjstadig: pjb3: 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:11 jsabeaudry: TimMc, Hmmmm, thanks, I'll keep reading I haven't wrapped my head around the multithreaded constructs yet (too many years of locking)

10:11 pjstadig: which creates a recur target

10:11 TimMc: claj: Oh, good call.

10:11 pjb3: scgilardi- 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:12 claj: http://clojuredocs.org/clojure_core/clojure.core/ref-max-history

10:13 TimMc: Hmm, that's not so clean.

10:13 jsabeaudry: claj, Thanks for the link, too bad the doc is so short

10:14 pjb3: pjstadig: yeah, looks like what I want to call is actually with-query-results*, the internal function

10:14 claj: essentially (def no-retries-ref (ref-max-history (ref {}) 1)) should do

10:14 pjstadig: claj: i don't think the ref-max-history determines the number of retries

10:14 pjb3: What's the point of the internal namespace?

10:14 claj: oh, you're right.

10:14 pjb3: Is that link, don't call this stuff directly, it might change?

10:14 pjstadig: it 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:15 Vinzent: cemerick, #_ 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:15 pjb3: s/link/like/

10:15 cemerick: Vinzent: yeah, there was a fifth suggestion floating around before.

10:15 TimMc: #_(comment ...)

10:16 Also...

10:16 &[#_ #_ #_ 1 2 3 4 5]

10:16 lazybot: ⇒ [4 5]

10:16 cemerick: well, that, and an editor that cares to should be able to drop #_'s as needed to comment out selected forms, etc.

10:17 TimMc: hah, didn't know about that

10:17 That could really burn someone badly.

10:17 Imagine if multiple semicolons commented multiple lines…

10:17 pjstadig: i was recently reading the STM code, it's quite an interesting read

10:20 TimMc: cemerick: I don't know if that behavior is documented.

10:20 s/documented/intended/

10:21 pjb3: Yeah, 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:21 so you get this

10:21 (sql/with-query-results results ["SELECT * FROM mytable"] (prn results))

10:21 instead of

10:21 (let [results (sql/with-query-results* ["SELECT * FROM mytable"])])

10:21 err

10:21 (let [results (sql/with-query-results* ["SELECT * FROM mytable"])] (prn results))

10:22 oh, and the body doesn't have to be a function, it can just be a form

10:23 TimMc: jsabeaudry: Off the top of my head: (defmacro dosync-once [& exprs] `(let [retried# (atom false)] (dosync (when @retried# (throw ...)) ~@exprs)))

10:23 erm

10:24 jsabeaudry: throw in a (swap! retried# (constantly true)) at the beginning of the dosync

10:24 pjb3: still, unless I'm missing something, I think just having a select-rows function that just returns the results make a lot more sense

10:25 Vinzent: cemerick, just curious, what the fifth was?

10:25 TimMc, hm, thank you! #_(comment ...) looks very nice

10:25 * TimMc throws a heredoc into the room and runs away

10:26 cemerick: TimMc: hah, six

10:26 Vinzent: it was some transplant from another lisp; don't remember

10:26 #; maybe?

10:26 jsabeaudry: TimMc, like this: http://pastebin.com/WwGxiLD4 ?

10:27 TimMc: jsabeaudry: Well, after the when

10:27 jsabeaudry: TimMc, Oh ya heheh

10:27 TimMc: my bad

10:28 jsabeaudry: TimMc, So basically if I throw within the dosync it will not be retried?

10:28 TimMc: That's my understanding, yes.

10:28 jsabeaudry: TimMc, However, if the dosync executes fines but the validator fn fails then it will get retried, is that right?

10:29 TimMc: Oh, validators... I would *imagine* they are called at the end of dosync before it commits.

10:30 and I think they wouldn't cause a retry, but a failure. But I have read up on this stuff recently.

10:31 stuartsierra: if the validation function doesn't pass, it throws an exception and the transaction aborts

10:32 jsabeaudry: stuartsierra, 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:33 stuartsierra: yes

10:33 TimMc: I don't think atoms are affected by dosyncs.

10:34 jsabeaudry: stuartsierra, ahhhhh ok I guess it is becoming clearer

10:34 TimMc: only refs and sends to agents

10:35 stuartsierra: TimMc: yes, dosync transactions only apply to refs and agents. But Atoms can also have validation functions, which behave the same way for `swap!`.

10:35 TimMc: sure

10:39 gtrak`: where's the slides for the ants talk?

10:39 I think I'm on the verge of converting 2 more people

10:39 TimMc: That demo really should be updated.

10:39 MIght be a nice little project.

10:40 gtrak`: it was a 'wow' video for me

10:40 tmciver: gtrak`: which video is this? link?

10:40 TimMc: Don't have it on hand.

10:40 Kototama: when 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:40 gtrak`: http://blip.tv/clojure/clojure-concurrency-819147

10:40 tmciver: thanks

10:41 gtrak`: it says, "be sure to grab the slides and code in order to follow along"

10:41 where are they?

10:42 TimMc: Code is easy enough to find: http://www.lisptoronto.org/past-meetings/2009-05-clojure-ants-demo

10:43 tmciver: That's an old talk. I assume it's still relevant?

10:44 gtrak`: it was before protocols/records

10:44 it's a good talk though

10:52 TimMc: So, 1.2? 1.1?

10:56 stuartsierra: TimMc: I think ants.clj was pre-1.0

10:58 TimMc: fancy

10:59 timvisher: Anyone know if it's possible to tell emacs compilation buffers to respect color code sequences, i.e. `^[[1m^[[32m0`?

10:59 jlf: timvisher: try C-h f ansi-color-for-comint-mode-on

10:59 stuartsierra: timvisher: it's possible. Comint mode can do it

11:00 jlf: timvisher: you might try calling that from compilation-start-hook or somesuch

11:01 Kototama: Or how can I specify the context path for some routes?

11:02 timvisher: jlf stuartsierra: good points. I'll investigate. :)

11:16 jsabeaudry: Is there a function that will transform nil into "nil" ?

11:17 TimMc: &(pr-str nil)

11:17 lazybot: ⇒ "nil"

11:17 TimMc: &(map {nil "nil"} [1 2 nil])

11:17 lazybot: ⇒ (nil nil "nil")

11:17 TimMc: :-P

11:18 $findfn nil "nil"

11:18 lazybot: [clojure.core/print-str clojure.core/pr-str]

11:19 jsabeaudry: TimMc, Whoa, what is this findfn black magic?

11:20 gfredericks: jsabeaudry: you give it some args and a return value and it looks for functions that do that

11:20 $findfn 2 3 4 5 6 20

11:20 lazybot: [clojure.core/+ clojure.core/+']

11:22 TimMc: jsabeaudry: You can also get it as a local REPL tool, but I find it more convenient to /msg lazybot ^_^

11:22 jsabeaudry: $findfn 2 10 1024

11:22 lazybot: []

11:23 TimMc: $findarg map % [1 2 3] [true false true]

11:23 lazybot: [clojure.core/odd?]

11:24 jsabeaudry: Great stuff, love that you can do it in private too

11:24 gfredericks: for finding secret functions

11:26 TimMc: $findfn + 2 3 5

11:26 lazybot: [clojure.core/trampoline]

11:27 gfredericks: $findfn 7 8 false

11:27 lazybot: [clojure.core/== clojure.core/identical? clojure.core/isa? clojure.core/= clojure.core/> clojure.core/>= clojure.core/contains? clojure.core/bit-test]

11:27 gfredericks: good to know that 7 isn't an 8

11:28 TimMc: and doesn't contain one as a key

11:29 $findfn 2 1

11:29 lazybot: [clojure.core/unchecked-dec clojure.core/unchecked-dec-int clojure.core/dec' clojure.core/dec]

11:29 TimMc: $findfn 2 1

11:29 lazybot: [clojure.core/unchecked-dec clojure.core/unchecked-dec-int clojure.core/dec' clojure.core/dec]

11:29 TimMc: $findfn 2 1

11:29 lazybot: [clojure.core/unchecked-dec clojure.core/rand-int clojure.core/unchecked-dec-int clojure.core/dec' clojure.core/dec]

11:29 tdrgabi: $findfn 7 8 true

11:29 lazybot: [clojure.core/not= clojure.core/distinct? clojure.core/< clojure.core/<=]

11:29 TimMc: ^ clojure.core/rand-int

11:29 tdrgabi: awesome. didn't know about this

11:29 is it part of standard clojure?

11:30 TimMc: Nope, just lazybot.

11:30 (And sorry for spamming.)

11:31 gfredericks: TimMc: it just has to be done once a month or so

11:31 * gfredericks waits for someone to $findfn nil

11:32 TimMc: and false, and true, and 0, and 1...

11:32 gfredericks: I think nil is the biggie

11:32 TimMc: Yeah, but lazybot will truncate the response.

11:33 $findfn [x 3] x 3 ;; just fns, or also macros?

11:33 lazybot: java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:0)

11:33 * gfredericks misses sexpbot

11:33 TimMc: just functions

11:35 gfredericks: ,(let* [x 3] x)

11:35 &(let* [x 3] x)

11:35 lazybot: ⇒ 3

11:35 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>

11:36 gfredericks: clojurebot: you might want to have that checked out

11:36 clojurebot: Pardon?

11:36 TimMc: I'm sure that class isn't too important, I wouldn't worry.

11:51 devn: lol

11:54 pyr: came across something weird

11:54 (let [pool (java.util.concurrent.Executors/newFixedThreadPool 10)] (.submit pool some-fn))

11:54 fails

11:54 whereas

11:55 (def pool (java.util.concurrent.Executors/newFixedThreadPool 10)) (.submit pool some-fn) works

11:55 hiredman: there is a submit method which takes callables or runnables and fns are both

11:55 pyr: yes, but how come it works when you def ?

11:55 hiredman: so for the non-reflective case you need a cast or a hint

11:56 tmciver: hiredman: which of the two examples is reflective?

11:57 hiredman: since the compiler knows the type of the local pool in the let case it is trying to compile the call non-reflectively

11:57 TimMc: pyr: What sort of failure do you get?

11:58 pjb3: https://gist.github.com/1886007

11:58 pyr: hold on, the repl isn't giving me errors

11:58 TimMc: it matched what hiredman is describing

11:58 TimMc: (multiple methods defined)

11:58 pjb3: I must not understand the difference between using multiple functions with different arities and using loop/recur

11:59 hiredman: pjb3: you can't recur across a lazy-seq (which lazy-cat expands to)

11:59 TimMc: pjb3: That recur might be caught on something in lazy-cat

12:01 pjb3: hiredman: ok, is that just because lazy-cat is a macro that defines a recur target internally?

12:02 so recur goes somewhere inside the macro instead of to the loop that I defined?

12:02 TimMc: pyr: The let version doesn't give me an error.

12:03 pyr: there, reproduced, let me gist

12:03 TimMc: https://gist.github.com/1886044

12:03 given that namespace

12:04 you get a failure when requiring

12:04 CompilerException java.lang.IllegalArgumentException: More than one matching method found: submit

12:04 and indeed

12:04 adding runnable

12:04 ^Runnable

12:04 fixes the problem

12:05 TimMc: I wonder if this has something to do with reflection when using a var vs. a local.

12:08 tmciver: TimMc: what's the difference between a var defined using def and one created in a let?

12:08 hiredman: let doesn't create vars

12:09 http://clojure.org/vars

12:10 gfredericks: tmciver: let and function arguments create locals

12:11 * tmciver needs to learn more about vars. Thanks.

12:11 gfredericks: tmciver: I think there's a clojure west talk about the topic

12:12 tscheibl: dnolen: found it... look at my comment at http://dev.clojure.org/jira/browse/CLJS-133

12:13 dnolen: tscheibl: so that fixes all cases?

12:15 tscheibl: dnolen: 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:16 dnolen: same as you did for the Character type .. but replace all \uFDD0 and \uFDD1 occurences in strings

12:17 pyr: i suppose everybody new, but was somewhat surprise to see a huge time differnce between json-str/read-json and pr-str/read-string

12:17 dnolen: tscheibl: can you demonstrate a case that doesn't work?

12:17 hiredman: pyr: clojure.data.json is slow, use cheshire

12:18 pyr: i do

12:18 it's two orders of mangnitude faster

12:18 hiredman: oh

12:19 pyr: and i'm doing something wrong with carbonite

12:19 because it's slower than cheshire on my use case

12:20 sritchie: pyr: that's interesting, what are you serializing?

12:21 hiredman: cheshire is there to be fast, and it's built on top of jackson

12:21 I don't see any kind of speed benchmarks for carbonite

12:21 tscheibl: dnolen: do you mean a case that doesn't work with your patch for 139?

12:22 hiredman: https://github.com/revelytix/carbonite/blob/master/src/carbonite/serializer.clj <-- all proxies, proxy is slow

12:24 jcrossley3: if 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:25 tscheibl: dnolen: 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:25 pyr: sritchie: maps and vectors

12:25 tscheibl: dnolen: your patch only handles the character literal case

12:25 pyr: hold on

12:26 dnolen: tscheibl: what I mean is what cases are broken after both 139 & 133 patches are applied

12:28 sritchie: hiredman: I reimplemented them in java on my fork

12:29 tscheibl: dnolen: 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:29 web app (no plural) :)

12:29 hiredman: sritchie: was it faster?

12:29 sritchie: hiredman, pyr: I'll go ahead and benchmark those and submit a pull request for the conversions

12:30 pyr: sritchie: https://gist.github.com/1886194

12:30 tscheibl: dnolen: anyway I would also apply my 133 patch because using character literals seems to me more idiomatic in this case :)

12:31 hiredman: pyr: https://github.com/hugoduncan/criterium

12:32 sritchie: pyr: what are the versions on those deps?

12:32 pyr: sritchie: carbonite is yours (1.1.1), cheshire 2.2.2

12:33 2.2.0

12:33 tscheibl: dnolen: 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:33 sritchie: ah, so you're on 1.1.1

12:33 I'll see if I can do anything to speed it up, or if that's just a limit w/ kryo

12:33 tscheibl: dnolen: but this would of course need the fix for String (I could do that if you like)

12:34 pyr: sritchie: it looks as though

12:34 dnolen: tscheibl: yes a patch for that would be welcome as well

12:34 tscheibl: dnolen: ok

12:35 pyr: sritchie: the numbers i'm seeing make it seem as though pr-str was called

12:35 sritchie: oh, yeah, it is

12:35 pyr: sritchie: as in clj-print

12:35 sritchie: which wouldn't make sense, would it

12:35 sritchie: well, some data structures get printed and the string gets serialized

12:36 probably every single serializer that uses that can be improved dramatically

12:36 pyr: if you look at make-payload

12:36 sritchie: https://github.com/sritchie/carbonite/blob/develop/src/clj/carbonite/serializer.clj#L25

12:36 pyr: sritchie: yes i was referring to that

12:37 sritchie: but my payloads are all stuff that should be handled by the clojure collections serializers

12:37 sritchie: that'd get var, keyword, symbol

12:37 yeha

12:38 pyr: ah, wait, reading again

12:38 sritchie: your keys will be serialized with clj-print

12:38 pyr: ah, i get it

12:38 sritchie: so only the UUID escapes

12:39 pyr: the problem is the fact

12:39 that make-payload yields a LazySeq

12:39 ah no

12:40 sritchie: well, that's going to slow it down a little

12:40 if you had a vector you'd use transients

12:41 pyr: 18:38| sritchie| your keys will be serialized with clj-print

12:41 i don't get that

12:41 sritchie: for collection serialization, kryo will recursively look for serializers

12:42 the collection serializer asks kryo to serialize key and value -- kryo then looks up serializers for each of those

12:42 so the keyword keys get the clj-print serializer,

12:42 the UUID gets the UUIDSerializer

12:42 pyr: why ? clojure-primitives catches keywords

12:43 https://github.com/sritchie/carbonite/blob/develop/src/clj/carbonite/serializer.clj#L99

12:43 or maybe i'm misreading

12:43 sritchie: that's a map of class to serializer

12:43 https://github.com/sritchie/carbonite/blob/develop/src/jvm/carbonite/ClojureReaderSerializer.java

12:43 pyr: ClojureReaderSerializer

12:43 got it

12:43 ok

12:43 so if i want to be faster

12:44 sritchie: you'll get a nice bump if we do this: https://github.com/revelytix/carbonite/pull/3

12:44 dnolen: tscheibl: a patch to string should make your patch to 133 moot right?

12:44 sritchie: for keywords and symbols

12:44 pyr: will try out

12:44 sritchie: awesome, let me know how it goes

12:44 I'll get it into my branch too

12:45 pyr: actually, i'll try out with a registry that just registers the needed serializers

12:45 i was comparing serializers for my kafka flow, i'll admit i was surprised to see cheshire come out on top

12:46 i need to include msgpack and friends in the mix

12:46 the defrecord trick for kryo seems promising too

12:47 sritchie: the trick I did recently with hierarchies?

12:47 if there's another one, I'm really curious

12:47 shaolynn: Can someone point me to a tutorial on getting Noir running with Nginx?

12:48 pyr: sritchie: i mean just proxying serializer

12:48 sritchie: for a given record

12:49 sritchie: got it

12:49 I

12:49 figu

12:49 red out a way to write a serializer that'll work for every record

12:49 in cascading.kryo, I (and some twitter folks) extended kryo to be able to handle more general registrations

12:50 so it'll look at exact class matches first, then if none of those match, at "hierarchy registrations"

12:50 shaolynn: Or actually, what's the best way to get a Clojure webapp running on an Ubuntu server?

12:50 sritchie: pyr: that lets you register a serializer for "clojure.lang.IRecord"

12:51 pyr: sritchie: ack

12:52 sritchie: haha, is that bad?

12:52 my goal here is to be able to serialize anonymous functions w/ kryo

12:52 pyr: nope, not bad

12:53 ahah, that sounds bad though :)

12:53 sritchie: that way we wouldn't need the defops in cascalog

12:53 you could use anonymous functions as cascalog ops

12:53 technomancy: shaolynn: easiest thing is to use jetty until it becomes a bottleneck

12:53 pyr: speaking of which i was almost able to get cascalog work on cassandra

12:54 sritchie: writing to cassandra?

12:54 pyr: reading + writing

12:54 but no time to dig into it more lately, i'm going to need it though

12:54 later on

12:54 sritchie: nice, that'd make a great contrib module

12:54 shaolynn: technomancy: thx!

12:54 sritchie: pyr I can add you to contrib, if you want to submit it

12:55 pyr: it's not ready yet, but i'll ping you when it is

12:55 sritchie: sounds good, man

13:03 gfredericks: The advantage of naming your libraries /lib-\d\d\d\d/ is that you're instantly the top google hit

13:04 tscheibl: dnolen: yes ... sorry for the delay, needed to feed

13:04 ibdknox: hola

13:05 to bad the game thing is in Germany

13:06 that sounds like fun :)

13:06 too*

13:06 dnolen: tscheibl: cool that would be awesome, would be nice to put this unicode stuff to rest

13:06 tscheibl: ibdknox: what game thing? I live in Austria.. that'S not too far from germany.. ok depends on which part of germany :)

13:07 ibdknox: Berlin!

13:07 tscheibl: dnolen: definitely :)

13:07 ibdknox: tscheibl: http://groups.google.com/group/clojure/msg/a843c8ea685551e7

13:11 tscheibl: ibdknox: sounds cool...

13:12 ibdknox: yeah, definitely a neat opportunity for someone

13:15 tscheibl: tscheibl: 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:16 lol.. I'm talking to myself

13:17 duncanm: hey dnolen_

13:17 dnolen_: duncanm: heya

13:18 duncanm: dnolen_: 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:18 i started learning Scala a little while back, it's kinda fun, but the combination of features gets pretty complicated and hairy very quickly

13:19 dnolen_: 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:19 are -> and

13:19 modes -> modern

13:21 duncanm: I also just can't get into Scala. Way too much syntax compared to Standard ML / OCaml / Haskell

13:21 ibdknox: don't forget that this is a publicly logged channel :)

13:21 duncanm: oh?

13:21 gfredericks: $google clojure irc

13:21 hiredman: ~logs

13:21 clojurebot: logs is http://clojure-log.n01se.net/

13:21 lazybot: [#clojure log - Feb 22 2012] http://clojure-log.n01se.net/

13:22 duncanm: dnolen_: 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:22 the key is not to try every single feature all together

13:22 hiredman: sounds like C++

13:22 duncanm: yeah, it's a bit like that

13:22 ibdknox: yeah I think scale is headed down that path

13:22 it's already employs monstrous complexity through its various features. Step 1, check.

13:23 s/it's/it

13:23 dnolen_: duncanm: I think exposing OO at the upper levels of a system is just wrong (this is just my newly forming opinion)

13:23 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:23 ibdknox: dnolen_: I share it.

13:23 dnolen_: 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:24 duncanm: hmm

13:24 dnolen_: all complexity in Scala seem to fall out of OO at top level

13:25 the rest is details

13:25 duncanm: it's true that i can recall the core abstractions of clojure must easier than scala

13:25 in Clojure, we have IFn, ISeq, and that's kinda it

13:25 ibdknox: the point at which you *must* understand co- and contra-variance to use a language, you've failed

13:25 duncanm: in 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:25 how they call that

13:26 ibdknox: well, all the strongly-typed languages are like that, right? ML, Haskell, etc

13:26 hiredman: at the bottom you are simulating the execution of your language on a machine, and oop does simulation pretty well

13:26 duncanm: dnolen_: 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:27 dnolen_: duncanm: thx!

13:27 duncanm: how active is clojure.net? i switched jobs a while back, and switched runtimes along with it

13:27 now i use Mono everyday, and i don't run the JVM anymore

13:27 TimMc: duncanm: You mean Clojure CLR?

13:28 duncanm: TimMc: right, that's the name

13:28 dnolen_: duncanm: it seems to be picking up some momentum based on the number of watchers as well the appearance of blogposts

13:29 hagna: what'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:29 dnolen_: duncanm: we're quite a ways off but the possibility of libraries that work on JVM/CLR/JS seem eventually likely

13:30 TimMc: hagna: Don't take this personally, but that's a terrible question.

13:30 (It depends entirely on what the "data source" is and what API it provides.)

13:30 hagna: TimMc: hehe thanks

13:31 duncanm: dnolen_: my understanding is that lein is fairly tied to maven, and .net doesn't really have anything quite like it

13:31 TimMc: hagna: Is this hardware, or what? Are you polling it? Are there timestamps in a data stream?

13:32 dnolen_: duncanm: interesting - I really know nothing about .net

13:33 hagna: TimMc: it's an irc bot so I would get strings over time

13:33 dnolen_: 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:33 hagna: TimMc: in a callback fashion I suppose

13:34 TimMc: hagna: conj into a vec in a ref until the time is up, I guess

13:40 hagna: TimMc: 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:42 jsabeaudry: hagna, could future-cancel the thread after 5 seconds work?

13:43 hagna: jsabeaudry: maybe, is that a good way to get a function to behave one way and then another way based on time

13:43 ?

13:45 jsabeaudry: hagna, I'm not sure, I'm new to clojure and have no java background

13:45 hagna, This might be of interest to you http://stackoverflow.com/questions/6694530/executing-a-function-with-a-timeout

13:46 TimMc: Set an atom, start a future that will sleep for 5 seconds and swap! the atom, loop until the atom has changed.

13:47 ibdknox: alternatively, you could event loop it.

13:47 hagna: ibdknox: oh yeah?

13:47 ibdknox: which I guess is basically what TimMc was suggesting

13:48 TimMc: And instead of a future, maybe you want j.u.Timer

13:48 which will do the sleep for you.

13:50 seancorfield: pjb3: sorry, was away when you were asking about java.jdbc

13:50 pjb3: seancorfield: no problem!

13:50 seancorfield: i'm not fond of the current with... macro approach and will be providing a more functional API in a future release

13:51 `fogus: any tips for getting cljsbuild to execute on a heroku deployment?

13:52 seancorfield: clojure/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:52 ibdknox: `fogus: I've been lazy so far and checked in the generated bootstrap.js :/

13:52 technomancy: `fogus: you can set LEIN_BUILD_TASK to "cljsbuild", but you have to enable the user_env_compile flag; lemme find the link

13:52 * `fogus was hoping to avoid that

13:52 seancorfield: at 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 `fogus: technomancy: that would be great

13:53 technomancy: `fogus: see "Configuration" in https://github.com/heroku/heroku-buildpack-clojure/

13:53 ibdknox: `fogus: I'll probably revive noir-cljs at some point which would also solve this problem

13:53 seancorfield: well, after early may, more like since we're in "launch" mode at world singles thru the end of april :)

13:53 technomancy: ^ anyone else deploying on Heroku would probably benefit from reading that too

13:54 ibdknox: technomancy: can we chain tasks somehow?

13:55 TimMc: ibdknox: You mean call one task from another?

13:55 technomancy: ibdknox: sure, just use commas

13:55 ibdknox: k

13:55 TimMc: oh, sequence them

13:56 seancorfield: one 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:56 happy to hear other suggestions pjb3

13:56 ibdknox: TimMc: yeah, in that case you'd need to do deps and then build cljs

13:56 seancorfield: that would be great

13:57 I hate with-query-results

13:57 pjb3: seancorfield: +1 for the functional API

13:57 yes, I learned that I hate with-query-results today too :)

13:57 just give me a select-rows function :0

13:57 ibdknox: it's nicely hidden in korma :)

13:57 pjb3: (defn select-rows [query] (sql/with-query-results rs query (into [] rs)))

13:58 gfredericks: do I need to go look up that ssh command on clojars to update my lib or is there something baked into lein now?

13:58 ibdknox: lein-clojars

13:59 gfredericks: that's a plugin?

13:59 ibdknox: 0.7.0, I think?

13:59 TimMc: scp pom.xml my-foo<TAB> clojars@clojars.org:

13:59 ibdknox: gfredericks: yeah

13:59 gfredericks: TimMc: so you recommend memorizing it? :)

13:59 tmciver: or lein push


13:59 ibdknox: lol

14:00 * amalloy still uses cake release

14:00 technomancy: shell alias

14:01 gfredericks: alias .=lein push

14:02 * gfredericks wonders if he can alias ","

14:03 * gfredericks can

14:03 pjstadig: should have aliased ☃

14:03 gfredericks: man I can't even see what that is

14:03 Scriptor: a cat?

14:03 TimMc: Yeah, not from this terminal

14:04 gfredericks: my terminal renders it, just not with enough resolution

14:04 raek: http://☃.net/

14:04 `fogus: I have a bookmark that performs a google search for "clojars lein scp" :-(

14:04 TimMc: >_<

14:04 gfredericks: http://lab.brainonfire.net/whatchar/identify.php

14:04 nishant_: I get a ClassNotFoundException when I trying doing META - . on a namespace (http://pastebin.com/29ZKCUKZ), any ideas?

14:05 jsabeaudry: Funny that some functions added in Clojure 1.0 are still "alpha"

14:05 pjstadig: it is of course the unicode snowman

14:05 TimMc: ah

14:05 gfredericks: jsabeaudry: it's "alpha" as in "alpha-male" sort of thing

14:05 ibdknox: what's wrong with the lein-clojars plugin? :p

14:05 nishant_: this is after I have required the namespace

14:05 technomancy: ibdknox: it doesn't work with dsa keys

14:06 TimMc: nishant_: What did you actually enter on the REPL?

14:06 ibdknox: I see

14:06 jsabeaudry: gfredericks, Ah that explains it ;)

14:06 nishant_: TimMc: (require 'name.space)

14:07 ibdknox: nishant_: he meant when you asked for meta

14:07 pyr: you guys can also use lein deploy

14:08 technomancy: pyr: not to clojars unfortunately

14:08 nishant_: oh, I just typed <ESC>.

14:08 pyr: ah sorry, didn't see the target was clojars

14:08 technomancy: hopefully clojars will accept that in the future though

14:08 TimMc: I'm not lazy enough.

14:08 Every 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:09 pyr: well 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 `fogus: technomancy: 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:12 technomancy: hmm; well let me know if you need help following it up

14:12 `fogus: k

14:12 technomancy: I haven't used cljsbuild yet myself, but I've spoken to folks who are using it

14:12 hopefully user_env_compile becomes default soon so there are fewer manual steps in the future

14:13 emezeske: `fogus, technomancy: If there's anything in cljsbuild that could be improved to make that sort of thing easier, I'm all ears.

14:13 I haven't ever deployed to heroku, so I'm not sure what would make that easy

14:13 gtrak`: is there a way to pull dependencies directly from git from lein?

14:14 if-not, wouldn't that be cool?

14:14 `fogus: emezeske: I've only started using it yesterday, but love it so far

14:14 jsabeaudry: gtrak, would be pretty cool, curious to hear if there is already a way

14:14 seancorfield: pjb3: 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:14 technomancy: gtrak`: it would not be very cool IMO

14:15 transitive dependencies would be an absolute nightmare

14:15 `fogus: gtrak`: I think the ClojureScript one has a lein task that does that, but I'm not entirely sure

14:15 seancorfield: plus get-by-id, find-by-keys, delete-by-id and a few other "conveniences"

14:15 muhoo: better to have a lein on your task than a lein on your car

14:15 TimMc: lien

14:15 gtrak`: hmm, yea I'm just thinking as a temporary thing for new code, not for something you'd release

14:15 technomancy: it 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:15 pjb3: seancorfield: the main thing is I think I'd rather have select-rows return a seq of maps (rows) than pass it a function

14:16 gtrak`: technomancy: agreed

14:16 ibdknox: `fogus: the problem is probably that you need to have it download your dev dependencies too

14:16 technomancy: gtrak`: do you know about checkout dependencies?

14:16 gtrak`: technomancy: yes, I've tried it once

14:16 technomancy: those give you 95% of the goodness of full-fledged git dependencies without the heartache

14:17 `fogus: ibdknox: You're probably right. I'll tackle it later today

14:17 technomancy: it 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:17 ibdknox: lol

14:18 technomancy: anyone looking for a fun learning project? there you go. easy but still useful.

14:18 gtrak`: set up checkout-dependencies?

14:18 interesting

14:18 technomancy: gtrak`: yeah, like it could populate your checkouts/ dir for yout

14:18 you

14:18 gtrak`: that might be useful

14:18 TimMc: ah, not with symlinks

14:18 gtrak`: is it something i could code up in a couple of hours?

14:19 technomancy: definitely

14:19 gtrak`: i'll give it a go

14:19 technomancy: sweet; let me know if you run into any issues

14:21 lnostdal: ,pastebin

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

14:21 lnostdal: &paste

14:21 lazybot: java.lang.RuntimeException: Unable to resolve symbol: paste in this context

14:21 lnostdal: &pastebin

14:21 lazybot: java.lang.RuntimeException: Unable to resolve symbol: pastebin in this context

14:21 lnostdal: meh

14:21 ibdknox: ?

14:21 lnostdal: :]

14:22 ibdknox: http://refheap.com

14:22 lnostdal: i recall there being a bot here one could ask about ... ah yeah

14:22 thanks

14:22 ibdknox: ~pastebin

14:22 clojurebot: Pardon?

14:22 ibdknox: is how it would've been triggered

14:23 ~gist

14:23 clojurebot: gist is paste

14:23 ibdknox: lol

14:24 lnostdal: ~paste

14:24 clojurebot: paste is http://www.refheap.com

14:24 lnostdal: so if gist is paste, and paste is that url .. what is then refheap? .. hmm

14:24 ~refheap

14:24 clojurebot: Gabh mo leithscéal?

14:24 lnostdal: i see .... hehe

14:25 TimMc: ~paste

14:25 clojurebot: paste is http://www.refheap.com

14:25 TimMc: Sometimes it says "paste is gist", too. :-(

14:25 ibdknox: lol

14:25 TimMc: clojurebot's factoid module is half-broken.

14:25 technomancy: but always in entertaining ways

14:26 lnostdal: perhaps it's using rand-nth or something :)

14:26 ibdknox: TimMc: you mean totally awesome.

14:26 TimMc: lnostdal: The brokenness is partly that you can't remove some factoids.

14:26 ibdknox: ~guards

14:26 clojurebot: SEIZE HIM!

14:26 lnostdal: ~clojure

14:26 clojurebot: clojure is far closer to perfection then python

14:27 lnostdal: then, then, _then_, THEN! .. it's, perfect!

14:27 TimMc: There goes the next 5 minutes...

14:28 amalloy: ibdknox: you missed the chance to give him a botsnack

14:28 also, i didn't really read the log very well, so that's not relevant

14:28 ibdknox: lol

14:28 Raynes: If amalloy would write the damned factoids lazybot plugin

14:29 ibdknox: srsly

14:29 Raynes: amalloy doesn't even write code anymore, I don't think.

14:29 technomancy: has he ascended to Architect?

14:29 amalloy: Astronaut

14:30 Raynes: The impossible astronaut.

14:33 ibdknox: jimduey: the beta versions of korma remove the need for exec

14:34 Raynes: ibdknox: You make every conversation about you.

14:34 They have pills for that these days.

14:34 ibdknox: :p

14:34 I was reading his DSL examples thing which hit HN

14:34 gtrak`: technomancy: for that to work, though, I'd need the dependency to be on clojars already, yes?

14:34 ibdknox: I'd be curious to hear what he has to say about making it less "lumpy"

14:35 technomancy: gtrak`: clojars or ~/.m2, I think

14:35 gtrak`: ah, I see, so it would save me from having to dl/build myself except the first time

14:36 m0smith: hi all

14:36 technomancy: gtrak`: no, you wouldn't have to clone or anything even the first time

14:36 m0smith: ;(reversible? "asd")

14:36 technomancy: as 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:36 gtrak`: not all jars will contain poms, and not all poms contain <scm> elements, but it's fairly common

14:37 m0smith: &(reversible? "asdf")

14:37 lazybot: ⇒ false

14:37 TimMc: &(doc reversible?)

14:37 lazybot: ⇒ ------------------------- clojure.core/reversible? ([coll]) Returns true if coll implements Reversible nil

14:37 m0smith: Is there some reason that strings aren't reversible?

14:38 TimMc: m0smith: Sure, they don't implement Reversible.

14:38 (more importantly, they aren't collections)

14:38 Raynes: $login

14:38 lazybot: You've been logged in.

14:38 Raynes: $reload

14:38 gtrak`: technomancy: ah, lein doesn't have an scm feature yet?

14:38 dnolen_: ,(reverse "foo")

14:38 lazybot: Reloaded successfully.

14:38 clojurebot: (\o \o \f)

14:38 Raynes: &(doc reversible?)

14:38 lazybot: ⇒ "([coll]); Returns true if coll implements Reversible"

14:38 technomancy: gtrak`: it emits <scm> into the poms, but it doesn't contain any mechanism for doing clones

14:39 dnolen_: ,(reverse (range 0 10))

14:39 clojurebot: (9 8 7 6 5 ...)

14:39 jimduey: ibdknox: nice. Will have to get caught up. Too many irons in the fire ATM.

14:39 technomancy: gtrak`: you actually might be able to steal from https://github.com/Seajure/melange

14:39 TimMc: &(doc reverse)

14:39 lazybot: ⇒ "([coll]); Returns a seq of the items in coll in reverse order. Not lazy."

14:39 m0smith: I was actually thinking of rseq

14:39 &(rseq "asd")

14:39 lazybot: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Reversible

14:39 ibdknox: jimduey: I'd be interested to hear your thought on making it less "lumpy" at some point :)

14:39 technomancy: gtrak`: melange is similar but goes the other way; it works with dependents rather than dependencies

14:39 jimduey: ibdknox: monads! :)

14:39 m0smith: Ok, so String doesn't implement reversible

14:40 ibdknox: jimduey: lol that's an implementation detail :p

14:40 dnolen_: m0smith: yeah the's the idea behind reversible, but you can't change Java Strings they are final.

14:40 gtrak`: technomancy: thanks, I'll take a look, though I don't want to shave a yak :-)

14:40 m0smith: But if rseq were implemented as protocl, it would be able to handle Strings and other such goodies

14:40 technomancy: gtrak`: feel free to copy as much as you like; melange is actually quite similar to what you want.

14:41 dnolen_: m0smith: possible in ClojureScript, not so easy in Clojure

14:41 m0smith: &(rseq (seq "asd))

14:41 lazybot: java.lang.RuntimeException: EOF while reading string

14:41 m0smith: &(rseq (seq "asd"))

14:41 lazybot: java.lang.ClassCastException: clojure.lang.StringSeq cannot be cast to clojure.lang.Reversible

14:42 m0smith: Couldn't StringSeq be reversible?

14:42 dnolen_: m0smith: oh yeah, probably

14:42 m0smith: &(rseq (vec "asd"))

14:42 lazybot: ⇒ (\d \s \a)

14:43 amalloy: dnolen_, 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:43 m0smith: so converting a string to a vector is reversible, but shouldn't a string itself be reversible?

14:43 amalloy: which issue?

14:44 TimMc: amalloy: I wonder if you'd be better off just writing the patch and attaching it -- might get noticed more quickly.

14:44 amalloy: TimMc: hasn't helped any of my other patches

14:44 TimMc: true :-/

14:44 gtrak`: technomancy: how does clojuresphere get the git urls? do all those projects have to have poms, I don't get it?

14:45 technomancy: gtrak`: it uses both poms and github search

14:45 Raynes: It assumes a lot of things.

14:45 amalloy: i actually can't find that jira issue; maybe i only asked on clj-dev

14:45 gtrak`: ah

14:45 that kinda sucks :-)

14:45 technomancy: gtrak`: but for a checkouts plugin you can ignore clojuresphere and just use poms

14:45 m0smith: I was looking on DEV and couldn't find it

14:45 dnolen_: amalloy: well I'd vote for it, seems like a simple enough change - but why not ArraySeq then too?

14:45 amalloy: dnolen_: i don't think seqs should be reversible

14:45 just strings

14:45 dnolen_: or IndexedSeq rather

14:46 amalloy: i doubt if vector-seqs are reversible either

14:46 m0smith: amalloy: I second the vote

14:46 amalloy: &(rseq (seq [1 2 3]))

14:46 lazybot: java.lang.ClassCastException: clojure.lang.PersistentVector$ChunkedSeq cannot be cast to clojure.lang.Reversible

14:46 technomancy: gtrak`: 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:46 dnolen_: amalloy: then why should StringSeq if not IndexedSeq?

14:46 amalloy: http://groups.google.com/group/clojure-dev/browse_frm/thread/6e92172038d2f41e/511ab0cccb2e418d?lnk=gst&q=reversible#511ab0cccb2e418d for what t

14:46 er

14:47 anyway, i don't think stringseq should be. just String

14:48 (in the same way that strings support nth)

14:48 gtrak`: 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:48 dnolen_: amalloy: ah, so special case Strings to call .reverse and wrap in seq on rseq?

14:49 amalloy: yes, or return an anonymous subclass of Seq that wraps the existing string

14:49 which is how i would have done it; more efficient than calling reverse, but perhaps not worth the effort

14:50 hiredman: well, if seq was a protocol you could just extend it to string insteand of needing a Seq type

14:50 Somelauw: seq is like a java interface, right?

14:50 hiredman: ISeq

14:50 amalloy: sure, of course, hiredman. but that's not going to happen until CinC at the soonest, right?

14:51 because the compiler needs to work with seqs from java, and protocols would be a huge hassle

14:52 * technomancy can't get over the fact that cond isn't really readable without putting newlines in the middle of function bodies. =(

14:52 technomancy: it makes me want to use multimethods even when not appropriate

14:52 hiredman: amalloy: actually it is not required

14:53 amalloy: technomancy: i wrote a little cond+ that allows (cond+ test expr, [test expr])

14:53 hiredman: you can have a project that just aot compiles a bunch of protocol definitions (and corresponding java interfaces) for bootstrapping

14:54 and clojure would just depending on the clojure-bootstrap.jar for building

14:55 dnolen_: hiredman: or pick a superior host like JavaScript that makes protocols at the bottom easy *ducks* :D

14:56 hiredman: dnolen_: *shrug* it's not really that hard, I might pick definterface for the bottom on the jvm instead of defprotocol

14:57 amalloy: hiredman: 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:58 (or saying something else entirely)

14:58 technomancy: also (let+ [name val (name val)])

14:58 hiredman: amalloy: I think it would cover something like 70-80% where the rest would have to be worked around

15:00 technomancy: amalloy: I don't have trouble with let for some reason

15:00 probably because the local names can be a lot shorter than cond conditions

15:00 amalloy: yes, exactly. but it was nice for symmetry

15:00 technomancy: though sometimes I am guilty of picking short names just to keep it under 80

15:00 amalloy: technomancy: i have had really-long names for let on occasion

15:00 nested destructuring

15:01 it turns out clojure-mode doesn't always indent that stuff the way i would like

15:01 TimMc: amalloy: The line following a multiline map destructure is indented weirdly.

15:02 amalloy: right, though that's a special case of a more general weirdness

15:03 eg, ((foo bar \n baz) bang \n sam) - sam lines up with baz instead of with (

15:04 mylesb: anyone here use cljr?

15:06 technomancy: I don't think cljr is maintained.

15:07 mylesb: :/ looks that way

15:08 technomancy: jark looks like a contender for the same space, but it's pretty immature right now

15:08 mylesb: I'm just getting into to clojure, want to mess around with some "sketch" files, is my best bet a lein project?

15:08 I've got that working, just seems a bit heavyweight

15:08 technomancy: yeah, until jark stabilizes it's best to stick with that

15:09 mylesb: thanks

15:15 tjgillies: how do i do a doseq without throwing away head?

15:16 brehaut: by holding on to the head yourself

15:16 TimMc: tjgillies: let

15:16 tjgillies: Or do you mean you want to collect results of an expr in the doseq body?

15:16 amalloy: yikes. sounds like correct answers to a bad question

15:16 brehaut: you probably need to do someting with the head after the doseq (such as return it) for it to not be discarded though

15:17 TimMc: amalloy: That's what I'm here for.

15:17 brehaut: amalloy: im not drinking coffee for the next 40 days. expect more of this

15:17 ibdknox|away: lol

15:17 tjgillies: i don't need doseq

15:17 brehaut: (and worse: bad answers to bad questions)

15:18 tjgillies: i want something that acts like doseq but returns a collection

15:18 amalloy: for

15:18 tjgillies: im a noob so i mosly know the side effect function because ive been a slave to OO most of my career ;)

15:24 magnars: I'm using good old (clojure.test) - any super-simple way of stubbing a function?

15:29 technomancy: magnars: with-redefs

15:29 magnars: technomancy: excellent, thanks!

15:36 It seems like I'm not quite grasping this with-redefs.

15:36 ,(with-redefs [- +] (- 3 4))

15:36 clojurebot: -1

15:37 stuartsierra: magnars: arithmetic is inlined

15:37 magnars: I see, that makes sense. Thanks.

15:37 `fogus: ,(with-redefs [println reverse] (println "hi"))

15:37 clojurebot: (\i \h)

15:38 raek: ,(with-redefs [inc eval] inc)

15:38 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

15:40 brehaut: ,(with-redefs [println (comp printlin reverse)] (println "hi"))

15:40 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: printlin in this context, compiling:(NO_SOURCE_PATH:0)>

15:40 magnars: Seems 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:40 brehaut: ,(with-redefs [println (comp println reverse)] (println "hi"))

15:40 clojurebot: (i h)

15:40 brehaut: bah

15:41 `fogus: ,(with-redefs [println (comp println #(apply str %) reverse))

15:41 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>

15:42 `fogus: ,(with-redefs [println (comp println #(apply str %) reverse)))

15:42 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>

15:42 TimMc: magnars: System/getProperty is a static method, not a clojure var

15:42 `fogus: ,(with-redefs [println (comp println #(apply str %)] (println "hi"))

15:42 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: ]>

15:42 `fogus: i suck

15:42 TimMc: defs make vars, refefs remake vars

15:42 Bronsa: ,(with-redefs [println (comp println #(apply str %))] (println "hi"))

15:42 clojurebot: hi

15:42 `fogus: thank you

15:43 brehaut: haha not quite

15:43 ,(with-redefs [println (comp println #(apply str %) reverse)] (println "hi"))

15:43 clojurebot: ih

15:44 `fogus: I clearly need to go back to C++

15:44 magnars: TimMc: yes, that makes sense, thanks - I'm just trying stuff out with an eager optimism :) clojure makes me happy

15:44 brehaut: `fogus: because you want the entire programming experience to be reversed?

15:44 Raynes: `fogus: I'll alert the men of your newly acquired suck.

15:45 `fogus: Raynes: More wedgies for me. :-(

15:45 fliebel: What is happening to pods?

15:46 brehaut: i've seen Boost template compiler errors. thats the digital equivalent of wedgie

15:46 amalloy: they're being put behind an invisible wall and mutated before being revealed in a finished state, fliebel

15:47 jodaro: brehaut: totally.

15:47 fliebel: amalloy: You mean some big brains are still thinking about them, and then they will magically appear in Clojure 1.4 or 1.5?

15:47 jodaro: a wedgie and a purple nurple

15:47 amalloy: well, i was kinda making a joke about what pods are

15:49 fliebel: I realized they would be pretty neat for writing games in Clojure.

15:49 mdeboard: ,((comp + -) 2 1)

15:50 clojurebot: 1

15:51 sritchie: technomancy, do you have advice on how to debug this? java.util.zip.ZipException: error in opening zip file

15:51 it's coming form extract-native-deps

15:51 brehaut: mdeboard: unary plus is the identity operation on numbers

15:51 sritchie: oh, I bet I know why

15:52 mdeboard: oh :(

15:52 fliebel: &(+ -1)

15:52 lazybot: ⇒ -1

15:52 brehaut: mdeboard: 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:53 mdeboard: Huh

15:53 Interesting

15:53 Thanks for that surprisingly articulate explanation for something I was doing on a lark

15:53 brehaut: no problem :)

15:54 you get to be a bit more magical if you start composing juxt and knit funcs (knit is from useful)

15:54 or alternatively if you switch over to using arrows (with say conduit) but thats a smidge more complicated

15:56 fliebel: No pods on the mailinglist, no pods on IRC, no pods on dev.clojure... a little pods on blip. sad world.

15:56 m0smith: amalloy: are you interested in pursuing rseqable strings and whatnot?

15:58 mdeboard: brehaut: I only just started getting into comp, juxt, and so forth over the weekend when I had a 4clojure marathon

15:59 brehaut: im pretty sure you get to join a secret order now

15:59 mdeboard: OMG YES

15:59 I DID solve problem 53, nbg

15:59 nbd*

16:00 amalloy: m0smith: if you want to do it, go ahead

16:01 m0smith: Actually I had some thoughts but I was interested on what you were thinking

16:02 amalloy: meh. just add clojure.lang.RT/rseqFrom that mirrors clojure.lang.RT/seqFrom

16:03 and then have clojure.core/rseq forward to that

16:04 m0smith: I also liked your thought of making anything Counted and Indexed as Reversible as well

16:06 Making the APersistentVector$RSeq more general purpose should do the trick

16:09 amalloy: oh yeah, i forgot about that. what a clever idea

16:17 m0smith: I think it would be a good enhancement ie rseq should mirror seq as far as possible

16:19 technomancy: sritchie: 1.x or 2?

16:19 sritchie: turns out it was my fault, I borked a pom

16:20 tmciver: ugh, 4clojure captures Ctl-L for line number goto.

16:20 sritchie: technomancy: thanks for checking back :) I did find an issue with regexes and symbols in the :aot value

16:20 filed a ticket

16:20 technomancy: yup, saw that

16:21 probably won't get to it myself by the 2.0 preview but would be happy to get a patch

16:23 amalloy: tmciver: i turned off the javascript input box entirely

16:23 hate those keyboard "shortcuts"

16:24 Raynes: That ace stuff isn't very helpful.

16:24 ibdknox|away: my experience with codemirror has been really good

16:25 Raynes: Huh. I've never heard of this.

16:25 Perhaps this could be added to RefHeap.

16:25 ibdknox|away: it was far easier to use than Ace

16:26 aperiodic: (half an hour late) I used juxt for the first time the other day

16:26 it was awesome

16:26 Raynes: So you're… wait for it… nuts for juxt!?!?!!??!1!11!??

16:26 lazybot: Raynes: Definitely not.

16:27 aperiodic: coocoo for juxt-o-puffs

16:27 tmciver: amalloy: you turned if off on the live 4clojure site?

16:27 amalloy: in my preferences

16:28 http://www.4clojure.com/settings

16:28 tmciver: Ah

16:28 Raynes: tmciver: You'd have to work much harder to get him to actually make a commit to the website.

16:28 callen: amalloy: ooh, thank you for making me aware of them

16:28 Somelauw: Huh, how to reverse a lazy seq?

16:28 tmciver: I wasn't logged in. Personally I'd prefer that feature wasn't there at all.

16:29 callen: amalloy: I'm usually experimenting my repl and then copy-pasta into that input box, so the js stuff is irritating.

16:29 Raynes: &(reverse (range 10))

16:29 lazybot: ⇒ (9 8 7 6 5 4 3 2 1 0)

16:29 mdeboard: &(reverse (take-while (partial > 10) (range 10)))

16:29 lazybot: ⇒ (9 8 7 6 5 4 3 2 1 0)

16:29 mdeboard: lol

16:30 &(reverse (take-while (partial > 10) (iterate inc 0)))

16:30 lazybot: ⇒ (9 8 7 6 5 4 3 2 1 0)

16:30 Somelauw: , (reverse '(3 4 5))

16:30 clojurebot: (5 4 3)

16:31 mdeboard: &(reduce * (reverse (take-while (partial > 10) (iterate inc 0))))

16:31 lazybot: ⇒ 0

16:31 Somelauw: Oh, wait. It didn't work for me because I globally imported something that overwrites reverse.

16:31 mdeboard: &(reduce * (reverse (take-while (partial > 10) (iterate inc 1))))

16:31 lazybot: ⇒ 362880

16:31 Somelauw: in the repl

16:33 amalloy: Somelauw: stop typing (use 'clojure.string) :P

16:34 Somelauw: amalloy: Yes, it was clojure.string.

16:34 That's exactly what I did.

16:44 hagna: ok this is weird C-c C-k in emacs compiles with no warnings but lein compile fails with a null pointer exception

16:45 juhu_chapa: is there a way to remove warnings like the following? Reflection warning, file.clj:23 - call to split can't be resolved.

16:46 brehaut: juhu_chapa: type hints

16:46 (.split ^String s " ") for instance

16:47 tjgillies: when 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:48 juhu_chapa: brehaut: thank you, let me see.

16:49 brehaut: tjgillies: any reason for polarity being strings rather than keywords?

16:50 tjgillies: brehaut: because im a noob and i didn't think of it until you said that

16:50 brehaut: aha :)

16:51 TimMc: tjgillies: You should be using a lot more "when" instead of "cond"

16:52 tjgillies: "for" is lazy

16:52 tjgillies: TimMc: i haven't learned when yet, cond is all i know

16:53 brehaut: ,(map #(when % %) [true false nil 1 2 "hello"])

16:53 clojurebot: (true nil nil 1 2 ...)

16:54 tjgillies: TimMc: floop is increasing the values of my neurons but its not prinlning when they reach 5

16:54 printlning

16:54 brehaut: ,(let [n {:polarity :+}] (case (:polarity n) :+ "positive" :- "negative"))

16:54 clojurebot: "positive"

16:54 brehaut: tjgillies: ^

16:54 tjgillies: brehaut: thnx

16:55 brehaut: case is a special case of condp which is a special case of cond

16:55 tjgillies: heh

16:55 brehaut: ,(let [n {:polarity :+}] (condp = (:polarity n) :+ "positive" :- "negative")) ; eg

16:55 clojurebot: "positive"

16:56 brehaut: and when is a special case of if

16:56 tjgillies: i haven't learned condp yet either

16:56 brehaut: as is when-not

16:56 tjgillies: if your test predicate is consistent across all your cond clauses, then you can use condp

16:57 tjgillies: ok

16:57 brehaut: if your condp predicate is = then you can use case

16:57 tjgillies: thnx

16:58 brehaut: tjgillies: you could also hoist your cond out of the doseq

16:58 aperiodic: brehaut: not necessarily; case only accepts compile-time literals as tests

16:58 brehaut: aperiodic: ah good catch

16:59 jsabeaudry: Anyone aware of a CRC-CCITT algorithm in clojure?

16:59 aperiodic: brehaut: that's bitten me before :)

17:00 TimMc: In case, 'foo becomes (quote foo) which is interpreted as (list 'quote 'foo)

17:01 (a list of possible matches)

17:02 hagna: my bad I thought emacs slime mode compile was the same as lein compile, but it isn't

17:04 pjb3: Question for anyone that has used any of the various clojure redis libraries that wrap jedis

17:04 Is it possible to specify the initial database you want it to use?

17:04 Seems like it will always default to 0

17:04 and there's no way in a config to say start with 1 or 2, etc.

17:05 you would have to just call the select command after it's made the connection

17:08 that seems to be what the ruby library does

17:08 https://github.com/ezmobius/redis-rb/blob/master/lib/redis/client.rb#L26

17:13 ah, looks like redis-clojure actually does it

17:13 di-csuehs: What 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:15 aperiodic: di-csuehs: as far is I know, the dev team is teaming up with leiningen, but I don't think Cake itself is

17:15 aidy: Does 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:15 TimMc: aidy: do

17:16 aidy: TimMc: thanks!

17:17 AimHere: ,(loop [] (println "spam") (recur))

17:17 TimMc: aidy: http://clojure.org/special_forms

17:17 clojurebot: Execution Timed Out

17:17 _phil: hey whats a better way of doing (if (k layout) (conj a k) a)?

17:19 or more specifically (reduce (fn [a k] (if (k layout) (conj a k) a)) [] sorted-keys)

17:19 amalloy: (filter #(% layout) sorted-keys)?

17:19 ibdknox|away: (filter {:a true :b false :c true} [:a :b :c :d])

17:20 amalloy: or just filter layout, if layout/k are actually a map/keys; it's not a strictly accurate converstion if they're something else

17:20 nishant_: 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:22 TimMc: nishant_: Oh, I didn't understand the "META - ." in your question before. For future reference, M-. is a more standard way of writing it.

17:22 (but I'm not familiar with SLIME, so I'm no help beyond that)

17:22 nishant_: TimMc: Thanks

17:24 tmciver: nishant_: 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 _phil: amalloy: god, it seems so obvious now :)

17:24 thanks!

17:24 nishant_: tmciver:doing M-. on a namespace's name usually takes me to the source file where that namespace is defined

17:25 tmciver: nishant_: hmm, https://github.com/technomancy/swank-clojure says that it jumps to the definition of a var, is a namespace a var?

17:25 I don't think so

17:28 nishant_: tmciver: I think not, but I've used this feature in the past. It works.

17:29 tmciver: In fact, I have another clojure project, where I am able to use it even now.

17:29 stuartsierra: tmciver: a Var is a globally-visible definition, it has a namespace and a name.

17:29 technomancy: it should work on namespaces too, but that's a newer feature and not as well-tested

17:30 jsabeaudry: Any elegant way of transforming a byte array in a bit array?

17:30 nishant_: 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:31 amalloy: it's not a class

17:32 technomancy: amalloy: does this still occur in the 1.7.0 release? https://github.com/technomancy/leiningen/issues/393

17:32 amalloy: and require finds it because it doesn't look for a class

17:42 nishant_: amalloy:Thanks

17:43 technomancy: emezeske: interested in your input on https://github.com/technomancy/leiningen/issues/421 if you have a moment

17:45 emezeske: technomancy: I can't speak for the level of chaos it will bring, but I think it's a good idea otherwise

17:45 technomancy: emezeske: yeah, that's my only hesitation =\

17:45 emezeske: technomancy: I felt awkward writing :source-path ["more" "than" "one"]

17:45 technomancy: emezeske: but on the other hand, strings->vectors is already fairly chaotic

17:45 emezeske: technomancy: yeah

17:45 technomancy: so it's really only the poor folks like you who have already adapted who will feel the pain =\

17:46 emezeske: meh, I actually found out that I wasn't done adapting cljsbuild last night, so I have more to do anyway :)

17:46 technomancy: ok, cool =)

17:46 I have 421 implemented on a branch; will probably merge it soon.

17:46 shall I give you a heads up once it lands?

17:47 emezeske: def. :)

17:47 Raynes: mos def

17:47 technomancy: will do

17:47 TimMc: jsabeaudry: By bit array, do you mean a BitSet?

17:51 lnostdal: gen-and-load-class is missing from 1.3? .. i'm following some wikipage on user-defined exceptions

17:59 pjb3: redis-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:00 I get that the idea is to take care of opening and then closing the connection when done

18:00 but for some programs, you don't want to do that

18:01 you want to open one connection to redis when the program starts, and just use that one connection for the life of the process

18:01 of course you can wrap your whole main function in a call like redis/with-server

18:02 TimMc: That sounds like the right solution.

18:02 pjb3: but stylistically I don't like that

18:02 TimMc: Why?

18:02 clojurebot: TimMc: because you can't handle the truth!

18:02 TimMc: >_<

18:02 pjb3: because I want to write a namespace of functions

18:02 tmciver: ha!

18:02 pjb3: that abstract away the notion of redis

18:02 and that namespace can take care of instantiating that connection

18:02 hiredman: pjb3: and your namespace has a with-storage macro

18:03 pjb3: hiredman: ?

18:03 TimMc: pjb3: Make one of those a wrapper for with-server

18:03 pjb3: but then that has to open/close the connection on every call

18:03 TimMc: that's what hiredman is suggesting

18:03 pjb3: I want to do

18:03 hiredman: pjb3: it doesn't

18:04 TimMc: pjb3: You still wrap your main fn, but with your own macro.

18:04 pjb3: hiredman: oh, how does it work then?

18:04 hiredman: the real problem is a lot of things like with-server etc don't account for retries and connection errors etc

18:04 pjb3: I would like to do

18:04 (ns scoring)

18:04 (def connection (redis/make-connection { … } ))

18:04 hiredman: bleh

18:05 a top level def like that for a connection is almost always a mistake

18:05 pjb3: (defn add-score [person value] (redis/set person value))

18:05 hiredman: why

18:05 now, callers of my function can just do

18:05 (add-score "x" 42)

18:05 hiredman: because what happens when the connection dies? who has resonsibility for closing it?

18:06 pjb3: it never closes

18:06 hiredman: it is a resource without a livecycle

18:06 pjb3: if it dies, the process dies

18:06 hiredman: pjb3: when you close your app?

18:06 pjb3: nothing

18:06 hiredman: lifecycle

18:07 pjb3: I 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:07 I understand you might not always want that, but I think there are cases where that makes sense

18:08 but 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:08 I think I have to do either

18:09 TimMc: pjb3: I told you, your API demands that everything be wrapped in a certain macro it provides.

18:09 pjb3: (redis/with-server {} (add-score "x" 42))

18:09 or

18:09 (with-scoring (add-score "x" 42))

18:09 mylesb: technomancy: are the instructions for getting syntax highlighting in a repl buffer here: https://github.com/technomancy/swank-clojure still current?

18:10 technomancy: mylesb: as far as I know, but I don't use them myself

18:10 pjb3: TimMc: Well, my API is forced to do that because of the design of redis-clojure

18:11 mylesb: technomancy: is your repl uncolored or do you do something else?

18:11 technomancy: I don't have coloring in my repl

18:11 I guess I should set that up

18:24 muhoo: heh HAS_JOSH_K_SEAL_OF_APPROVAL=true

18:26 callen: technomancy: weird, you don't?

18:26 technomancy: you're like the power user to end all power users, hahaha.

18:28 amalloy: technomancy's hidden shame: he sometimes uses the mouse

18:28 technomancy: amalloy: calumny!

18:28 amalloy: $dict calumny

18:28 lazybot: amalloy: noun: A false statement maliciously made to injure another's reputation.

18:28 technomancy: callen: I had paredit on in the repl for a while

18:29 callen: technomancy: I've been writing lisps/schemes of various sorts in emacs for so long that I never got acclimated to paredit

18:29 technomancy: I've been attempting to get accustomed to it for...gods, since like Emacs 21 or something. can't do it.

18:29 technomancy: you just have to believe in yourself

18:29 callen: don't believe in yourself, believe in me, who believes in you.

18:30 I'm just used to relying on indentation to demonstrate structure and I edit it that way.

18:30 technomancy: that 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:30 muhoo: what'd be the clojure equivalent to something like this: http://www.phantomjs.org/

18:31 emezeske: muhoo: I'm not sure there is one. There's Rhino, but it just interprets JS, it doesn't provide a whole browser environment

18:31 callen: blah, I'll try it again, fine fine.

19:03 devn: callen: 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:03 callen: my problem is that it fucks with me when I'm trying to indent.

19:03 devn: callen: 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:03 clojurebot: c'est bon!

19:03 callen: I'll see if I can settle into a pattern.

19:03 devn: Do you indent by hand? I just hit tab.

19:05 I 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:06 technomancy: M-^ is such an awful binding for a really useful command

19:06 aperiodic: technomancy: paredit in the repl? does that rely on emacs?

19:06 cause if not, how do i set that up?

19:06 callen: devn: I don't indent by hand.

19:06 devn: you'd have to see me fighting paredit to know what I'm talking about.

19:06 technomancy: aperiodic: it does

19:07 aperiodic: blast

19:07 technomancy: callen: is it when you're adding comments?

19:08 callen: technomancy: or when I'm trying to break an outer paren to the next line to start the next form.

19:10 amalloy: what on earth, M-^

19:10 callen: amalloy: ?

19:10 amalloy: i've never used it, or knew about it

19:11 and it seems like a crazy keybinding for anything useful

19:11 technomancy: amalloy: yeah! I didn't notice it for like five years

19:11 I couldn't start using it till I rebound it to C-c q

19:11 amalloy: i can see how it might be useful. i'm pretty sure i've been regularly doing stuff with the same intent, but badly

19:12 hiredman: I M-^ all the time

19:12 jjcomer: I'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:12 technomancy: do you need snippets for clojure?

19:12 write a macro =D

19:13 hiredman: I had yasnippets turned on for clojure for a day or two

19:13 jjcomer: technomancy: lol

19:13 hiredman: meh

19:14 jjcomer: It sounds like it might not be worth the effort to fix :)

19:14 amalloy: the 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:14 jjcomer: amalloy: the lol was more of a touche

19:15 ibdknox|away: there are occasionally times when I'd want a snippet

19:16 writing ns forms is one

19:17 scottj: tests is another. snippets work better than macros when editing other people's projects.

19:17 ibdknox|away: yeah tests were another one I was thinking about

19:17 scottj: (some snippets work better than some macros rather)

19:17 hiredman: I rather clojure-mode developed some smarts for ns forms

19:18 technomancy: yeah, ns forms are specific enough that you'd want a dedicated defun for it

19:19 not 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:19 hiredman: technomancy: did you see https://gist.github.com/1880975? gives you a buffer narrowed to specific function with a nicer buffer name

19:20 * scottj uses yasnippet with clojure. link to breakage?

19:20 technomancy: hiredman: cool; so your edits propagate back to the source?

19:20 that's nifty

19:20 hiredman: yeah

19:20 technomancy: sometimes I'll C-x 2 to have 2 windows on the same buffer, but that looks better

19:20 hiredman: I am not totally sold on it though, needs some field testing

19:21 technomancy: scottj: jjcomer mentioned it above

19:24 scottj: jjcomer: I use yasnippets w/ clojure. not doing anything special.

19:25 callen: ditto.

19:25 It's not really for generating code such as you would write a macro for though.

19:25 I use it for quickie-shims for extraneous stuff like my tests.

19:28 jjcomer: scottj: thanks, I will inspect my configurations, there must be something conflicting

19:29 scottj: jjcomer: are you using autocomplete to use your yasnippets? if so, could be that your not setting your ac-sources correctly

19:32 jjcomer: scottj: I'm not using autocomplete (probably should be though)

19:34 muhoo: i'm think i'm weird or maybe old-skool that i prefer #(keyword (.toLowerCase (name %))) to (comp keyword #(.toLowerCase %) name)

19:34 it does tend to get a little crazy with the )))'s tho

19:35 brehaut: if you have to define an anon fn anyway, comp is often extravagant

19:35 clojurebot: Pardon?

19:35 technomancy: agreed; I only comp/partial when it's 2 or more existing functions

19:37 muhoo: i could see (apply comp list-of-stuff-to-do) being useful though, or scary

19:38 ibdknox|away: I would thread that though

19:38 amalloy: ibdknox|away: ...apply? you would thread a runtime list at compile-time?

19:39 ibdknox|away: no, his original

19:39 :p

19:39 amalloy: i guess that does make more sense, doesn't it

19:39 ibdknox|away: I promise I'm only half-stupid ;)

19:50 lynaghk``: ibdknox or dnolen, you guys around? I have a clj<->cljs design question.

20:04 ibdknox|away: lynaghk``: sup?

20:04 lynaghk``: yo

20:05 ibdknox|away: the stuff you sent looks awesome. I haven't had time to dig in quite yet

20:05 lynaghk``: So I'm thinking about how to structure C2 on the serverside

20:05 ibdknox|away: k

20:05 lynaghk``: In cljs, it manipulates the DOM. In CLJ, I'd like to keep as much of the code the same as possible

20:05 ibdknox|away: for the same graphic?

20:06 lynaghk``: maybe even to the point of putting together another "dom" namespace that fakes a dom using atoms or some such

20:06 the calling code, definitely

20:06 but also the library code itself.

20:06 ibdknox|away: hm

20:06 that strikes me as a blackhole problem

20:07 lynaghk``: as in, one from which no information can escape?

20:07 ibdknox|away: people are always going to use it in ways you wouldn't expect

20:07 and so you will never be able to adequately model a subset of the dom

20:07 you'd have to model SVG too, right?

20:07 lynaghk``: 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:08 ibdknox|away: right

20:08 oh

20:08 lynaghk``: it's not actually tied into anything about DOM nodes themselves.

20:08 ibdknox|away: you mean render it as html still?

20:08 totally misunderstood

20:08 lynaghk``: yeah. The entire library is just a declarative way to map data to a dom tree.

20:08 ibdknox|away: got it. And then you'll have something else that turns html to a picture or some such?

20:08 lynaghk``: oh, yeah, definitely not interested in making something like node's domenv or PhantomJS or anything.

20:09 yeah

20:09 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:10 ibdknox|away: so is the question how do you efficiently modify a giant hiccup structure?

20:10 lynaghk``: 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:10 ibdknox|away: right

20:11 lynaghk``: 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:11 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:12 ibdknox|away: the former would be more efficient speed-wise

20:12 I would assume

20:13 alternatively, have unify! return the result

20:13 lynaghk``: I'm not so sure; I wouldn't be surprised if (map) ended up faster than (doseq [] bang bang bang)

20:13 ibdknox|away: which on the client would be a dom node but doesn't get used

20:14 lynaghk``: I thought about that briefly, but I think cljs needs to be destructive as much as possible for speed reasons

20:14 ibdknox|away: it still would be, you wouldn't use the return on the client, just on the server

20:15 lynaghk``: so I'd have to fork the code then.

20:15 that might be the best solution, actually. Just have a destructive and non-destructive version of the same function.

20:15 ibdknox|away: I think that'd probably be best

20:16 lynaghk``: Okay, rad. Thanks for the suggestions.

20:16 ibdknox|away: btw, 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:17 side-effecty

20:17 lynaghk``: on the server it'd return the clj representation which is a hiccup structure

20:17 lynaghk``: I think they'd have to be separate functions though

20:18 ibdknox|away: implementation-wise, yes they should be

20:18 but as a consumer

20:18 it's all just unify

20:19 lynaghk``: potentially relevant: https://github.com/davidsantiago/tinsel

20:19 hiccup + css selectors

20:19 lynaghk``: hmm

20:20 I don't think there is any reason to use CSS selectors on the serverside.

20:22 ibdknox|away: depends on how serious you want to be about write once (I personally, wouldn't go down that whole too far)

20:22 hole*

20:22 lynaghk``: Yeah, I agree with you there. Luckily, most of the problems this library solves are very data-oriented

20:23 very little to do with browsers, events, &c.

20:23 ibdknox|away: yep

20:23 lynaghk``: I'll take a crack at a JVM implementation of unify later tonight

20:23 ibdknox|away: let me know how it goes :)

20:23 lynaghk``: then maybe start prodding at cljsbuild's "crossover" stuff and then keep the actual .cljs as small as possible.

20:23 will do, have a rad evening.

20:37 technomancy: emezeske: the plural-paths thing is in leiningen master now

20:37 emezeske: technomancy: thanks for the heads-up!

20:37 technomancy: also sent in a pull request that's not really 2.x related

20:40 emezeske: technomancy: yeah, I saw that, thanks! Hopefully I can merge it later tonight

20:40 technomancy: anyone else want to help test with lein2?

20:40 particularly if you have a large and complicated project.clj file

20:40 or are one of the plugin maintainers whose projects I haven't sent pull requests to in the last 24 hours =)

20:42 bsteuber: technomancy: what's new in 2?

20:43 technomancy: bsteuber: oh man; where do I start?

20:43 brehaut: unicorns

20:43 and rainbows

20:43 technomancy: there are about 300 lines of code that are not new in lein 2

20:43 mainly it's profiles though

20:44 bsteuber: wow

20:44 technomancy: clojurebot: profiles in clj-http is https://gist.github.com/1846759 an example of the profiles feature in Leiningen 2

20:44 clojurebot: Ack. Ack.

20:44 technomancy: check that one out

20:45 bsteuber: cool

20:45 any interesting architectural changes?

20:45 besides that

20:46 technomancy: there's better leiningen/project isolation

20:46 you can have aliases perform partial application

20:46 leiningen-core is a library now

20:47 brehaut: reply!

20:47 technomancy: oh yeah

20:47 that's the best!

20:47 the new repl is great

20:47 brehaut: fantastic even

20:47 Wraithan: So, 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:47 bsteuber: ok I have to try :)

20:48 technomancy: bsteuber: clone the master branch and check the "building" section at the bottom of the readme

20:48 * technomancy should populate NEWS.md

20:50 brehaut: technomancy: its getting announced at clj/w right?

20:50 technomancy: brehaut: yeah, just want to make sure it's a smooth transition

20:50 especially with plugins

20:51 brehaut: sure :)

20:51 technomancy: don't want to make this another clojure 1.3

20:51 ibdknox|away: technomancy: what was wrong with 1.3? ;)

20:51 technomancy: heh

20:51 yes

20:51 well

20:52 you know

20:54 bsteuber: so what about the repl?

20:54 can it replace emacs yet? :)

20:55 technomancy: heh... no, the excitement about the new repl is mostly limited to non-emacs-users

20:55 aperiodic: what's new?

20:55 brehaut: it doesnt suck ;)

20:55 technomancy: the main thing is jline2 and completion

20:56 aperiodic: woo, completion!

20:56 brehaut: built in clojuredocs support too

20:56 bsteuber: had older checkout and symlink already in place, so "installing" wasn't that hard :)

20:56 nice

20:56 technomancy: bsteuber: 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:56 bsteuber: what does jline2?

20:57 sure did that when I had troubles once

20:57 brehaut: the biggest change is that it does garble the crap out of long lines

20:58 technomancy: it actually understands unicode

20:58 and acts like readline

20:59 aperiodic: brehaut: 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:59 brehaut: yeah

20:59 aperiodic: i already get readline features in the lein repl... what's different about jline2?

20:59 brehaut: aperiodic: obviously the doc macro is still available

20:59 arohner: /join #resque

20:59 bsteuber: how do I trigger completion?

20:59 cemerick: bsteuber: tab

21:00 bsteuber: weird

21:00 brehaut: aperiodic: the big difference is that clojuredocs have examples

21:00 cemerick: bsteuber: also, the REPL in lein2 is nREPL, which is shared by ccw, jark, and (soon to be) vimclojure

21:00 * cemerick still has hope that someone will write a bridge for swank/SLIME

21:01 bsteuber: I still hope getting rid of emacs one day :)

21:01 aperiodic: brehaut: that doesn't seem like a huge help to me, but maybe i'll change my tune after i try it

21:01 Wraithan: <3 emcs.

21:02 emacs.

21:02 cemerick: bsteuber: ccw is getting lein support in the very near future, FWIW

21:02 TimMc: bsteuber: And use vim, or what?

21:02 brehaut: aperiodic: 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:03 technomancy: aperiodic: rlwrap doesn't do live completion

21:03 cemerick: one of these days I'll have to take a look at that

21:03 bsteuber: ah I wasn't in master lol

21:03 cemerick: technomancy: it's going to be hard. Lots of emacsisms baked into the protocol.

21:04 bsteuber: some old stuff I played around with

21:04 technomancy: cemerick: I meant ccw

21:04 I'd rather leave the swank stuff to someone else

21:04 bsteuber: yes heard about ccw making good progress

21:04 brehaut: cemerick: im really looking forward to lein in ccw

21:05 bsteuber: though I still kind of hate eclipse

21:05 well for java it is great

21:05 but still :)

21:05 so dunno

21:05 devn: hm, my completion works in the repl, but not in my source buffer

21:05 any ideas?

21:05 bsteuber: may cljmacs

21:05 or cljsmacs

21:06 github with js live simultan editor would be nice

21:06 +ous

21:06 devn: I hope clooj continues to grow

21:06 i would love a Racket-esque editor for clojure

21:06 cemerick: technomancy: oh, hah

21:06 devn: Dr. Racket, that is

21:06 cemerick: that'll be the day ;-)

21:06 devn: what would make something Racket-esque?

21:06 devn: the debug mode for one

21:06 cemerick: 'course, I'm using vim these days, so who knows

21:07 ibdknox|away: cemerick: how's that going?

21:07 devn: the arrows drawn when you hover a variable

21:07 those sorts of things

21:07 cemerick: ah

21:07 technomancy: cemerick: just so I can relate to the Heroku Java team a bit

21:07 cemerick: devn: stuff like that actually isn't too far away

21:08 ibdknox|away: not bad. I think I'm safely committed to it for life as my general-purpose editor.

21:08 ibdknox|away: it'd be pretty easy to do in cljs

21:08 devn: cemerick: *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:08 ibdknox|away: the hard part is doing all the anlysis

21:08 once someone has that done, building a nice editor shouldn't be *too* difficult

21:08 cemerick: technomancy: well, Java is…Java. :-P

21:09 devn: I think clooj + some fancy clojure "explorer"-like tools in one nice, dead simple, packaged environment

21:09 will be a huge win for clojure in general

21:09 ibdknox|away: devn: how about that online ;)

21:09 devn: ibdknox|away: im not opposed!

21:09 * cemerick assumes a sufficiently-smart analyzer won't materialize

21:09 aperiodic: technomancy: do you know if lein-daemon has been tested with lein2?

21:09 devn: cemerick: yes, but with an attitude like that, who could have predicted ambrose?! :)

21:10 ibdknox|away: cemerick: someone would have to care a lot

21:10 devn: i have to say that i'

21:10 i'm optimistic on these fronts

21:10 i 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:10 cemerick: devn: 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:11 devn: cemerick: 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:11 it happens is all im saying

21:12 bsteuber: ibdknox|away: yes once all basic stuff is in a library the actual editor can be simple

21:12 maybe even just inside goog.editor with rich text feeling if you like it

21:12 no pun intended

21:13 arohner: aperiodic: I can tell you lein-daemon has not been tested w/ lein2 yet

21:13 * cemerick is taking bets on how long until goog.* is abandoned

21:13 bsteuber: cemerick: why that?

21:13 instead of wrapped, I mean

21:14 aperiodic: arohner: righto, thanks

21:14 cemerick: bsteuber: oh, I don't mean abandoned by cljs; I mean shuttered by google

21:15 bsteuber: ah

21:17 anything pointing in that direction, besides general google trends?

21:17 arohner: aperiodic: patch welcome for lein-daemon btw. I'll get back to maintaining it soon, I promise :-)

21:18 cemerick: bsteuber: not really; insofar as they hedge their bets, so shall I

21:18 aperiodic: arohner: yeah, if i have a few hours i'll definitely look into it, but no promises

21:19 cemerick: It's especially tough to keep a straight face when they toss dart and NaCl out there.

21:21 callen: what is the *deal* with Dart anyway?

21:21 CoffeeScript I can at least make a case for, Dart is totally left-field.

21:22 cemerick: Not sure anyone knows.

21:24 ibdknox|away: what's your take on dart, anyway? Not sure I've heard you say anything on it.

21:25 callen: that's the thing, I haven't heard anyone make a serious case for Dart that's not being paid to say so.

21:25 echo-area: Does 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:26 (for a Ref object)

21:34 bsteuber: the repl is great

21:35 callen: man. Korma looks amazing.

21:35 Anyone have any experience with Korma?

21:35 brehaut: callen: i think ibdknox|away has had a litle

21:39 arohner: does 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:39 there was a blog post about it? called chronos or something like that

21:39 brehaut: monotonic or something?

21:40 arohner: brehaut: yes! https://github.com/aredington/monotony

21:40 thank you

21:40 brehaut: no problem. there was a conj lightening talk about it i think

21:43 arohner: though it makes me nervous that it's not based on joda or jsr310

21:44 cemerick: technomancy: exit and abort want to be in a core.misc ns; I need abort in project. Yea or nay?

21:44 bah

21:45 brehaut: arohner: that also worried me

21:55 ibdknox|away: callen: brehaut: a tad, I guess

21:56 :)

21:57 sritchie: do you guys remember an announcement on the clojure list about a library that dealt with infinite sequences of time intervals?

21:57 I remember this great demo

21:57 of time intervals as streams

21:57 brehaut: sritchie:monotony

21:57 https://github.com/aredington/monotony

21:58 sritchie: awesome, thanks, man

21:58 brehaut: arohner had just found it :)

21:59 sritchie: hadoop data at twitter is bucketed in all of these wacky intervals --

22:00 a monotony stream + a clj-time formatting parser gives me all I need to grab logs in arbitrarily complex patterns

22:00 brehaut: except that montony uses java.util.Date :/

22:01 callen: ibdknox|away: what was your experience?

22:01 brehaut: callen: he wrote it ;)

22:01 ibdknox|away: haha

22:01 sritchie: just a format string, then, I can deal

22:01 callen: fml.

22:01 ibdknox|away: how many edge-cases in schema are covered, like that many-to-many on the mailing list?

22:02 ibdknox|away: is it a pure query generator, or is it closer to a full-blown ORM?

22:02 ibdknox|away: the former

22:02 callen: ibdknox|away: then why do you have to define your schema?

22:03 ibdknox|away: you don't have to :)

22:03 callen: ibdknox|away: oh, I'll do that then.

22:03 ibdknox|away: thx thx.

22:03 ibdknox|away: I just wanted a clean way to do SQL queries and parameterization.

22:03 ibdknox|away: the rest is there for convenience so you don't have to write all the joins all the time and such

22:03 korma should fit you perfectly then :)

22:05 callen: ibdknox|away: SQLAlchemy, Django ORM, and ActiveRecord all made me lose my faith in ORMs. I'd rather just think in SQL.

22:05 ibdknox|away: yep

22:05 I've written 3 :)

22:05 heh

22:05 callen: it's not like set theory is all that alien.

22:05 ibdknox|away: so I imagine you've bumped into the same ridiculous pain that I have.

22:05 spending more time working around artifice than being productive, etc.

22:06 ibdknox|away: hence korma :)

22:06 callen: ibdknox|away: thanks for making it.

22:06 ibdknox|away: Quite welcome!

22:14 jimduey: I 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:15 callen: jimduey: defentity?

22:16 jimduey: No. ibdknox|away had some speculative stuff in once that let you specify columns and stuff.

22:17 And then you could do a create operation to build the tables.

22:17 callen: maybe he learned the error of his ways.

22:17 jimduey: At least that's what I thought I saw.

22:17 callen: that is the dark path! ;_;

22:17 jimduey: :) Yeah, but I NEEEEED it.

22:17 callen: noooooooo

22:17 jimduey: haha :P

22:41 TimMc: I'm so old-fashioned.

22:41 ibdknox|away: jimduey: it's in korma.incubator now :) https://github.com/ibdknox/korma.incubator

22:41 TimMc: I write up an honest-to-goodness database schema documentation file, then code to that.

22:42 None of this self-documenting code you youngsters are snorting these days.

22:42 ibdknox|away: TimMc: it's a high you've never experienced ;)

22:43 TimMc: clojurebot: you kids is <reply>Get off my lawn!

22:44 callen: TimMc: luckily my code doesn't turn into gobbledegook, so it's not a bad blueprint to by.

22:44 clojurebot: Ik begrijp

22:44 callen: Hrm.

22:44 ibdknox|away: lol

22:44 callen: clojurebot appears to has lost its marbles.

22:44 ibdknox|away: ~you kids

22:44 clojurebot: Get off my lawn!

22:44 TimMc: clojurebot: kids these days is <reply>Get off my lawn!

22:44 clojurebot: You don't have to tell me twice.

22:44 TimMc: for good measure

22:45 dgrnbrg: Is 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:46 TimMc: dgrnbrg: Not entirely clear on what you want, but have you tried lein trampoline test?

22:46 dgrnbrg: I'd like to reduce the startup time of lein

22:46 TimMc: Oh, that won't do it!

22:46 dgrnbrg: I know

22:47 I really want lein to run in the background

22:47 ibdknox|away: lein interactive

22:47 dgrnbrg: and some C client to throw code at the JVM with a socket

22:47 ibdknox|away: jark

22:47 dgrnbrg: like nail gun, but appserver-style isolation

22:47 TimMc: ibdknox|away: Your nick makes you less credible. If you'd lie about away-ness...

22:47 ibdknox: fine.

22:47 dgrnbrg: So I can use lein-interactive with tests while changing protocol definitions?

22:47 ibdknox: ~guards

22:47 clojurebot: SEIZE HIM!

22:48 ibdknox: nope

22:48 lol

22:48 brehaut: TimMc: you've never given me a burger, how can i trust you?

22:48 dgrnbrg: :(

22:48 TimMc: haha, what

22:48 dgrnbrg: can I write plugins for lein to automate other compilation toolchains?

22:48 ibdknox: brehaut: I see what you did there and I approve

22:48 dgrnbrg: I want to run the xilinx fpga toolchain w/ lein

22:48 brehaut: TimMc: to explain the joke would ruin it

22:48 TimMc: OK, then I get it.

22:48 brehaut: high five!

22:49 TimMc: I just wasn't sure if I was missing an outside cultural reference.

22:49 ibdknox: from us kids? :p

22:49 TimMc: (I live under an oddly shaped rock.)

22:51 dgrnbrg: You've investigated server vs. client VM?

22:51 dgrnbrg: I am specifically interested in this one technique

22:51 you can't do it faster

22:51 you run a persistent JVM

22:52 which can accept code on a socket, and loads it in an isolated classloader

22:52 and then you have another program that doesn't start a jvm send the code over to it via the socket protocol

22:52 and the other program is probably very low overhead/super fast, like C or OCaml

22:53 since the startup cost and socket transmission times dominate

22:53 then you can can run jvm applications instantly

22:53 cemerick: dgrnbrg: exactly what you're describing is fast approaching

22:53 dgrnbrg: I have seen a thing for groovy that does this

22:53 wonderful

22:53 eta?

22:53 TimMc: jark?

22:53 dgrnbrg: lol

22:53 clojurebot: jark is a clojure daemon for scripting: http://icylisper.in/jark/

22:54 cemerick: dgrnbrg: jark works now, though I think you still need to build it yourself.

22:54 dgrnbrg: lovely, that's exactly what I want

22:54 even down to the languages

22:54 lol

22:54 cemerick: Binaries will be coming very soon.

22:54 dgrnbrg: can I use jark w/ lein?

22:54 cemerick: I hear rumors of a Haskell nREPL client as well.

22:54 dgrnbrg: that's one of the few remaining sticking points.

22:54 TimMc: cemerick: nrepl still blocking?

22:54 cemerick: blocking?

22:54 TimMc: blocking jark

22:54 cemerick: nope

22:54 TimMc: nice

22:55 dgrnbrg: I really want lein test on jark

22:55 ibdknox: cemerick: I haven't really gotten it working for scripts :(

22:56 cemerick: dgrnbrg: If you want to run tests instantly, you don't need to wait for lein and jark to get together

22:56 dgrnbrg: cemerick: how can I run the tests just using jark?

22:56 cemerick: Any persistent REPL environment will do; SLIME, ccw, reply…

22:56 dgrnbrg: I know how to use $() to get the claspath from lein

22:56 if i evaluate a test file, it doesn't run the tests

22:57 cemerick: ibdknox: /me doesn't do scripts ;-)

22:57 dgrnbrg: is there something else I need to do to run the tests?

22:58 cemerick: dgrnbrg: IMO, if you're worrying about classpaths, you're probably doing it wrong.

22:58 dgrnbrg: if I wanted to start jark

22:58 since it's like jark -cp $(lein classpath) or something

22:58 TimMc: cemerick: I worry about classpaths all the time.

22:58 I worry about them in my sleep.

22:59 cemerick: TimMc: you worry too much then

22:59 TimMc: The other day, I think a classpath was following me around town.

23:00 cemerick: it probably wrapped around whole blocks and everything

23:02 TimMc: OK. 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:02 Is this hopelessly naïve and far from the truth?

23:03 brehaut: TimMc: well its certainly big…

23:03 TimMc: heh

23:03 cemerick: TimMc: that's mostly true, and why add-classpath is possible

23:04 The details are a bitch though.

23:04 TimMc: This jark stuff makes it sound like you can partition things off.

23:05 cemerick: Yeah, you can.

23:05 brehaut: TimMc: 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:06 amalloy: TimMc: when a classloader loads a class, that class is only visible in places that pay attention (somehow or other) to the aforementioned classloader

23:06 which is how that partitioning works

23:07 TimMc: Ah, they get a reference to the classes and loaders, etc.

23:07 which is how classes can get GC'd

23:08 amalloy: something like that. it's all deep magic beyond my comprehension

23:08 TimMc: Oh, I'm not even pretending to myself that I understand it.

23:09 amalloy: clojure 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:39 emezeske: technomancy: You around?

Logging service provided by n01se.net