#clojure log - Jul 15 2010

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

0:11 robink: hrm, clojure-contrib does not include string

0:12 ...at least mine doesn't

0:14 Oh, that's because it's only in git

0:21 * robink remerges maven-bin :(

1:10 Bahman: Hi all!

1:16 raek: hi!

2:56 idrop: hi all, v. new to clojure: given (def data '( {:foo 1} {:foo 2} )), how come this map fn works:

2:56 (map (fn [m] {:bar (:foo m)}) data)

2:56 but this doesn't:

2:56 (map #({:bar (:foo %) }) data)

2:57 think the issue is with %

3:01 raek: what is the expected output? ({:bar 1} {:bar 2}) ?

3:01 replaca: idrop: #(f a b c) = (fn [...] (a b c))

3:01 sorry, idrop: #(f a b c) = (fn [...] (f a b c))

3:02 raek: the #(...) shorthand can only do function invocations

3:02 replaca: see the extra parens added?

3:02 raek: you can do it like this (map #(hash-map :bar (:foo %)) data)

3:04 idrop: you might be interested in this: http://richhickey.github.com/clojure/clojure.set-api.html#clojure.set/rename-keys

3:04 (map #(clojure.set/rename-keys % {:foo :bar}) data)

3:05 (assuming renaming :foo to :bar was the goal)

3:07 reflection: {...} can be considered to be syntactic sugar for (hash-map ...)

3:07 (unless the map is very small. then it would be (array-map ...))

3:11 tomoj: why is rename-keys in clojure.set?

3:30 zkim: hey all

3:40 bortreb: what do you guys recommend for clojure debugging in emacs?

3:40 Is there some sort of way to step through code even if it goes into javaland?

3:41 AWizzArd: bortreb: you can use any Java debugger, for example jswat. That would be an external program. But in Emacs you can try with recent versions of slime to use swank.core/break

3:41 This will stop your program at that point and you can inspect local vars, and then continue.

3:42 bortreb: nice, but I would think that emacs would have some killer way of debugging clojure ?

3:48 AWizzArd: Nope.

3:48 println debugging :-)

3:56 tomoj: nice, clojure-json can lazily encode lazy seqs to writers :D

3:58 can't lazily decode, though, hmm

4:03 raek: it consumes a (potentially blocking) lazy seq and encodes every element and writes them to the writer?

4:14 esj: morning all

4:17 LauJensen: Morning esj

4:33 cais2002: hi all, is transient support still alpha as indicated in the doc?

4:33 idrop: sorry all, thanks for your suggestions

4:37 tgk: I'm trying to define a description string for a function separate from the function but it doesn't work. I'll give you a quick example in a jiffy. There's probably some subtle reason as to why it can't work.

4:37 (def desc "Foo bar") (defn foo desc [x] x) (doc foo) => user/foo (desc)

4:42 AWizzArd: tgk: "defn" is a macro and thus does have a defn-specific evaluation rule for its arguments.

4:42 defn expects a string while you put a symbol into that position

4:42 raek: maybe (defn #^{:doc desc} foo [x] x) works

4:43 esj: or roll your own defn macro

4:43 raek: the docstring position is just a shortcut for adding :doc metadata to the var

4:43 tgk: raek: that works

4:43 raek: and the metadata on the symbol will be copied to the var

4:43 AWizzArd: tgk: what also should work is: (defn foo #=desc [x] x)

4:44 no, should not work

4:44 esj: AWizzArd: what is the #= ?

4:44 AWizzArd: A reader macro, which will trigger an evaluation of an expression in the reader, during read-time.

4:45 esj: AWizzArd: nice.

4:45 tgk: Oh, okay. I'm using the #^ approach, but thanks

4:46 I'm not entirely sure why the symbol isn't evaluated though

4:46 AWizzArd: tgk: because defn is a macro

4:46 tgk: AWizzArd: but it could force evaluation

4:46 AWizzArd: Macros don't need to evaluate their arguments.

4:46 It could, but why should it?

4:47 tgk: Why not?

4:47 AWizzArd: Why not not?

4:47 tgk: I would think least surprise would dictate evaluation

4:47 raek: since fn takes a variable number of args, it needs some way of knowning what is what

4:48 it expects docstrings to be strings

4:48 AWizzArd: It's just a source for errors.

4:48 And the doc string should be pretty clear, and won't need to get calculated during runtime.

4:48 tgk: raek: Ahhh! That makes sense, thanks.

4:48 cschreiner: Looking for more documentation on the identity in (map #(%1 %2) (cycle [inc identity]) [1 2 3 4 5 6 7 8 9 10])

4:49 raek: (defn identity [x] x)

4:50 cschreiner: well, yes

4:50 raek: (cycle [inc identity]) => (inc identity inc identity inc identity ...)

4:50 map will get one sequence of alternating inc and identity fns, and one sequence of numbers

4:50 AWizzArd: cschreiner: for example you have a sequence of objects, but some may be nil or false, then (filter identity your-seq) ==> non-nil objects

4:50 raek: and then apply the first fn to the first number, etc

4:51 cschreiner: so, it's an implicit something

4:51 raek: => ((inc 1) (identity 2) (inc 3) (identity 4) ...)

4:51 identity is a functional no-op

4:51 cschreiner: raek: let me dwell a little on that

4:56 AWizzArd: New NS for pprint is now clojure.core?

4:57 cschreiner: so, identity is a way to sort out things that has a real identity

4:57 AWizzArd: Nah, clojure.pprint I mean is the new NS, right?

4:57 cschreiner: I understand your example AWizzArd

4:57 AWizzArd: cschreiner: identity just forwards whatever you have

4:58 you use it to look at a specific object, when you need to specify a function

4:59 cschreiner: so, would (filter odd? (filter identity [1 2 3 4 nil])) be an idiomatic approach?

4:59 AWizzArd: filter identity was just an example, it can remove nil and false, but if you just have nils then (remove nil? ...) would be more idiomatic

5:00 cschreiner: ok

5:00 AWizzArd: But in principle that's it.

5:10 esj: this morning, on the 1.2 beta thread on the list, somebody was mentioned equals and equiv and that there was a difference. Anybody know what it is ?

5:50 zkim: cschreiner: thanks for adding that example to clojuredocs.org

6:10 lazy1: ,(+ 10 20)

6:10 clojurebot: 30

6:11 lazy1: ,odd?

6:11 clojurebot: #<core$odd_QMARK_ clojure.core$odd_QMARK_@182c6dc>

6:11 lazy1: ,(filter odd? (range 10))

6:11 clojurebot: (1 3 5 7 9)

6:14 lazy1: clojurebot: help

6:14 clojurebot: http://www.khanacademy.org/

6:17 lazy1: clojurebot: help

6:17 clojurebot: http://www.khanacademy.org/

6:18 rhudson: That's not very helpful

6:19 tomoj: sexpbot: help

6:19 sexpbot: tomoj: I can't help you, I'm afraid. You can only help yourself.

6:20 tomoj: :D

7:44 * _fogus_ reading Yegge's latest (the last line is the best)

7:53 defn: link?

7:54 clojurebot: your link is dead

7:54 mikem: http://steve-yegge.blogspot.com/2010/07/blogger-finger.html

7:55 defn: Whoa. I want to be Steve Yegge's friend.

8:02 chouser: _fogus_: you're right -- the last line is the best.

8:02 defn: who created clojuredocs.org?

8:02 _fogus_: chouser: :)

8:02 TimMc: Aw, that's great.

8:02 _fogus_: Clojure is pulling them all in one by one.

8:03 defn: bah -- i tried to get people interested in something exactly like it awhile back

8:03 _fogus_: Next thing you know Paul Graham is going to post "Why Clojure is Different"

8:03 * defn cries himself to sleep

8:03 chouser: _fogus_: ha!

8:04 defn: I wasn't ready before. I'm sure that has made all the difference!

8:04 defn: :)

8:04 chouser: maybe we could integrate walton with clojuredocs?

8:05 i havent touched that project in way, way too long

8:05 chouser: defn: oh, sorry -- I thought you were talking about clojure, not clojuredocs.org

8:05 defn: oops!

8:06 chouser: I've only glanced at walton, and not even that with clojuredocs.org

8:06 defn: that's it...i'm going to beat clojuredocs.org into the ground

8:06 The Most Ultimate Documentation Site Ever Conceived is upon us, gentlemen.

8:08 cemerick: rhickey: the latter portion of the docstring for reify needs work (the "recur works" sentence fragment + missing this in example arglists). Do you want tickets for these sorts of things?

8:08 * cemerick doesn't want to submit patches with botched descriptions of recur semantics

8:09 rhickey: cemerick: yes, thanks

8:31 bigwavejake: I get an error I haven't see before in a macro that creates a function: http://pastebin.com/T0CWMj9h

8:31 "Can't use qualified name as parameter"

8:31 Any ideas on how to fix it?

8:34 rhudson: use a# instead of a

8:34 bigwavejake: rhudson: nice!

8:34 thanks!

8:38 cemerick: bigwavejake: the a# notation produces a unique symbol for the binding involved. See (doc gensym).

8:38 bigwavejake: cemerick: i will, thanks

8:39 thanks everyone, gotta jet

8:51 Kttmm: hi, could somebody please tell me what's wrong with lein sank on my setup: http://groups.google.com/group/swank-clojure/browse_thread/thread/a176f6e591d740fe

8:54 AWizzArd: Kttmm: the file basic.clj is mentioned. Is that one that you wrote?

8:54 I think neither Leiningen nor swank-clojure have a file named like that.

8:57 wlangstroth: unmatched delimiter on line 185 of basic.clj?

9:01 Kttmm: no, it's not mine

9:04 wlangstroth: Kttmm: weird - did you find basic.clj?

9:05 Kttmm: it's in swank-clojure

9:10 dnolen: Kttmm: just tried the same thing here, that works find for me.

9:11 Kttmm: dnolen: are you using mac os ?

9:12 dnolen: Kttmm: yeah Snow Leopard on i7 MBP

9:13 Kttmm: which version of leiningen are you using?

9:13 dnolen: whatever the latest one is

9:13 wlangstroth: not sure how the architecture could influence a missing parens - probably something in the install

9:14 Kttmm: i just recompiled swank-clojure and i have the same error

9:15 dnolen: Kttm: did you try swank-clojure 1.2.1?

9:17 Kttmm: yes, i have the same error with it

9:18 dnolen: Kttmm: but are you compiling swank-clojure yrself or just getting it off clojars?

9:18 Kttmm: i tried both

9:23 dnolen: Kttmm: hmm, out of ideas. I copied and pasted your clj file and that works for me. Do you have user.clj lying around or something?

9:24 Kttmm: nope, it's a new account :s

9:24 which version of java are you using?

9:25 wlangstroth: I just tried it, and no issues here

9:25 dnolen: Kttm: JDK 1.6 64bit

9:25 wlangstroth: that's a weird one

9:26 (the issue, not the jdk version)

9:27 Kttmm: do you get the warnings when launching swank ?

9:27 dnolen: Ktttmm: no warnings, because of the presence of group-by it looks like your not really getting swank-clojure 1.3.0

9:28 Kttmm: i've got leiningen 1.2-RC2, it should be okay no?

9:29 swank-clojure seems fine : ls lib/dev/

9:29 swank-clojure-1.3.0-20100502.112537-1.jar

9:31 dnolen: Kttmm: perhaps yr in that weird computer vortex. erase your project. erase lein. erase ~/.m2 start over.

9:32 Kttmm: ok, good idea

9:32 dnolen: Kttmm: oh do you have a classpath environment variable set up in your .profile?

9:33 i think lein respects that and perhaps picking up a swank-clojure-xxxx.jar from somewhere else

9:33 Kttmm: you mean the ~/.profile file? or another one? i'm not a mac os X user...

9:34 dnolen: Kttmm: yeah, it used be .bash_profile prior to 10.6

9:34 Kttmm: i don't have any .bash_profile, the account was just newly created

9:35 or is there a global one in /etc too ?

9:35 /etc/profile and /etc/bashrc do not set any classpath

9:36 dnolen: Kttmm: no, I just wipe yr clojure stuff out and start over at this point.

9:38 chrisffm: hi there

9:39 ,(+ 1 1)

9:39 :-(

9:39 chouser: no clojurebot :-P

9:39 no hiredman to ping about it

9:39 chrisffm: hi

9:40 ,(+ 1 1)

9:41 boojum: firedman :)

9:41 cais2002: $(+ 1 1)

9:41 sexpbot: This command is old. Use -> now. It's a hook, so it can evaluate anything, even stuff that doesn't start with parentheses.

9:41 cais2002: ->(+ 1 1)

9:41 sexpbot: => 2

9:41 cais2002: ->->

9:41 sexpbot: java.lang.Exception: Can't take value of a macro: #'clojure.core/->

9:41 chouser: ->>

9:41 sexpbot: => #<core$_GT_ clojure.core$_GT_@1b4e0f0e>

9:42 dnolen: ->(reverse [1 2 3 4])

9:42 sexpbot: => (4 3 2 1)

9:42 chouser: -><-

9:42 sexpbot: java.lang.Exception: Unable to resolve symbol: <- in this context

9:43 chrisffm: hi

9:43 saml: is there csp? something like jsp but in clojure

9:43 chouser: chrisffm: you're connecting each time

9:43 chrisffm: but clojurebot's not here

9:43 saml: i wanna mix in html and clojure because i want to be cool

9:43 like php style

9:43 chrisffm: sorry for that

9:43 i was not registered

9:43 chouser: saml: oh, please don't. have you looked at how enlive works?

9:44 s/works/can be used/

9:44 sexpbot: saml: oh, please don't. have you looked at how enlive can be used?

9:44 wlangstroth: uh, sexpbot agrees?

9:44 lypanov: a warning label is needed. "php style can result in premature death"

9:44 Kttmm: dnolen: i just clone leinigen, remove ~/.m2, self-install, lein new, copied the project file from usenet and I still have the same errors :-(

9:45 dnolen: Kttmm: clone leiningen? you don't need to do that, just d/l the bin and copy that into yr path

9:45 Kttmm: I mean d/l the lein shell script

9:46 chrisffm: could somebody help me with reify and overloaded methods please?

9:47 Kttmm: dnolen: which one?

9:47 chouser: chrisffm: you've got multiple methods with the same name but different arg types?

9:47 chrisffm: yes

9:47 chouser: same arg counts?

9:48 dnolen: Kttmm: http://github.com/technomancy/leiningen/raw/stable/bin/lein

9:48 chrisffm: simply a java interface with void error(Strings); void error(Exception ex)

9:48 String s

9:48 Kttmm: leiningen 1.1.0 works with clojure 1.2 ?

9:48 chrisffm: and i try: reify AnyWrapper (error (^void [_ ^String s] (println s)) (^void [_ ^Exception ex] (println ex))) )

9:49 but get the error: Must hint overloaded method: error

9:50 whats wrong with my hints? :)

9:51 dnolen: Kttmm: oops, http://github.com/technomancy/leiningen/raw/master/bin/lein

9:52 Kttmm: again, wipe out all yr stuff before you run self-install

9:52 chouser: try (reify AnyWrapper (^void error [_ ^String s] (println s)) (^void error [_ ^Exception ex] (println ex)))

9:53 dnolen: Kttmm: perhaps you don't need to, but I like to keep the variables to an absolute minimum.

9:53 chouser: that is, return hints go on the method name, and repeat the method name rather than just the args+body (yes, this is different than proxy and fn)

9:54 chrisffm: thx that worked, my error was that i tried to migrate from a proxy to reify...

9:54 Kttmm: exactly the same problem

9:54 and i removed the .m2 directory first

9:55 chrisffm: i read the doc but it was not clear to me

9:55 thank you very much :)

9:56 why is it different in proxy and reify?

9:56 chouser: chrisffm: yeah, there are awkward differences between them that I hope can be unified eventually.

9:56 the reasons have mostly to do with ease of implementation in each case, I think.

9:56 chrisffm: ah okay

9:56 chouser: the way they're implemented is quite different, actually.

9:56 chrisffm: i see

9:57 nevertheless great language :)

9:57 chouser: glad you're enjoying it.

9:58 chrisffm: every day :)

9:58 chouser: At work I've been pulled off my normal tasks to write/maintain PHP for a few weeks. It feels a bit ... different.

9:59 rhudson: my sympathies

9:59 chouser: PHP code, not PHP itself of course.

9:59 rhickey: chouser: what differences do you want to see unified?

9:59 because many of the differences are intentional, not implementation related

10:00 chouser: rhickey: multiple method names vs. multiple fn bodies is the one chrisffm was just stumbling over.

10:01 implicit vs. explicit 'this' is another

10:02 rhickey: chouser: making multiple methods look like a multi-arity fn would be a lie, as as multi-arity fn can pass itself as a value that is a multi-arity fn, a method cannot

10:02 explicit this won't be unified except by breaking proxy to make it like everything else

10:05 chouser: at one time we talked about an uber-proxy, though I don't remember what all was included in that idea. Breaking or deprecating the existing proxy for better consistency with everything else seems valuable.

10:06 the proxy macro could at least support repeated method names for overload on arity, and perhaps even arg type.

10:06 rhickey: yikes

10:07 a proxy is a mapping of methods to fns, quite different from what reify produces

10:08 rhudson: The doc should at least be clear about what you have to do for overloaded methods

10:09 rhickey: rhudson: ticket/patch welcome

10:09 rhudson: ok; how do I go about that?

10:10 I mean, where to submit?

10:10 chrisffm: rhusdon: i could help with an example :)

10:10 for the doc

10:11 wlangstroth: http://clojure.org/contributing

10:11 rhudson: Thanks wlangstroth

10:12 Thanks chrisffm, paste it somewhere? But basically I'd want to see an extra sentence or two in the proxy doc string that says you gotta define all the overloads in your function

10:13 chrisffm: that would indeed help

10:14 or to state the difference in between proxy and reify

10:16 rhudson: The reify doc string is pretty clear to me

10:16 chrisffm: hm okay, i see

10:18 chouser: The conceptual distance between reify and proxy for the user is not very big, even though the technical semantics are quite different.

10:18 rhudson: rhickey: Thanks for such a wonderful language! Clojure is the most impressive language design I've seen; you have excellent taste

10:19 My biggest frustration with Clojure is that I don't get to use it at work yet

10:19 chouser: every case where reify works, proxy could be used. It'd be nice if converting from one to the other was simpler.

11:09 cryptic_star: hi all, I have a question regarding :gen-class - is it possible to :gen-class methods that take variable arguments? I suspect it's not, but thought I would check here

11:10 AWizzArd: cryptic_star: those methods are JVM methods.

11:10 So, variable amount of args means: collection of args

11:23 cryptic_star: ok, many thanks for the help

11:33 yacin: how do i change the value of a java object's public field?

11:34 chouser: (set! (.field obj) new-value)

11:34 yacin: thanks

12:13 raek: hi

12:13 how long does it take until ones name appears on clojure.org/contributing?

12:14 I sent my CA from Sweden in the beginning of June

12:15 I have found two bugs (one in core and one in contrib) that I'd like to create tickets for

12:15 can I create the tickets before my name appears?

12:15 chouser: try the support tab

12:17 raek: the clojure-dev list is only for listed contributors, right?

12:18 chouser: ah, ok. thanks! I didn't know about that one

12:26 AWizzArd: technomancy: in a .clj buffer (fn [...]) gets displayed as (f [] ...) and (lambda () ...) as (λ () ...). How can I stop Emacs from auto-translating those for me?

12:32 technomancy: AWizzArd: there's some stuff in starter-kit-lisp near the end you can comment out

12:34 dpritchett: Just catching up on Yegge fever and I was amazed at how the opinions on news.ycombinator.com have shifted around clojure since last February. http://news.ycombinator.com/item?id=470254

12:35 AWizzArd: technomancy: k, thx

12:59 Timmcd: Hello1

13:00 Is there a way to import an entire java library in clojure?

13:00 ie, (import 'javax.swing.*)

13:02 LauJensen: Timmcd: No

13:03 Timmcd: LauJensen: Ah, thats a shame. THanks tho

13:04 LauJensen: Timmcd: If its a shame I dont know. Ive asked rhickey about it myself, and he explained that its more than a 'compiler thing', but that we can actually leverage these fully qualified imports somehow. Im unsure exactly what he meant

13:05 Timmcd: LauJensen: Huh, thanks.

13:05 mefesto: would be nice to also be able to alias a package name so you could do something like (:import [javax.swing :as ui])

13:06 Timmcd: mmhm

13:14 LauJensen: mefesto: Ive never crammed enough imports into one namespaces to have had a need for that

13:15 mefesto: LauJensen: I just see it as the java version of (:require [some.ns :as x])

13:15 LauJensen: Sure, I understand, just saying I never felt the need

13:38 raek: now it is done: http://www.assembla.com/spaces/clojure/support/tickets/404-making-a-writer-from-a-socket-with-clojure-java-io-writer-fails

13:39 how often does rich check the post box for new CAs?

14:03 polypus: do you guys know if 1.2.0-master-SNAPSHOT will get the latest beta announced today?

14:03 qbg: Get it how?

14:04 polypus: as in lein deps

14:04 qbg: See http://groups.google.com/group/clojure/browse_thread/thread/d981917e767d86f5/a687b242f9b90ec5#a687b242f9b90ec5

14:04 polypus: ty

14:05 qbg: Beta 1 is "1.2.0-beta1"

14:35 kotarak: ~suddenly

14:35 hmm

14:35 danlarkin: gasp!

14:36 kotarak: danlarkin: what was the trigger?

14:36 And suddenly...

14:36 danlarkin: clojurebot seems to be MIA

14:36 kotarak: Hmm

14:36 yea

14:36 rubydiamond: Joy of Clojure or Programming Clojure ?

14:36 which is good one?

14:36 kotarak: Both

14:36 rubydiamond: if I am to buy right now

14:36 ohpauleez: they're both good

14:36 cemerick: danlarkin: he's been gone all day

14:37 danlarkin: :'(

14:37 rubydiamond: kotarak: if I am to spend $20 right now

14:37 which book should I purchase.. I am absolute beginner

14:37 kotarak: rubydiamond: beginner pc, expert JoC

14:37 cemerick: rubydiamond: PC if you're a beginner

14:37 rubydiamond: kotarak: hmm

14:37 cemerick: hmm

14:37 kotarak: sosososo

14:37 Ah, so desu ka?

14:38 cemerick: rubydiamond: if you've done any functional programming before, then JoC is appropriate

14:39 abedra: rubydiamond: don't forget about Practical Clojure

14:39 both the PC's are good starting points

14:39 rubydiamond: cemerick: i have not done any practical functional programming

14:40 abedra, cemerick, kotarak I just saw this tweet http://itunes.apple.com/app/twitter/id333903271?mt=8

14:40 oh this link http://twitter.com/fogus/status/18621944947

14:41 cemerick: heh, yeah, chouser and _fogus_ do a good job with the twitter promotion :-)

14:41 rubydiamond: and started thinking to buy it

14:41 abedra: rubydiamond: it's a great book

14:41 you should buy it

14:41 i just wouldn't start there

14:41 rubydiamond: abedra: JOC ?

14:41 abedra: rubydiamond: yeah

14:42 rubydiamond: I really enjoyed it

14:42 rubydiamond: but I would start with either or both of the PCs

14:42 rubydiamond: all 3 books have something to offer

14:42 rubydiamond: abedra: which book ?

14:43 okay..

14:43 abedra: rubydiamond: Programming Clojure or Practical Clojure

14:43 _fogus_: I like Joy of Clojure the best

14:43 abedra: _fogus_: I do too :)

14:43 cemerick: ha

14:44 rubydiamond: _fogus_: haha, you are here

14:44 abedra: _fogus_: it's the only book that I can't claim bias towards lol

14:44 _fogus_: since I work with the Stuarts

14:44 _fogus_: cemerick: We've been thinking of running an Old Spice-style Twitter campaign... Chouser is the burly shirtless guy

14:44 rubydiamond: _fogus_: I am getting it around $16 or so... can you give me some more discount so that I can purchase it for $10..

14:45 lancepantz: rubydiamond: come on, just spend the $6

14:45 rubydiamond: _fogus_: I am an Indian.. so $ is > Rupees

14:45 abedra: _fogus_: great job on the book though

14:45 rubydiamond: I am might purchase one of PR too..

14:45 _fogus_: abedra: I'll take the bias however I can get it

14:46 rubydiamond: I can't give you a bigger discount, but I will be your best friend

14:46 rubydiamond: abedra: you used to do ruby before right?

14:46 _fogus_: abedra: You're doing the Clojure tutorial at CUFP right?

14:46 abedra: _fogus_: yep

14:47 _fogus_: going to give everyone a data set and have them form it into an app with some incanter goodness

14:47 rubydiamond: _fogus_: :D

14:47 _fogus_: I will try to swing by and say Hi.

14:47 abedra: _fogus_: but the dataset will be a little off

14:47 _fogus_: cool!

14:47 TimMc: Any message-taking bots in here>

14:48 _fogus_: I put in a talk proposal but I'm not sure it will be chosen

14:48 cemerick: nope

14:48 _fogus_: But I will be there nonetheless

14:49 TimMc: bah

14:49 rubydiamond: abedra: btw don't you now use emacs nowadays..

14:49 your post http://www.aaronbedra.com/2008/10/03/stop-emacs-time.html is invalid now right?

14:49 abedra: rubydiamond: yeah, some of my posts got messed up in the great gh-pages migration

14:49 rubydiamond: i need to fix them

14:50 rubydiamond: but yes i do, and bascially always have :)

14:50 rubydiamond: abedra: I meant .. you said that you are stopping using emacs..

14:50 TimMc: Oh good, there is a MemoServ on freenode.

14:50 rubydiamond: but I strongly feel that you use emacs these days.. may be I am wrong

14:50 abedra: rubydiamond: lol, no. That post was a redesign of my blog to look like an emacs window

14:50 rubydiamond: i had that up for about 8 months

14:51 rubydiamond: and you could use emacs commands to navigate the site and move the content windows around

14:51 rubydiamond: abedra: hmm ..

14:51 that would be great

14:52 abedra: rubydiamond: but sadly i needed a change

14:52 rubydiamond: because i get bored easily

14:52 zkim: rubydiamond: If you're a beginner you'll definitely want to check out http://faustus.webatu.com/clj-quick-ref.html, great cheat sheet

14:52 rubydiamond: abedra: btw how are you finding clojure though.. don't you miss ruby's lots of gems/libraries

14:53 abedra: rubydiamond: i still use ruby for rails

14:53 rubydiamond: but that's about it

14:53 rubydiamond: otherwise no, I don't miss much about it at all actually

14:53 rubydiamond: i still maintain rcov and some other ruby tools

14:53 rubydiamond: I heard clojures libraries also called gems.. is that true?

14:53 abedra: rubydiamond: no

14:53 rubydiamond: abedra: great

14:54 zkim: thanks.. that cheatsheet looks nice

14:54 zkim: yeah, looks like the author put a lot of work into it

14:56 rubydiamond: reading this now http://stackoverflow.com/questions/2578837/comparing-clojure-books

14:57 _fogus_: buying your book

14:57 :p

14:57 chouser: woo!

14:57 rubydiamond: thanks!

14:58 hope you find it useful and enjoyable. :-)

14:59 _fogus_: rubydiamond: Thanks!

15:02 rubydiamond: done..

15:06 LauJensen: TimMc: Yea good point - Didnt think about overlaps

15:07 TimMc: (For the rest of the channel: Aliasing java.util.Date vs. java.sql.Date would be nice.)

15:07 Honestly, that's the one place it has ever come up for me.

15:11 * raek just bought Joy of Clojure

15:11 raek: with summer job salary, there is no excuse anymore

15:11 ohpauleez: raek: It's a great book

15:12 also, the authors of all the Clojure stuff hang out in here and actively work on Clojure, or significant clojure projects

15:13 chouser: raek: yay! thanks to you too. :-)

15:21 Raynes: Too bad they went with Manning though.

15:21 chouser: Raynes: oh yeah? Why's that?

15:22 I'm not necessarily disagreeing, just wondering why it matters to you.

15:22 Raynes: MEAP links only last for 5 days, so if you want to grab it after the 5 days, I guess you have to sign into your account. However, you don't have to make an account to purchase books, so you have to make an account. I just made my account, got the email, clicked verify, and now I'm stuck with this: "Unable to verify the user. You may have already registered the user or registration failed for a reason. Please contact us immediately at support@manning.c

15:22 om."

15:23 So, I guess I have to contact support now.

15:23 ._.

15:23 It's just minor annoyances I've never had with any other publishing company.

15:23 rubydiamond: btw how to execute this function

15:23 (defn ls [path] (seq (.list (java.io.File. path))))

15:23 ls gives me #<user$ls user$ls@2875ca3e>

15:25 mefesto: rubydiamond: (ls "/tmp")

15:26 rubydiamond: mabes: yeah worked.. thanks a lot

15:27 this might be one of my very first clojure programs ..executed.

15:27 defn: Raynes: I've never logged in

15:27 I just use my yahoo order number to get my ebook download

15:27 chouser: Raynes: bleh. Sorry about that.

15:27 mefesto: anyone view the JoC book on the normal sized kindle?

15:27 Raynes: chouser: It isn't your fault.

15:28 defn: mefesto: no, why, are you thinking about an ereader?

15:28 Raynes: defn: I don't have an order number. I'm smart enough that I rarely keep such things. ;)

15:28 mefesto: defn: i have the smaller kindle (non-dx)

15:28 rubydiamond: mefesto: I have ordered kindle too

15:28 hope I read most of JOC on it

15:29 Raynes: If all else fails, I'll get the next MEAP. ;p

15:29 rubydiamond: mefesto: I have ordered the same kindle ..

15:29 mefesto: btw how many books you have read on it

15:29 mefesto: never read a tech book on there so i was wondering how it looks

15:29 rubydiamond: mefesto: hmm

15:29 mefesto: rubydiamond: quite a few ... haven't been keeping count but definitely the majority of my book reading is on it

15:30 rubydiamond: mefesto: that's good news for me..

15:30 mefesto: i still go paper for tech books which is why i ask... wondering how readable it is on there

15:31 raek: JoC downloaded... yay!

15:32 it's really great that they don't DRM the books

15:32 chouser: supposedly epub and other versions will be avaible once the book is actually in stores.

15:32 and MEAP buyers will have access to those.

15:33 Raynes: I never buy dead-tree programming-related books.

15:33 mefesto: yeah it's a habit i'm looking to break

15:35 MEAP ebook = PDF?

15:35 chouser: yeah

15:35 rubydiamond: raek: great

15:36 raek: dead-tree ?

15:37 raek: yup

15:37 mefesto: rubydiamond: gotta kill the trees to make the paper for those books :)

15:38 rubydiamond: mefesto: got it

15:38 Having Kindle DX should be basic human right.

15:38 :D

15:38 mefesto: rubydiamond: oh, you have the dx?

15:38 rubydiamond: save paper. save trees. use kindle.

15:38 mefesto: nope

15:38 mefesto: the MEAP pdfs should look nice on that

15:39 rubydiamond: I have ordered a Kindle 2 couple days back..

15:39 I am waiting for it..

15:39 raek: I discovered that I could rotate the picture on my laptop screen 90 degrees

15:39 rubydiamond: mefesto: anyways.. I can always increase font size

15:39 raek: it almost becomes one big book

15:39 tomoj: I wonder how many ebooks you have to buy for the impact of the kindle's production on trees to be balanced by the amount of paper you save..

15:40 KirinDave: http://9to5mac.com/woz-speaks-about-iphone-antenna?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+9To5Mac-MacAllDay+%289+to+5+Mac+-+Apple+Intelligence%29

15:40 mefesto: lmao

15:40 KirinDave: Man, Woz is basically insane now.

15:40 He was also going off about the prius problem

15:44 nDuff: mefesto, yes, they do

15:45 mefesto: rubydiamond: increasing the font size works well for ebooks but pdf's are rendered like images... at least last time i tried.

15:45 rubydiamond: mefesto: i heard kindle has native support for pdfs

15:45 nDuff: that's still the case on the current version

15:45 but the DX is big enough to render them fine

15:45 rubydiamond: so may not be a problem..

15:45 think so

15:46 nDuff: I wouldn't want to try it on one of the smaller models

15:46 mefesto: yeah you can view them but they don't use a flow text layout... pdf's are rigit

15:46 rubydiamond: nDuff: do you mean Kindle 2 is not suitable for pdfs

15:46 mefesto: rigid*

15:46 nDuff: rubydiamond, probably not for PDFs which weren't rendered to a smaller-than-usual page size, yes.

15:46 defn: if you buy an ebook reader i have a great recommendatiion

15:46 and ive done a lot of research on this

15:46 mefesto: rubydiamond: the screen is a bit small for pdfs, imo. but you can use mobipocket to convert it to a .mobi which usually works well

15:47 rubydiamond: mefesto: okay..

15:47 defn: the the iRex DR800SG

15:47 nDuff: last time I looked at iRex, they were pretty but too pricey.

15:47 defn: bigger than a kindle, no DRM, replacable battery, SIM card

15:47 this is 400$

15:48 nDuff: well, that's not so bad

15:48 defn: better than the Sony, I sent back two Sony ereaders before I got this

15:48 mefesto: wow that thing is pretty

15:48 defn: and best thing is: PDFs are readable

15:48 a bit small, but im not 70 years old

15:49 slightly less contrast than the kindle DX, the high contrast is a personal preference, and no touch screen so you dont get glare in the sun

15:49 rubydiamond: defn: hmm

15:49 I have already ordered Kindle 2 .. hope it is worth buying..

15:50 defn: i chose to got go with the Kindle 2 due to DRM restrictions

15:50 mefesto: rubydiamond: what type of books do you typically read?

15:50 rubydiamond: mefesto: 95% technical

15:50 defn: and the small screen -- pdf reflow doesnt work very well

15:50 rubydiamond: 5% fiction/non fiction

15:50 defn: if you want to read non-fiction you almost have to get a bigger screen than the kindle 2 imo

15:50 lancepantz: why is the ipad not in the discussion?

15:50 zkim: defn: or at all anymore, I wonder if the dx is better for pdfs

15:50 lancepantz: i've been wanting something to read technical papers too, have been planning on picking up an ipad

15:50 rubydiamond: defn: I can increase/decrease font size of pdfs on laptops.. and expect same on kindle2

15:51 defn: lancepantz: getting away from a backlit screen was a high priority

15:51 zkim: rubydiamond: you can't resize on the kindle 2

15:51 defn: the ipad does PDF reflow too

15:51 lancepantz: i would like that as well, but i also would like to be able to read in the dark

15:51 zkim: rubydiamond: rotate is as good as it gets

15:51 lancepantz: so i guess you get a light for the kindle?

15:51 defn: yeah

15:51 or a head lamp

15:51 rubydiamond: zkim: that's bad news

15:51 mefesto: i like being able to read outside in the sun

15:51 lancepantz: haha

15:51 rubydiamond: I thought resizing works

15:51 :(

15:52 defn: hey! dont laugh! a head lamp is a great way to read in the dark

15:52 zkim: not on mine (kindle 2)

15:52 mefesto: rubydiamond: it does for ebooks :-\

15:52 lancepantz: ya know, i think i'm going to get a headlamp

15:52 that can be useful for other things as well

15:52 defn: DR800SG can change PDF font size

15:52 rubydiamond: mefesto: i bought it because it is now cheaper .. 189 bucks

15:52 defn: ...sort of...

15:52 rubydiamond: and thought I would finish dozens of tech books with it

15:52 lancepantz: that's going to crack the girlfriend up

15:53 zkim: defn: is that the sony?

15:53 defn: nah, dont buy the sony

15:53 unless you just want to read novels, and whatever you do, dont buy the touchscreen

15:53 the glare makes it impossible to read

15:53 even under indoor light at night

15:53 zkim: got it

15:54 mefesto: rubydiamond: if you find the experience painful, remember mobipocket .pdf -> .mobi conversion

15:54 rubydiamond: mefesto: ok

15:54 defn: the DR800SG has a free 3g connection on board too. I managed to get it to surf the web. It's slow as heck, but still sort of neat

15:55 * rubydiamond laters friends

15:55 defn: ciao

15:55 zkim: wow the dr8 looks nice

15:57 defn: it's pretty neat -- the new firmware lets you draw with the stylus and stuff

15:57 anyway...clojure...

15:57 zkim: heh

15:58 defn: how are all of the cool kids getting the bleeding edge 1.2 beta

15:58 in leiningen i mean

15:58 clojurebot: enlive is for generating HTML from pure-markup templates: http://wiki.github.com/cgrand/enlive/getting-started

15:58 defn: [clojure "1.2.0-master-BETA"] or what?

15:58 mefesto: is building from master the same as 1.2 beta or is there another branch?

15:58 defn: mefesto: my question exactly

16:00 qbg: Another branch exists

16:00 tomoj: http://build.clojure.org/releases/org/clojure/clojure/1.2.0-beta1/

16:00 mefesto: 1.2.x im guessing?

16:00 qbg: Yes

16:00 tomoj: so [clojure "1.2.0-beta1"]

16:00 defn: thanks tomoj

16:00 tomoj: and similarly for contrib

16:00 dakrone: defn: [org.clojure/clojure "1.2.0-beta1"]

16:00 * defn nods

16:09 mefesto: anyone using couchdb with clojure?

16:09 thetafp: (+ 1 2)

16:09 clojurebot: 3

16:11 tomoj: mefesto: I just started writing a view server last night..

16:11 mefesto: tomoj: recommend any particular driver? been looking at couchdb4j

16:12 tomoj: that sounds terrible

16:12 mefesto: wondering if there is a good clojure one

16:12 tomoj: don't like clutch?

16:12 http://github.com/ashafa/clutch/

16:12 mefesto: ahh, thanks :)

16:12 tomoj: I haven't used it, though

16:12 writing my own instead

16:13 mefesto: tomoj: have you used couchdb for non clojure things?

16:14 tomoj: toyed around in ruby once, that's it

16:14 qbg: (apply str (let [a "eda?we ie oc hk otShswnntr"] (map #(get a (mod (* 15 (- % 4)) 26)) (range 26))))

16:15 (+ 1 2)

16:15 clojurebot: 3

16:15 qbg: Hmm...

16:16 Why does that work, but not the other one?

16:17 tomoj: (- 3 5)

16:17 clojurebot: -2

16:17 tomoj: only for math maybe?

16:17 arohner: (map inc (range 0 3))

16:17 ,(map inc (range 0 3))

16:17 clojurebot: (1 2 3)

16:18 qbg: ,(apply str (let [a "eda?we ie oc hk otShswnntr"] (map #(get a (mod (* 15 (- % 4)) 26)) (range 26))))

16:18 clojurebot: "Since when does that work?"

16:29 arohner: I'm trying to build a jar using lein and gen-class, and it's not working. I have :aot in my project file, and (:gen-class) in the .clj file

16:29 using lein-1.2, I get the message "compiling Foo", but then the .class file doesn't show up in the jar

16:29 using lein-1.1, I get no message about compiling, and nothing shows up in the jar

16:32 with lein-1.2, it looks like it compiled fine (I can see the .class files in classes/)

16:33 cschreiner: How can I specify a default .clj file to load when starting the repl (via swank)? Is the regular approach to specify some (slime-load-file "~/dev/cljstart-clj") and add it to the slime-repl-start-hook (if such a thing exist)?

17:28 krey: Hello everyone

17:30 raek: hi

17:53 defn: is there anything like linkparser for clojure?

17:54 (something that will read from wordnet)

17:54 like this: http://deveiate.org/projects/Ruby-LinkParser

17:57 lpetit: defn: something like this ? http://writequit.org/blog/?p=365

17:57 defn: or this ? http://code.google.com/p/word-clj/

17:58 defn: lpetit: ive been looking into opennlp, but im not sure if i need all the bells and whistles it provides

17:58 looking at the 2nd one now

17:59 lpetit: thanks for the suggestions

18:00 i think ill probably go with opennlp -- im have some hare-brained scheme to use tagged sentences to generate midi data

18:00 s/im/i

18:51 moshisushi: hello i'm getting this error in emacs: File error: Cannot open load file, swank-clojure-autoload

18:51 when following:

18:52 http://riddell.us/ClojureWithEmacsSlimeSwankOnUbuntu.html

18:52 any ideas why it's missing?

18:55 technomancy: moshisushi: that documentation is pretty old; try the swank-clojure readme

19:07 raek: ,(doc future-cancel)

19:07 clojurebot: "([f]); Cancels the future, if possible."

19:08 raek: when is it not possible to cancel a future?

19:09 tomoj: one case is when it's already done

19:09 dunno if there are more

19:12 ataggart: future-cancel just calls Future.cancel() so the javadocs there would be more illuminating

19:12 chouser: if it's in a busy compute loop, it won't cancel until it blocks on IO or a lock, or something of that nature.

19:13 ataggart: Future.cancel() has a return value that would be worth looking at (unmentioned in the clojure docs)

19:14 KirinDave: Man

19:14 These jackoffs on news.ycomb claiming Lisp is not meaningful because the market doesn't select it...

19:14 They make my head hurt.

19:15 Raynes: If people only use mainstream languages, no other languages will ever become mainstream. I don't understand why people don't accept that.

19:15 lpetit: isn't this the coolest regex ever ? :) #"(?:\/|(?:(?:[a-z|A-Z|\*|\!|\-|\_|\?|\>|\<|\=|\$]|\+(?![0-9]))(?:(?:(?:[a-z|A-Z|\*|\!|\-|\_|\?|\>|\<|\=|\$]|\+(?![0-9]))|[0-9]|\.|\#))*(?:\:(?:(?:(?:[a-z|A-Z|\*|\!|\-|\_|\?|\>|\<|\=|\$]|\+(?![0-9]))|[0-9]|\.|\#))+)*)(?:\/(?:(?:[a-z|A-Z|\*|\!|\-|\_|\?|\>|\<|\=|\$]|\+(?![0-9]))(?:(?:(?:[a-z|A-Z|\*|\!|\-|\_|\?|\>|\<|\=|\$]|\+(?![0-9]))|[0-9]|\.|\#))*(?:\:(?:(?:

19:16 (?:[a-z|A-Z|\*|\!|\-|\_|\?|\>|\<|\=|\$]|\+(?![0-9]))|[0-9]|\.|\#))+)*))?)"

19:16 Raynes: Stop trying to blind us.

19:17 ataggart: regex: write-once, read-never

19:18 technomancy: KirinDave: also clearly dvorak is crap, since modern keyboards aren't sold with it.

19:18 KirinDave: and right next to the A key is the best place to put capslock!

19:18 KirinDave: technomancy: I don't want to conflate that. ;)

19:18 technomancy: All I know is that Common Lisp still had something better than exceptions in 1992 and we still have fucking exceptions.

19:18 * nDuff grumbles about people who think they can parse SGML-derived formats with regular expressions

19:18 KirinDave: It's Not Difficult to have conditions and restarts.

19:19 lpetit: Raynes, ataggart: heh, need to write a dsl for being able to use variables in regex (in order to reuse a pattern in several places). cgrand told me they did that in their conjlab, as an exercise :)

19:19 KirinDave: And here we are still playing with the equivalent of rocks and sticks with our error handling.

19:19 ataggart: there's a lot that can be read from what emerges from a market, but "menaningfulness" isn't one of them.

19:21 I need to figure out a way to get paid to write clojure.

19:21 KirinDave: ataggart: Look for jobs?

19:21 There is no shortage

19:21 I turned one down the other day, as a matter of fact.

19:22 ataggart: true enough, though I like being able to bring my dog into the office. Not many places allow that.

19:22 dogs + office = awesome

19:22 technomancy: ataggart: no office is even better: http://www.flickr.com/photos/technomancy/tags/remoteoffice/

19:22 * technomancy mentions Sonian is hiring

19:22 ataggart: technomancy: I agree. If only I could figure out how to love emacs, I would have app'd to you guys a while ago.

19:23 technomancy: oh, dang.

19:23 ataggart: I'm more than willing to accept it as a personal flaw

19:23 technomancy: nobody's perfect. =)

19:24 nDuff: ataggart, indeed; being able to bring the dogs to work again is one of the reasons I'm looking forward to leaving Dell

19:25 ataggart: I'm close to just moving to Vancouver and opening up my own shop, then I can do what I want.

19:55 pedroteixeira: is there any problem defn fn1 and having a protocol with function fn1, with different arity? i think something is odd here.

19:56 hm.. the protocol overwrites the function! ;/

20:02 chouser: only one fn/protocol method with the same name in the same namespace

20:40 gstamp: Clojars seems to be a bit of a mess. Seems difficult to know which versions are current. For example which lein-javac is the correct choice in this list? (http://clojars.org/search?q=javac)

20:41 lancepantz: gstamp: the bottom one

20:42 if it has no group id, then it was the first one on clojars

20:43 gstamp: ok. so always go for the one with no namespace. gotcha

20:49 dnolen: gstamp: usually lookup the project on GitHub to figure out what to put in my project.clj, but yeah clojars is a bit messy now.

21:16 gstamp: is leiningen compatible with clojure 1.2.0-beta1? I'm getting a class cast exception when running lein (with no args)

21:27 dnolen: yowza aleph zips along at 20,000+ req/s on a EC2 Compute Cluster

21:30 lancepantz: dnolen: wow

21:30 that's nice

21:30 bonus points if you bench node.js on the same box

21:31 dnolen: lancepantz: already did, ~8600 req/s

21:31 I didn't do any work to setup multiple node processes tho, so that's not bad for only running on a single thread.

21:32 lancepantz: right

21:32 one of the guys at work is huge on node.js

21:33 obviously us clojure guys are resisting vehemently, aleph couldn't have come at a better time

21:34 dnolen: node.js is certainly fun. but I'm skeptical, you're forced to write wacky code. but for simple things node.js is pretty cool.

21:36 lancepantz: i just really don't want to support another webstack

21:45 cais2002: 早上好 good morning

21:45 mikem: morning :)

22:20 defn: man i forget so much of my chinese

22:20 something something hau

22:20 heh

22:57 cais2002: defn: that's right

22:58 fuchsd: Here's a really stupid question: is there a better way to seach for jars on clojars.org than the search box at the top?

22:58 I'm looking for the 1.2 clojure beta (or any clojure 1.2)

22:58 But it doesn't come up when I search for 'clojure' (among other search terms)

22:58 mikem: fuchsd: not sure that's on clojars

22:59 fuchsd: Ahh, gotcha

22:59 mikem: you can grab it here: http://clojure.org/downloads

23:00 fuchsd: But clojure 1.1 should come up if I search for 'clojure', right?

23:01 mikem: I don't think any version of clojure (or clojure-contrib) is on clojars

23:01 ah, there is a version of contrib

23:02 fuchsd: Where does leiningen get it from?

23:04 mikem: I think it's pulled from http://build.clojure.org/

23:05 fuchsd: Oh, ok, cool. Thanks!

23:06 mikem: when you run lein deps, there's usually four places that are checked if you take a closer look at the output

23:08 fuchsd: oh right, build.clojure.org, clojars.org, clojure-snapshots and central

23:08 Cool, thanks

23:10 so the beta is up at build.clojure.org/releases

23:10 [org.clojure/clojure "1.2.0-beta1"]

23:11 That did it, thanks for the help

23:11 mikem: now run along and build some cool stuff :D

23:11 fuchsd: will do :)

23:13 defn: heh

23:13 building cool stuff for great good!

23:14 i wonder if there's a way to take distributed development, sort of an open source model approach, to a development company

23:14 like based on your contributions you get paid X, and anyone can contribute, but contributions are accepted by a comittee

23:16 rhudson: Closest thing I can think of like that is the Apple App Store :)

23:17 caio: anyone using compojure can help me pls?

Logging service provided by n01se.net