#clojure logs

2010-07-15

00:11robinkhrm, clojure-contrib does not include string
00:12robink...at least mine doesn't
00:14robinkOh, that's because it's only in git
01:10BahmanHi all!
01:16raekhi!
02:56idrophi all, v. new to clojure: given (def data '( {:foo 1} {:foo 2} )), how come this map fn works:
02:56idrop(map (fn [m] {:bar (:foo m)}) data)
02:56idropbut this doesn't:
02:56idrop(map #({:bar (:foo %) }) data)
02:57idropthink the issue is with %
03:01raekwhat is the expected output? ({:bar 1} {:bar 2}) ?
03:01replacaidrop: #(f a b c) = (fn [...] (a b c))
03:01replacasorry, idrop: #(f a b c) = (fn [...] (f a b c))
03:02raekthe #(...) shorthand can only do function invocations
03:02replacasee the extra parens added?
03:02raekyou can do it like this (map #(hash-map :bar (:foo %)) data)
03:04raekidrop: you might be interested in this: http://richhickey.github.com/clojure/clojure.set-api.html#clojure.set/rename-keys
03:04raek(map #(clojure.set/rename-keys % {:foo :bar}) data)
03:05raek(assuming renaming :foo to :bar was the goal)
03:07raekreflection: {...} can be considered to be syntactic sugar for (hash-map ...)
03:07raek(unless the map is very small. then it would be (array-map ...))
03:11tomojwhy is rename-keys in clojure.set?
03:30zkimhey all
03:40bortrebwhat do you guys recommend for clojure debugging in emacs?
03:40bortrebIs there some sort of way to step through code even if it goes into javaland?
03:41AWizzArdbortreb: 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
03:41AWizzArdThis will stop your program at that point and you can inspect local vars, and then continue.
03:42bortrebnice, but I would think that emacs would have some killer way of debugging clojure ?
03:48AWizzArdNope.
03:48AWizzArdprintln debugging :-)
03:56tomojnice, clojure-json can lazily encode lazy seqs to writers :D
03:58tomojcan't lazily decode, though, hmm
04:03raekit consumes a (potentially blocking) lazy seq and encodes every element and writes them to the writer?
04:14esjmorning all
04:17LauJensenMorning esj
04:33cais2002hi all, is transient support still alpha as indicated in the doc?
04:33idropsorry all, thanks for your suggestions
04:37tgkI'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.
04:37tgk(def desc "Foo bar") (defn foo desc [x] x) (doc foo) => user/foo (desc)
04:42AWizzArdtgk: "defn" is a macro and thus does have a defn-specific evaluation rule for its arguments.
04:42AWizzArddefn expects a string while you put a symbol into that position
04:42raekmaybe (defn #^{:doc desc} foo [x] x) works
04:43esjor roll your own defn macro
04:43raekthe docstring position is just a shortcut for adding :doc metadata to the var
04:43tgkraek: that works
04:43raekand the metadata on the symbol will be copied to the var
04:43AWizzArdtgk: what also should work is: (defn foo #=desc [x] x)
04:44AWizzArdno, should not work
04:44esjAWizzArd: what is the #= ?
04:44AWizzArdA reader macro, which will trigger an evaluation of an expression in the reader, during read-time.
04:45esjAWizzArd: nice.
04:45tgkOh, okay. I'm using the #^ approach, but thanks
04:46tgkI'm not entirely sure why the symbol isn't evaluated though
04:46AWizzArdtgk: because defn is a macro
04:46tgkAWizzArd: but it could force evaluation
04:46AWizzArdMacros don't need to evaluate their arguments.
04:46AWizzArdIt could, but why should it?
04:47tgkWhy not?
04:47AWizzArdWhy not not?
04:47tgkI would think least surprise would dictate evaluation
04:47raeksince fn takes a variable number of args, it needs some way of knowning what is what
04:48raekit expects docstrings to be strings
04:48AWizzArdIt's just a source for errors.
04:48AWizzArdAnd the doc string should be pretty clear, and won't need to get calculated during runtime.
04:48tgkraek: Ahhh! That makes sense, thanks.
04:48cschreinerLooking for more documentation on the identity in (map #(%1 %2) (cycle [inc identity]) [1 2 3 4 5 6 7 8 9 10])
04:49raek(defn identity [x] x)
04:50cschreinerwell, yes
04:50raek(cycle [inc identity]) => (inc identity inc identity inc identity ...)
04:50raekmap will get one sequence of alternating inc and identity fns, and one sequence of numbers
04:50AWizzArdcschreiner: for example you have a sequence of objects, but some may be nil or false, then (filter identity your-seq) ==> non-nil objects
04:50raekand then apply the first fn to the first number, etc
04:51cschreinerso, it's an implicit something
04:51raek=> ((inc 1) (identity 2) (inc 3) (identity 4) ...)
04:51raekidentity is a functional no-op
04:51cschreinerraek: let me dwell a little on that
04:56AWizzArdNew NS for pprint is now clojure.core?
04:57cschreinerso, identity is a way to sort out things that has a real identity
04:57AWizzArdNah, clojure.pprint I mean is the new NS, right?
04:57cschreinerI understand your example AWizzArd
04:57AWizzArdcschreiner: identity just forwards whatever you have
04:58AWizzArdyou use it to look at a specific object, when you need to specify a function
04:59cschreinerso, would (filter odd? (filter identity [1 2 3 4 nil])) be an idiomatic approach?
04:59AWizzArdfilter identity was just an example, it can remove nil and false, but if you just have nils then (remove nil? ...) would be more idiomatic
05:00cschreinerok
05:00AWizzArdBut in principle that's it.
05:10esjthis 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 ?
05:50zkimcschreiner: thanks for adding that example to clojuredocs.org
06:10lazy1,(+ 10 20)
06:10clojurebot30
06:11lazy1,odd?
06:11clojurebot#<core$odd_QMARK_ clojure.core$odd_QMARK_@182c6dc>
06:11lazy1,(filter odd? (range 10))
06:11clojurebot(1 3 5 7 9)
06:14lazy1clojurebot: help
06:14clojurebothttp://www.khanacademy.org/
06:17lazy1clojurebot: help
06:17clojurebothttp://www.khanacademy.org/
06:18rhudsonThat's not very helpful
06:19tomojsexpbot: help
06:19sexpbottomoj: I can't help you, I'm afraid. You can only help yourself.
06:20tomoj:D
07:53defnlink?
07:54clojurebotyour link is dead
07:54mikemhttp://steve-yegge.blogspot.com/2010/07/blogger-finger.html
07:55defnWhoa. I want to be Steve Yegge's friend.
08:02chouser_fogus_: you're right -- the last line is the best.
08:02defnwho created clojuredocs.org?
08:02_fogus_chouser: :)
08:02TimMcAw, that's great.
08:02_fogus_Clojure is pulling them all in one by one.
08:03defnbah -- i tried to get people interested in something exactly like it awhile back
08:03_fogus_Next thing you know Paul Graham is going to post "Why Clojure is Different"
08:03chouser_fogus_: ha!
08:04chouserdefn: I wasn't ready before. I'm sure that has made all the difference!
08:04defn:)
08:04defnchouser: maybe we could integrate walton with clojuredocs?
08:05defni havent touched that project in way, way too long
08:05chouserdefn: oh, sorry -- I thought you were talking about clojure, not clojuredocs.org
08:05defnoops!
08:06chouserI've only glanced at walton, and not even that with clojuredocs.org
08:06defnthat's it...i'm going to beat clojuredocs.org into the ground
08:06defnThe Most Ultimate Documentation Site Ever Conceived is upon us, gentlemen.
08:08cemerickrhickey: 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?
08:09rhickeycemerick: yes, thanks
08:31bigwavejakeI get an error I haven't see before in a macro that creates a function: http://pastebin.com/T0CWMj9h
08:31bigwavejake"Can't use qualified name as parameter"
08:31bigwavejakeAny ideas on how to fix it?
08:34rhudsonuse a# instead of a
08:34bigwavejakerhudson: nice!
08:34bigwavejakethanks!
08:38cemerickbigwavejake: the a# notation produces a unique symbol for the binding involved. See (doc gensym).
08:38bigwavejakecemerick: i will, thanks
08:39bigwavejakethanks everyone, gotta jet
08:51Kttmmhi, 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
08:54AWizzArdKttmm: the file basic.clj is mentioned. Is that one that you wrote?
08:54AWizzArdI think neither Leiningen nor swank-clojure have a file named like that.
08:57wlangstrothunmatched delimiter on line 185 of basic.clj?
09:01Kttmmno, it's not mine
09:04wlangstrothKttmm: weird - did you find basic.clj?
09:05Kttmmit's in swank-clojure
09:10dnolenKttmm: just tried the same thing here, that works find for me.
09:11Kttmmdnolen: are you using mac os ?
09:12dnolenKttmm: yeah Snow Leopard on i7 MBP
09:13Kttmmwhich version of leiningen are you using?
09:13dnolenwhatever the latest one is
09:13wlangstrothnot sure how the architecture could influence a missing parens - probably something in the install
09:14Kttmmi just recompiled swank-clojure and i have the same error
09:15dnolenKttm: did you try swank-clojure 1.2.1?
09:17Kttmmyes, i have the same error with it
09:18dnolenKttmm: but are you compiling swank-clojure yrself or just getting it off clojars?
09:18Kttmmi tried both
09:23dnolenKttmm: 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?
09:24Kttmmnope, it's a new account :s
09:24Kttmmwhich version of java are you using?
09:25wlangstrothI just tried it, and no issues here
09:25dnolenKttm: JDK 1.6 64bit
09:25wlangstroththat's a weird one
09:26wlangstroth(the issue, not the jdk version)
09:27Kttmmdo you get the warnings when launching swank ?
09:27dnolenKtttmm: no warnings, because of the presence of group-by it looks like your not really getting swank-clojure 1.3.0
09:28Kttmmi've got leiningen 1.2-RC2, it should be okay no?
09:29Kttmmswank-clojure seems fine : ls lib/dev/
09:29Kttmmswank-clojure-1.3.0-20100502.112537-1.jar
09:31dnolenKttmm: perhaps yr in that weird computer vortex. erase your project. erase lein. erase ~/.m2 start over.
09:32Kttmmok, good idea
09:32dnolenKttmm: oh do you have a classpath environment variable set up in your .profile?
09:33dnoleni think lein respects that and perhaps picking up a swank-clojure-xxxx.jar from somewhere else
09:33Kttmmyou mean the ~/.profile file? or another one? i'm not a mac os X user...
09:34dnolenKttmm: yeah, it used be .bash_profile prior to 10.6
09:34Kttmmi don't have any .bash_profile, the account was just newly created
09:35Kttmmor is there a global one in /etc too ?
09:35Kttmm /etc/profile and /etc/bashrc do not set any classpath
09:36dnolenKttmm: no, I just wipe yr clojure stuff out and start over at this point.
09:38chrisffmhi there
09:39chrisffm,(+ 1 1)
09:39chrisffm:-(
09:39chouserno clojurebot :-P
09:39chouserno hiredman to ping about it
09:39chrisffmhi
09:40chrisffm,(+ 1 1)
09:41boojumfiredman :)
09:41cais2002$(+ 1 1)
09:41sexpbotThis command is old. Use -> now. It's a hook, so it can evaluate anything, even stuff that doesn't start with parentheses.
09:41cais2002->(+ 1 1)
09:41sexpbot=> 2
09:41cais2002->->
09:41sexpbotjava.lang.Exception: Can't take value of a macro: #'clojure.core/->
09:41chouser->>
09:41sexpbot=> #<core$_GT_ clojure.core$_GT_@1b4e0f0e>
09:42dnolen->(reverse [1 2 3 4])
09:42sexpbot=> (4 3 2 1)
09:42chouser-><-
09:42sexpbotjava.lang.Exception: Unable to resolve symbol: <- in this context
09:43chrisffmhi
09:43samlis there csp? something like jsp but in clojure
09:43chouserchrisffm: you're connecting each time
09:43chouserchrisffm: but clojurebot's not here
09:43samli wanna mix in html and clojure because i want to be cool
09:43samllike php style
09:43chrisffmsorry for that
09:43chrisffmi was not registered
09:43chousersaml: oh, please don't. have you looked at how enlive works?
09:44chousers/works/can be used/
09:44sexpbotsaml: oh, please don't. have you looked at how enlive can be used?
09:44wlangstrothuh, sexpbot agrees?
09:44lypanova warning label is needed. "php style can result in premature death"
09:44Kttmmdnolen: i just clone leinigen, remove ~/.m2, self-install, lein new, copied the project file from usenet and I still have the same errors :-(
09:45dnolenKttmm: clone leiningen? you don't need to do that, just d/l the bin and copy that into yr path
09:45dnolenKttmm: I mean d/l the lein shell script
09:46chrisffmcould somebody help me with reify and overloaded methods please?
09:47Kttmmdnolen: which one?
09:47chouserchrisffm: you've got multiple methods with the same name but different arg types?
09:47chrisffmyes
09:47chousersame arg counts?
09:48dnolenKttmm: http://github.com/technomancy/leiningen/raw/stable/bin/lein
09:48chrisffmsimply a java interface with void error(Strings); void error(Exception ex)
09:48chrisffmString s
09:48Kttmmleiningen 1.1.0 works with clojure 1.2 ?
09:48chrisffmand i try: reify AnyWrapper (error (^void [_ ^String s] (println s)) (^void [_ ^Exception ex] (println ex))) )
09:49chrisffmbut get the error: Must hint overloaded method: error
09:50chrisffmwhats wrong with my hints? :)
09:51dnolenKttmm: oops, http://github.com/technomancy/leiningen/raw/master/bin/lein
09:52dnolenKttmm: again, wipe out all yr stuff before you run self-install
09:52chousertry (reify AnyWrapper (^void error [_ ^String s] (println s)) (^void error [_ ^Exception ex] (println ex)))
09:53dnolenKttmm: perhaps you don't need to, but I like to keep the variables to an absolute minimum.
09:53chouserthat 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)
09:54chrisffmthx that worked, my error was that i tried to migrate from a proxy to reify...
09:54Kttmmexactly the same problem
09:54Kttmmand i removed the .m2 directory first
09:55chrisffmi read the doc but it was not clear to me
09:55chrisffmthank you very much :)
09:56chrisffmwhy is it different in proxy and reify?
09:56chouserchrisffm: yeah, there are awkward differences between them that I hope can be unified eventually.
09:56chouserthe reasons have mostly to do with ease of implementation in each case, I think.
09:56chrisffmah okay
09:56chouserthe way they're implemented is quite different, actually.
09:56chrisffmi see
09:57chrisffmnevertheless great language :)
09:57chouserglad you're enjoying it.
09:58chrisffmevery day :)
09:58chouserAt work I've been pulled off my normal tasks to write/maintain PHP for a few weeks. It feels a bit ... different.
09:59rhudsonmy sympathies
09:59chouserPHP code, not PHP itself of course.
09:59rhickeychouser: what differences do you want to see unified?
09:59rhickeybecause many of the differences are intentional, not implementation related
10:00chouserrhickey: multiple method names vs. multiple fn bodies is the one chrisffm was just stumbling over.
10:01chouserimplicit vs. explicit 'this' is another
10:02rhickeychouser: 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:02rhickeyexplicit this won't be unified except by breaking proxy to make it like everything else
10:05chouserat 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:06chouserthe proxy macro could at least support repeated method names for overload on arity, and perhaps even arg type.
10:06rhickeyyikes
10:07rhickeya proxy is a mapping of methods to fns, quite different from what reify produces
10:08rhudsonThe doc should at least be clear about what you have to do for overloaded methods
10:09rhickeyrhudson: ticket/patch welcome
10:09rhudsonok; how do I go about that?
10:10rhudsonI mean, where to submit?
10:10chrisffmrhusdon: i could help with an example :)
10:10chrisffmfor the doc
10:11wlangstrothhttp://clojure.org/contributing
10:11rhudsonThanks wlangstroth
10:12rhudsonThanks 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:13chrisffmthat would indeed help
10:14chrisffmor to state the difference in between proxy and reify
10:16rhudsonThe reify doc string is pretty clear to me
10:16chrisffmhm okay, i see
10:18chouserThe conceptual distance between reify and proxy for the user is not very big, even though the technical semantics are quite different.
10:18rhudsonrhickey: Thanks for such a wonderful language! Clojure is the most impressive language design I've seen; you have excellent taste
10:19rhudsonMy biggest frustration with Clojure is that I don't get to use it at work yet
10:19chouserevery case where reify works, proxy could be used. It'd be nice if converting from one to the other was simpler.
11:09cryptic_starhi 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:10AWizzArdcryptic_star: those methods are JVM methods.
11:10AWizzArdSo, variable amount of args means: collection of args
11:23cryptic_starok, many thanks for the help
11:33yacinhow do i change the value of a java object's public field?
11:34chouser(set! (.field obj) new-value)
11:34yacinthanks
12:13raekhi
12:13raekhow long does it take until ones name appears on clojure.org/contributing?
12:14raekI sent my CA from Sweden in the beginning of June
12:15raekI have found two bugs (one in core and one in contrib) that I'd like to create tickets for
12:15raekcan I create the tickets before my name appears?
12:15chousertry the support tab
12:17raekthe clojure-dev list is only for listed contributors, right?
12:18raekchouser: ah, ok. thanks! I didn't know about that one
12:26AWizzArdtechnomancy: in a .clj buffer (fn [...]) gets displayed as (f [] ...) and (lambda () ...) as (λ () ...). How can I stop Emacs from auto-translating those for me?
12:32technomancyAWizzArd: there's some stuff in starter-kit-lisp near the end you can comment out
12:34dpritchettJust 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:35AWizzArdtechnomancy: k, thx
12:59TimmcdHello1
13:00TimmcdIs there a way to import an entire java library in clojure?
13:00Timmcdie, (import 'javax.swing.*)
13:02LauJensenTimmcd: No
13:03TimmcdLauJensen: Ah, thats a shame. THanks tho
13:04LauJensenTimmcd: 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:05TimmcdLauJensen: Huh, thanks.
13:05mefestowould be nice to also be able to alias a package name so you could do something like (:import [javax.swing :as ui])
13:06Timmcdmmhm
13:14LauJensenmefesto: Ive never crammed enough imports into one namespaces to have had a need for that
13:15mefestoLauJensen: I just see it as the java version of (:require [some.ns :as x])
13:15LauJensenSure, I understand, just saying I never felt the need
13:38raeknow 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:39raekhow often does rich check the post box for new CAs?
14:03polypus do you guys know if 1.2.0-master-SNAPSHOT will get the latest beta announced today?
14:03qbgGet it how?
14:04polypusas in lein deps
14:04qbgSee http://groups.google.com/group/clojure/browse_thread/thread/d981917e767d86f5/a687b242f9b90ec5#a687b242f9b90ec5
14:04polypusty
14:05qbgBeta 1 is "1.2.0-beta1"
14:35kotarak~suddenly
14:35kotarakhmm
14:35danlarkingasp!
14:36kotarakdanlarkin: what was the trigger?
14:36kotarakAnd suddenly...
14:36danlarkinclojurebot seems to be MIA
14:36kotarakHmm
14:36kotarakyea
14:36rubydiamondJoy of Clojure or Programming Clojure ?
14:36rubydiamondwhich is good one?
14:36kotarakBoth
14:36rubydiamondif I am to buy right now
14:36ohpauleezthey're both good
14:36cemerickdanlarkin: he's been gone all day
14:37danlarkin:'(
14:37rubydiamondkotarak: if I am to spend $20 right now
14:37rubydiamondwhich book should I purchase.. I am absolute beginner
14:37kotarakrubydiamond: beginner pc, expert JoC
14:37cemerickrubydiamond: PC if you're a beginner
14:37rubydiamondkotarak: hmm
14:37rubydiamondcemerick: hmm
14:37kotaraksosososo
14:37kotarakAh, so desu ka?
14:38cemerickrubydiamond: if you've done any functional programming before, then JoC is appropriate
14:39abedrarubydiamond: don't forget about Practical Clojure
14:39abedraboth the PC's are good starting points
14:39rubydiamondcemerick: i have not done any practical functional programming
14:40rubydiamondabedra, cemerick, kotarak I just saw this tweet http://itunes.apple.com/app/twitter/id333903271?mt=8
14:40rubydiamondoh this link http://twitter.com/fogus/status/18621944947
14:41cemerickheh, yeah, chouser and _fogus_ do a good job with the twitter promotion :-)
14:41rubydiamondand started thinking to buy it
14:41abedrarubydiamond: it's a great book
14:41abedrayou should buy it
14:41abedrai just wouldn't start there
14:41rubydiamondabedra: JOC ?
14:41abedrarubydiamond: yeah
14:42abedrarubydiamond: I really enjoyed it
14:42abedrarubydiamond: but I would start with either or both of the PCs
14:42abedrarubydiamond: all 3 books have something to offer
14:42rubydiamondabedra: which book ?
14:43rubydiamondokay..
14:43abedrarubydiamond: Programming Clojure or Practical Clojure
14:43_fogus_I like Joy of Clojure the best
14:43abedra_fogus_: I do too :)
14:43cemerickha
14:44rubydiamond_fogus_: haha, you are here
14:44abedra_fogus_: it's the only book that I can't claim bias towards lol
14:44abedra_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:44rubydiamond_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:45lancepantzrubydiamond: come on, just spend the $6
14:45rubydiamond_fogus_: I am an Indian.. so $ is > Rupees
14:45abedra_fogus_: great job on the book though
14:45rubydiamondI am might purchase one of PR too..
14:45_fogus_abedra: I'll take the bias however I can get it
14:46_fogus_rubydiamond: I can't give you a bigger discount, but I will be your best friend
14:46rubydiamondabedra: you used to do ruby before right?
14:46_fogus_abedra: You're doing the Clojure tutorial at CUFP right?
14:46abedra_fogus_: yep
14:47abedra_fogus_: going to give everyone a data set and have them form it into an app with some incanter goodness
14:47rubydiamond_fogus_: :D
14:47_fogus_I will try to swing by and say Hi.
14:47abedra_fogus_: but the dataset will be a little off
14:47abedra_fogus_: cool!
14:47TimMcAny message-taking bots in here>
14:48_fogus_I put in a talk proposal but I'm not sure it will be chosen
14:48cemericknope
14:48_fogus_But I will be there nonetheless
14:49TimMcbah
14:49rubydiamondabedra: btw don't you now use emacs nowadays..
14:49rubydiamondyour post http://www.aaronbedra.com/2008/10/03/stop-emacs-time.html is invalid now right?
14:49abedrarubydiamond: yeah, some of my posts got messed up in the great gh-pages migration
14:49abedrarubydiamond: i need to fix them
14:50abedrarubydiamond: but yes i do, and bascially always have :)
14:50rubydiamondabedra: I meant .. you said that you are stopping using emacs..
14:50TimMcOh good, there is a MemoServ on freenode.
14:50rubydiamondbut I strongly feel that you use emacs these days.. may be I am wrong
14:50abedrarubydiamond: lol, no. That post was a redesign of my blog to look like an emacs window
14:50abedrarubydiamond: i had that up for about 8 months
14:51abedrarubydiamond: and you could use emacs commands to navigate the site and move the content windows around
14:51rubydiamondabedra: hmm ..
14:51rubydiamondthat would be great
14:52abedrarubydiamond: but sadly i needed a change
14:52abedrarubydiamond: because i get bored easily
14:52zkimrubydiamond: If you're a beginner you'll definitely want to check out http://faustus.webatu.com/clj-quick-ref.html, great cheat sheet
14:52rubydiamondabedra: btw how are you finding clojure though.. don't you miss ruby's lots of gems/libraries
14:53abedrarubydiamond: i still use ruby for rails
14:53abedrarubydiamond: but that's about it
14:53abedrarubydiamond: otherwise no, I don't miss much about it at all actually
14:53abedrarubydiamond: i still maintain rcov and some other ruby tools
14:53rubydiamondI heard clojures libraries also called gems.. is that true?
14:53abedrarubydiamond: no
14:53rubydiamondabedra: great
14:54rubydiamondzkim: thanks.. that cheatsheet looks nice
14:54zkimyeah, looks like the author put a lot of work into it
14:56rubydiamondreading this now http://stackoverflow.com/questions/2578837/comparing-clojure-books
14:57rubydiamond_fogus_: buying your book
14:57rubydiamond:p
14:57chouserwoo!
14:57chouserrubydiamond: thanks!
14:58chouserhope you find it useful and enjoyable. :-)
14:59_fogus_rubydiamond: Thanks!
15:02rubydiamonddone..
15:06LauJensenTimMc: Yea good point - Didnt think about overlaps
15:07TimMc(For the rest of the channel: Aliasing java.util.Date vs. java.sql.Date would be nice.)
15:07TimMcHonestly, that's the one place it has ever come up for me.
15:11raekwith summer job salary, there is no excuse anymore
15:11ohpauleezraek: It's a great book
15:12ohpauleezalso, the authors of all the Clojure stuff hang out in here and actively work on Clojure, or significant clojure projects
15:13chouserraek: yay! thanks to you too. :-)
15:21RaynesToo bad they went with Manning though.
15:21chouserRaynes: oh yeah? Why's that?
15:22chouserI'm not necessarily disagreeing, just wondering why it matters to you.
15:22RaynesMEAP 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:22Raynesom."
15:23RaynesSo, I guess I have to contact support now.
15:23Raynes._.
15:23RaynesIt's just minor annoyances I've never had with any other publishing company.
15:23rubydiamondbtw how to execute this function
15:23rubydiamond(defn ls [path] (seq (.list (java.io.File. path))))
15:23rubydiamondls gives me #<user$ls user$ls@2875ca3e>
15:25mefestorubydiamond: (ls "/tmp")
15:26rubydiamondmabes: yeah worked.. thanks a lot
15:27rubydiamondthis might be one of my very first clojure programs ..executed.
15:27defnRaynes: I've never logged in
15:27defnI just use my yahoo order number to get my ebook download
15:27chouserRaynes: bleh. Sorry about that.
15:27mefestoanyone view the JoC book on the normal sized kindle?
15:27Rayneschouser: It isn't your fault.
15:28defnmefesto: no, why, are you thinking about an ereader?
15:28Raynesdefn: I don't have an order number. I'm smart enough that I rarely keep such things. ;)
15:28mefestodefn: i have the smaller kindle (non-dx)
15:28rubydiamondmefesto: I have ordered kindle too
15:28rubydiamondhope I read most of JOC on it
15:29RaynesIf all else fails, I'll get the next MEAP. ;p
15:29rubydiamondmefesto: I have ordered the same kindle ..
15:29rubydiamondmefesto: btw how many books you have read on it
15:29mefestonever read a tech book on there so i was wondering how it looks
15:29rubydiamondmefesto: hmm
15:29mefestorubydiamond: quite a few ... haven't been keeping count but definitely the majority of my book reading is on it
15:30rubydiamondmefesto: that's good news for me..
15:30mefestoi still go paper for tech books which is why i ask... wondering how readable it is on there
15:31raekJoC downloaded... yay!
15:32raekit's really great that they don't DRM the books
15:32chousersupposedly epub and other versions will be avaible once the book is actually in stores.
15:32chouserand MEAP buyers will have access to those.
15:33RaynesI never buy dead-tree programming-related books.
15:33mefestoyeah it's a habit i'm looking to break
15:35mefestoMEAP ebook = PDF?
15:35chouseryeah
15:35rubydiamondraek: great
15:36rubydiamondraek: dead-tree ?
15:37raekyup
15:37mefestorubydiamond: gotta kill the trees to make the paper for those books :)
15:38rubydiamondmefesto: got it
15:38rubydiamondHaving Kindle DX should be basic human right.
15:38rubydiamond:D
15:38mefestorubydiamond: oh, you have the dx?
15:38rubydiamondsave paper. save trees. use kindle.
15:38rubydiamondmefesto: nope
15:38mefestothe MEAP pdfs should look nice on that
15:39rubydiamondI have ordered a Kindle 2 couple days back..
15:39rubydiamondI am waiting for it..
15:39raekI discovered that I could rotate the picture on my laptop screen 90 degrees
15:39rubydiamondmefesto: anyways.. I can always increase font size
15:39raekit almost becomes one big book
15:39tomojI 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:40KirinDavehttp://9to5mac.com/woz-speaks-about-iphone-antenna?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+9To5Mac-MacAllDay+%289+to+5+Mac+-+Apple+Intelligence%29
15:40mefestolmao
15:40KirinDaveMan, Woz is basically insane now.
15:40KirinDaveHe was also going off about the prius problem
15:44nDuffmefesto, yes, they do
15:45mefestorubydiamond: increasing the font size works well for ebooks but pdf's are rendered like images... at least last time i tried.
15:45rubydiamondmefesto: i heard kindle has native support for pdfs
15:45nDuffthat's still the case on the current version
15:45nDuffbut the DX is big enough to render them fine
15:45rubydiamondso may not be a problem..
15:45rubydiamondthink so
15:46nDuffI wouldn't want to try it on one of the smaller models
15:46mefestoyeah you can view them but they don't use a flow text layout... pdf's are rigit
15:46rubydiamondnDuff: do you mean Kindle 2 is not suitable for pdfs
15:46mefestorigid*
15:46nDuffrubydiamond, probably not for PDFs which weren't rendered to a smaller-than-usual page size, yes.
15:46defnif you buy an ebook reader i have a great recommendatiion
15:46defnand ive done a lot of research on this
15:46mefestorubydiamond: 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:47rubydiamondmefesto: okay..
15:47defnthe the iRex DR800SG
15:47nDufflast time I looked at iRex, they were pretty but too pricey.
15:47defnbigger than a kindle, no DRM, replacable battery, SIM card
15:47defnthis is 400$
15:48nDuffwell, that's not so bad
15:48defnbetter than the Sony, I sent back two Sony ereaders before I got this
15:48mefestowow that thing is pretty
15:48defnand best thing is: PDFs are readable
15:48defna bit small, but im not 70 years old
15:49defnslightly 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:49rubydiamonddefn: hmm
15:49rubydiamondI have already ordered Kindle 2 .. hope it is worth buying..
15:50defni chose to got go with the Kindle 2 due to DRM restrictions
15:50mefestorubydiamond: what type of books do you typically read?
15:50rubydiamondmefesto: 95% technical
15:50defnand the small screen -- pdf reflow doesnt work very well
15:50rubydiamond5% fiction/non fiction
15:50defnif you want to read non-fiction you almost have to get a bigger screen than the kindle 2 imo
15:50lancepantzwhy is the ipad not in the discussion?
15:50zkimdefn: or at all anymore, I wonder if the dx is better for pdfs
15:50lancepantzi've been wanting something to read technical papers too, have been planning on picking up an ipad
15:50rubydiamonddefn: I can increase/decrease font size of pdfs on laptops.. and expect same on kindle2
15:51defnlancepantz: getting away from a backlit screen was a high priority
15:51zkimrubydiamond: you can't resize on the kindle 2
15:51defnthe ipad does PDF reflow too
15:51lancepantzi would like that as well, but i also would like to be able to read in the dark
15:51zkimrubydiamond: rotate is as good as it gets
15:51lancepantzso i guess you get a light for the kindle?
15:51defnyeah
15:51defnor a head lamp
15:51rubydiamondzkim: that's bad news
15:51mefestoi like being able to read outside in the sun
15:51lancepantzhaha
15:51rubydiamondI thought resizing works
15:51rubydiamond:(
15:52defnhey! dont laugh! a head lamp is a great way to read in the dark
15:52zkimnot on mine (kindle 2)
15:52mefestorubydiamond: it does for ebooks :-\
15:52lancepantzya know, i think i'm going to get a headlamp
15:52lancepantzthat can be useful for other things as well
15:52defnDR800SG can change PDF font size
15:52rubydiamondmefesto: i bought it because it is now cheaper .. 189 bucks
15:52defn...sort of...
15:52rubydiamondand thought I would finish dozens of tech books with it
15:52lancepantzthat's going to crack the girlfriend up
15:53zkimdefn: is that the sony?
15:53defnnah, dont buy the sony
15:53defnunless you just want to read novels, and whatever you do, dont buy the touchscreen
15:53defnthe glare makes it impossible to read
15:53defneven under indoor light at night
15:53zkimgot it
15:54mefestorubydiamond: if you find the experience painful, remember mobipocket .pdf -> .mobi conversion
15:54rubydiamondmefesto: ok
15:54defnthe 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:55defnciao
15:55zkimwow the dr8 looks nice
15:57defnit's pretty neat -- the new firmware lets you draw with the stylus and stuff
15:57defnanyway...clojure...
15:57zkimheh
15:58defnhow are all of the cool kids getting the bleeding edge 1.2 beta
15:58defnin leiningen i mean
15:58clojurebotenlive is for generating HTML from pure-markup templates: http://wiki.github.com/cgrand/enlive/getting-started
15:58defn[clojure "1.2.0-master-BETA"] or what?
15:58mefestois building from master the same as 1.2 beta or is there another branch?
15:58defnmefesto: my question exactly
16:00qbgAnother branch exists
16:00tomojhttp://build.clojure.org/releases/org/clojure/clojure/1.2.0-beta1/
16:00mefesto1.2.x im guessing?
16:00qbgYes
16:00tomojso [clojure "1.2.0-beta1"]
16:00defnthanks tomoj
16:00tomojand similarly for contrib
16:00dakronedefn: [org.clojure/clojure "1.2.0-beta1"]
16:09mefestoanyone using couchdb with clojure?
16:09thetafp(+ 1 2)
16:09clojurebot3
16:11tomojmefesto: I just started writing a view server last night..
16:11mefestotomoj: recommend any particular driver? been looking at couchdb4j
16:12tomojthat sounds terrible
16:12mefestowondering if there is a good clojure one
16:12tomojdon't like clutch?
16:12tomojhttp://github.com/ashafa/clutch/
16:12mefestoahh, thanks :)
16:12tomojI haven't used it, though
16:12tomojwriting my own instead
16:13mefestotomoj: have you used couchdb for non clojure things?
16:14tomojtoyed around in ruby once, that's it
16:14qbg(apply str (let [a "eda?we ie oc hk otShswnntr"] (map #(get a (mod (* 15 (- % 4)) 26)) (range 26))))
16:15qbg(+ 1 2)
16:15clojurebot3
16:15qbgHmm...
16:16qbgWhy does that work, but not the other one?
16:17tomoj(- 3 5)
16:17clojurebot-2
16:17tomojonly for math maybe?
16:17arohner(map inc (range 0 3))
16:17arohner,(map inc (range 0 3))
16:17clojurebot(1 2 3)
16:18qbg,(apply str (let [a "eda?we ie oc hk otShswnntr"] (map #(get a (mod (* 15 (- % 4)) 26)) (range 26))))
16:18clojurebot"Since when does that work?"
16:29arohnerI'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:29arohnerusing lein-1.2, I get the message "compiling Foo", but then the .class file doesn't show up in the jar
16:29arohnerusing lein-1.1, I get no message about compiling, and nothing shows up in the jar
16:32arohnerwith lein-1.2, it looks like it compiled fine (I can see the .class files in classes/)
16:33cschreinerHow 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:28kreyHello everyone
17:30raekhi
17:53defnis there anything like linkparser for clojure?
17:54defn(something that will read from wordnet)
17:54defnlike this: http://deveiate.org/projects/Ruby-LinkParser
17:57lpetitdefn: something like this ? http://writequit.org/blog/?p=365
17:57lpetitdefn: or this ? http://code.google.com/p/word-clj/
17:58defnlpetit: ive been looking into opennlp, but im not sure if i need all the bells and whistles it provides
17:58defnlooking at the 2nd one now
17:59defnlpetit: thanks for the suggestions
18:00defni think ill probably go with opennlp -- im have some hare-brained scheme to use tagged sentences to generate midi data
18:00defns/im/i
18:51moshisushihello i'm getting this error in emacs: File error: Cannot open load file, swank-clojure-autoload
18:51moshisushiwhen following:
18:52moshisushihttp://riddell.us/ClojureWithEmacsSlimeSwankOnUbuntu.html
18:52moshisushiany ideas why it's missing?
18:55technomancymoshisushi: that documentation is pretty old; try the swank-clojure readme
19:07raek,(doc future-cancel)
19:07clojurebot"([f]); Cancels the future, if possible."
19:08raekwhen is it not possible to cancel a future?
19:09tomojone case is when it's already done
19:09tomojdunno if there are more
19:12ataggartfuture-cancel just calls Future.cancel() so the javadocs there would be more illuminating
19:12chouserif 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:13ataggartFuture.cancel() has a return value that would be worth looking at (unmentioned in the clojure docs)
19:14KirinDaveMan
19:14KirinDaveThese jackoffs on news.ycomb claiming Lisp is not meaningful because the market doesn't select it...
19:14KirinDaveThey make my head hurt.
19:15RaynesIf people only use mainstream languages, no other languages will ever become mainstream. I don't understand why people don't accept that.
19:15lpetitisn'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:16lpetit(?:[a-z|A-Z|\*|\!|\-|\_|\?|\>|\<|\=|\$]|\+(?![0-9]))|[0-9]|\.|\#))+)*))?)"
19:16RaynesStop trying to blind us.
19:17ataggartregex: write-once, read-never
19:18technomancyKirinDave: also clearly dvorak is crap, since modern keyboards aren't sold with it.
19:18technomancyKirinDave: and right next to the A key is the best place to put capslock!
19:18KirinDavetechnomancy: I don't want to conflate that. ;)
19:18KirinDavetechnomancy: All I know is that Common Lisp still had something better than exceptions in 1992 and we still have fucking exceptions.
19:18KirinDaveIt's Not Difficult to have conditions and restarts.
19:19lpetitRaynes, 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:19KirinDaveAnd here we are still playing with the equivalent of rocks and sticks with our error handling.
19:19ataggartthere's a lot that can be read from what emerges from a market, but "menaningfulness" isn't one of them.
19:21ataggartI need to figure out a way to get paid to write clojure.
19:21KirinDaveataggart: Look for jobs?
19:21KirinDaveThere is no shortage
19:21KirinDaveI turned one down the other day, as a matter of fact.
19:22ataggarttrue enough, though I like being able to bring my dog into the office. Not many places allow that.
19:22ataggartdogs + office = awesome
19:22technomancyataggart: no office is even better: http://www.flickr.com/photos/technomancy/tags/remoteoffice/
19:22ataggarttechnomancy: I agree. If only I could figure out how to love emacs, I would have app'd to you guys a while ago.
19:23technomancyoh, dang.
19:23ataggartI'm more than willing to accept it as a personal flaw
19:23technomancynobody's perfect. =)
19:24nDuffataggart, indeed; being able to bring the dogs to work again is one of the reasons I'm looking forward to leaving Dell
19:25ataggartI'm close to just moving to Vancouver and opening up my own shop, then I can do what I want.
19:55pedroteixeirais there any problem defn fn1 and having a protocol with function fn1, with different arity? i think something is odd here.
19:56pedroteixeirahm.. the protocol overwrites the function! ;/
20:02chouseronly one fn/protocol method with the same name in the same namespace
20:40gstampClojars 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:41lancepantzgstamp: the bottom one
20:42lancepantzif it has no group id, then it was the first one on clojars
20:43gstampok. so always go for the one with no namespace. gotcha
20:49dnolengstamp: 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:16gstampis leiningen compatible with clojure 1.2.0-beta1? I'm getting a class cast exception when running lein (with no args)
21:27dnolenyowza aleph zips along at 20,000+ req/s on a EC2 Compute Cluster
21:30lancepantzdnolen: wow
21:30lancepantzthat's nice
21:30lancepantzbonus points if you bench node.js on the same box
21:31dnolenlancepantz: already did, ~8600 req/s
21:31dnolenI didn't do any work to setup multiple node processes tho, so that's not bad for only running on a single thread.
21:32lancepantzright
21:32lancepantzone of the guys at work is huge on node.js
21:33lancepantzobviously us clojure guys are resisting vehemently, aleph couldn't have come at a better time
21:34dnolennode.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:36lancepantzi just really don't want to support another webstack
21:45cais2002早上好 good morning
21:45mikemmorning :)
22:20defnman i forget so much of my chinese
22:20defnsomething something hau
22:20defnheh
22:57cais2002defn: that's right
22:58fuchsdHere'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:58fuchsdI'm looking for the 1.2 clojure beta (or any clojure 1.2)
22:58fuchsdBut it doesn't come up when I search for 'clojure' (among other search terms)
22:58mikemfuchsd: not sure that's on clojars
22:59fuchsdAhh, gotcha
22:59mikemyou can grab it here: http://clojure.org/downloads
23:00fuchsdBut clojure 1.1 should come up if I search for 'clojure', right?
23:01mikemI don't think any version of clojure (or clojure-contrib) is on clojars
23:01mikemah, there is a version of contrib
23:02fuchsdWhere does leiningen get it from?
23:04mikemI think it's pulled from http://build.clojure.org/
23:05fuchsdOh, ok, cool. Thanks!
23:06mikemwhen you run lein deps, there's usually four places that are checked if you take a closer look at the output
23:08fuchsdoh right, build.clojure.org, clojars.org, clojure-snapshots and central
23:08fuchsdCool, thanks
23:10fuchsdso the beta is up at build.clojure.org/releases
23:10fuchsd[org.clojure/clojure "1.2.0-beta1"]
23:11fuchsdThat did it, thanks for the help
23:11mikemnow run along and build some cool stuff :D
23:11fuchsdwill do :)
23:13defnheh
23:13defnbuilding cool stuff for great good!
23:14defni wonder if there's a way to take distributed development, sort of an open source model approach, to a development company
23:14defnlike based on your contributions you get paid X, and anyone can contribute, but contributions are accepted by a comittee
23:16rhudsonClosest thing I can think of like that is the Apple App Store :)
23:17caioanyone using compojure can help me pls?