#clojure log - Dec 02 2010

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

0:49 clizzin: what is the deal with clojure.string / clojure.contrib.string / clojure.contrib.str-utils / clojure.contrib.str-utils2? are any of these preferred over the others?

0:52 brehaut: clizzin: clojure.string is prefered over clojure.contrib in general

0:52 technomancy: the others are for pre-1.2 versions of clojure

0:52 brehaut: stuff has moved from contrib into clojure proper over time, string stuff is one of them

0:52 technomancy: only kept around for backwards compatibility

0:53 clizzin: brehaut, technomancy: great, thanks. that's what i suspected, but wanted to check. what are some examples of other libs that have moved into clojure proper over time?

0:53 i think i saw set as one of them

0:53 technomancy: duck-streams -> clojure.java.io is the main one

0:54 there's a list in th e 1.2 release notes

1:02 clizzin: whoa, that is good to know. so (line-seq (io/reader filename)) is now preferable to (duck/read-lines filename)? it seems kind of verbose.

1:04 technomancy: read-lines was never a good idea.

1:04 it was basically asking for a resource leak to do that lazily.

1:06 clizzin: would you mind explaining further? i'm not really familiar with the potential pitfalls of lazy evaluation.

1:08 technomancy: read-lines doesn't close the reader until the last line is consumed. it's easy to just discard the lazy seq of lines after getting what you need from it without realizing the whole thing

1:08 which would result in a resource leak

1:39 Bahman: Hi all!

1:44 Raynes: http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java

1:45 mengu_: lol

1:45 Raynes: that was explained

1:45 it is generated

1:45 Raynes: It's still insane.

2:09 $kill

2:09 sexpbot: KILL IT WITH FIRE!

2:27 joshua__: I love (source some-func).

2:28 Was wondering whether a function was implemented in terms of another function.. so I checked :P

2:35 Read through this article and really liked it. It is on how to use zippers: http://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip/

2:36 brehaut: joshua__: zippers are great

2:39 joshua__: the xml-> selection operator has made my week

3:20 LauJensen: Morning

3:20 lpetit: morning !

3:23 mduerksen: morning

3:25 Raynes: morning

3:47 sthuebner: morning all

4:14 bytecolor: using clojure.contrib why would I be able to require say, str-utils, but not combinatorics? NoClassDefFoundError

4:16 I'm using the forms: (require '[clojure.contrib.str-utils :as str-utils]) and (require '[clojure.contrib.combinatorics :as comb]), respectively

4:23 Also, I did not build from source. I installed clojure-contrib-1.1.0.zip

4:56 hmm, the README says I don't have to do anything, but if I run ant, it works but, the two jars written are the same size where they were not in the .zip.

4:59 * bytecolor is confused!

5:22 LauJensen: bytecolor: you might want to try clojure-contrib-1.2.0 instead. Pull it as a dependency for your project

5:49 bytecolor: LauJensen: all righty

5:50 atom_: think so

5:54 i'm so happy.. just managed to get compojure/ring and CometdServlet running in parallel on the same jetty instance

6:01 lpetit: ccw 0.2.0 RC1 publicly announced on ccw mls

6:01 Raynes: lpetit: Congratulations!

6:02 lpetit: Raynes: thanks. But to be honest, most of this release's content is cemerick's. I've just polished things, removed some regressions.

6:02 Raynes: cemerick: Congratulations...!

6:05 cemerick: lpetit: Hey, snazzy :-)

6:05 atom_: lpetit: great, thx!

6:05 * cemerick waits for the flood of bug reports ;-)

6:10 * Raynes notes that sexpbot is currently undergoing a bit of live testing of a new multi-protocol branch with twitter support, and may come and go a bit over the next hour or two.

6:14 Lajla: &(loop [x 3] recur)

6:14 sexpbot: java.lang.Exception: Unable to resolve symbol: recur in this context

6:16 Tordmor: Lajla: trying to do an infinite loop? (loop [] (recur))

6:17 Lajla: Tordmor, no

6:17 I'm trying to see if recur was a function

6:17 that could escape its original lexical environment

6:17 Tordmor: Ah, ok.

6:17 Lajla: That would be pretty cool

6:17 If you could store it in a variable

6:17 and call it at random points to jump back to the original continuation

6:19 atom_: uhm... but that wouldn't be tail recursion...

6:20 Raynes: Well, recur isn't really tail recursion.

6:21 Tordmor: Lajla: maybe iterate does what you want?

6:21 mduerksen: lpetit: where can i get ccw 0.2.0 RC1? the last version i saw (on code.google.com) was 0.0.64 - that's a huge step!

6:23 lpetit: mduerksen: since it's a Release Candidate, I spoke publicly in length about it only in ccw's mls

6:23 (they are open to anybody, though, of course)

6:23 Lajla: Raynes, recur is tail recursion, it's not tail call optimization however.

6:23 lpetit: mduerksen: details are on the release note wiki page of ccw

6:24 Lajla: Tordmor, nahh, it was just a theoretical experiment to see if recur could escape its original lexical environment

6:26 mduerksen: lpetit: thank you, i will check it out as soon as i get home from my day job ;)

6:28 cemerick: Lajla: even if recur was a function, it wouldn't carry a continuation with it.

6:28 lpetit: ok, home page of ccw update

6:28 s/update/updated/

6:30 Lajla: cemerick, what do you mean with 'carry a continuation with it'?

6:30 cemerick, you mean, 'can return a value'?

6:31 cemerick: You were hoping that you could return recur as a fn, then invoke it in order to return flow of control to the head of the loop it was within?

6:33 atom_: ...like the continue statement in Java?

6:33 cemerick: well, continue is just a goto variant

6:34 I assume Lajla was hoping that recur would allow a return to the head of the loop, even after control had escaped from that lexical context.

6:35 atom_: .. ahh ok

6:39 Lajla: cemerick, yeah

6:39 But that is not really 'carrying a continuation with it', it's just a function.

6:40 basically what recur repraesents is 'the value this loop-block would return if the variables were bound to these values'

6:40 If it was a function, at least.

6:40 cemerick: if it were to return flow of control, then that's a continuation

6:40 right

6:40 well, it's a special form :-)

6:40 Lajla: I gathered.

6:40 Too bad.

6:40 =(

6:40 cemerick: It's the only sane approach given no TCO.

6:42 Lajla: Is there a way by the way to nest multiple loops inside each other

6:42 And rebind and jump to one that is not the nearest?

6:42 cemerick: I don't think so.

6:42 There's no reason why that wouldn't be possible.

6:43 Lajla: But it's just not there?

6:43 Like, you can't 'name' your recur.

6:43 ?

6:43 cemerick: nope

6:44 it's a worthwhile feature request

6:45 atom_: why the heck does this code produce no output:

6:45 (loop [x 0] (if (= x 10) (do (println "reset") (recur 0)) (do (println x) (recur (inc x))))

6:46 btw.. i'm a clojure noob

6:47 cemerick: atom_: you're short a closing paren

6:47 atom_: ..ok.. *blush*

6:47 ..thx

6:48 Lajla: wouldn't that kind of construct solve most of your requirements?

6:49 cemerick: no, that doesn't help Lajla's use case

6:50 having to manually manage control flow sorta defeats the point

6:52 Lajla: cemerick, hmm

6:52 I can imagine that this is an implementation thing though

6:52 Like

6:52 I take it that with each loop

6:52 It makes a save of some part of memory.

6:52 Or some location

6:52 which has to be rebound

6:52 If you say that it can rebind arbitrarily far back, it has to safe every instance of loop and fn

6:53 cemerick: it's not that complicated

6:56 If I recall, recur is just setting some fields, and then continue-ing from the head of loop (for function).

7:19 Raynes: Can has stability.

7:23 cemerick: Raynes: I wonder if sexpbot (or whatever could drive the logging) could be bottled up for redistribution. I'm sure many people would be happy to run it, really ensuring that we have a comprehensive log.

7:23 Pair that with automatic uploading to e.g. S3 or SDS, hashed as necessary to avoid duplicates…

7:24 Raynes: cemerick: Yeah, I've been really lacking in real material for users since the beginning.

7:24 Lajla: cemerick, hmm

7:24 then requaest it

7:24 and I shall forever hug you

7:24 Raynes: Once I get the protocols branch stable and redesign the privilege system, the next big step is documentation and user-friendliness.

7:24 cemerick: Lajla: you mean the arbitrary loop-head recur thing?

7:25 Lajla: cemerick, yeah

7:25 that you can name it

7:26 Like (loop some-random-name [cemerick 3] (if (= 0 cemerick) "done" (some-random-name (- cemerick 1)))

7:27 cemerick: Yeah. I'd be surprised if it happens, but I'll think about it some and suggest it at some point.

8:11 Raynes: fliebel: Hi.

8:11 fliebel: hi

8:12 Raynes: fliebel: Go tweet "@sexpbot &(+ 1 2 3)"

8:15 fliebel: Raynes: What happens with output vs return value?

8:15 Raynes: fliebel: sexpbot on twitter is exactly the same as sexpbot on IRC, save for some commands and plugins being disabled and such because they're IRC specific.

8:16 &(println "blah")

8:16 sexpbot: ⟹ blah nil

8:16 fliebel: right

8:16 Raynes: Return value comes after a space.

8:17 fliebel: oh, does mail work? :) and karma, and.. and...

8:18 Raynes: Those are IRC specific, so no.

8:18 Well, karma isn't, but would require modification to work on twitter.

8:18 So for now, it's IRC only.

8:18 Lajla: &(seq "string")

8:18 sexpbot: ⟹ (\s \t \r \i \n \g)

8:18 Lajla: Raynes, how does carma work?

8:18 Raynes: mail could work with modification, but it would be irrelevant with direct messages.

8:18 fliebel: (inc Raynes)

8:18 sexpbot: ⟹ 1

8:19 fliebel: oh, sed would be awesome :)

8:20 Raynes: Aye, but not very useful.

8:21 fliebel: If you want to check the twitter support out, check out the protocols branch. If all goes smoothly today, I'll merge it into master.

8:21 fliebel: Raynes: You could implement a clojure group as a channel to provide :on-message style stuff.

8:21 I will :)

8:21 I love the Twitter api, and Clojure

8:21 Raynes: I'm going to add email support eventually.

8:21 That'll be interesting.

8:24 Lot of sweat, pain, and blood went into that branch over the last two weeks.

8:24 fliebel: Raynes: Did you rewrite plugins, or made it work transparently?

8:25 Raynes: It works mostly transparently. The changes I made to the plugins reflect mostly unrelated changes.

8:31 fliebel: Raynes: So what it does is get mentions and execute call-all with the arguments?

8:32 Raynes: Pretty much. It basically just implements sexpbots little communication interface.

8:33 fliebel: Raynes: So you could make a twitter list and implement all features that assume a 'channel', so that $seen can work

8:34 Raynes: I'd have to check, but possibly.

8:35 fliebel: Now all that remains is a nice logo :)

8:35 fogus`: Stop, hammock time: http://clojure.blip.tv/file/4457042/

8:37 cemerick: very exciting that these are coming out :-D

8:37 joly: oooh, the videos are getting posted? nice!

8:38 fliebel: awesome

8:38 cemerick: interesting that they're on blip

8:38 I thought they were going to be on infoq

8:39 fliebel: It would be fun to have the pencast side by side with the video...

8:55 kjeldahl_: Has anybody used leiningen "checkouts" for hacking multiple projects simultaneously? Am I supposed to symlink the project directory, or the jars themselves? Any pointers to tutorials, except what's already in the faq?

8:56 neotyk: In clojure-mode when I do M-. it jumps to definition, is there a way to 'jump-from' location?

9:04 M-* does it

9:04 and it's a stack, so you can go multiple levels

9:07 mduerksen: neotyk: M-*? i thought it was M-,

9:13 neotyk: mduerksen: M-. and M-* are from etags.el, while M-, is from sliem.el, still it works :)

9:13 tonyl: morning

9:13 neotyk: s/sliem/slime/

9:14 raek: kjeldahl_: you symlink the project directory

9:14 also, you need to add that project as a dependency as usual

9:14 no pointers, I'm afraid...

9:15 (to tutorials etc)

9:15 kjeldahl_: raek: Ok, thanks. Do you know if it picks up things in "modules" as well for the dependency?

9:15 raek: modules?

9:15 kjeldahl_: raek: My testing indicates it does not...

9:16 raek: Incanter. It's stuff is found as separate "incanter" modules beneath a modules directory.

9:16 raek: ah, it's a maven project, right?

9:16 kjeldahl_: raek: Eh, it builds fine with "lein jar".

9:17 mduerksen: neotyk: ah, i see

9:18 kjeldahl_: raek: It simply lists it submodules as dependencies, i.e. "[incanter/incanter-core "1.2.3"], and that seems to get stuff built (I assume it is not fetching from repos..).

9:18 neotyk: how do I get slime-who-calls to work? any special setup needed?

9:18 raek: anyway, I think checkouts is an alternative to running lein install and restart the dependant clojure instance for every change

9:18 kjeldahl_: do the modules have project.clj files too?

9:19 kjeldahl_: raek: Yes.

9:20 raek: then I think you need to symlink each one of the interesting modules directories one by one

9:20 technomancy knows more about this (he's the author)

9:20 kjeldahl_: raek: Thanks, I will try.

9:21 mfex: neotyk: I installed highlight-parentheses with M-x package-list-packages, but no highlighting yet. Is there another step?

9:21 raek: beware, this is just my extrapolation of how I think this works... :-)

9:22 neotyk: mfex: sure there is :)

9:23 (require 'highlight-parentheses)

9:23 (add-hook 'clojure-mode-hook (lambda ()

9:23 (highlight-parentheses-mode t)))

9:23 mfex: neotyk: M-x highlight-parenthesis

9:23 Raynes: https://gist.github.com/725372

9:23 mfex: ?

9:23 raek: what does highlight-parentheses-mode do? I've only used the built-in show-paren-mode

9:23 neotyk: mfex: add it to you init

9:24 Raynes: .emacs

9:24 neotyk: raek: highlights parens in context Pop the edit-definition stack and goto the location.

9:24 Raynes: Unless you're using emacs-starter-kit

9:24 neotyk: raek: http://www.emacswiki.org/HighlightParentheses

9:25 this was supposed to be pasted before

9:25 mfex: neotyk: thanks, it works

9:25 neotyk: mfex: np

9:25 raek: neat.

10:12 cemerick: has anyone here used the google collections data structures (officially now in guava, I guess)?

10:13 dreamreal: yes

10:13 oh, not in clojure, sorry

10:13 cemerick: yeah, no, I'm not curious about using them in clojure

10:14 dreamreal: am I reading the javadoc right that the immutable collections classes have no methods that return a new, "modified" instance?

10:14 i.e. corollary to assoc or conj in clojure?

10:30 joegallo: cemerick: I don't think they have that.

10:30 I think it's just immutable, period.

10:31 foo = new SomeMutableList(immutableOne); foo.add(bar); ...

10:31 I could definitely be wrong, though.

10:34 cemerick: joegallo: OK, glad I'm not missing something.

10:34 Seems fairly pointless in that case, but…oh well.

10:35 * cemerick has been ruined by clojure in so many ways :-)

11:00 defn: So I have a question -- the "unless" macro. How is this different from Ruby's unless? Could you write unless in Ruby?

11:01 (defmacro unless [expr & body] `(if ~expr nil (do ~@body)))

11:01 Raynes: defn: You could with blocks, right?

11:02 fliebel: defn: Unless? I thought it was called wehn-not?

11:06 chouser: def when_not(x) if not(x) then yield end end

11:06 but the syntax for using a when_not is different from using ruby's built in unless

11:06 unless false then p "hi" end

11:06 when_not(false) {p "hi"}

11:10 defn: so i guess my next question is, why isn't unless in clojure core?

11:10 chouser: it's called when-not

11:10 in clojure core

11:10 * defn stabs himself in the face

11:10 defn: i had no idea.

11:10 raek: I've heard that the name "unless" is reserved for macro tutorials ;-)

11:10 chouser: heh

11:11 defn: or if-not

11:11 depending of course on whether you need an else clause or not

11:12 defn: chouser: can we get an alias for when-not into core? :X

11:13 (unless i mean) -- maybe im insane, but i really like "unless"

11:13 (when-not) is a bit terse

11:13 chouser: I've heard several people express thanks for it being named "when-not" rather than "unless"

11:14 terse?

11:14 and would unless act like when-not or like if-not? :-)

11:14 fliebel: yea, second should also be named fnext.

11:14 chouser: mm

11:15 raek: anyone who would like to see (defn in? [x coll] (contains? coll x))?

11:15 fliebel: raek: Why the reverse args?

11:15 raek: I think it looks better when writing unit test

11:16 but that's a very subjective opinion...

11:16 also, I used to program in python before I got into clojure

11:17 fliebel: raek: Ah, me to… I still go looking for in before I find contains?

11:17 But (in? coll x) makes more sense to me.

11:18 raek: (in? name #{"fred" "ethel"})

11:18 cemerick: um… (#{"fred" "ethel"} name)

11:19 raek: I'm concerned with the case where name, "fred" and "ethel" are large expressions

11:19 as I said, personal aesthetic reasons...

11:20 it's like if you would have the first argument in 'case' last...

11:25 cemerick: fogus`: how do you turn around your HN submissions so rapidly? ;-)

11:26 fogus`: cemerick: The magic of bookmarklets.

11:27 cemerick: fogus`: where can I get this amazing technology innovation? :-P

11:27 fogus`: It's proprietary

11:28 cemerick: I'm persistently 30-60m behind on the twitter (and RSS before it), so I've never been good at any submitting to any newsy site.

11:30 fogus`: Ahhh, the advantages of having no life... first post every time!

11:30 fliebel: cemerick: pubsubhubub and a streaming twitter client will get you a long way.

11:31 cemerick: fliebel: the fact that I've never even heard of pubsubhubub is indicative of my general circumstance.

11:33 fliebel: In fact, I have toyed with the idea of setting up a google reader account and subscribing to some popular blogs, and have a deamon submit any new entries for me. How evil...

11:38 jweiss: what's the idiomatic way to do this - i have a macro, let's say it take a map key as an argument. but i don't want to have to pass in the map every time, there's a lot of calls to this macro and the map is the same. But the map belongs in the caller's namespace. should the macro assume the map var exists? is there a better way?

11:52 mduerksen: jweiss: i don't know what your macro does exactly, but maybe you do something similar to what "memoize" does: (defn stuff [... m ] (let [mcopy m] (defn newfun [...] ....

11:53 even though memoize is a function, not a macro, you can take that as an example

11:53 jweiss: mduerksen: the idea here is syntactic sugar so my calls will be more concise. i think i probably just want to capture the symbol in my macro.

11:54 tscheibl: shouldn't ccw's clojure builder aot compilethe gen-class namespaces?

11:54 jweiss: with memoize, i would think i'd have to pass the map in at least once, and who knows which caller will be the first :)

11:55 i suppose i can deliberately set it up

11:58 tscheibl: cemerick: shouldn't ccw's clojure builder aot compile the gen-class namespaces?

11:59 cemerick: tscheibl: it should if you have started a REPL for the project in question

11:59 That requirement will be going away soon.

11:59 chouser: anyone know about ANTLR + maven?

11:59 I know, way off topic, sorry...

11:59 cemerick: chouser: Alex Miller knows something of the combo, IIRC.

12:00 mduerksen: jweiss: i think i misunderstood your goal, never mind

12:03 technomancy: three people confused about checkout dependencies in 24 hours; time to update the docs =\

12:07 tscheibl: cemerick: can't get it to aot compile even with running repl

12:09 cemerick: it only copies over all the .clj from the src to the classes folder

12:09 cemerick: tscheibl: and your source directories are configured properly in eclipse (either directly or from an e.g. maven build)?

12:09 that is, *source* directories, not resource dirs?

12:10 tscheibl: cemerick: did it with lein eclipse

12:10 cemerick: huh, ok; didn't know about that one

12:11 tscheibl: in your project properties, under "Java build path" > Source, is your source directory listed there as you'd expect?

12:11 tscheibl: well it's in the source tab within the java build path dialog

12:11 cemerick: ah, ok

12:12 tscheibl: look under "builders" in your project properties; is the Clojure builder there and enabled?

12:12 tscheibl: the gen-class ns is extending javax.servlet.http.HttpServlet

12:12 it's enabled

12:13 .. in the meantime i've configured an external builder using lein compile instead which worls as expected

12:13 cemerick: tscheibl: ok; I've exhausted my list of quick checks. I'm no expert on the builder's impl; could you shoot a message to the users ML @ http://groups.google.com/group/clojuredev-users ?

12:14 tscheibl: cemerick: ok, thx

12:21 chouser: cemerick: did you say something about dependency:list at some point?

12:23 cemerick: chouser: probably. why?

12:23 chouser: just trying to figure out what maven's actually doing here

12:26 <dependencies> usually specify runtime deps, right? is there a way to specify comiple-time deps?

12:28 cemerick: chouser: dependencies are compile-time (and therefore runtime and test-time) by default

12:28 chouser: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope

12:29 chouser: hm. I'm pretty sure the antlr maven plugin is using a different version of the antlr jar at compile time than what I specify in my <dependencies>

12:29 Raynes: freakazoid: Candlejack was h

12:30 freakazoid: :D

12:30 dnolen: man, extend-type is amazing

12:30 cemerick: If so, that's a plugin issue -- i.e. clojure-maven-plugin could (if it wanted to be broken) use some fixed version of clojure for compiles, etc, rather than what the project defined locally.

12:30 chouser: perhaps it's an antlr plugin configuration option?

12:39 ymasory_: what are some common uses for preventing evaluation of a symbol?

12:54 bartj: if rational numbers are treated different in Clojure, then why is this equal?

12:54 ,(= (/ 4 11) (float (/ 4 11)))

12:54 clojurebot: true

12:54 bartj: , (/ 4 11)

12:54 clojurebot: 4/11

12:54 bartj: (float (/ 4 11))

12:54 I mean:

12:55 , (float (/ 4 11))

12:55 clojurebot: 0.36363637

12:55 freakazoid: it's probably converting them to a common type for comparison

12:55 cemerick: bartj: I suspect because = is implicitly dropping the rational to a float for the comparison

12:55 freakazoid: I bet it's the other way around

12:56 unless clojure is good at converting floats to the simplest rational that's within their error bars

12:56 bartj: cemerick, do you agree that is unexpected?

12:57 cemerick: freakazoid: I was referring to 4/11 as the rational, sorry.

12:57 freakazoid: oh I read that backwards

12:57 clojure reversed my brain

12:58 cemerick: bartj: no; equality isn't bound to type

12:58 freakazoid: you guys checked out the J1 CPU yet? That think looks neat-o

12:58 cemerick: ,(= 1 (Float. 1))

12:58 clojurebot: java.lang.IllegalArgumentException: No matching ctor found for class java.lang.Float

12:58 * cemerick ,(= 1 (Float. 1.0))

12:59 cemerick: ,(= 1 (Float. 1.0))

12:59 clojurebot: true

12:59 cemerick: bartj: ^^

12:59 bartj: hmm

13:00 by that definition

13:00 ,(= 1 "1")

13:00 clojurebot: false

13:00 bartj: :)

13:00 cemerick: no, no

13:00 bartj: am I missing something?

13:00 raek: reminds me of perl...

13:00 cemerick: a notion of numerical equivalence does not imply weak typing

13:00 freakazoid: it probably does something special for numeric comparisons

13:00 bartj: oh!

13:01 freakazoid: can clojurebot be made to dump bytecodes?

13:01 I guess that would cause it to flood out

13:01 we need "explain"

13:01 ala sql

13:01 bartj: cemerick, thank you much

13:01 freakazoid: particularly sqlite

13:01 cemerick: np :-)

13:01 freakazoid: also, clojure needs an IDE as awesome as Racket's

13:02 cemerick: freakazoid: you read JVM bytecodes as a matter of habit?

13:02 freakazoid: I can read the mnemonics.

13:02 cemerick: ah

13:02 freakazoid: what do you like about Racket's IDE?

13:02 freakazoid: The fact that it shows you dataflow and graphical stack traces

13:03 the error reporting and code navigation are both quite awesome

13:03 cemerick: graphical stack traces?

13:03 freakazoid: it draws arrows indicating the control flow implied by the current stack

13:04 cemerick: You mean in the editor?

13:05 freakazoid: yeah

13:05 cemerick: interesting

13:05 that could get painful in some cases, no?

13:05 freakazoid: I don't think it draws the whole stack

13:05 it might draw each frame separately and let you navigate up and down

13:06 I need to reinstall that and play with it more since I've become more interested in IDEs lately

13:06 hiredman: freakazoid: the byte code for a simple fn is way too verbose to dump to irc

13:07 cemerick: I've heard Racket is an excellent environment, but the last time I used it, it was years ago and called Dr. Scheme.

13:07 * cemerick is always gathering development environment ideas

13:10 bartj: freakazoid, couldn't find racket ide on google!

13:11 cemerick: bartj: google racket scheme

13:15 bartj: cemerick, thanks again; I thought it was an ide, sigh

13:15 cemerick: well, it comes with an IDE *shrug*

13:21 joshua__: Is there a library that gives you wiki like storage in clojure?

13:21 Something you could use to build the base of wikipedia of stackoverflows revision system.

13:46 LauJensen: In case some of you missed it, Richs Keynote: http://clojure.blip.tv/file/4457042/

13:47 hiredman: ,(doc clojure.set/difference)

13:47 clojurebot: "([s1] [s1 s2] [s1 s2 & sets]); Return a set that is the first set without elements of the remaining sets"

13:48 cemerick: hiredman: you have a mail in sexp bot that I presume you're not picking up because it's on your banlist?

13:48 Raynes: cemerick: Ah, new bug.

13:49 He has had that mail for ages, but sexpbot is accidentally noticing the whole channel.

13:49 * Raynes fixes.

13:49 Raynes: Happy that was caught before I fell asleep.

13:49 joegallo: So... would you say sexpbot accidentally the channel?

13:50 Raynes: Hehe

13:51 hiredman: cemerick: ignore list, but yes

13:54 fliebel: I suppose hosting a Clojure app is normally done using a servlet container? So there is no such thing as mod_ring or whatever. It would be nice if I could us the same server for hosting some PHP and Clojure.

13:55 cemerick: fliebel: there are PHP runtimes for the JVM ;-)

13:55 fliebel: cemerick: Quercus?

13:55 chouser: fliebel: you can config apache to proxy for a servlet container

13:55 cemerick: fliebel: there are many

13:55 Raynes: That is fixed. No more global mail alerts.

13:55 Sorry about that.

13:55 chouser: grr

13:55 cemerick: Thanks :-)

13:56 fliebel: cemerick: Oh? I found only Quercus.

13:57 chouser: I would like to avoid running 2 servers on, say, a Amazon micro instance.

13:58 cemerick: fliebel: there are at least two others; p8 is the only one I can remember.

13:58 drewr: why have mail in a bot anyway when freenode provides that for you?

13:59 cemerick: fliebel: keep in mind, I've never used any of them.

13:59 fliebel: cemerick: I have used Quercus, and it worked, but it's weird. p8 isn;t easily found.

14:00 cemerick: it's IBM kit, so almost surely not free *shrug*

14:00 arohner: fliebel: set up jetty or whatever on port 8080, then use apache or nginx to proxy from 80 to 8080

14:01 fliebel: similarly set up php on 8081, and then forward by url

14:01 i.e. foo.com:80/clojure proxies to 8080, but foo.com:80/php proxies to 8081

14:02 fliebel: it's a pretty standard setup

14:02 fliebel: arohner: I can think of some setups that might work, but all include at least 2 servers.

14:02 arohner: fliebel: two boxes, or two web servers?

14:05 fliebel: arohner: 2 web servers

14:05 arohner: fliebel: yeah, if you want to combine clojure and PHP, that's pretty much a necessity

14:06 fliebel: but apache + jetty isn't bad, and is a pretty standard deployment

14:06 fliebel: arohner: quercus might get them onto one server, as well as mod_ring, which unfortunately doesn't exists.

14:07 arohner: fliebel: what's the problem with two web servers?

14:07 cemerick: would a mod_ring simply be a bad idea?

14:07 s/would/wouldn't

14:07 sexpbot: <cemerick> wouldn't a mod_ring simply be a bad idea?

14:07 fliebel: arohner: double setup, double memory, double maintenance.

14:08 cemerick: Why?

14:09 cemerick: I remember having a devil of a time with mod_python back in the day. My impression I left that world with was that running larger runtimes in apache wasn't particularly feasible.

14:09 * cemerick has little idea of what he's talking about, BTW

14:10 fliebel: cemerick: I know that ring is quite like wsgi and the ruby equiv, which both have well respected modules.

14:10 cemerick: I think they work much like fastcgi...

14:11 cemerick: In terms of API, yes. But you'd have to load up a JVM into apache, or use something akin to mod_jk.

14:11 * fliebel has even less of an idea what he is talking about

14:12 fliebel: cemerick: I imagine a separate JVM which has its ring handlers called directly by some jni magic.

14:13 cemerick: well, if it's JNI, then it's not a separate JVM

14:13 fliebel: Rather than via a bunch of xml and indirection called tomcat.

14:13 cemerick: I have here the salvation of the world. The best hackers won't touch it though, 'cause it uses XML.

14:13 * cemerick sighs

14:16 fliebel: Nothing wrong with XML, though I would rather have my ring handlers called directly rather than via a servelet container. I don't know much about it, but these containers feel like heavy to me.

14:16 clojurebot: XmL is case-sensitive

14:16 cemerick: fliebel: jetty is just as much a servlet container as tomcat is?

14:17 fliebel: cemerick: I told you I don't know anything about it… *last futile attempt* I just like the sound of mod_ring better than Tomcat or Jetty.

14:18 cemerick: heh, ok

14:18 * fliebel walks of to read about jetty

14:18 * cemerick waits for my talk from the conj to be released so I can refer to it

14:19 cemerick: fliebel: until then: http://cemerick.com/2010/11/02/continuous-deployment-of-clojure-web-applications/ *shrug*

14:19 * Raynes waits for Aaron Bedra's talk to be released so that he can hide from it.

14:19 fliebel: So now the question is, quercus in jetty, or jetty in apache :)

14:19 * fliebel waits for any talks to be released so he can learn from it.

14:20 Raynes: It wouldn't be so bad if I hadn't have somehow slipped "and stuff" into my commentary. I nearly hung myself after the talk was over.

14:21 cemerick: fliebel: I'd recommend tomcat instead.

14:21 KirinDave: Does anyone have some tooling to make sbt play nice with clojure projects?

14:21 fliebel: Raynes: What was Aaron Bedra's talk about?

14:21 Raynes: I can't remember. I blacked it out.

14:22 His talk didn't seem to have a real subject, but the awesomeness of the Clojure community was the framework

14:22 A real single subject, I mean. His talk wasn't incoherent, just not as focused as the others, but that was the point.

14:23 fliebel: cemerick: Why?

14:23 Raynes: Because he likes using things that nobody else around here uses. :p

14:23 cemerick: I use jetty daily for development

14:24 Raynes: Well, if you count the backend, I use maven daily for development, so we're even.

14:24 cemerick: In production, tomcat provides better process/service management, more reliable hot deployment IMO, and much more accessible configuration.

14:24 fliebel: okay

14:25 cemerick: jetty is biased towards the embedded use case – which is fine – but I don't want to have to change code to modify configuration.

14:30 what languages/runtimes provide for mutable strings by default? I know of CL, but surely there are others?

14:30 also outside of C et al., of course.

14:31 technomancy: cemerick: ruby does =(

14:31 cemerick: jeez, really?

14:31 brutal.

14:31 Shows just how little I know about Ruby.

14:31 technomancy: is that considered a feature over there?

14:32 technomancy: cemerick: depending on who you ask it's an embarassment or a handy trick

14:32 I think the latter is more common

14:33 cemerick: whee

14:34 And to think I almost picked up Ruby for rails a while back.

14:34 fliebel: cemerick: If I remember correctly, you can to things like def a = "foo bar"; a[1,3] = "uu"; puts(a) => "fuu bar"

14:35 cemerick: glorified byte arrays, then

14:35 fliebel: But last time I looked at Ruby, the tutorial assumed 1.9, so I found a'bug' in the tut right away.

14:35 technomancy: don't get me started on encoding and the way it dishonors peoples' ancestors

14:35 cemerick: presumably, that was the source of the encoding issues that Ruby was known for for some time…

14:36 fliebel: Ruby 1.9 iterates over words or lines rather than chars, for some reason.

14:36 cemerick: technomancy: that's not fixed at this point? I thought they had gotten over their unicode hatred and standardized on something.

14:37 technomancy: cemerick: strings have encoding now, but it's not standardized on unicode internally

14:37 LOPP: lulz

14:37 when will people learn

14:37 I work with non-standard codepage

14:38 and I often run into problems with various software that can't handle encodings properly

14:38 LaPingvino: technomancy: it's not standardized on unicode because it's a japanese programmer; a lot of japanese systems still use alternative encodings

14:39 cemerick: JIS for life and all that.

14:39 LaPingvino: yup

14:40 you know why the Japanese pioneered in video games and the US in Business software?

14:41 fliebel: LaPingvino: Tell us :)

14:46 rata_: hi

14:46 sholden: Hi everyone, sorry if I'm newbing it up hard, but I'm trying to build enclojure from source but maven is raining on my parade when trying to find the swank-clojure artifact. Is anyone else having this issue? "Could not find artifact swank-clojure:swank-clojure:jar:1.2.1 in clojure-releases"

14:47 LaPingvino: fliebel: the alphabet is small, so typing is easy, and thus word processing etc is the first thing you think of (following typing machines)

14:48 rata_: could too many sends to an agent cause an stack overflow?

14:48 LaPingvino: fliebel: for the Japanese, software couldn't have variable text (as the memory of a computer was yet too small to contain all Japanese chars) so they put the text in images

14:48 fliebel: you cannot do that in text editing software, but you can in games

14:48 fliebel: rata_: Yes, in my experience :(

14:49 rata_: fliebel: do you know how can I work around it?

14:49 fliebel: rata_: I'm not sure await is for agent, nor if release-pending-sends dos execute them ,but look a those

14:49 edw`: My backtraces show no local variables in SLIME; is there some Java command-line option I need to ad (or avoid) in order to get locals showing up in the debugger?

14:49 s/ad/add/

14:49 sexpbot: <edw> My backtraces show no local variables in SLIME; is there some Java command-line option I need to add (or avoid) in order to get locals showing up in the debugger?

14:50 fliebel: LaPingvino: Cool :)

14:50 cemerick: sholden: why build enclojure from source?

14:52 lenw: hi all

14:52 fliebel: Hi

14:53 lenw: anyone know of a neat way to start and stop / manage clojure servers

14:54 neotyk: lenw: crane is ok

14:54 fliebel: lenw: cemerick just referred me to pallet. Don;t know if it does what you need.

14:55 lenw: dont those guys provision ec2 instances and manage cloud storage for you

14:55 cemerick: lenw: http://cemerick.com/2010/11/02/continuous-deployment-of-clojure-web-applications/

14:55 neotyk: lenw: and crates in particular https://github.com/pallet/pallet-crates

14:55 cemerick: jclouds + pallet is sorta "all of the above"

14:55 lenw: cemerick: checking that out thanks

14:55 rata_: fliebel: the documentation of release-pending-sends says that it dispatch the functions send to an agent immediately, but I need those functions are called sequentially on each agent... does it affect the sequentiality of fn calls by the agent?

14:56 lenw: neotyk: do those tools allow deployment o my own server ?

14:58 fliebel: rata_: await tells me it will wait for all actions to finish.

14:59 rata_: fliebel: ok, so I should send a batch, wait for them, then send another batch and wait for them and so on?

14:59 neotyk: lenw: don't think that crates will help with local machine

14:59 lenw: though crane will do the job there

15:00 lenw: neotyk: thanks reading and learning

15:01 fliebel: rata_: Better would be to modify your code so that it doesn't overflow.

15:01 neotyk: lenw: np

15:02 rata_: fliebel: but it overflows just because I'm sending too many actions to an agent

15:02 fliebel: rata_: Then don't use an agent.

15:03 neotyk: lenw: careful with crane though, it is still in snapshot, might change api w/o warning

15:03 lenw: neotyk: thanks

15:04 cemerick: lenw, neotyk: pallet and its crates will work just fine targeting any machine, local or in the cloud

15:04 neotyk: cemerick: good to know

15:04 lrenn: ring exists such that something like mod_ring could be written.

15:04 cemerick: vbox vms soon as well, or so I hear, similar to vagrant

15:04 neotyk: lenw: than ignore my crane talk, go crates

15:05 lrenn: that didn't come out right, but you know what i mean.

15:05 lenw: cemerick: how does it stop the servers - kill ?

15:05 cemerick: lenw: depends upon what server you're talking about

15:06 rata_: fliebel: why? how else would you get "indenpendent and asynchronous" state modifications in clojure?

15:06 joshua__: Are there any wiki engines in clojure?

15:07 lenw: cemerick: in one instance I have a clj file that starts up some mail polling threads ...

15:07 Raynes: joshua__: Well, there is clicki, but that isn't really what you're looking for, I imagine.

15:07 lenw: cemerick: so just wondering what i need to do to it to play nice with something like pallet

15:07 fliebel: rata_: If you do asynchronous, make sure the updates are short enough so that you don't get ahead of yourself, like you do. So, cheaper updates or synchronous, I guess.

15:09 rata_: niether one is a possibility here... anyway, it seems that release-pending-sends solves the problem

15:09 lenw: cemerick: watching the video

15:09 rata_: mmmm... no, it doesn't

15:10 sholden: rage. getting closer but now im getting an exception that my command line is too long (win). sigh

15:10 joshua__: No, I don't think thats what I'm looking for.

15:12 fliebel: lrenn: What *did* you mean? Someone should write mod_ring? :D

15:13 joshua__: Hmm.. maybe Clojure isn't the right tool for this job. I don't want to have to write my own wiki system atm.

15:14 lrenn: fliebel: sorry :) I thought someone said mod_ring would be a bad idea. What I meant was that ring exists for the sole purpose of allowing other webservers to implement ring and not being tide to a j2ee webapp container.

15:14 tied even.

15:15 jweiss: anybody use java logging and clojure.contrib.logging and know how to fix class names like this:

15:15 201012021509:54.435 - INFO: hello (clojure.contrib.logging$impl_write_BANG_.invoke)

15:16 the doc for c.c.logging makes mention of this but i don't understand how they meant for me to fix it

15:16 fliebel: lrenn: Right. But I looked at mod_wsgi, and decided it is not going to be me who will write it.

15:17 lrenn: fliebel: yeah, i wouldn't want to be the one to write it either :)

15:28 bendlas: Hey folks

15:45 LauJensen: bendlas: hey :)

15:45 cemerick: lrenn: I think you heard me say that something like mod_ring would be a PITA / not really worth it

15:45 bendlas: LauJensen: just trying to reproduce an issue with cql so I'll be able to report

15:46 LauJensen: bendlas: ehm.. there are no issues with cql ... :)

15:47 bendlas: LauJensen: of course not, just instances where it might be able to forgive :)

15:48 one I can tell you right away: :fn/tbl2.col gives fn(tbl1.tbl2.col)

15:49 LauJensen: bendlas: You should check out my latest tumblr/offtopic post, I show how to implement an Oracle SQL compiler in ClojureQL

15:49 bendlas: will do

15:49 LauJensen: bendlas: yea you should qualify in a col-spec. It will auto qualify to the table you're working on

15:50 s/should/shouldn't/

15:50 sexpbot: <LauJensen> bendlas: yea you shouldn't qualify in a col-spec. It will auto qualify to the table you're working on

15:50 rata_: what is java.util.concurrent.ThreadPoolExecutor$Worker for?

15:50 bendlas: ok, but consider when you want to aggregate a join

15:51 might not be feasible to aggregate before, if you want to join on an aggregated col

15:52 LauJensen: bendlas: Have you checked out the example for joining on aggregates that are already there?

15:53 bendlas: those in the README, will check the examples file

15:57 LauJensen: bendlas: btw, you're welcome in #clojureql :)

15:58 raek: rata_: probably an internal class (as it is not listed in the javadoc) used by java.util.concurrent.ThreadPoolExecutor

15:58 Clojure uses two ThreadPoolExecutor to execute the functions sent to agents (one pool for send and one for send-off)

16:00 rata_: raek: I'm wondering because that class is taking almost all the time in the profiling and I don't understand why

16:01 raek: are you using futures or agents a lot?

16:01 LOPP: lol because that class runs agents and futures

16:02 rata_: raek: yes, agents a lot

16:03 raek: I guess that simply means that the majority of the work in your program is done in agents, rather than in the repl thread

16:03 rata_: the main problem is the app seems to sleep forever, when I send more than n times to each agent

16:04 LOPP: maybe too much thread switching then?

16:04 raek: do you have blocking code in the functions you send to the agents?

16:04 LOPP: are you using send or send-off for agents?

16:05 rata_: I'm using send

16:05 and I'm not doing IO in the fn passed

16:06 raek: no Thread/sleep?

16:06 rata_: no

16:08 LOPP: send has limitations

16:09 &(doc send)

16:09 sexpbot: ⟹ "([a f & args]); Dispatch an action to an agent. Returns the agent immediately. Subsequently, in a thread from a thread pool, the state of the agent will be set to the value of: (apply action-fn state-of-agent args)"

16:09 LOPP: &(doc send-off)

16:09 sexpbot: ⟹ "([a f & args]); Dispatch a potentially blocking action to an agent. Returns the agent immediately. Subsequently, in a separate thread, the state of the agent will be set to the value of: (apply action-fn state-of-agent args)"

16:09 LOPP: anyway try with send-off

16:09 it uses a separate worker pool and can take more threads at once or some such jibba-jabba

16:10 raek: btw, does anyone have a program publicly available that utilizes agents in its design?

16:10 LOPP: I forgot what exactly was the diff

16:10 rhickey's ants...

16:10 raek: LOPP: that's about the only program I have seen so far... :)

16:11 the thread-pool that send-off uses does not have a fixed size

16:11 LOPP: I've seen others

16:11 in book about clojure

16:11 can't be arsed to copy is here

16:11 raek: if there is a free thread, it will be used. otherwise a new will be created.

16:16 callasgunnar: i'm noob, i have the Stuart Halloway's book on clojure and I'm struggling. I have recursive function over a list. How do I stop ? How do I check that the message passed to me is not nil?

16:18 rata_: callasgunnar: (seq message)

16:19 tonyl: (if (seq mylist) (my process ..) (recur ...))

16:22 callasgunnar: rata_ and tonyl thx!

16:34 rata_: LOPP: send-off seems to help, but it also sleeps indefinitely :(

16:40 raek: rata_: sleeps indefinitely when it supposed to do stuff, or after it is done?

16:40 rata_: is there a way to say "wait for at least x of y agents"?

16:40 when it's supposed to do stuff

16:41 raek: do you have some code that we can look at?

16:43 rata_: the code of the fn is very simple, it creates n agents, call m fns on each of them, wait for them, and then return the dereferenced values... this is the fn: https://github.com/rhz/kapjure/blob/master/src/kappa/chamber.clj#L299

16:44 and it's called from here: https://github.com/rhz/kapjure/blob/master/test/kappa/simple_models.clj#L17

16:45 raek: for just starting off calculations in separate threads, consider 'future'

16:46 rata_: I'd like to use agents, because I'm planning to intercommunicate them in the future

16:47 anyway, thanks for the advice, I'll make a version of the fn using futures to see if that solves the problem

16:49 raek: as long as the function you send to the agents does not have any side-effecs, I don't se why you code, in principle, shouldn't work

16:52 kjeldahl: Yay! Finally figured out how leiningen checkout works (relax, haven't had the time to look into it until now). It simply adds the symlink paths with "/src" and "/classes" appended. To make this work with for instance incanter, you need to build the incanter submodules with "lein javac" to get stuff in the "/classes" dir for each module.

16:52 adds the symlink paths TO THE CLASSPATH I meant.

16:54 "lein deps" will still pull in the dependencies, so if there's nothing in the "/classes" dir, it will use the downloaded jars instead. So you need to be careful.

16:54 * chouser is very unhappy with both maven and antlr right now

16:56 ossareh: 'lo all

16:57 kjeldahl: leiningen CHECKOUTS, sorry, it's getting late

17:06 neotyk: how common are persistent data structures in other functional langs?

17:07 chouser: scala had immutable collections, but they weren't persistent, required internal locks, etc.

17:08 neotyk: how about other langs, outside of jvm land?

17:09 brehaut: presumably haskell does

17:10 neotyk: I'm trying to figure out a topic for presentation to mostly academic crowd

17:10 they are experts in FP

17:10 rata_: raek: thanks a lot! using futures the fn is much nicer and shorter now and it works (althought it presumably consumes a lot more memory)

17:10 neotyk: but would like to show them something that would get them interested it teaching Clojure

17:10 brehaut: calculating pi with a spigoted stream?

17:11 neotyk: brehaut: what is it/

17:12 local expert, google, doesn't help me much

17:12 brehaut: its a very very academic haskell lecture i once sat through

17:12 interesting but entirely confusing for an FP no0b ;)

17:13 neotyk: is it really written spigoted?

17:14 brehaut: probably not

17:14 i'll see if i can find the paper

17:16 http://www.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/spigot.pdf

17:17 'Unbounded Spigot Algorithms for the Digits of Pi' is the title

17:17 neotyk: brehaut: thank you

17:22 brehaut: neotyk: in seriousness though, i think you might find it hard to impress expert FPers with uniqueness of any feature in clojure, but if you show how the pieces fit together in a cohesive whole you might have better luck

17:24 neotyk: brehaut: this is my doubt as well, I want to learn from them in first place, and share some joy I found programming clj

17:24 I know that real life software will not impress them, as it is not very much real for them

17:26 brehaut: what will impress them vs what will leave them disappointed will also depend what school of FP they are from too; eg lispers vs ml/haskellers

17:26 neotyk: and to be fair comparing to problems they work with is a bit lame

17:26 hiredman: you might show them something like cascalog

17:26 neotyk: haskell is strong there

17:27 hiredman: I mean, academics love prolog, right?

17:27 brehaut: hiredman: oh yeah good idea

17:27 neotyk: have you seen nathan marz introduction video to cascalog ?

17:28 neotyk: not yet

17:28 looking now at http://nathanmarz.com/blog/introducing-cascalog-a-clojure-based-query-language-for-hado.html

17:28 brehaut: neotyk: http://sna-projects.com/blog/2010/11/clojure-at-backtype/

17:29 neotyk: hiredman: thanks!

17:29 brehaut: bbl

17:29 hiredman: np

17:30 * neotyk is watching http://sna-projects.com/blog/2010/11/clojure-at-backtype/ for next hour

17:32 rata_: raek: the only problem with futures is that they start one thread for each future. agents used a thread pool instead

17:32 hiredman: futures also use a threadpool

17:33 infact futures use the same threadpool as agent actions when the action is sent via send-off

17:33 send-off (and futures) use an unbounded threadpool

17:33 send uses a threadpool that is limited to core count + 2 threads

17:34 LOPP: neotyke, I don't think you can impress FP nuts with clojure features

17:34 haskell is much more pure and academics love it

17:35 the advantages of clojure compared to haskell are elsewhere: concurrency-ready, wide platform, huge java api and third party libraries

17:37 rhickey: LOPP: Haskell has good concurrency support

17:38 hiredman: there is a neat video on youtube of spj talking about nest data parallelism in haskell

17:39 http://www.youtube.com/watch?v=NWSZ4c9yqW8

17:39 rhickey: that's different

17:39 parallelism != concurrency

17:39 KirinDave: Is there a better way to macromatically express Some.Java.Class/FIELD?

17:39 I'm trying to clean up my scala-singleton->clojure importer

17:40 It seemed like ~x/~y wasn't working right for me.

17:40 So I settled on this: https://gist.github.com/726235

17:40 hiredman: rhickey: sure

17:41 he mentions the desire to make sure it plays well with the concurrency primitives like mvars

17:41 so you don't have to choose either or

17:42 raek: rata_: you could create your own thread pool and submit your fns to that

17:42 http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool(int)

17:43 the submit method returns a Future object (just like clojure's "future" function)

17:43 rata_: raek: thanks! I'll check it =)

17:45 raek: can I also deref what the submit method returns then?

17:45 hiredman: no

17:45 you have to call .get

17:46 rata_: ok, thanks

17:46 hiredman: unless you implement your own threadpool and have it return clojure futures

17:53 raek: rhickey: There seems to be a lot of goodies in java.util.concurrent. Is the reason for that there are not many clojure wrapper functions for most of the stuff there that one is expected to interface with them directly using java interop? Could one say that Clojure does not add stuff when the the corresponding stuff in java already does the job?

17:54 rhickey: yes

17:56 raek: ok. thanks! :)

18:02 technomancy: rberger: are you using the leiningen cookbook on cookbooks.opscode.com?

18:05 rberger: technomancy: Not right now I don't think

18:05 Should I?

18:05 technomancy: rberger: well... I vaguely recall convincing you not to

18:05 rberger: We're not yet using leningen in production....

18:05 technomancy: or at least not to use it for deployment

18:05 but it would actually be useful for vagrant VMs

18:05 rberger: Ah,

18:06 technomancy: anyway, we just created a new leiningen cookbook as part of a chef training session; was wondering if it could be merged with yours

18:09 rberger: Sure, please do!

18:10 technomancy: cool; could you add me as a collaborator on cookbooks.opscode.com?

18:10 rberger: Ok, I'll do that now.

18:15 technomancy: Did you mean on github? Or in cookbooks.opscode.com? I made you a collaborator at https://github.com/rberger/Runa-Public-Chef-Cookbooks/tree/master/site-cookbooks/leiningen/

18:15 Not sure how to add you as a collaborator on cookbooks.opscode.com...

18:18 KirinDave: Hey guys

18:18 Is there a better way to compute mod-field-sym and have it defined in the namespace?

18:19 This code works, but it feels wrong: https://gist.github.com/726235

18:19 dakrone: how do people feel about the Apache License? I got an invitation for one of my projects to be part of a project in the Apache Incubator, but I'm not sure about the licensing stuff

18:19 right now it's EPL-licensed

18:19 technomancy: on cookbooks... I'm not sure quite the trick for it since I don't have any cookbooks of my own

18:20 dakrone: the requirement to add a license header to every single file is really annoying

18:20 rberger: technomancy: I'll poke some more on cookbooks

18:20 technomancy: but the license is legally is like MIT plus patent protection.

18:20 dakrone: so you would lose the weak copyleft-ness

18:21 dakrone: I have no idea whether that would be a good move to make, library-wise

18:21 technomancy: dakrone: IMO the bureaucracy of the apache foundation looks pretty stifling

18:21 I don't really see it conveying much in terms of benefits.

18:22 dakrone: the only real benefit I see if that it gains the java library's "blessing" an approved API for clojure

18:23 technomancy: oh, if it's built on an existing Apache library then it probably makes sense.

18:23 dakrone: well, the library wasn't originally part of Apache, they just got invited to the ASF and offered an invitation to be part of the project to me as well

18:24 well, the Apache Incubator, not the ASF

18:24 technomancy: rberger: thanks

18:27 rberger: technomancy: Cookbook collaboration enabled.

18:28 technomancy: very nice

18:28 leafw: anybody using incanter? Is there a way to set the first and last values of the X axis only, for a bar-chart?

18:34 zkim: dakrone: is that your opennlp lib?

18:35 dakrone: zkim: yea

18:35 zkim: dakrone: cool, congrats

18:36 dakrone: thanks, not sure what to make of it yet

19:03 rata_: leafw: has you tried incanter.charts/set-x-range?

19:28 defn: https://github.com/harukizaemon/hamster

19:37 Curious if anyone has checked out hamster...

19:41 tomoj: whoa

19:41 thanks to my clojure doc example, when I googled for 'clojure hamster', my old hamster's name came up, pretty surprising for a second..

19:42 huh, clojuredocs seems broken

19:48 defn: haha tomoj -- this is a ruby thing

19:48 but it's interesting nonetheless

20:00 joshua__: In the zipper module the make-node function is taking [loc node children].. can I please have an explanation of what the node part is for?

20:00 It seems like no matter what I put as node it is ignored.

20:11 tomoj: joshua__: hmm

20:11 ,(require 'clojure.zip)

20:11 clojurebot: nil

20:13 tomoj: ,(clojure.zip/make-node (clojure.zip/vector-zip [1]) (with-meta [] {:foo 3}) [])

20:13 clojurebot: []

20:13 tomoj: ,(meta (clojure.zip/make-node (clojure.zip/vector-zip [1]) (with-meta [] {:foo 3}) []))

20:13 clojurebot: {:foo 3}

20:13 tomoj: the return value of make-node inherits the metadata of the node argument

20:14 for vector zips at least

20:37 defn: https://github.com/headius/cloby

20:37 Clojure Ref/STM plugin for JRuby!

20:37 one more step towards a sane environment to program in

20:37 methinks that this coupled with hamster could make me actually enjoy some of the ruby i do at work

20:38 tomoj: multithreaded ruby?

20:39 defn: mostly rails work -- the persistent immutable structures hamster provides are awfully nice. With the STM there for coordination that could be cool.

20:39 I'm not sure how feasible it is to be perfectly honest with you. Talk me down off the ledge! :)

20:43 joshua__: tomoj: So are you suppose to use make-node along with replace or something like that to create a branch within an existing tree?

20:43 p_l|home: main issue keeping threading non-concurrent in Python and Ruby is the interpreter implementation, afaik both JRuby and Jython don't have that issue

20:50 tomoj: joshua__: dunno

20:56 lancepantz: we use have too many native gems in our codebase for jruby to be feasible

20:57 i started down that path at one point, but it just became a mountain of work

20:58 mlm: hello fellow clojurians

20:58 p_l|home: heh. I guess it is sometimes better to have proper FFI instead of such embedding of C code :D

22:16 technomancy: Leiningen 1.4.0 is out: http://bit.ly/lein-news

22:18 hiredman: huzzah

22:18 cemerick: technomancy: congrats; seems like a big step forward :-)

22:20 technomancy: cemerick: it's 0.9 better than the last release!

22:20 cemerick: :-D

22:20 technomancy: I keep saying, you should try your hand at tech marketing/positioning. ;-)

22:20 Names, slogans, etc.

22:21 It's a one-stop-shop.

22:21 brehaut: technomancy: woo :D

22:24 technomancy: actually this release is pretty boring; consolidating plugins and preparing the ground for a 2.0 based on maven's aether.

22:25 cemerick: technomancy: did you notice the really-honestly-ready patch for 322 waiting?

22:26 p_l|home: hmmm... Anyone has any experience in teaching clojure to people who know Java and *uknown* set of other languages but probably no Lisp (hit-by-bus prevention)?

22:26 technomancy: cemerick: yeah, now that this release is off my plate I hope to have a chance take a look.

22:26 cemerick: That'd be great :-)

22:26 This one even has tests. :-P

22:27 technomancy: I actually added a workaround in lein now for people stuck on 1.2; it will clear out .class files that don't have a corresponding package in src/.

22:27 but I'd much prefer to treat the problem rather than the symptoms

22:29 * p_l|home is interested in adding more than Java to a project (university year-long coursework team thingy, so there are certain limits).

22:29 p_l|home: So I need to know how long it might take to teach someone enough to work on codebase written by another?

22:30 cemerick: Here's hoping 1.3.0 isn't *too* long in coming. I suspect that there would be broad support for a 1.2 patch release that contained a fix for 322 otherwise.

22:30 brehaut: p_l|home: its entirely dependent on their motivation to learn something that might be perceived as unnecessary. you dont want to come across as a pushy ass

22:31 p_l|home: heh

22:31 technomancy: it's complicated since 1.3.0 isn't backwards-compatible =\

22:31 p_l|home: brehaut: I guess I might not have lots of chance there :)

22:32 cemerick: Breakage, thy name is progress.

22:32 hrm, probably vice versa.

22:32 technomancy: yeah, the "=\" was perhaps not quite what I meant

22:33 cemerick: Surely all of human emotion can squeeze through six emoticons.

22:33 p_l|home: Though the reason behind use of Java is IMHO broken ("because everyone here knows java so we won't have to mix different languages")... because we already have to mix JavaScript and quite possibly Postgres' variant of PL/SQL

22:34 brehaut: technomancy: ive managed to break my basicly brand new lein install; it's telling me it cant find clojure. any pointers?

22:35 technomancy: brehaut: paste the details?

22:39 brehaut: p_l|home: if you cant handle that sort of reasoning, i have some bad news for you

22:45 chett: test

22:46 pdk: nobody's expecting clojure to whisk that away pl

22:49 p_l|home: pdk: I know it won't remove that. It would probably make it easier to implement certain parts of it

22:50 Just like why I'm avoiding most of the Java-based Web stuff, because I can replace quite big chunk of it with one-two JRuby files that will do the whole job the Web-facing component needs to

22:52 and no-one in the team has any previous experience doing Web stuff in Java

22:55 mlm: I have a question re: use of a java.util.concurrent.Semaphore (as a ref so that multiple threads can access it) inside of a dosync block. When a thread blocks on the P operation (or acquire), it seems to be causing deadlock. How can I use semaphores between threads?

22:57 headius: once you start using java synchronization primitives, you're on your own

22:57 I'm not a clojure guy, but they're subject to normal java synchronization policies

22:57 mlm: ahh

22:58 headius: dosync or otherwise

22:58 mlm: i'm not a java guy, and i'm a very new clojure guy

22:58 makes sense

22:58 stick to Clojure concurrency mechanisms

22:59 i wonder if there is a way to sort of 'break' out of a dosync block? like a break statement?

23:00 chett: Just getting started. I can't seem to load my project.clj when running emacs + slime and M-x lein-swank. My sample code is here : http://github.com/chett/oad. -> Unable to resolve symbol: defproject in this context. Any tips?

23:00 mlm: nevermind, sorry, I seem to be asking dumb questions tonight. thanksf for your help!

23:02 technomancy: chett: project.clj runs in the context of Leiningen, not inside your project's JVM

23:02 Derander: chett: see http://github.com/andymoreland/smucket for a project.clj file

23:02 chett: the important part is swank-clojure down in dev-dependencies

23:03 headius: technomancy: only one remains to confirm on Mirah license

23:03 had to send him a Github message though...no telling

23:03 Derander: chett: once you have that, run "lein deps" in the project root w/ a shell, and then "lein swank". From emacs, do slime-connect after the swank server boots

23:03 technomancy: headius: cool

23:04 headius: I was able to relicense swank-clojure with ~30 contributors in a week or so; it was easier than I feared.

23:04 headius: yeah, most folks are still "around"

23:04 relicensing JRuby circa 2006 was a big headache

23:04 p_l|home: why relicense?

23:04 technomancy: helps to have a young project

23:04 Derander: chett: let me know if you run into trouble. I had a hell of a time getting clojure/emacs to work together at first

23:04 headius: by 2006 there were something like 40 contribs

23:04 technomancy: headius: oh, didn't realize you had already gone through that. sounds like a pain =\

23:05 headius: I didn't do it :D

23:05 chett: :Derander ,:technomancy thanks, will keep you posted

23:05 headius: enebo handled that

23:05 technomancy: headius: what was the old license?

23:05 headius: it was always GPL/LGPL, and we added CPL for commercial products

23:05 like a month before CPL was deprecated in favor of EPL

23:05 technomancy: is it EPL now?

23:05 headius: sigh

23:05 technomancy: ugh

23:05 headius: we haven't wanted to go through the hassle again

23:05 and we probably have hundreds of contribs now

23:06 technomancy: was there no upgrade path for cpl -> epl?

23:06 headius: dunno

23:06 * p_l|home is happy to avoid *GPL licenses now. Lisp-related code doesn't suffer them nicely.

23:06 headius: yeah

23:06 I don't care one way or the other but closed-source companies are terribly fearful of GPL

23:06 perhaps for good reason

23:06 technomancy: IIUC if you specify the Eclipse Foundation as the steward of the license then they can specify a successor license

23:06 headius: so I'll probably be apache 2.0 forever

23:07 technomancy: if flaws are discovered in the EPL 1.0

23:07 headius: everyone seems fine with apache

23:07 bleh, one of those nights where step debugging won't step through the method you expect it to

23:09 p_l|home: headius: not really, a big chunk of the market nowadays is more than happy to ignore certain issues of GPLv2... the thing is, Common Lisp (not necessarily Clojure) code *really* doesn't like it, due to murkiness of terms like "linking", "runtime" etc.

23:09 headius: p_l|home: yeah, that's what we've run into

23:09 no concrete fear just a general one

23:09 the grayness of linking

23:10 p_l|home: headius: for example, in case of CL, GPL and LGPL are flat out if you don't want to relicense the whole thing under GPL

23:10 headius: there are conflicting opinions about whether dynamic linking constitutes linking under GPL too

23:10 chett: quit

23:10 p_l|home: and then there's the fact of inclusion of projects that might have completely different licensing, including the implmentation (a big issue with CLISP is its license, for example)

23:11 headius: if someone would make a concrete statement about that, a lot of those problems would go away

23:11 p_l|home: yeah, we have that problem in jruby

23:11 p_l|home: headius: heh, you have dynamic linking. CL doesn't exactly have it :D

23:11 headius: we *think* most of the libs jruby ships with are compatible with all three licenses

23:11 but we don't really want to know if they're not

23:11 p_l|home: loaded code in CL becomes part of the image instead of being dynamically linked

23:12 headius: it's just so far removed from the problems we want to be solving

23:12 yeah I suppose so

23:12 p_l|home: I guess Smalltalk has similar issue. Java has convenient dynamic-loading system compared to CL

23:12 * hugod has yet to understand why apache treats EPL as a second rate license

23:13 headius: right...but Sun et al have felt the need to have a "GPL with classpath exception" even then

23:13 because it's so murky

23:13 technically every single class in Java is dynamically bound :D

23:13 and I'll testify to that in court

23:14 * technomancy really likes the EPL except for the "E" in the name. =)

23:14 headius: technomancy: yeah, we might as well have a JPL for JRuby

23:15 hmm, ok...what do you do when there's only one impl of a given method, and it's not getting hit for a breakpoint

23:15 perhaps you quit and try tomorrow

23:16 or you set its Ruby visibility appropriately...d'oh

23:25 chett: :Derander - I did the following 1) Add :dev-dependencies[[swank-clojure "1.2.0"]]) to project.clj 2) lein deps 3) from shell $lein swank & 4) Opened emacs, M-x slime-connect 5) opened project.clj 6) C-c C-l gives Symbol's function defintion is void inferior-lisp-proc

23:26 Derander: chett: where'd you install slime from?

23:26 chett: cvs slime or elpa slime-repl/slime?

23:27 chett: :Derander elpa

23:27 Derander: chett: when you ran slime-connect, did it pop open an repl buffer?

23:27 try C-c C-z

23:28 chett: :Derander Yes the repl buffer came up

23:28 Derander: can you evaluate expressions in it?

23:29 chett: :Derander yes

23:29 Derander: what is C-c C-l bound to? I'm not familiar with that

23:30 slime-load-file?

23:30 chett: :Derander similar to C-c C-e, it loads the file i believe

23:31 Derander: C-h c will tell you definitively the function that a keybinding is bound to

23:31 Does C-c C-k work?

23:31 chett: :Derander no

23:32 Derander: strange

23:32 so you *can* use the repl buffer to eval clojure, but for some reason slime isn't finding the inferior lisp process?

23:33 chett: :Derander also on M-x slime connect i get the message : Versions differ nil (slime) vs. 20100404 (swank)

23:33 Derander: I've never found that to be a problem

23:33 (mine does that too.)

23:33 chett: ok

23:34 Derander: do you have swank-clojure and clojure-mode installed from elpa? not sure what it would do

23:34 they would do

23:34 chett: yes they were installed from elpa

23:35 technomancy: if you install from my package source you shouldn't get that error

23:36 chett: Surely I've missed something

23:36 Derander: wait

23:36 are you trying to load-file the project.clj file?

23:36 slime-load-file*

23:37 technomancy: yeah, that's not supposed to work

23:37 Derander: chett: ^

23:37 if you are, you don't need to

23:37 chett: OK

23:38 I guess I didn't ask the right question

23:38 technomancy: project.clj only gets loaded by leiningen, not by your project's code

23:40 chett: Ok If i have tests defined in myproject/test/myproject/test/myproject can i run them from a slime repl connected to lein swank

23:41 technomancy: sure; load the file and run (clojure.test/run-tests 'myproject.test.myproject)

23:41 or use clojure-test-mode for a nicer interface

23:47 chett: :technomacy I get clojure.test class not found

23:55 :technomancy, :Derander thanks for steering me in the right direction. Hopefully I'll be able to field noob questions soon enough!

23:58 technomancy: chett: yeah, will need to require clojure.test.

Logging service provided by n01se.net