#clojure log - Oct 30 2011

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

4:33 spoon16: anyone using jenkins for clojure projects?

4:33 looking for some information on configuring a leiningen project in Jenkins

4:36 scottj: spoon16: idk but chas made a video about clojure+hudson and a blog post maybe 1.25 years ago

4:37 spoon16: I'll look for it

5:19 callen: the clojurebox site appears to be down.

5:19 not sure what's going on there.

5:55 zilti: I hate having to ask again, but I'm trying to get noir up and running... Locally (using "lein ring server") everything works perfect, but as soon as I'm deploying it using "lein ring uberwar" I get this: http://lyrion.ch/beta

5:55 Using ring 1.0.0-RC1

6:09 I hate having to ask again, but I'm trying to get noir up and running... Locally (using "lein ring server") everything works perfect, but as soon as I'm deploying it using "lein ring uberwar" I get this: http://lyrion.ch/beta

6:09 callen: zilti: don't repeat yourself.

6:09 zilti: it's a waste of time and pollutes the channel.

6:09 zilti: everytime you repeat yourself, I drown a kitten. Capiche?

6:11 zilti: NOOO not the kitten

8:23 raek: zilti: did you get an answer to the proxy question?

8:23 zilti: raek: Yes, it's working now.

8:44 Huh why can't I recur in a (while [...] (if ?

8:46 raek: ,(macroexpand-1 '(while condition body))

8:46 clojurebot: (clojure.core/loop [] (clojure.core/when condition body (recur)))

8:47 zilti: "Did you mean: loop?"

8:47 raek: zilti: what do you mean by "can't recur"?

8:48 zilti: Use recur there. But yeah, I meant loop instead of while, mistyped that stuff...

8:49 raek: zilti: you mean using recur in the body of a loop form? that should work.

8:49 zilti: Yes, it does

8:53 archaic: i have a problem where incanters matrix is not respecting repls *print-length* any advice on how to fix this? (slime/emacs)

10:45 gfredericks: ,(+ 5 6)

10:45 clojurebot: 11

10:58 zilti: Is there some sort of let that "generates" vals based on a zipmap?

11:13 gfredericks: zilti: not quite sure what you mean. Try giving some example code (with your made-up syntax) and explain what it does?

11:13 zilti: gfredericks: I mean something like (let [{a 10 b 50}] ...) which does the same as (let [a 10 b 50] ...)

11:14 gfredericks: zilti: so then you'd be able to (let [m {'x 12}] (let [m] (inc x))) => 13?

11:15 zilti: gfredericks: I meant more like (let [{m 12}] (inc m) => 13

11:16 gfredericks: zilti: what's the advantage there? isn't that the same as (let [m 12] (inc m)) but with two more characters?

11:16 zilti: gfredericks: I want to use this in a macro where I have a list of argument-names and a list of arguments

11:17 gfredericks: zilti: so you have a map and you're trying to generate a let expression for it?

11:18 ,(let [m {'a 71 'b :foo}] `(let [~@(apply concat m)] foo bar))

11:18 clojurebot: (clojure.core/let [a 71 b :foo] sandbox/foo sandbox/bar)

11:18 gfredericks: ^ any reason that wouldn't work?

11:19 zilti: Ah concat... ok

11:19 tbh I'm not yet sure what's the difference between ~ and ~@

11:19 gfredericks: ~@ unpacks a sequence.

11:19 clojurebot: @ splices in a seq and foo# is a symbol, not a seq

11:20 gfredericks: `(x y ~@[:a :b :c])

11:20 ,`(x y ~@[:a :b :c])

11:20 clojurebot: (sandbox/x sandbox/y :a :b :c)

11:20 gfredericks: vs

11:20 babilen: zilti: I found http://www.learningclojure.com/2010/09/clojure-macro-tutorial-part-i-getting.html (and subsequent parts) to be quite helpful to clarify this among other things.

11:20 zilti: I see

11:20 gfredericks: ,`(x y ~[:a :b :c])

11:20 clojurebot: (sandbox/x sandbox/y [:a :b :c])

11:21 zilti: (inc gfredericks)

11:21 lazybot: ⇒ 3

11:21 zilti: babilen: Thanks, I already know these links, but haven't worked them through yet

11:21 babilen: zilti: Hehe :)

11:22 zilti: It wasn't exactly clear to me what "splice" means in this context

11:22 duck1123: ~@ is like the macro version of apply

11:22 clojurebot: Ack. Ack.

11:22 duck1123: I wasn't talking to you clojurebot

11:22 zilti: lol

11:22 morphling: clojurebot: @

11:22 clojurebot: @ , {a b c]

11:23 gfredericks: what a weirdo

11:23 morphling: clojurebot: what is @

11:23 clojurebot: Alles klar

11:23 duck1123: if you do ~ it puts the value as is, if you do ~@ it inserts each item of the seq into the code

11:24 gfredericks: keep in mind that neither ~ nor ~@ give you any additional power in a macro -- any macro could be written without them, just more verbosely and less readably

11:25 zilti: Oh, clojurebot speaks german

11:27 I have a "(fn ['~'~@argslist] '~'~body)" now. Argslist are normal arguments in a vector (as in (def [x y z])). Could it be that this causes a "Can't use qualified name as parameter" error?

11:28 gfredericks: oh man I can't imagine that you actually have a reason to use '~'~@

11:28 zilti: maybe you should describe on a higher level what you're trying to do

11:28 duck1123: zilti: why are you quoting everything?

11:29 zilti: Well... emh... I don't know an alternative to it

11:29 gfredericks: zilti: what's your motivation for using macros in the first place?

11:30 zilti: gfredericks: To avoid having to repeat myself over and over in the code

11:30 llasram: So I noticed that on the alioth shootout benchmmarks, the Clojure implementation of the "n-body" bench mark is the largest of all the implementations code-wise, about 2x the size of the (average-ish) Java version

11:30 gfredericks: zilti: what sort of repetition?

11:30 llasram: I'm trying to create something which is a bit smaller, but I haven't gotten it down that much. Anyone have any ideas? https://gist.github.com/1326024

11:32 zilti: gfredericks: a nested function call with an additional arg

11:33 So I can do (do-something x) instead of (wrap (partial do-something x) y)

11:34 duck1123: most of the time, unless you have special requirements about evaluating the params, you don't need a macro

11:34 gfredericks: yeah. I'd say you probably want some kind of HOF at the most

11:35 zilti: HOF?

11:35 clojurebot: HOF is Higher-Order Function

11:35 duck1123: wanting to pass a body to be wrapped in other code, is a valid use for macros, however

11:35 gfredericks: zilti: like is the issue that you want something like partial that adds arguments to the end instead of the beginning?

11:35 cgray: would it break anything if (println foo) returned (identity foo)? because i just got bitten by that while trying to debug...

11:36 gfredericks: cgray: at this point I think that'd be a pretty major change

11:36 cgray: also it'd make the repl very repetitive

11:37 zilti: gfredericks: It's not about just adding that argument.

11:37 duck1123: cgray: it's usually easy enough to create a macro that evals, prints, and then returns the value

11:37 cgray: gfredericks: yeah, i guess it would... what i was trying to do was (->> foo (println) (bar)) and assuming that foo would get passed to bar

11:37 duck1123: ok, good plan

11:37 gfredericks: duck1123: cgray: that sounds like a function, not a macro: #(do (println %) %)

11:38 duck1123: cgray: for instance, this is the one I use https://github.com/duck1123/ciste/blob/master/src/ciste/debug.clj#L5

11:38 gfredericks: fair enough. In my case, I needed a macro because I needed access to the code

11:38 cgray: duck1123: cool, thanks

11:39 gfredericks: duck1123: ah ha

11:40 duck1123: although in the middle of -> that might be a little weird

11:40 duck1123: it shows up oddly, but it's good enough to know what I was doing

11:41 gfredericks: zilti: well I can't give a more specific example without knowing more details

11:46 zilti: I just don't understand why it gives me a "Can't use qualified name as parameter" error

11:47 duck1123: because clojure won't let you put a normal name. You need to gensym that name, or pass it in

11:47 gfredericks: ,(fn [sandbox/foo] 12)

11:47 clojurebot: #<CompilerException java.lang.RuntimeException: Can't use qualified name as parameter: sandbox/foo, compiling:(NO_SOURCE_PATH:0)>

11:48 duck1123: zilti: so are you passing forms that are to be used as the body?

11:48 gfredericks: ,[`(fn [foo] 12) `(fn [foo#] 12)]

11:48 clojurebot: [(clojure.core/fn [sandbox/foo] 12) (clojure.core/fn [foo__53__auto__] 12)]

11:48 gfredericks: the former breaks, the latter works

11:50 also there's ##`(fn [~'foo] 12)

11:50 lazybot: ⇒ (clojure.core/fn [foo] 12)

11:52 gfredericks: the worst thing about macros is that people are tempted to use them

11:55 zilti: duck1123: yes

11:56 duck1123: zilti: here's a case where I used a macro to create a fn. help? https://github.com/duck1123/ciste/blob/master/src/ciste/core.clj#L28

11:57 zilti: I have them all suffixed with # that doesn't help

12:03 duck1123: zilti: if possible, could you post what you have and how you call it, and what you're looking for?

12:06 zilti: duck1123: https://gist.github.com/1326068

12:07 duck1123: zilti: a macro that creates a macro?

12:07 zilti: duck1123: Yes

12:07 gfredericks: o_o

12:08 TimMc: Now you have 3 problems.

12:08 gfredericks: lol

12:08 duck1123: and I thought I wrote crazy macros

12:09 TimMc: duck1123: Now write a macro that makes you answer a riddle before it will allow your code to compile!

12:09 duck1123: how does nesting syntax quotes work. do you have to double escape them?

12:09 TimMc: ,``a

12:10 clojurebot: (quote sandbox/a)

12:10 gfredericks: macros are _usually_ not the answer, but I think it's fair to say that macros that create macros are _never_ the answer.

12:10 TimMc: ,(pr-str ``a)

12:10 clojurebot: "(quote sandbox/a)"

12:10 TimMc: gr

12:10 zilti: hmm

12:10 No you don't have to double escape syntax quotes

12:11 duck1123: ok, first off. The top level of args do not need the #

12:12 zilti: I did that to ensure that they aren't the reason

12:12 gfredericks: zilti: # is only for when you introduce a new symbol inside a ` form. Usually for let bindings or function arguments. The args to the top level macro are not inside ` so don't apply

12:17 duck1123: zilti: if you take the body and wrap it in a fn, then you could call that fn inside this named part and just make it a macro that creates fns

12:18 TimMc: Hey, I just had a thought -- when people ask how to (apply) a macro, what they're actually asking for is eval!

12:19 mefesto: also i think there is an issue with the (do ~@forms) which looks like you're expecting all the results to be saved in 'records but do will only return the last value

12:20 duck1123: mefesto: that's my code... that works

12:20 mefesto: oic

12:21 duck1123: or at least it well once I fix the error I just introduced trying to get rid of naked uses

12:24 gfredericks: TimMc: okay, so let's say I want to do (apply and my-vals). You're saying what I'm trying to do is (eval (cons 'and my-vals))?

12:25 I think that makes sense. If you want to decide the arguments to the macro at runtime, eval would be essentially the way to do it.

12:27 zilti: Phew. So now I have a macro that yields a function which calls a function. Works now.

12:35 mefesto: zilti: did ring-1.0.0-RC1 fix that issue you were having with noir yesterday?

12:36 i get that error anytime i enter a url to a directory of the public resources

12:36 zilti: mefesto: Yes and no... It did fix the problem I had yesterday, but now I have this: http://www.lyrion.ch/beta

12:37 mefesto: zilti: ugh, i ran into that at work on fri ... doesn't happen when you test locally?

12:38 zilti: mefesto: Works fine locally (lein ring server)

12:38 mefesto: i was using apache to reverse proxy to ring ... which gave me that error

12:38 i tried with nginx and it worked

12:38 maybe a default content/mime type setting in apache?

12:39 zilti: mefesto: mime type would be one thing. The other is that it's just displaying the "not found" page which shouldn't be there. Btw I can't switch the server software - It's a shared server with a private Tomcat

12:40 mefesto: zilti: for the root mapping i had to add a (defpage "/" [] (render "/home")) or something like that

12:40 or /beta => /beta/home

12:41 zilti: render /home ?

12:41 mefesto: yeah, where /home is the welcome page

12:41 zilti: mefesto: All it is currently is the default noir example, except that I've set a defpage "/" []. It doesn't change anything if it's in beta/ or not.

12:42 See http://www.lyrion.ch same thing

12:42 Ok, off eating

12:52 back. mefesto, do you have any idea what might break the routing stuff?

13:12 mefesto: zilti: ping

13:12 zilti: am here

13:12 mefesto: i just reproduced the issue and found something for apache that fixes it

13:13 one sec, i'll post the config

13:13 although like you were saying about your host, you might not be able to change the apache config (htaccess sometimes lets you)

13:15 zilti: https://gist.github.com/0efa42d54857f269ffde

13:16 i didn't set it up as the root app but should be similar

13:16 zilti: Ok, thanks!

13:16 mefesto: zilti: http://mefesto.dyndns.org:8080/myapp

13:16 zilti: But why do you have 8080?

13:17 mefesto: zilti: by default noir (jetty) runs on port 8080

13:17 zilti: mefesto: But I replaced the default noir server call in the server.clj with the gen-handler call from noir to create handlers for ring

13:18 mefesto: zilti: replace the 8080 with whatever port your instance is running on

13:19 zilti: mefesto: I only have "(def handler (server/gen-handler {:ns 'lyrionch}))" so I guess it's 80?

13:19 mefesto: zilti: when you launch the server from the command line doesn't it print out the port number?

13:20 zilti: or if you're on linux you can figure it out using netstat or something

13:21 zilti: netstat -tanp | grep java

13:21 zilti: mefesto: On the command line I use lein ring server 8080 because by default lein ring scans from 3000 upwards for a free port. I guess it's different when deployed by war

13:21 duck1123: when using a war, it's whatever the container is using. usually 8080

13:23 zilti: duck1123: I had some stuff running on that server using Scalatra, didn't need to set anything for that. Also uses jetty locally and also deployed by war.

13:25 duck1123: so these are all showing up accessible on port 80?

13:25 zilti: duck1123: Yes

13:26 duck1123: ok, and you have apache or something proxying that call right?

13:27 zilti: Well I guess so, yes. It isn't my apache.

13:27 duck1123: that's probably what's happening

13:28 mefesto: zilti: i think this is because the 404 page generated by noir isn't setting a content-type header and apache defaults to text/plain. as an alternative to the apache conf stuff you can add middleware that will add :content-type "text/html" to the response map if it's empty

13:28 zilti: I've now included mefestos gist in my htaccess. I wonder how I activate it

13:29 mefesto: zilti: ring might already have something for this so check there first

13:29 https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/content_type.clj

13:29 duck1123: I had something similar happen is it asking you to download the file?

13:30 zilti: Basically "my" apache determines the content type based on file extensions

13:30 duck1123: I had an issue with netty and apache where netty would send back a not modified and apache would mess it up

13:32 zilti: Is the .htaccess used immediately? Or is it cached?

13:33 mefesto: meh that built-in ring middleware defaults to application/octet-stream

13:36 zilti: If it's not cached then I'm not allowed to do anything like that in the htaccess. I even put some random stuff in it to see if it's parsed, and nothing happened.

13:37 duck1123: you can't put location info like that in htaccess I believe

13:39 zilti: "Game Over"

13:40 mefesto: zilti: example w/out modifying apache conf: https://gist.github.com/1326168

13:41 zilti: updated my setup and removed the DefaultType from apache

13:42 R4p70r: What is the Clojure equivalent of Haskell unzip? Which from what I understand is an f such that (f [[1 2] [3 4] [5 6]]) => [[1 3 5] [2 4 6]]

13:43 zilti: mefesto: But that doesn't solve the routing problem...

13:44 mefesto: zilti: i thought you already had the routing working from apache -> yourapp and it was just the 404 page coming back as plain text?

13:44 zilti: mefesto: No, there's only the 404 page, nothing else, no matter what route

13:44 duck1123: does noir have any way of intercepting the requests?

13:44 Raynes: duck1123: You can use pre-route

13:45 duck1123: you could probably add some middleware in there to inspect it

13:45 mefesto: https://gist.github.com/1326168

13:45 line 10

13:45 duck1123: could it be that your requests are coming in with the context appended?

13:47 mefesto: zilti: you're running this in tomcat right?

13:47 zilti: yes, Tomcat 6

13:49 mefesto: zilti: how is apache talking to tomcat, mod_jk, proxy, other?

13:51 tufflax: R4p70r I don't think something that does that exists. But I wrote this, maybe it will help. But then you'd have to flatten first. http://pastebin.com/GSjej6hG

13:52 R4p70r: tufflax, Thanks I'll take a look

13:58 mefesto: i still get the FileNotFoundException from ring (1.0.0-RC1) when a directory is accessed

14:00 ok n/m ... lein clean :)

14:01 zilti: Hm now I get HTTP Status 404 - Servlet lyrionch.server/handler servlet is not available

14:09 mefesto: I've added your middleware, now my server.clj looks like this: https://gist.github.com/1326198 I still have the same source-code-404-page when having the port set to 8080, and when I set it to 80 I get "HTTP Status 404 - Servlet lyrionch.server/handler servlet is not available"

14:11 mefesto: this is middleware that is setup in the main but you don't use the main ... you deploy as a war to tomcat, right?

14:11 zilti: yes

14:12 mefesto: yeah this middleware is only added if you do `lein run`

14:12 i dunno how to do it for a war setup

14:12 * rafl really wishes clojars.org was slightly more like metacpan.org or search.cpan.org :-/

14:15 zilti: mefesto: I just had to add (server/add-middleware wrap-content-type "text/html") in front of the (def handler (server/gen-handler {:ns 'lyrionch})) statement

14:15 Now I have at least a good-looking 404 page

14:16 mefesto: zilti: progress :)

14:17 zilti: mefesto: :) Well now I'll try to log the routes... What's the recommended method for logging in clojure?

14:17 Raynes: cake latest-version clojail

14:18 Damn, wrong window.

14:18 mefesto: zilti: if it's just for temp why not just println?

14:18 zilti: otherwise, clojure.tools.logging

14:18 Raynes: And don't ask why I don't know what the latest version of my own library is.

14:18 zilti: mefesto: Because I won't be able to see that on my server ;)

14:18 Raynes: lol

14:20 mefesto: hmm some sneaky guy tried using my server as a forward proxy :)

14:23 zilti: mefesto: Where's the current route stored?

14:24 mefesto: zilti: (:uri request)

14:28 Raynes: &(require 'clojure.string)

14:28 lazybot: ⇒ nil

14:28 Raynes: &(clojure.string/join [\a \b \c])

14:28 lazybot: ⇒ "abc"

14:28 Raynes: amalloy_: ^ Unbroke that for you, wherever you are. <3

14:30 zilti: mefesto: Argh... I can't get hold of the request variable anywhere outside the middleware...

14:31 mefesto: zilti: can you post your middleware?

14:31 zilti: mefesto: It's your middleware, unchanged

14:31 mefesto: the content type one?

14:32 zilti: Yes... Now I think it's best to create a second one for adding the route to the output?

14:32 mefesto: https://gist.github.com/1326237

14:32 ring probably has stuff for this tho

14:33 zilti: log?

14:33 clojurebot: see logs

14:33 zilti: But I don't have any logging set up.

14:33 mefesto: replace that with your log function :)

14:34 zilti: Isn't there a way to add this to the ouput?

14:35 mefesto: zilti: output being the response body?

14:35 zilti: yes

14:36 mefesto: zilti: aren't you able to check the tomcat logs? if so then println should be good enough for this debugging

14:36 zilti: It's stored in there? Yes, I can access them.

14:36 mefesto: zilti: otherwise, assuming the response body is a string then the typical clojure concat stuff should do

14:37 zilti: yeah, last i recall tomcat dumps stdout into the logs

14:37 zilti: mefesto: I don't know how to access the response body in the middleware

14:37 mefesto: zilti: (let [res (handler req)] ...)

14:38 zilti: res is the response map ... return the modified version from that let

14:38 zilti: mefesto: Yes, but what key does the content have? :body ?

14:38 mefesto: https://github.com/mmcgrana/ring/blob/master/SPEC

14:38 yup :body

14:39 zilti: Oh, nice! Thanks!

14:41 (inc mefesto)

14:41 lazybot: ⇒ 1

14:46 mefesto: does lazybot keep score?

14:47 (dec mefesto)

14:47 lazybot: You can't adjust your own karma.

14:47 mefesto: hah nice

14:48 zilti: ARGH How long can it take to restart a Tomcat!

14:49 Oh no... I accidentally queued 3 stops and 3 starts...

14:50 mefesto: zilti: yea i think im done using tomcat/jboss these days

14:50 zilti: Using jetty instead?

14:50 mefesto: zilti: i'm new to noir but so far it's got everything i need

14:51 zilti: i'm thinking just using lein run is good enough

14:51 zilti: ex. lein run prod

14:52 zilti: i have a few (simple) apps to be made at work and i'm going to try this out for them

14:52 zilti: mefesto: The only problem with Tomcat I have is that when deploying using war files you can't deploy to the root context

14:53 mefesto: zilti: you should be able to

14:53 zilti: mefesto: It seems to only be possible by manually copying the contents of the war into the root context

14:53 mefesto: http://benhutchison.wordpress.com/2008/07/30/how-to-configure-tomcat-root-context/

14:54 so something like `lein uberwar ROOT.war` ?

14:54 gfredericks: cp my.war tomcat/webapps/ROOT.war

14:58 zilti: Hm right now it doesn't println to the log file

14:58 mefesto: zilti: is there a catalina.out file?

14:59 zilti: mefesto: It doesn't println to the log file? Which folder is that cataline.out file supposed to be?

14:59 mefesto: http://tomcat.apache.org/tomcat-6.0-doc/logging.html

15:00 zilti: not sure. i thought it was the tomcat root dir

15:01 The "Console" section says that System.err/out go to that file

15:04 zilti: find it?

15:04 zilti: mefesto: Unfortunately: no

15:05 mefesto: zilti: on linux?

15:06 zilti: if so try `find /dir/to/tomcat -name catalina.out`

15:07 zilti: mefesto: Yes, on linux. But I'll first try (java/util/logging/Logger/global/info

15:08 Raynes: This is why I don't do web development.

15:08 mefesto: zilti: clojure.tools.logging should work for you then. i believe it'll use whatever underlying logging framework is available at runtime (commons logging, java.util.logging, log4j, etc)

15:08 Raynes: Or, why I'm happy that I don't have to do *much* web development.

15:08 mefesto: This is why i can't stand java web containers

15:08 daaku: i'm trying my hand at some complex clojure (for me) and java (which i don't really know) by writing a gen-class that extends java.util.logging.Handler and i'm getting a "No matching ctor found for class" error that i can't seem to figure out and would love some help with: https://gist.github.com/bab3a0a8160f9abb1714

15:10 i tried to decompile the generated class, and oddly i do see a constructor with the signature i'm using (what the rest of the code was doing is beyond me)

15:11 gfredericks: daaku: what're you doing when you get the error?

15:11 daaku: gfredericks: trying to instantiate my handler class: (ring-loggly.core.handler. "foo" 200)

15:11 gfredericks: this happens at (compile 'my.ns) btw

15:12 gfredericks: hm

15:12 * gfredericks gives up

15:13 daaku: lol, i'm not there yet. i figured if i can get this to work, i'll know more about java interop as well as clojure concurrency

15:14 zilti: Ok bye for today. Progess: I'm getting an exception now...

15:14 gfredericks: daaku: if it were me, I would try things like putting the reference to the class after the gen-class, or in another namespace so you can properly import it. But really I don't know what's going on.

15:15 daaku: gfredericks: seems unlikely it's an order thing since it does seem to find the class, just not the constructor (at one point the class wasn't being found either)

15:16 gfredericks: daaku: agreed. That's why I gave up before mentioning it.

15:28 simard: is there a lib for git/clojure interop ?

15:29 maio: what's wrong with (iterate repeat :foo) ?

15:32 TimMc: maio: What are you trying to accomplish?

15:33 maio: (= (repeat 100 :foo) (take 100 (iterate ___ :foo))))

15:33 what would you put instead of ___?

15:33 TimMc: ,(doc iterate)

15:34 clojurebot: "([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"

15:34 TimMc: maio: identity would work, but just use the (repeat) function.

15:37 maio: ok thanks. I'm doing clojure koans btw - https://github.com/functional-koans/clojure-koans/blob/master/src/koans/lazy_sequences.clj#L24

15:38 TimMc: maio: Oh, in that case I shouldn't have told you the answer.

15:38 Do you understand why it works?

15:40 maio: well I understand one that is few lines above (= __ (take 20 (iterate inc 0)))

15:40 that would call inc 0, than inc of that inc before and so on

15:41 but I'm not sure I get that example I needed help with

15:42 I would just put (repeat :foo) there

15:43 Raynes: &(take 5 (iterate identity :foo))

15:43 lazybot: ⇒ (:foo :foo :foo :foo :foo)

15:44 maio: &(take 5 (repeat :foo))

15:44 lazybot: ⇒ (:foo :foo :foo :foo :foo)

15:44 maio: &(repeat 5 :foo)

15:44 lazybot: ⇒ (:foo :foo :foo :foo :foo)

15:44 Raynes: Yes, that'd make more sense. But I don't think koans are meant to make sense. ;)

15:45 brehaut: if a lazy seq falls in the forest, is it fully realized?

15:45 Raynes: brehaut: Depends -- does it land on a gopher?

15:45 brehaut: Raynes: nobody uses gopher these days, so i think we can assume no

16:04 maio: ,(doc complement)

16:04 clojurebot: "([f]); Takes a fn f and returns a fn that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value."

16:16 TimMc: ,(take 5 (iterate complement :hi))

16:16 clojurebot: (:hi #<core$complement$fn__3653 clojure.core$complement$fn__3653@5b0f2e> #<core$complement$fn__3653 clojure.core$complement$fn__3653@419d65> #<core$complement$fn__3653 clojure.core$complement$fn__3653@1c477f9> #<core$complement$fn__3653 clojure.core$complement$fn__3653@1a089a6>)

16:17 gfredericks: what a fantastic collection of functions!

16:17 TimMc: oof

16:17 ,(take 5 (iterate not :hi))

16:17 clojurebot: (:hi false true false true)

16:17 TimMc: I always do that.

17:03 daaku: i've successfully written some code that pipes java logging to loggly.com in a single background thread that batches them in a number of async http requests. it's using gen-class and atoms, and is pretty small (45 lines) and would love some feedback if anyone's got some time: https://github.com/nshah/ring-loggly.clj/blob/master/src/ring_loggly/core.clj (the ring middleware aspect is still wip)

17:05 one thing i discovered is that i might be able to use proxy instead of gen-class, but haven't figured it out yet

17:08 zakwilson: I know there have been a bunch of different things written to allow Clojure to connect to IRC and do various things. I want to join a channel and receive all the channel's messages, triggering a callback when a message is received. Which is likely to be the simplest to work with?

17:18 Raynes: zakwilson: I maintain an IRC library.

17:18 zakwilson: https://github.com/Raynes/irclj

17:19 I use this library in lazybot. It hasn't had much attention by me lately, and I plan to rewrite parts of it in the future, but in the meantime it works pretty well and is dead simple.

17:19 The example bot should be helpful.

17:20 zakwilson: Raynes: looks like exactly what I need. Thanks.

17:21 Raynes: https://github.com/raek/lcug-examples/tree/master/bot is another example bot.

17:26 terom: Raynes: the link on irclj page (http://www.github.com/Raynes/sexpbot) gives 404

17:27 Raynes: terom: Yeah, it's http://github.com/flatland/lazybot

17:27 I'll update that shortly.

17:28 jodaro: irclj: i see what you did there

17:28 Raynes: jodaro: Indeed.

17:28 jodaro: See why you should stop using crappy names?

17:30 jodaro: totally

17:30 i'm missing an important part of the creative process

17:32 Raynes: Just ask me and I'll give you golden names.

17:33 jodaro: For example, clj-wordnik = wordnak, clj-klout = repute.

17:34 zakwilson: I just found that the google search 'where did contrib go' gives the right answer.

17:34 * technomancy_ is pretty bummed that chrono got renamed to clj-time

17:41 Raynes: technomancy_: Yeah, I don't understand people who name things clj-*

17:41 Use your mind, friends. There are all sorts of lovely names you can squat.

17:41 llasram: CL people who are used to projects named cl-* ?

17:41 Raynes: That's the whole problem with CL. Crappy names.

17:42 llasram: nice

17:42 Raynes: Even the name of the language -- Common Lisp. I mean, 'common' is in the name!

17:42 llasram: You could even extend that to a statement about namespaces...

17:42 Raynes: What if Clojure was called Typical JVM Lisp.

17:42 technomancy_: I've said it before, Common Lisp function names are optimized for Wheel of Fortune.

17:43 how else do you explain rplacd?

17:43 llasram: lol, I was just trying to make sure I was going to spell "rplaca" right

17:44 Although I've been reading /Let over Lambda/, and even Hoyte admits it's probably one of the worst-named functions ever

17:45 technomancy_: calling filter "remove-if-not" has got to be on that list though

17:45 dont-keep-unless-predicate-isnt-false

17:47 llasram: Eh. I'm not going to defend CL (never really used it), but any langage of any age will have a few naming warts. I mean, Clojure is all of what, 3 years old? And find vs get, for just one example

17:50 technomancy_: yeah, or some or contains

17:50 though the former is really CL's fault too

17:51 llasram: There is only possible solution: go back in time, and replace CL with Scheme when no-one is looking

17:53 manutter: woot, just got my blog added to Planet Clojure

17:54 I haven't been Clojure blogging much, anyone got any good tips, syntax colorizers for Clojure, etc?

17:54 I'm also trying to branch out into screencasts too

17:55 scottj: manutter: have you seen http://youtube.com/emailataskcom screencasts?

17:55 manutter: no, but I will, thanks :)

17:56 Raynes: manutter: What blogging engine do you use?

17:56 manutter: blogger right now

17:56 Raynes: Yikes.

17:56 No clue in that case.

17:56 manutter: I do some other blogs on WordPress

17:57 Raynes: I'm into octopress.

17:57 manutter: wow, haven't heard of that one

17:57 Raynes: Wordpress's SyntaxHighlighter plugin can highlight Clojure.

17:57 scottj: http://jaderholm.com/blog/blog/2011/09/26/blogging-with-org-mode-and-octopress/

17:57 Raynes: Octopress is a developer-oriented blogging engine.

17:58 scottj: with org+octo you can get the exact same clojure highlighting (and any other language) as you get in eamcs

17:58 manutter: awesome, that's exactly the kind of stuff I was hoping to find.

17:58 * Raynes hasn't found a use for org-mode yet.

17:58 Raynes: I do note taking and… everything else in Springpad.

17:59 jcromartie: does anybody know how to use clj-http with cookies?

17:59 wrap-cookies in particular

18:00 I'm reading the source in the mean time https://github.com/dakrone/clj-http/blob/master/src/clj_http/cookies.clj

18:00 Bronsa: http://kimochi.ath.cx/up/9e0a18c69940ae9e20a84cc7846c961b.avi

18:01 jcromartie: Bronsa: what's that?

18:02 Bronsa: some paredit-like thing i'm working on

18:02 jcromartie: oh cool

18:02 :) paredit is the way to go

18:02 * Raynes isn't in the habit of clicking random avi links.

18:02 technomancy_: M-x htmlize-buffer is great for blogging

18:03 llasram: Oh man, htmlize-buffer is totally my blog's syntax-highlighting engine

18:03 manutter: Oo, that sounds like a good one too, thanks.

18:03 jcromartie: I feel like paredit is much closer to "modifying the code" than simple text editing, which is more like "modifying the text that makes up the code"

18:04 technomancy_: llasram: supposedly htmlfontify replaces it in 23 or 24, but it still has a couple bugs with giving the default face a different style.

18:05 Raynes: technomancy_: I was using that for my talk, but then I realized I could gist my code and then copy it over to keynote and maintain highlighting. Github's highlighting is easier to see in my talk, since I use solarized dark in Emacs which is pretty low-contrast.

18:05 technomancy_: there's a github theme for Emacs =)

18:05 but yeah, I basically only use htmlize with the stock theme

18:05 Raynes: Besides, I'm of the opinion that gist solves all problems.

18:06 llasram: technomancy_: Hmm. Thanks for the heads-up. Works fine in 23, but something to check when I make the switch to 24

18:06 scottj: you can have different themes per frame

18:06 Raynes: I know, but htmlize gives me an extra step of having to open the html in my browser to copy it over. With gist, I just gist the code. Not that there is a huge difference.

18:07 technomancy_: yeah, if you're using a non-textual format for your slides... but then you have the proverbial two problems.

18:08 llasram: Raynes: Or you can do what I did. I wrote my own blog engine, and the only way to post to it is from code written in emacs-lisp, which uses htmlize-buffer to syntax-highlight code examples before posting. Totally a sane solution

18:08 Raynes: Yeah, man.

18:08 technomancy_: llasram: 93-line rakefile, man. can't go wrong.

18:09 scottj: (defun raynes () (interactive) (htmlize-buffer) (browse-url-of-buffer) (run-shell-command "conkeror -e 'cmd_selectAll(); cmd_copy();"))

18:10 technomancy_: scottj: nice; didn't know about browse-url-of-buffer

18:10 llasram: technomancy_: Nice. Yeah, I need to switch to something else. Either something super-simple like that, or something off-the-shelf. I haven't touched my current blog code in years, and wouldn't know where to start even e.g. brushing up my stylesheets w/o spelunking

18:10 Raynes: Keynote is pretty nice. I needed nice and simple button buttons to press. It's my first ever talk. I'm scared of everything.

18:10 Minus the extra 'buttons' there.

18:10 technomancy_: Raynes: all the more reason to use version control

18:11 rafl: is there a standard or community standard for writing clojure documentation?

18:11 Raynes: I do use version control, though it doesn't do much good with binary files. ;)

18:11 rafl: Marginalia is a good option.

18:11 Autodoc is another.

18:12 But there aren't really any 'standards'.

18:13 scottj: ;; is a pretty good standard

18:13 Raynes: scottj: o/

18:13 * scottj has to google that emoticon

18:13 rafl: as in, even attempting to come up with a way to "give me the docs for $function" is basically futile?

18:14 llasram: docstrings?

18:15 rafl: that seems kinda useless if people tend to use other tools for providing their docs anyway, which is the impression Marginalia gave me

18:15 unless of course i didn't actually get what it does.

18:16 scottj: I think marginalia is for above and beyond docstrings

18:16 or a pretty way to display docstrings and more

18:16 rafl: so, if someone were to use marginalia for his docs, would that mean he normally wouldn't even bother to provide docstrings?

18:17 scottj: you'd still provide docstrings

18:17 you know about repl ways to read docstrings right?

18:18 wtetzner: if you're using slime, you can use M-. to jump to a function definition, which lets you easily see the docstring

18:18 llasram: Er, or C-c C-d C-d to just show the docstring for it

18:18 rafl: stepping back a bit - one of the annoyances i'm having is it being too hard and distracting to go to the docs for a given function or a synopsis of a full module or whatever. they all tend to be in very different places

18:19 and not necessarily for modules i have already installed, but for ones i'm trying to figure out whether or not to use them

18:20 it just seems slightly odd to have to go to different web pages all the time or having to figure out where the source lives for every one of them

18:20 i figured that, if there was some similarity in how all the modules would provide their docs, it'd be easy enough for me to write something that'd just give me docs for a module on clojars, given its name

18:21 but that doesn't seem very practical, apparently

18:21 scottj: llasram: same thing in tooltip http://www.youtube.com/watch?v=dio__Qylp-s#t=1m11s

18:22 llasram: scottj: Yah, I got ac-slime working just a few weekends ago. Thanks for the tip, though :-)

18:22 Any golfers in the house? I mentioned earlier, but I'm trying to make the Clojure solution for this alioth benchmark not the longest (code-wise) for any language http://shootout.alioth.debian.org/u64q/performance.php?test=nbody&sort=gz

18:23 Here's what I have so far: https://gist.github.com/1326024

18:23 Which is now slightly shorter than the Haskell version, but longer than the Java version (by their metric)

18:23 scottj: rafl: have you looked at autodoc? maybe you could run that on the various projects.

18:24 Raynes: ibdknox: HAI

18:24 scottj: rafl: also if you're using emacs/vim you can use tag files to navigate to the symbol's source w/o having it running in your system

18:24 ibdknox: Raynes: OMG

18:24 Raynes: HAI

18:25 rafl: scottj: i will in a minute. right now i'm being distracted by the shiny that is ac-slime :)

18:25 Raynes: ibdknox: I require a new version of noir without cssgen's contrib dependency. No, I demand it.

18:25 ibdknox: I think that's fair

18:25 I'm annoyed with cssgen anyways

18:26 Raynes: give me a minute

18:26 Raynes: It's just, it puts contrib on tryclojure's classpath, yet tryclojure runs 1.3.

18:26 scottj: have you used gaka?

18:26 Raynes: It's all very confusing and scary.

18:26 ibdknox: Also, I got tryclojure running on heroku last night. :>

18:26 ibdknox: wow

18:27 Raynes: I'm impressed. I never looked at clojail that in depth but I would've thought it required some stuff that wouldn't work on heroku

18:27 Raynes: ibdknox: Took me like 10 minutes.

18:27 Yeah, me too!

18:27 ibdknox: that's... awesome

18:27 Raynes: All I had to do was specify the policy file on the command-line.

18:27 ibdknox: very cool

18:27 Raynes: Heroku apparently doesn't care, since it isn't like unsandboxed code can damage anything anyways.

18:28 llasram: I haven't used Heroku (yet), but I saw one of their guys' talks at Strange Loop. AFAI could tell from what he said, you basically just get a chroot in an EC2 box to do whatever you want it?

18:30 ibdknox: eh

18:30 you have no local storage

18:31 basically you can't interact with the filesystem last I knew

18:31 maybe that changed recently though

18:31 technomancy_: ibdknox: well... that was on the old stack

18:31 back when it was all-ruby

18:32 ibdknox: technomancy_: huh.. I tried a while back and had bad things happen when I tried to read a file

18:32 technomancy_: and that was with Clojure

18:32 technomancy_: hmm... definitely let me know if you run into that again

18:32 you can write to the filesystem, but you should only use it as a scratch-pad rather than for permanent storage.

18:32 ibdknox: right

18:32 technomancy_: (which is actually true of everything on EC2, not just heroku)

18:32 ibdknox: yep

18:33 technomancy_: you saw that Raynes got try-clojure onto heroku in 10 minutes, yeah?

18:33 (inc technomancy)

18:33 lazybot: ⇒ 17

18:33 technomancy_: yeah, that's sweet

18:40 algal: speaking of clojure in the cloud, is there anything standard / good / obvious for persisting clojure data structures to the Google App Engine datastore?

18:41 daaku: is there a null-safe built in macro?

18:42 ibdknox: daaku: huh?

18:42 algal: just pr-str them?

18:43 daaku: ibdknox: something to deal with calling a java method on the result of null value from another java method where object or null is returned

18:44 algal: ibdknox: yeah, read/print serialisation to a string seems like the drop dead simplest way. Was wondering if there's anything non-obvious I should know about. New to clojure.

18:46 ibdknox: algal: I mean you could try to do something clever, splicing maps out into columns and such, but it's probably not worth it, unless you're doing crazy indexing

18:46 algal: it's hard to tell without knowing your use case though.

18:46 daaku: ##(doc if-let) is the only thing I can think of

18:46 lazybot: ⇒ "Macro ([bindings then] [bindings then else & oldform]); bindings => binding-form test If test is true, evaluates then with binding-form bound to the value of test, if not, yields else"

18:47 technomancy_: daaku: there's -?> in clojure.core.incubator I think

18:47 daaku: -?> looks like it

18:47 thanks technomancy_

18:47 scottj: there's .?. also

18:48 daaku: i just came up with a crappy one: (defmacro null-safe [default & body] `(try (do ~@body) (catch java.lang.NullPointerException e# ~default)))

18:48 ibdknox: I should look at the incubator stuff aparently :)

18:48 Raynes: 1.2.1-SNAPSHOT no longer has cssgen

18:49 Raynes: o/

18:49 daaku: man there's a lot of cool stuff available

18:52 algal: A newb question -- I notice add-classpath is deprecated. Is there some new function that replaces it? Without it, it seems like my REPL is crippled to whatever the class path was when I started it. Or am I missing something?

18:58 technomancy_: algal: most people just restart

18:58 you can try https://github.com/cemerick/pomegranate though

18:59 algal: technomancy_: ok, thanks.

18:59 technomancy_: and thanks also for leiningen. It's a great help -- been away from Java so long, maven etc.. is a mystery to me. nice to find something sane to get started with.

19:00 technomancy_: great! =)

19:00 algal: I even liked the short story too, so it's a double win. :)

19:17 speaking of leiningen, is ~/.lein/bin/swank-clojure a sensible place to put customisations if my "default" (i.e., non-project) REPL's classpath? (e.g., if I wanted contribs to be available so I could get to trace )

19:19 technomancy: that's one way to do it. I just generate a new scratch project

19:22 algal: technomancy: okay, cool. I like to have a REPL just a command away in emacs, so I'm trying to just find the defaults..

19:23 Raynes: Bleh. Scratch projects are for wimps who don't believe in The Global Project, technomancy.

19:24 Wimp.

19:24 algal: The Global Project is life itself, eh?

19:24 Raynes: algal: It was a vague reference to a non-argument we had about cake's global project concept a while back.

19:25 algal: Raynes: ah.

19:25 Raynes: He gave me a line that I've had a lot of fun with since then: "Must be solving problems I don't have."

19:25 algal: Raynes: That is a good one! Reminds of an old Quaker saying, which I quite like. "It does not speak to my condition."

19:26 Raynes: technomancy is the Shakespeare of programming.

19:26 algal: i can believe it

19:26 ibdknox: this was him: http://shakespearelang.sourceforge.net/report/shakespeare/

19:27 algal: yeah, saw that on HN recently

19:28 Contribs is pretty stable stuff, I'm guessing? (again, newb question….)

19:28 ibdknox: noooooo

19:28 ~contrib

19:28 clojurebot: latest contrib is 947

19:28 ibdknox: ..

19:28 algal: don't use contrib

19:29 ~where did contrib

19:29 clojurebot: contribute is http://clojure.org/contributing

19:29 ibdknox: ok

19:29 algal: ibdknox: oh really… ?

19:29 ibdknox: the bot is pissing me off lol

19:29 Raynes: $google where did contrib go

19:29 lazybot: [Where Did Clojure.Contrib Go - Clojure Design - Clojure Development] http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

19:29 Raynes: ibdknox: lrn2bo

19:29 t

19:29 ibdknox: algal: yeah, the old monolithic contrib is phased out

19:30 Raynes: one of these days I will understand clojurebot and his mysterious ways.

19:30 that day is not today.

19:30 algal: ah.

19:30 Raynes: Meh, just understand lazybot. I'll help.

19:32 ibdknox: lazybot: is clojurebot annoying???

19:32 lazybot: ibdknox: How could that be wrong?

19:32 ibdknox: srsly.

19:33 algal: ibdknox: So, monolithic phase-out means just rejiggering of the namespace, but it's still just one jar? and half the stuff hasn't been officially upgraded and renamespaced for clojure 1.3? Am I getting it?

19:33 ibdknox: algal: not one jar

19:33 algal: ibdknox: (I mean, understanding it.)

19:33 ibdknox: algal: they're all different projects now

19:33 algal: mamma mia.

19:33 ibdknox: algal: the idea being that you shouldn't be bringing down some epic jar when you just want one function

19:34 algal: also, the projects move at very different speeds

19:35 algal: okay, so if it's being broken into loads of smaller jars, then that makes distribution more complicated. Is that solved by them all living in an official repo that people access via maven / leiningen / etc. ?

19:35 simard: does anyone know of a clojure library for accessing git ? I'm having a hard time finding that on google, as every lib these days is hosted on github

19:35 algal: (Sometimes tough to back out this big picture stuff just by googling reading etc.. fast moving plat and all that.)

19:35 ibdknox: algal: if it's an official contrib library it's in maven central

19:36 algal: ibdknox: ok. And some of the parts of the "old 1.2" contrib have been officially upgraded and others are waiting for maintainer input and others have been orphaned…. ?

19:36 ibdknox: simard: https://github.com/TobiasRaeder/clj-git

19:36 simard: also, there's jgit

19:37 algal: correct

19:37 algal: ibdknox: Great. Thanks.

19:37 Raynes: simard: Also, if you need to work with the Github API, check out https://github.com/Raynes/clj-github

19:38 ibdknox: Raynes: oo, didn't know about that

19:38 Raynes: jodaro: And before you call me out on having a clj-* library, it's only because I haven't come up with an interesting name yet. ;)

19:39 simard: ibdknox: Raynes: thank you both

19:39 ibdknox: Raynes: what do you use the github api for?

19:40 Raynes: I believe I wrote it because I was working on a cake plugin for working with Github.

19:40 But other people use it now, so I still maintain it.

19:40 ibdknox: mm

19:40 Raynes: I also thought I'd want to use it in lazybot for commit reporting in channels, but I ended up using using a post-receive hook + web server.

19:41 ibdknox: yeah, I've always ended up using hooks

19:41 Raynes: P.S.: If you had an IRC channel for noir, I could get lazybot to report commits in there with compare links and everything.

19:42 ibdknox: oo

19:42 no one has requested a Noir channel yet

19:42 that's the only reason I haven't done it

19:42 wow

19:42 #noir is actually empty

19:42 Raynes: Might become necessary at some point. Noir is obviously going to be the most popular web framework.

19:43 ibdknox: obviously.

19:43 I'll have achieved victory once we bully amalloy_ into using it... :D

19:43 Raynes: When I get some time, I'll do the work required for 4clojure to use it.

19:44 algal: thanks for the tips, chaps.

19:44 Raynes: 4Clojure's routing and stuff is relatively simple. I did some refactoring of it a while back, so it shouldn't be troublesome.

19:46 ibdknox: :)

19:46 ok

19:46 I registered noir

19:46 lol

19:47 Raynes: o/

19:48 simard: Raynes: do you have an example of using your lib ?

19:48 Raynes: simard: clj-github?

19:48 simard: yes

19:48 Raynes: What do you want to do?

19:48 simard: short answer: I don't know

19:48 ibdknox: lol

19:48 Raynes: Well, there is a brief example under 'Usage' in the README.

19:48 ibdknox: you just know you want to do something with github?

19:49 simard: I'd like to.. retrieve a file from a repo on github

19:49 modify it, and commit it bacj

19:49 Raynes: Oh. Yeah, this wont help you with that.

19:49 simard: you mean the lib, or your readme ?

19:49 ibdknox: simard: you need jgit for that

19:49 simard: ok

19:49 Raynes: You need jgit for that.

19:49 ibdknox: Damn you.

19:49 * ibdknox wins

19:50 simard: so that wrapper around jgit, is it faily usable ?

19:50 clj-git

19:50 ibdknox: it implements like two things

19:50 lol

19:50 Raynes: Looks like it. Deps are a bit out of date though.

19:51 But in general, jgit shouldn't be hard to use. clj-git is probably like a big usage example.

19:51 ibdknox: more or less

19:51 there's really not much there

19:52 simard: ok, yeah I'll read to get an idea of how to use jgit

20:08 dnolen: why constraint logic programming rocks, http://dosync.posterous.com/a-taste-of-ckanren

20:09 ibdknox: For those playing the home game, #noir is now open :)

20:35 technomancy: simard: I wrote https://github.com/technomancy/quickbeam but it was more of an exercise in swarm coding than an actual useful library

20:35 s/I wrote/I wrote with the help of the Boston Clojure Group/

20:35 based on jgit

20:36 Raynes: technomancy: Boston Clojure Group? Don't you live in Seattle? You must get around.

20:37 technomancy: apparently they schedule their meetings around my travel itineraries

20:37 Raynes: I bet.

20:37 technomancy: or they did anyway; the first 3 always coincided with Sonian team get-togethers.

20:38 simard: technomancy: swarm coding ?

20:38 technomancy: simard: it's like pair programming but with 4+ people =)

20:39 simard: oh, you mean chaos :)

20:39 technomancy: as close to chaos as you can get and still end up with a functioning library published to github and clojars =)

20:39 simard: hehehe

20:40 jamiltron: I only code when I have a cheer squad accompanying me.

20:41 Raynes: I only code when I have The Ting Tings performing That's Not My Name at the other end of the room.

20:42 jamiltron: Nice

21:04 meta_: Why does clojure.walk and into destroy meta?

21:07 Raynes: Man, writing talks is hard. Why did I wait to the last minute to write this thing?

21:07 meta_: I mean, I know _why_ as the bugs in the clojure 1.3 code are obvious...

21:07 Raynes: redinger: I'd appreciate it if you'd go ahead and move the Conj to December. That isn't unreasonable, is it?

21:07 meta_: I just wonder if there was a reason why that I'm missing.

21:09 details: 'into uses transients but forgets about meta.

21:10 Raynes: "Stuart, the author, hates it because he says it’s too buggy and breaks on too many edge cases..."

21:10 RE: clojure.walk

21:11 That was '10. Not sure if anything has changed since then.

21:11 meta_: I've heard that back then, and I get it (I still like clojure.walk...)

21:11 Raynes: I do too. :>

21:11 Guilty pleasure.

21:11 ibdknox: it's really slow

21:12 meta_: _into_ is the big bug IMHO

21:12 Raynes: We use it significantly in Clojail.

21:12 meta_: I'd like to build a case:

21:12 1. metadata has its uses

21:13 2. currently it cannot be used with clojure 1.3 because it's somewhat like stepping on a mine field wether or not it will survive after calling a clojure core fn.

21:13 is that too harsh?

21:15 It's just me posting the short unfiltered version because it's irc...

21:16 I heart Clojure.

21:38 technomancy: meta_: that's always been a big question mark with metadata usage; it's unclear which operations preserve it and which don't

21:39 meta_: I vote that Clojure (core fns) should never lose metadata.

21:39 Who's with me?

21:40 spoon16: is there a way to tell if a sequence is lazy?

21:41 technomancy: meta_: I think it should be decided on a case-by-case basis. into should probably propagate the metadata of its first arg though.

21:42 meta_: I'm actually fine with that _except_ for into and clojure.walk (I love those fns and rely on them heavily, but I'd also love to use metadata too...)

21:43 I guess I'm just arguing for those two things.

21:43 technomancy: maybe bring it up on the mailing list

21:44 meta_: That's a good idea. Would you mind doing that ? <grin>

21:45 technomancy: I don't have a very good track record for getting my fixes into clojure =\

21:45 meta_: heh heh...

21:45 ty for the comments.

21:47 technomancy: sure

21:59 gfredericks: does anybody know what maven repo I need to add to get clojure.algo.generic?

22:02 simard: to whoever recommended me "The Joy of Closure", thank you

22:03 Raynes: simard: That'd be pretty much everybody.

22:03 Not many people don't like that book.

22:04 simard: thanks everybody

22:04 :)

22:04 * Raynes rubs against chouser to obtain some bookfu for his own book.

22:06 gfredericks: I've recommended JoC a number of times and have never looked inside it at all

22:44 Raynes: gfredericks: That's the Clojure hive mind.

22:44 Once you've been here for a while it gets inside your head.

22:56 daaku: is there a better way to write this: (array-map :trace 0 :debug 1 :info 2 :warn 3 :error 4 :fatal 5) ? i feel i should be able to use [:trace :debug :info :warn :error :fatal] (iterate inc 0) instead, but can't seem to figure out what's the best way to write it

22:58 technomancy: ,(map-indexed vec [:trace :debug :info :warn :error :fatal])

22:58 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: core$vec>

22:58 technomancy: ,(map-indexed vector [:trace :debug :info :warn :error :fatal])

22:58 clojurebot: ([0 :trace] [1 :debug] [2 :info] [3 :warn] [4 :error] ...)

22:58 daaku: sweet, even better. thanks technomancy

22:58 technomancy: I guess you still need an (into {} ) there

22:58 if you only have 6 elements you might as well use a literal

23:00 daaku: hmm.. i get ArityException Wrong number of args (2) passed to: core$vec clojure.lang.AFn.throwArity (AFn.java:437)

23:01 i'm using 1.3

23:05 oh

23:05 man, i'm an idiot

23:12 technomancy: man, what is it with people and wanting to avoid putting jars in repositories?

23:12 ಠ_ಠ

23:13 maybe if it were "get a subscription with $HOSTED_SERVICE" instead of "run your own archiva server" people wouldn't be so resistant to doing the right thing

23:14 am I missing something, or does sonatype not offer nexus-as-a-service?

23:15 seems like a real no-brainer; they're trying to sell an "enterprise nexus" instead which doesn't make any sense.

23:24 spoon16: I want to use *buffer-size* defined in duck-streams

23:24 how do I do that from my own ns/.clj?

23:25 technomancy: spoon16: duck-streams?

23:25 surely you mean clojure.java.io?

23:26 spoon16: clojure.contrib.duck-streams

23:26 it defs *buffer-size*

23:26 I just want to read that value in my own .clj

23:26 technomancy: yeah, but duck-streams is way deprecated

23:26 spoon16: oh

23:26 I guess I wasn't paying good attention :)

23:27 so, lets say I do mean clojure.java.io

23:27 how do I read the var in my own function/ns?

23:27 technomancy: (:require [clojure.java.io :as io])

23:27 then io/*buffer-size*

23:27 spoon16: ok

Logging service provided by n01se.net