#clojure log - Jun 02 2009

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

0:02 cads: hey, I'm looking for a better shell in which to write some clojure frontend functions like commandline options and such

0:03 I have one written in sh but I'd like to write more complex features more easily

0:03 hiredman: cads: have you looked at hashdot?

0:03 cads: should I consider doing command argument processing using clojure scripts, or take the shell aproach to a higher level with something like the scheme-shell

0:03 will do

0:04 perfect

0:04 "first class status on Unix-like operating systems"

0:04 nice

0:05 wow, so perfect

0:07 hiredman: was thinking about your uncurry function

0:07 wrote a few variants of the concept, based on it

0:08 do you get to use uncurry much?

0:08 I was wondering what other designs you may have considered

0:11 replaca: twopoint718: not exactly, the first argument is the instance of that class that you have created with the constructor

0:16 hiredman: cads: just the one

0:17 twopoint718: replaca: okay, so that explains the arity error that I was getting.

0:31 replaca: thanks, I have my test case working.

0:53 replaca: twopoint718: (wandered away for a few minutes) - great, glad it helped

1:21 cads: hey

1:24 I've got (? [x] (* x x)) working well using (defmacro ? [vec form] (list 'fn vec form))

1:26 hiredman: (defmaco ? [& foo] `(fn ~@foo))

1:27 cads: how could I write that macro to take for example (? x y z . (print x y z) (* x y z)) or (? (print %1 %2 %&) (apply * %1 %2 %&))?

1:27 ah

1:28 so based on the arguments to ? being either divided by . or using %, i'd like to simulate fns and #()s

1:29 hiredman: you find the . and walk backwards accumulating parameter names, then emit a fn form

1:29 cads: actually I don't think I want %s in there...

1:30 this is going to be neat, i will use them all the time

1:30 hiredman: you've seen transform?

1:30 cads: I couldn't understand what it does :D

1:30 hiredman: hmm

1:31 cads: "ugh, read the source. this started as a very specific function and turned into a very generic one."

1:31 the doc string helps me a lot :)

1:31 hiredman: :P

1:31 scgilardi: where is transform?

1:31 cads: can you write the haskell-like type of transform?

1:31 hiredman: ~transform

1:31 clojurebot: transform is http://github.com/hiredman/odds-and-ends/blob/8a84e6ddbad9d71f714ba16c3e1239633228a7eb/functional.clj

1:32 hiredman: cads: uh, dunno much haskell

1:32 and it's been a while since I touched transform

1:33 cads: ack, I can't grok it!

1:33 if it's finished, then it gives out se...

1:33 hiredman: so transform takes something (usually a zipper ala clojure.zip) a predicated a function to apply if the predicate returns true for any node in the zipper

1:34 cads: if it's not finished it recurs in one of two ways

1:34 hiredman: oh, and fin to check to see if you are finished walking the zipper

1:35 ,(pl inc $ inc $ inc $ 0)

1:35 clojurebot: 3

1:35 cads: yes, i've seen that trickery before :)

1:36 hiredman: so pl uses transform to walk a seq-zip and make alterations

1:36 actually it uses transforml and transformr

1:36 cads: lol: `(do ~@(-> forms zip/seq-zip fast-fwd dollar-sign-application interpunc-comp zip/root zip/seq-zip prefix-uncurry zip/root zip/seq-zip prefix-flip zip/root))

1:37 now that's functional :)

1:37 hiredman: hmm

1:37 cads: I think I can do the same thing for my simple .

1:37 hiredman: I think you might run into problems

1:38 the . symbol may be reserved by clojure

1:38 for java interop

1:38 ,'.

1:38 clojurebot: .

1:38 hiredman: ,(let [. 1] .)

1:38 clojurebot: java.lang.ClassFormatError: Illegal field name "." in class sandbox$eval__2794

1:38 cads: I could use -> or : as well I suppose

1:39 the period just makes it look oldskool

1:39 scgilardi: . is our tiniest little special form

1:40 cads: so we gotta edit java if we want to make it work?

1:41 scgilardi: you can get your list unevaluated. at that time it's just a symbol. you may be able to get it to work.

1:41 hiredman: I would recommend against repurposing a special form for something else

1:42 cads: not unless I could make it work backwards as well.. I don't want to break my implementation against other's people's code, after all

1:42 would be nice if the reader was fully extensible so we could fully repurpose the language if we wanted

1:43 hiredman: cads: it would be annoying

1:43 "I wrote this in clojure, but it is completely different and all the special forms have been switched around"

1:45 cads: well if you were using clojure for making a complete language for describing operations on cad drawings for example, you probably want to map different ideas to some of the special forms

1:46 such code would be less than general purpose but should be expected to able to be included in normal code

1:47 in the long term we might see someone wanting to write a proof description language on top of clojure or something

1:48 hiredman: the set of special forms is very small, 10? I think it is no small burden to give them

1:48 up

1:50 cads: lol, the dispatch macro table could be especially extensible

1:51 just looking at the code; when the reader sees # it just looks up the next symbol in a table to see whether it should read a set, a fn or metadata, etc.

1:53 / macros['|'] = new ArgVectorReader();

1:53 err

1:53 it's a line that's commented out of the lispreader.java

1:54 thank god :)

1:54 (fn |x y z| ...) would be so terrible

1:55 like ruby blocks

5:46 djpowell: hmm - JDK update 14 has an option to enable escape analysis - I wonder if it speeds up clojure at all

5:46 also the disturbing: "Although G1 [garbage collection] is available for use in this release, note that production use of G1 is only permitted where a Java support contract has been purchased. G1 is supported thru Sun's Java Platform Standard Edition for Business program"

5:48 rys: eek

5:48 That smells bad

5:48 piyo: djpowell: http://tech.slashdot.org/article.pl?sid=09/05/29/1711203

5:51 djpowell: ah, so G1 is in openjdk? I haven't had need to look at openjdk yet.

5:52 piyo: from one commentor: "The G1 collector is still a "work in progress" so they are suggesting that you use it *in production* only if you have a support contract with Sun (Oracle?). This is not a big deal. You can still use it, just enable it with "-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC" on the command line..."

5:52 you can turn it on yourself, and keep the pieces when it breaks

5:53 eevar2: openjdk is great. never been easier to get java on debian

5:54 djpowell: that doesn't placate me much. i get the impression that you would be breaking the licence agreement. surely sun wouldn't be encouraging only their paying customers to try it if it was unstable. i get the impression that this is more about making money than protecting people from experimental features - there are loads of -XX experimental features anyway

5:54 eevar2: just don't install any recommended packages, as they tend to pull in the gnu java stuff :/

5:54 djpowell: uh that slashdot thread is full of people complaining about the speed of java - it is like it is 1998 or something

5:55 rys: Seems like they're saying it's best to turn it on only if we can help you debug issues

5:58 djpowell: is G1 just about low-pause then, or does it have decent throughput too? I imagine low-pause is more of a thing for GUI apps; I doubt that is that important to most clojure people

10:31 Chouser: I think I'm abusing atoms.

10:31 rsynnott: filth!

10:32 rys: Poor atoms :(

10:33 Chouser: turns out they behave well even if you throw exceptions from inside the fn you give to 'swap!'

10:33 stuartsierra: What happens to the value?

10:33 Chouser: stays what it was

10:34 ,(let [x (atom 5)] (swap! x inc) (swap! x #(throw (Exception. (str "foo" %)))))

10:34 clojurebot: java.lang.Exception: foo6

10:34 Chouser: oh

10:34 ,(let [x (atom 5)] (swap! x inc) (swap! x #(throw (Exception. (str "foo" %)))) x)

10:34 clojurebot: java.lang.Exception: foo6

10:34 Chouser: oh

10:34 well, anyway, it would be 6 there. :-)

10:35 So I'm hoping that counts as "free of side effects"

10:41 Chousuke: hmm

10:42 I guess the exception just aborts the swap altogether so there's no fear that it'd get retried.

10:43 Chouser: oh! add-watch and add-watcher both exist.

10:43 Chousuke: but what would happen in a situation where the first swap doesn't throw an exception, gets retried, and that retry does throw an exception

10:44 Chouser: Chousuke: should be the same, it's just a loop.

11:31 wwmorgan: has anyone been able to get clojure.contrib.pprint to work with *print-dup* on? Pretty printing {:foo :bar} spits out {:foo" ":bar} when *print-dup* is bound to true

11:35 replaca: wwmorgan: sorry, print dup is not supported yet. But your behavior with the quotes is some kind of bug. I'll take a look.

11:36 wwmorgan: thanks replaca

11:36 replaca: wwmorgan: *print-dup* is coming, though!

11:58 grzm: anyone know if stuart sierra is still on at lispnyc next Tuesday?

12:23 jensCD: Hi. I am new to clojure and had a problem with emacs. (I use ubuntu, emacs 22 and installed slime and swank for clojure).

12:24 After certain gestures (e.g. resizing the emacs windows) my PC was frozen (maybe all keyboard events where catched). Did anybody had a corresponding experience?

12:28 chessguy_work: for a second there, i thought you meant mouse guestures, like in firefox. that would be a....strange emacs feature

12:29 technomancy: jensCD: did you have any network access going on at the time?

12:30 jensCD: Emacs has no concurrency support, so many operations are blocking.

12:30 mattrepl: and of course: http://www.emacswiki.org/emacs/StrokeMode

12:30 jensCD: I've noticed slowdown when the slime buffer contains longish lines

12:31 jensCD: In fact I could "heal" the freeze by removing the network cable (found experiment).

12:32 Only the mouse movement reacted. But nothing else.

12:34 technomancy: jensCD: were you using that instance for anything else?

12:34 checking mail, irc, etc?

12:34 jensCD: yes. Mail, firefox and others

12:35 technomancy: jensCD: I mean in that Emacs instance

12:35 jensCD: no

12:36 The freezing is reproducable e.g. after resizing the emacs window.

12:37 technomancy: jensCD: that's very strange; I've never seen anything like it. I know the X font rendering engine changed in 23, maybe you could try upgrading

12:37 the package is called emacs-snapshot

12:38 jensCD: What is the preferred editor in the community? Maybe I switch to something else?

12:39 technomancy: nah; nothing beats slime. =)

12:40 cemerick: jensCD: here be dragons. Don't listen to technomancy anyway -- he's on the take. ;-)

12:40 jensCD: I use netbeans + enclojure, FWIW

12:41 I hear the intellij environment is getting decent. There's also an eclipse plugin, though I don't know much of anything about that.

12:42 jensCD: Technomancy/Cemerick: Thanks for the remarks. I will continue investigating.

12:43 technomancy: jensCD: they would probably know better in #emacs; they're usually pretty helpful in there

12:43 jensCD: ok. Thx.

12:44 technomancy: but if you're on Ubuntu there's very little reason to stick with version 22.

12:45 jensCD: You recommend to go for 23?

12:46 technomancy: yeah, the upgrade path is really easy

12:46 at least check to see if the same problem manifests there

12:46 jensCD: ok. I will give it a try.

12:59 replaca: jensCD: in ubuntu (at least uptodate versions) snapshot == 23 if you've updated in in the last 6 months or so

13:19 gnuvince: Who was the blad hobo with Schwartz during the keynote?

13:20 *bald

13:46 hlship: when is Rich's talks on Clojure at JavaOne?

13:52 replaca: I think the script bowl is about to begin and then I think his overview talk is early afternoon

13:52 but I don't have the schedule in front of me

13:53 I'm watchig the twitter stream from JavaOne at http://twitterfall.com/?trend=javaone

13:54 ataggart: I don't know what to make of the still strong interest in EJBs

13:56 hlship: too bad, I don't get there until tomorrow

13:57 Chouser: twitterfall seems to be a bit behind?

13:57 replaca: it looks like it just stalled. Is it twitterfall or twitter, I wonder.

13:58 It was zooming along for a while

13:58 technomancy: what's this talk of a JDK7 announcement?

13:58 replaca: dunno what it means

13:58 ataggart: the tweets get queued

13:58 Chouser: I've a got a search for javaone on twitter open, and it seems to be up to date.

13:59 technomancy: does Clojure run on the JDK7?

13:59 ataggart: I can't hitnk of why it wouldn't

14:00 technomancy: there's no timeline on a release though right?

14:00 last I heard they hadn't even decided if TCO was going to make it in.

14:00 ataggart: which means it won't

14:00 technomancy: jerks

14:00 ataggart: ya

14:01 I still haven't figured out how invokedynamic would help (assuming it even makes it in)

14:01 technomancy: ataggart: it doesn't help clojure; it's for jruby and friends

14:01 ataggart: my bytecode level understanding of java is lacking

14:01 hrm

14:02 technomancy: sad that Ruby will get TCO before Clojure.

14:02 ataggart: hey, at least we know python won't ;)

14:03 * technomancy snickers

14:03 ataggart: you going to the thing tomorrow?

14:03 technomancy: yep

14:03 ataggart: nice

14:04 cemerick: technomancy: you mean cruby or merv or whatever?

14:04 technomancy: hmm; the JRuby dev seems to think TCO is a done deal in Java 7 as of three months ago

14:04 cemerick: ruby 1.9.1 (yarv) has it implemented but turned off by default

14:04 that's the latest stable "canonical" Ruby implementation

14:04 cemerick: ah, yarv, right.

14:05 * cemerick merged merb and yarv => merv :-P

14:05 technomancy: heh

14:06 http://www.ruby-forum.com/topic/180790#791664 <= re jdk7 development and TCO

14:08 replaca: rich is up, according to http://twitter.com/kaarenilsen

14:11 Chouser: and now scala. so that was it?

14:11 gnuvince: Oh great...: "maudrit Clojure - too many parentesis for my taste"

14:12 ataggart: "Showing Life-application. A lot of code to make it work ..."

14:12 cemerick: damn, has he looked at the curly-braces in other languages?

14:12 ataggart: Rich should have asked Stuart if he could use the StringUtils example from the book

14:13 *less* loc, branches, etc than the java version

14:13 erm... fewer

14:16 gnuvince: cemerick: that's usually what I say, but apparently braces are "different"

14:16 ataggart: not that I agree with the conclusions, but there is a different visual effect which can help convey information

14:16 gnuvince: Also, I wonder if a not-too-trivial program written in Clojure and Java wouldn't have more braces + parens than Clojure has parens.

14:17 cemerick: I think it's actually the depth of nesting that one often sees. )))))))) can be frightening, if you're not familiar with editors that make dealing with that trivial.

14:17 gnuvince: they do, almost universally.

14:17 ataggart: writing java intrp-op in clojure certainly seems to involve less parens

14:17 gnuvince: I think nesting is more a property of functional programming I think than Clojure itself.

14:18 Look at programs written in Clojure, Erlang, Haskell, etc. they usually have a lot more indentation than equivalent imperative programs

14:18 do_this();

14:18 do_that();

14:18 vs.

14:18 take_this(

14:18 take_that(

14:18 cemerick: eh, scala avoids it because of the convention. If it closed top-levels with }}}}}}}, I think the complaint would be the same.

14:18 gnuvince: filter_those()))

14:19 cemerick: maybe demo code should have (most?) close-parens on their own lines, indented sensibly

14:19 (that's obviously a bad idea)

14:19 gnuvince: When you're in functional mode, a function is usually a single expression, so having a bunch of lines indented at the same level makes no sense.

14:19 I don't think trying to pretend that we write code this way is a good idea

14:20 ataggart: or you could take the )))))) and drop it down to a line by itself, and then just don't scroll down all the way

14:20 Chouser: I think if you're used to reading procedural code, you're not used to holding the deep nesting context in your head. Instead you hold your complex mutable state (args, local variables, instanace members, etc.)

14:21 technomancy: if people are dismissing clojure because of the literal shape that its programs take, they probably aren't interested in actually evaluating it.

14:21 ataggart: ^^

14:21 technomancy: they're probably just looking for justification to stay inside their comfort zone

14:21 ataggart: in other news: http://e3.g4tv.com//e32009/g4onthefloor/wiebecam/

14:21 cemerick: +1 technomancy

14:23 technomancy: there are a lot of people who just want to believe that they're going to stay relevant by just churning out Java forever because they don't want to go through the initial "I suck at this" phase of learning something new. so their subconsciousness invents reasons for them.

14:23 it's a neat trick your mind can pull on you. =)

14:24 gnuvince: I'm actually afraid of the exact opposite

14:24 "Oh no, I don't know Java, C#, C++, Haskell, etc. I need to get cracking right now!"

14:24 Chouser: round two of scriptbowl

14:25 ataggart: by "round" do you mean language, or is it really some kind of "rounds" scheme going on?

14:25 Chouser: There are *so* many languages, and the effort required to really learn one well is so significant, you have to have some way of dismissing 90% of them without a full evaluation.

14:26 ataggart: they did some kind of 4 minute demo for each language, now I think they're going around again with 4 minutes each for "cummunity features" or something.

14:26 ataggart: "OK gentlemen, your next challenge: implement a red-black tree. GO!"

14:26 ahh ok

14:29 gnuvince: Chouser: sure, but I think there's a way to pick a few ones.

14:29 Chousuke: ataggart: that'd make clojure look bad I think :/

14:30 ataggart: the RBT?

14:30 Chousuke: yeah

14:30 ataggart: it was the first CS-y thing I could think of

14:30 Chousuke: I think it'd be quite slow because of immutability, and probably pretty complex too.

14:32 Chouser: sorted-map is an immutable red-black tree.

14:33 lots more "cool jruby" and "cool groovy" tweets than "cool clojure"

14:33 Chousuke: Chouser: but it's actually implemented in java.

14:33 Chouser: Chousuke: yes

14:33 cemerick: Chouser: to be expected, I think

14:33 Chouser: But *I* can implement it in clojure like this: (sorted-map)

14:33 :-)

14:34 ataggart: Would I be correct to think the "coolness" may be an artifact of the app and not the language?

14:34 Chousuke: Chouser: :)

14:34 cemerick: Chousuke: yes, I've done an RB tree in clojure, and it is pretty painful

14:34 it's a mismatch really -- many better ways to get to the same objective.

14:35 Chouser: ataggart: probably, cure.

14:35 sure

14:37 stuhood: ...implemented in java

14:37 oops

14:37 cemerick: does anyone know what the objective is in terms of promoting clojure in general? Is there a particular critical mass that is desired, etc.?

14:38 technomancy: cemerick: I don't think there's a Master Plan

14:38 Chouser: cemerick: the objective for the rest of us is to be able to get jobs writing Clojure full time.

14:39 danlarkin: aye!

14:39 Chouser: cemerick: you're just ahead of the game. :-)

14:39 "Interesting how #Clojure source almost looks like #Spring xml configuration files."

14:39 ataggart: Damning with faint praise, eh?

14:39 technomancy: Chouser: careful; you'll make me spill my drink

14:40 replaca: Chouser: lisp is strange when you first see it! People love their curly braces. This was Gosling's insight that led to Java's success.

14:41 Chouser: heh

14:41 cemerick: Chouser: I was going to say, I've got that one covered already, so what's the big hub-bub, bub? ;-)

14:41 technomancy: if you write XML, it will keep you fit and trim: http://justlooking.recursion.org/camping-xml-situps.png

14:41 Chouser: "Groovy is clearly winning the Script Bowl right now. Clojure too complicated to get across. Scala-guy not prepared enough."

14:41 ataggart: technomancy: awesome!

14:42 hiredman: Chouser: *rabble* *rabble*

14:42 cemerick: we should have a product launch this summer. Maybe we'll just start growing like a weed, and hire the entire population of clojure programmers. :-P

14:43 technomancy: the great thing about hiring clojure programmers right now is even though the pool is small the supply of jobs is even smaller. =)

14:44 cemerick: yeah, probably right.

14:44 replaca: I just poked my head into the #scala group and they're talking about contra-variance. I don't think clojure's more complex than that! :-)

14:44 rys: Are there any case studies or what have you from people using it in production?

14:44 cemerick: Especially since I'd be perfectly comfortable hiring anyone with a functional programming background.

14:45 hiredman: replaca: #scala goes on and on about "Arrows"

14:45 replaca: hiredman: of cource, half the conversation in here isabout how to get slime set up :-)

14:46 ack, spelling fail

14:46 hiredman: too bad technomancy over wrote all the emacs factoids

14:46 "emacs is hard, lets go shopping!"

14:46 technomancy: hiredman: we still have you to say them, even if clojurebot has forgotten

14:47 ataggart: that the first thing a java guy has to deal with when looking at clojure is emacs... it's less than ideal.

14:47 Chouser: Is atom-abuse a crime, or just frowned-upon?

14:47 technomancy: most of the questions are from folks who found a seven-month-old blog post about using Clojure together with Common Lisp and checking out about seven repositories by hand...

14:47 cemerick: ataggart: enclojure is top-notch, and pretty, and fast :-)

14:48 ataggart: I couldn't grok how netbeans was laid out. Been working in eclipse too long.

14:48 Chouser: emacs really isn't a requirement.

14:48 "The winner is between Groovy and Scala"

14:49 technomancy: not my fault if Google ranks out-of-date stuff over my tutorial. =)

14:49 Chouser: "scripting shootout winner is? groovy from the sounds of the applause. then probably scala then jruby "

14:49 "according the applause groovy is the winner of the script bowl"

14:49 "Ruby is the winner of the #ScriptBowl"

14:49 "script bowl winners: groovy followed by scala"

14:49 technomancy: and groovy just ... happens to be the closest to Java in terms of syntax.

14:49 coincidence?

14:49 cemerick: Chouser: man, reviled by the lispers, ignored by the java folks

14:49 replaca: sounds like familiarity is winning out, which is to be expected

14:49 Chouser: "Groovy the clear audience favorite."

14:49 gnuvince: Groovy happens to be the least interesting language of the bunch.

14:50 replaca: but if what you're after is "dynamic java," groovy is pretty compelling

14:50 ataggart: anyone know what Rich was using to demo clojure?

14:50 technomancy: replaca: the right answer to the wrong question. =)

14:51 replaca: it matches the platform really well and it's very easy for Java folks to get

14:51 Chouser: sounds like he showed the parallel life thing

14:51 replaca: technomancy: depends what you're trying to accomplish

14:51 gnuvince: Too bad he only had a dual core

14:51 Chouser: "Heading to Hall E 133 for the Clojure intro. I liked the Clojure approach to coding from the Script Bowl."

14:51 tell me to stop posting tweets so I can get work done.

14:52 gnuvince: If a 32-core Sun machine had been available and he could've shown all those cores crunching, that would've made some people go "whoa!"

14:52 stuhood: stop posting tweets! everyone watch http://twitter.com/#search?q=script%20bowl

14:52 ataggart: chouser: more tweets!

14:52 gnuvince: I don't understand though how Robert Fischer can represent for Groovy

14:53 Guy is a big, big fan of static typing and Groovy is like the total opposite of that.

14:53 hiredman: stuhood: I could turn on clojurebot's twitter gateway

14:54 ataggart: is there nothing clojurebot can't do?!

14:54 stuhood: hiredman: i think the flood of script bowl tweets has mostly flowed

14:54 gnuvince: So now we watch what people think of the Clojure introduction?

14:57 replaca: apparently it's at 12:30

14:58 jensCD: @cemerick/technomancy et al.: Just for your information: After installing emacs 23 snapshot the reported problems have disappeared. Thanks again for support!

14:58 technomancy: jensCD: cool. 23 is a lot nicer on X since the font backend was revamped, so I think you'll be better off with that anyway.

14:59 cemerick: jensCD: glad you're set up. Welcome!

14:59 technomancy: jensCD: it's technically not released yet, but I've been using it for years, and it's very stable for me.

14:59 cemerick: years?

15:00 that emacs release cycle is something else ;-)

15:00 technomancy: well I started using it right after 22 was released. =)

15:00 never had a crash

15:03 rys: Is the peepcode screencast worth the 9 bucks?

15:05 Chouser: wow what a great photo: http://www.mobypicture.com/user/dedwards/view/252762

15:05 ataggart: it's good if you don't know anything about clojure and don't want to look at the website

15:06 technomancy: rys: depends on a lot of factors... how much have you done with clojure so far... how much have you done with other similar languages... how much is $9 worth to you vs time spent figuring it out on your own. =)

15:06 gnuvince: Stupid lazy evaluation... Rich didn't need his face yet, so it hasn't been computed.

15:06 Chouser: gnuvince: ha!

15:06 gnuvince: Those lazy evaluation jokes are just too easy

15:06 :)

15:07 Chousuke: gnuvince: I have an infinite supply of them. it's just problematic to compute one when needed :/

15:07 gnuvince: ;)

15:08 * ataggart groans

15:10 Chouser: "Script bowl session has really piqued my interest in Clojure" ...that's better.

15:10 hiredman: "The Clojure guy was very hardcore. No smooth presentation for us that are a bit slow"

15:11 rys: Ah, what the hell, $9 is made while waking up in a morning over coffee at work

15:11 cemerick: separates the wheat from the chaff, etc.

15:11 danlarkin: technomancy: $$$

15:11 technomancy: rys: disclosure: I wrote the peepcode script. =)

15:12 cemerick: I still don't get the peepcode thing. I guess my head just isn't wired for that kind of learning.

15:12 ataggart: I would have paid more than $9 if they got Stephen Fry to narrate it.

15:12 rys: Well, I found the link from your site, so I figured you might have had a hand somewhere along the line!

15:13 technomancy: rys: heh; should probably put a disclosure there too

15:13 rys: hehe

15:13 ataggart: cemerick: it's a nice shortcut to see if something appeals to you without having to invest a significant amount of time.

15:14 technomancy: everyone's got a different learning style

15:14 replaca: New Clojure motto: "Too hardcore if you're a bit slow" :-)

15:14 rys: My brains seems to absorb information presented like that pretty well, so I might as well

15:15 ataggart: I'll be happy if we never get the hype of Ruby

15:15 technomancy: ataggart: to some degree that's unavoidable

15:15 rys: Plus, I hack using vim, so I need all the help I can get with emacs and slime :)

15:16 ataggart: anyone use TextMate for clojure on a regular basis?

15:16 cemerick: replaca: nice :-)

15:16 last I saw, it's plugin system uses regexes for syntax highlighting, etc. Not so hot for something like a lisp.

15:16 s/it's/its

15:17 technomancy: rys: oh, are you talking about the Emacs peepcode or the Clojure one?

15:17 rys: I got both in the end

15:18 technomancy: rys: we're working on a free promotional "editors for clojure" screencast, but it's gotten bogged down in production. =\

15:19 ataggart: heh, I spent like 20 mins looking for that "free" cast

15:19 technomancy: ataggart: =(

15:19 ataggart: no worries

15:19 rys: I'd seen the sample clojure one not too long ago, and now I've decided to learn the language properly, which probably means emacs if I want to be truly productive in the beginning....it's worth me getting both

15:20 hiredman: rys: vim works fine

15:20 ataggart: despite being fairly feature-free, I still manage to get more done with the eclipse plugin than with emacs

15:21 but that's largely a function of me wanting to learn clojure, not emacs

15:21 technomancy: it really depends on your workflow. if you like all-keyboard usage, you'll be happier with an environment that targets those kinds of users. if you like mousing around (I'm told some people do) then maybe try an IDE.

15:22 ataggart: he says, looking down his nose... :)

15:22 technomancy: ataggart: yeah, I'm allergic to mouse usage.

15:22 I guess it shows.

15:22 ataggart: the mousiness is nice when you don't know how everything works yet

15:22 replaca: cemerick: awww, you're making me famous in the twittersphere :-)

15:23 cemerick: replaca: workin' on it :-)

15:23 technomancy: when I really want to get work done I take the keyboard nipple off my thinkpad.

15:23 rys: lol

15:23 cemerick: that was a fine piece of work

15:23 ataggart: I find that using the mouse gives me time to think about what I want to write ;)

15:23 technomancy: ataggart: that's what test runs are for. =)

15:23 ataggart: lol

15:24 rys: I'm very happy the mouse is there, but I tend not to move it around *that* often

15:24 ataggart: I actually don't use the mouse much anymore in eclipse, now that I know all the keybinds

15:24 but I know the keybinds because they're listed in the mouse menus

15:25 technomancy: yeah, the best way to learn Emacs keybindings is my watching someone who's really good at it.

15:25 *by

15:27 ataggart: alas, I work from home.

15:30 rys: The cool thing about the screencasts (and the epub of Stuart's book) is they're likely perfect train or bed or lunchtime fodder since I've always got my phone or laptop, so they'll be useful for time passing and watching more than once to let it sink in

15:37 Chouser: "Clojure. Interesante. La gente se quedo sorprendida de que todo es inmutable. Mas cuando explican los beneficios de esto"

15:37 "Clojure. Interesting. People are surprised that it is immutable. But when they explained the benefits of this"

15:37 the clojure talk should be rolling now

15:38 ataggart: chouser: where are you seeing that?

15:39 Chouser: that quote is from twitter

15:39 the clojure talk was scheduled to start at 12:30 pm pacific time, I believe.

15:39 ataggart: which twitter feed are you using? I'm not seeing those tweets

15:40 Chouser: http://twitter.com/#search?q=clojure

15:40 ataggart: thx

15:50 Chouser: what does #fb mean in twitter?

15:51 hiredman: http://www.intertwingly.net/blog/2009/06/01/Wave-Robot-Ruby-Client

15:52 rys: Chouser: I think it tells some plugin somewhere to post to your facebook status too

15:53 Chouser: rys: ah

15:53 thanks

15:54 hiredman: clojurebot: twitter?

15:54 clojurebot: twitteronia is where shaq lives

15:54 hiredman: I see

15:54 clojurebot: twitter is <reply>http://haicolon.wordpress.com/tweetility/

15:54 clojurebot: 'Sea, mhuise.

15:55 lisppaste8: Chouser pasted "swap!-when" at http://paste.lisp.org/display/81237

15:55 Chouser: ^^^ atom abuse

15:56 anyway, I think I need something like that.

16:01 hiredman: I don't understand

16:02 so you have the swap depend on a side-effect driven predicate?

16:02 Chouser: well, on some external state as checked by the predicate, yes.

16:03 hiredman: (when (pred) (swap! the-atom fn))

16:04 Chouser: I've got a bunch of threads trying to do things to the-atom, and I want each to either succeed (if we're not @quitting) or fail with a return value (if we are @quitting)

16:04 hiredman: exactly like that, except without the race condition.

16:04 hiredman: Oh

16:04 I see

16:04 sounds like you want refs maybe

16:05 if you can make the predicate into a ref instead of a function

16:07 Chouser: I thought about that, but wasn't quite sure if it would work.

16:08 The predicates I'm using check an atom, so they could check a ref instead.

16:08 but since the outcome would depend on the value of that ref, I'd need to use 'ensure', I think.

16:09 hiredman: ~def ensure

16:09 Chouser: anyway, I think I understand the performance profile of this -- a single atom swap! that does flying reads on another atom!

16:09 I'm pretty certain I don't know how a transaction would behave here.

16:10 re scriptbowl: "Clojure and Scala had no community story."

16:10 hiredman: lying dogs!

16:10 technomancy: maybe we should start story hour.

16:10 gather the kids around, grab a book from the library, etc.

16:10 rys: ha, the reason I chose clojure was because of the community

16:11 hiredman: technomancy: read aloud from programming clojure

16:11 technomancy: hiredman: if only the chapters ended in cliffhangers

16:12 ataggart: nothing like appealing to ethos and pathos, while ignoring logos

16:13 hiredman: next week we discover if Chouser can defeat Race Condition the evil warlock

16:14 cemerick: that's odd -- this is the most pleasant programming community experience I've ever had.

16:15 Chouser: pretty hard to present that in 4 minutes, I suppose.

16:15 technomancy: cemerick: maybe he's talking about impressions from the presentation

16:16 cemerick: Rich could have just said "we're not assholes", and various other factions (who shall go unnamed) would just slide down in their seat a little bit. ;-)

16:16 Chouser: hehe

16:16 ataggart: I think clojure just has too many profound ideas that all work together, that it really can't be shown off in a few mins.

16:17 Chouser: "number of google group members: 2000. number of c.l.l-style flame wars in the last year: 0"

16:17 Chousuke: :)

16:17 hiredman: maybe it needed more pandering to java?

16:18 ataggart: hiredman, that'd be my guess

16:18 triddell: I'll bet that Rich got through to those in the room who were ready for clojure (no pun intended.)

16:18 hlship: I've been liking the IDEA plugin, now that it can launch a REPL, but it still has a ways to go

16:19 mattrepl: has anyone worked on getting the slime debugger working with jdpa (the java debugging framework)?

16:19 Chouser: "Clojure has a lot of "there" there."; "Really enjoyed the #clojure session at #javaone" Could it be done already?

16:20 hiredman: it's been 40 minutes

16:23 replaca: already a blog post on the script bowl: http://tech.puredanger.com/2009/06/02/javaone-script-bowl/

16:23 technomancy: is he a Terracotta employee?

16:23 dnolen_: mattrepl: do you mean jdb? or is that something different?

16:23 replaca: technomancy: dunno

16:24 * stuartsierra is working on map-like objects

16:24 mattrepl: dnolen_: think it's what Sun calls jdb these days, I think they're the same

16:24 dnolen_: mattrepl: yes someone posted a very simple jdb elisp project on the mailing list

16:24 hlship: I bet Clojure would have represented better at the script bowl if Stu Halloway had presented (not intended as a dig at Rich)

16:24 dnolen_: mattrepl: for breakpoint setting and checking locals it works well. lots of issues but better than println'ing all over the place.

16:25 mattrepl: dnolen_: I saw that, but didn't appear to be integrated with sldb, will look closer. nice

16:25 dnolen_: mattrepl: oops, no it's not integrated with sldb (slime-db right?)

16:25 technomancy: replaca: it sounds like rich focused on compojure when talking about the community. since that's a pretty small slice of the community maybe that's why folks thought the "community story" was lacking

16:26 hah; scala talked about couchdb access.

16:26 mattrepl: dnolen_: ah, ok. right.

16:27 technomancy: stuartsierra: ah nice. I was wanting something like that when I was working on chrono; ended up making something slightly ugly w/ proxy

16:27 hlship: If you think that presenting the best technology is all it takes, I've got eight years of experience with Tapestry as a counter-example

16:27 stuartsierra: technomancy: consider it experimental for now, but I included a few tests

16:28 hlship: I've struggled hard with explaining to "ordinary" developers how cool the functional approach is

16:28 dnolen_: hlship: I think Clojure is like very subtle and very profound. it's hard to explain in the benefits in a immediate way.

16:29 replaca: technomancy: well, the community is still getting started. Seems strong to those of us in the midst of it, but it is still small compared to the others (JRuby and Jython can leverage their parents, Groovy's been around for a long time and Scala's been doing a good job on community - hopefully we can learn from it)

16:30 hlship: I agree! subtle and powerful means it takes time to embrace, time you don't have in a 60 - 90 minute slot (or 40 mins at JavaOne)

16:30 technomancy: hlship: not to mention 4 minutes at the script bowl.

16:30 dnolen_: hlship: it's really tricky, even lispers don't get it. one person thought multimethods were just like CLOS generic functions.

16:31 replaca: look at this kind of event to see some of what's going on with scala

16:31 http://scalaliftoff.com/

16:34 tbatchelli: hlship: I pm'd the developer of IntelliJ's clojure plugin about the meetup tomorrow in SF. He said 90% chances he'll come... maybe it is a good time to put pressure on him? I agree the plugin has ways to go ...

16:35 Chouser: tbatchelli: "He" == Halloway?

16:35 tbatchelli: He == the developer of the clojure plugin for IntelliJ

16:35 Chouser: ah, sorry, I see that now.

16:36 cp2: interesting

16:36 'clojure with emacs and slime/swank on ubuntu' is the 7th result for a google search of 'emacs setup slime'

16:37 tbatchelli: In the last Bay Area meetup there was a pretty impressive demo of integration between emac's JDB and clojure's REPL ... I really think the people from JetBrains should see that :)

16:38 dnolen_: tbatchelli: is that something that's released, or the same that appeared on the ML awhile ago?

16:38 triddell: cp2: I wrote that :-)

16:38 cp2: triddell: well congrats, you're popular (i guess?)

16:38 tbatchelli: dnolen_ I think it's on github now ... let me find it

16:39 technomancy: triddell: care to update it? clojure-mode comes with an M-x clojure-install function that handles a lot of that stuff for you.

16:39 dnolen_: tbatchelli: http://github.com/GeorgeJahad/cljdb/tree/master this one?

16:39 tbatchelli: yup

16:39 dnolen_: yes that works well, same as the one the ML

16:39 has a couple of issues, but it's a great start

16:42 tbatchelli: dnolen_ : IntelliJ on the other end has awesome Java/Clojure integration when it comes to completion ... but the debugging is not there yet, and I don't know how easy/difficult for them will be to integrate the REPL in the same way emacs does ...

16:43 dnolen_: tbatchelli: haven't looked at IntelliJ yet, Enclojure/NetBeans looks good. I'm an Emacs nerd now tho, too late to save me.

16:43 tbatchelli: ... and so getting the guy from IntelliJ watch George Jahad's demo tomorrow is an attempt to matchmaking :D

16:43 ataggart: revealing my ignorance: "tries" is not the same thing as "trees", right?

16:44 * technomancy imagines dnolen hanging off a cliff by his fingers. "It's too late for me. save yourselves!"

16:44 stuartsierra: not quite

16:45 tbatchelli: dnolen_: long time user of Emacs for lisp... had to abandon it when working in Java, ... IntelliJ is a good alternative, but sometimes I still miss emac's alt-x ... nothing beats that

16:45 lisppaste8: Chouser annotated #81237 "abuse of IRef's in general" at http://paste.lisp.org/display/81237#1

16:46 Chouser: oops. that's untested

16:47 hiredman: Chouser: have you looked at the various BlockingQueues for coordination?

16:48 Chouser: hiredman: yes. I think they don't apply here. But of course I could be wrong.

16:48 hiredman: I'll take your word for it then

16:49 dnolen_: tbatchelli: true, i am also now completely sold on paredit + colored parens (i won't move until I see this in other IDEs)

16:49 Chouser: in this case I've got a hash-map in an iref. As msgs come in, their handler is found in the hash-map, called, and removed.

16:49 technomancy: paredit is a killer feature. I had no idea how addicting it would be till I tried it.

16:49 Chouser: I want to block until the hash-map is empty. So it's not really a queue at all.

16:50 hiredman: correct

16:52 technomancy: I have something similar in vim, and I tried netbeans the other day, it was hard going without it

16:53 technomancy: hiredman: cool, what's it called in vim?

16:53 I get annoyed by the lack of paredit every time I work in a non-lisp too. =\

16:53 clojurebot: lisp is the red pill

16:53 Hun`: technomancy: you know... paredit works fine in C, too :)

16:54 technomancy: Hun`: well I'd get annoyed writing C for other reasons. =)

16:54 Hun`: (and other languages...)

16:54 hiredman: technomancy: mine is mostly cobbled together

16:54 cp2: ah

16:54 paredit looks pretty neat

16:55 technomancy: Hun`: whoa; it works in Ruby. not in JS though, oddly.

16:55 oh, just not js2; works in regular javascript-mode.

16:55 Hun`: paredit works just on the () by default. you can M-x customize the expanded patterns to []{} though

16:55 js2 does a lot of things

16:56 lisppaste8: Chouser annotated #81237 "await-iref (tested)" at http://paste.lisp.org/display/81237#2

16:56 technomancy: Hun`: I think clojure-mode hacks paredit to honor []{} correctly, so I'm golden

16:57 Chouser: rhickey: wb. How'd the talks go?

16:57 I've been posting copies of tweets here all afternoon.

16:58 rhickey: they went well

16:59 I think Clojure came in 3rd, after Groovy and Scala, both of which are kind of java.next stories, so I'm satisfied

16:59 nice audience for the subsequent Clojure talk

17:03 hiredman: "The Clojure talk was great. I didn't know you could precompile and deploy the resulting classes"

17:03 cp2: heh

17:08 replaca: cp2: paredit has changed the way I think about writing code

17:09 rhickey: congrats on your talks!

17:10 technomancy: that is correct

17:10 hiredman: clojurebot: bytecode?

17:10 clojurebot: Pardon?

17:10 hiredman: clojurebot: bytecode is <reply>http://homepages.inf.ed.ac.uk/kwxm/JVM/codeByNo.html

17:10 clojurebot: In Ordnung

17:10 cp2: replaca: yeah, i like it

17:11 dnolen_: slurp and barf, good ol paredit

17:12 replaca: love that slurpin' but when I slurp too much, then I have to barf

17:13 triddell: technomancy: I'll look at the M-x clojure-install sometime soon and create a simplified tutorial. Is there anywhere quick to get the details on that?

17:13 wlr: long-time lispers say "What parentheses?" when talking about reading code. paredit allows one to program that way, too by dealing with structure not just characters.

17:13 technomancy: triddell: my tutorial is at http://technomancy.us/126

17:14 feel free to copy or link

17:14 opqdonut: paredit just takes some getting used to

17:14 one has to think about (for example) structure flattenings in a more explicit way

17:14 instead of just removing parentheses and bashing indent

17:14 cp2: oh wow

17:15 dnolen_: M-s splice to flatten one level

17:15 M-r to raise is genius

17:15 cp2: paredit has loads of useful things ( http://www.emacswiki.org/emacs/PareditCheatsheet )

17:16 dnolen_: yup

17:16 triddell: technomancy: ok, thanks. I think I ran across that the other day... I thought you were initially specifically referring to my tutorial as "very out of date and far more complicated than necessary." :-)

17:16 technomancy: even if you don't learn all the commands, the simple "you have to try to end up with invalid structure" is a huge win.

17:17 dnolen_: but learn all the commands

17:17 force yourself

17:17 technomancy: triddell: no! I was referring to Bill Clementson's.

17:17 dnolen_: you will be happy.

17:17 technomancy: triddell: the stuff in yours still works; his references sourceforge repositories.

17:17 triddell: technomancy: it could probably be said for mine too but my initial reaction was "Hey!"

17:18 technomancy: should probably re-word that

17:18 we just get so many people in here and on the mailing list that are (rightly) confused by this diagram: http://bc.tech.coop/blog/images/clojure-emacs-setup.png

17:19 cp2: its not that bad

17:19 but i think a tree style structure would look better

17:19 as in, like a dir tree output

17:19 triddell: technomancy: nah, I looked at those instructions too which is why I had to write my own just to figure things out... as a newbie then at least is was way over my head

17:19 technomancy: cp2: it's bad if it's the first thing someone reads about slime.

17:20 cp2: i suppose

17:23 technomancy: I don't understand the motivation behind paredit's version of M-; though

17:26 Chousuke: the fnmap thingy in contrib is neat.

17:29 technomancy: hiredman: any way you could get clojurebot to not announce the auto-doc commits?

17:30 gnuvince_: Is it normal that with a very large list (235,000 words) the following code overflows the stack: maximumBy (comparing length) myWords

17:30 hiredman: technomancy: sure

17:31 technomancy: thanks

17:31 Chousuke: why would it? :/

17:32 gnuvince_: I don't think it's normal.

17:32 gnuvince_: Wrong channel

17:32 I meant to ask in #haskell

17:32 and apparently, it's expected :)

17:33 Chousuke: weird.

17:33 hiredman: technomancy: won't take effect until the next time I restart clojurebot though

17:34 gnuvince_: Chousuke: too much thunking

17:34 Not enough reducing

17:34 technomancy: hiredman: no problem... assuming that's a matter of days rather than months. =)

17:34 gnuvince_: Lazy evaluation looks great on paper, but it seems that in practice, it's always getting in the way...

17:34 It's not the first time I've had weird stack overflows

17:39 technomancy: I saw some code the other day that produced a lazy seq from a Java object and then closed it when the seq had been fully realized... anyone know of a good example of that?

17:40 I guess it's not that tricky

17:40 hiredman: erm

17:40 with-open?

17:41 well, I guess not, but yeah, it's not so tricky

17:44 Chousuke: I guess all you really need is a (when (was-last-item-in source) .(close source)) in the function that produces the items for the seq.

17:44 oops, . in wrong place :P

17:45 of course, that's somewhat fragile, as the source is not closed unless everything is consumed :/

17:45 technomancy: yeah, the only tricky bit is that the source itself is iterable, so the recursion needs to pass the original java object of the source as well as the seq based on it

17:45 hrm; true

17:45 mrsolo: can you do * on (import) ?

17:46 Chousuke: hmm.

17:46 I don't think so.

17:46 it's bad practice anyway.

17:47 mrsolo: yes but handy while prototyping

17:48 dnolen_: mrsolo: yeah, comes up a lot, but I don't think it's going to happen anytime soon. it's OK, Clojure makes up on the other aspects of prototype in spades.

17:48 * technomancy has been meaning to write a function that could automatically add the needed imports by searching the classpath

17:48 dnolen_: prototyping

17:48 technomancy: (that would be an elisp function)

17:48 will be sure to post to the ML if I ever get that written

17:57 ataggart: is there a simple way to see what the code output from a macro would be given some args to the macro?

17:57 I looked at macroexpand, but that didn't seem to be it

17:57 hiredman: uh

17:57 that is exactly what macroexpand does

17:58 ataggart: ok, what do I do with whatever macroexpand is giving me?

17:58 because I want to see code

17:58 Hun`: ataggart: did you quote the argument to macroexpand?

17:58 ataggart: ah

17:58 hm

17:58 ,(macroexpand 'import)

17:58 clojurebot: import

17:59 ataggart: not quite what I had in mind

17:59 hiredman: ,(macroexpand '(let [[a b] '(1 2)] a))

17:59 clojurebot: (let* [vec__2842 (quote (1 2)) a (clojure.core/nth vec__2842 0 nil) b (clojure.core/nth vec__2842 1 nil)] a)

17:59 Hun`: what did you have in mind? a macro usually has arguments ;)

17:59 ataggart: lol fair point

18:00 hiredman: I don't think import is a macro anyway

18:00 Chousuke: clojure destructuring could probably be improved a bit when the source is fully known at compile time

18:00 ataggart: well the doc says "form". so wasn't sure if that included the would-be args

18:00 hiredman: or even a var

18:00 well

18:00 ataggart: import is a macro

18:01 hiredman: ,#'import

18:01 clojurebot: #'clojure.core/import

18:01 Chousuke: I mean, (let [[a b] '(1 2)] ...) is not equivalent to (let [a 1 b 2] ...) :/

18:01 hiredman: ,^#'import

18:01 clojurebot: {:macro true, :ns #<Namespace clojure.core>, :name import, :file "clojure/core.clj", :line 1852, :arglists ([& import-symbols-or-lists]), :doc "import-list => (package-symbol class-name-symbols*)\n\n For each name in class-name-symbols, adds a mapping from name to the\n class named by package.name to the current namespace. Use :import in the ns\n macro in preference to calling this directly."}

18:01 Hun`: ,(macroexpand '(import (Hello world)))

18:01 clojurebot: (do (clojure.core/import* "Hello.world"))

18:01 hiredman: ah

18:01 import*, of course

18:38 ataggart: whoa

18:41 cp2: :(

18:41 danlarkin: hah, that was nothing

18:42 oh... but for you I guess it was huge, nevermind

18:42 cp2: yeah

18:42 ive seen some pretty big splits

18:43 hiredman: which is why irc needs to be replaced with xmpp

18:49 cp2: does xmpp have group chat? (by that i mean channels)

18:51 dnolen: http://xmpp.org/extensions/xep-0045.html

18:51 hiredman: yes

18:51 MUC

18:52 multi-user-somethingorother

18:52 cp2: cool

18:52 technomancy: nobody's ever used it on the scale of freenode afaik; it may have annoyances just as bad as netsplits.

18:52 hiredman: technomancy: true

18:53 cp2: on a good network netsplits arent very frequent anyway

18:53 technomancy: plus my IRC client has a much nicer UI than my XMPP client. so let's stay here please. =)

18:53 cp2: yeah

18:53 i love irssi =P

18:54 technomancy: IRC is pretty decent given its age. it gets unicode right, which is somewhat surprising.

18:54 hiredman: there are irssi xmpp plugins

18:54 Chousuke: technomancy: it doesn't get unicode at all ;P

18:54 cp2: yeah ^

18:54 Chousuke: technomancy: all text is just bytes to it.

18:54 cp2: thats why it gets it right, because it doesnt do anything to it

18:54 technomancy: Chousuke: oh, well it does well enough for me to never notice any problems. =)

18:55 I guess because all clients agree that there's only one sane encoding.

18:55 cp2: hiredman: i thought that in the back of my mind, didnt care enough to verify though, heh

18:55 Chousuke: well, irssi has problems with channels if their names are not encoded in the charset you're using

18:55 hiredman: technomancy: http://metajack.im/2009/01/07/emacs-and-jabber-happy-together/

18:55 Chousuke: technomancy: I wish they did.

18:55 technomancy: ISO-8859-1 is still popular in Finland.

18:56 technomancy: Chousuke: I'm sorry.

18:56 Chousuke: I use UTF-8 though.

18:56 technomancy: hiredman: yeah, but I have to use pidgin because I have to talk with co-workers on skype. =(

18:56 hiredman: :(

18:56 Chousuke: but there were some nasty flamewars over this issue.

18:56 cp2: yuck

18:56 gnuvince_: technomancy: pidgin supports skype?

18:56 Chousuke: some channels would kick you if they detected UTF-8 characters.

18:56 hiredman: skype is horrible

18:56 cp2: wow Chousuke

18:56 thats kinda terrible

18:57 technomancy: gnuvince_: you have to keep the skype binary running at the same time, but all the UI goes through pidgin.

18:57 it's lame, but it's far better than the skype client's UI

18:57 Chousuke: channels about racism?

18:57 cp2: hah

18:59 gnuvince_: Neat

19:00 Chousuke: cp2: well, it was understandable though. if you went to a mainly latin1 channel and used UTF-8, your text would look like "ääliömäistä mössöä"

19:00 though that's a worst-case example.

19:01 cp2: heh

19:01 technomancy: gnuvince_: only text chat is supported though

19:02 rys: ??q? uo p??oq??? ? ?nq ? ???? ?s?? ??? s? s???

19:03 mmm, sweet unicode + irssi

19:03 cp2: (= oo? ?d?d??? ???? ? '???

19:03 technomancy: pbhyq or jbefr gubhtu

19:04 (if your client doesn't support rot13--it's time to find a new client)

19:04 cp2: oh man i didnt even noticed that was rot13'd

19:04 i thought you flipped it at first

19:05 and then i though you were typing gibberish to mess with us

19:05 (into thinking it was flipped)

19:05 rys: it was the "or" that threw me off

19:05 technomancy: hehe

19:05 I guess gubhtu does kind of sound like a new linux distro

21:29 quidnunc: Deep, unspeakable suffering may well be called a baptism, a regeneration, the initiation into a new state.

21:43 Raynes: Well that sucked.

21:43 I was just about to recommend Clojure as a first language, but realized, I really couldn't. :\

21:59 arohner: so I have methods that I want to mark private, but I also want to have unit tests for the private method, preferrably in another file

22:00 and I'd like the unit tests to have an ns declaration

22:00 anyone have suggestions for how to work around that?

22:02 hiredman: you can put the unit tests in the same namespace but a different file

22:06 arohner: hiredman: yeah, but that seems kind of hackish to say (ns foo) (in-ns 'bar)

22:06 hiredman: eh?

22:06 just do (ns bar)

22:07 actually

22:07 just (in-ns bar) would be best I believe

22:07 arohner: right, but then I don't get the standard (ns bar (:require baz)) niceities

22:08 I'm looking for something better than the hack :-)

22:08 hiredman: uh

22:08 it is not a hack

22:09 core.clj does the samething with core_print.clj

22:10 the correspondence between a namespace and a file is very loose

22:10 arohner: and once I do (load "core_print"), I can't do (ns core_print)

22:11 hiredman: arohner: there is no core_print namespace

22:11 arohner: I want an ns because that's how all "normal" files do require and import

22:11 I understand.

22:11 I want 1) a file to contain unit tests 2) that has it's own requires and imports 3) that calls private fns in other namespaces

22:12 if I use load and in-ns, I can't use (ns)

22:13 and I want a separate ns because the unit tests shouldn't affect the original file

22:14 by :require'ing and :use'ing namespaces that aren't in the original file

22:46 patrick_: hello all

22:47 arohner: patrick_: hi

22:48 patrick_: hi arohner

22:49 I was wondering whether you have any experience with quasi-quotation, specifically unsplice within Clojure

22:50 arohner: sure

22:51 what's your trouble?

22:51 patrick_: great! I have a macro that is attempting to pack rest parameters into the literal hash-map syntax using quote unsplice...

22:51 arohner: clojurebot: paste

22:51 clojurebot: lisppaste8, url

22:51 lisppaste8: To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.

22:52 patrick_: on my way

22:52 arohner: patrick_: do you have some example code you can paste?

22:52 patrick_: I do, I am pasting it currently

22:58 hmmm, paste.lisp is throwing an error when I submit

22:58 one sec

22:58 lisppaste8: paddy pasted "quote unsplice into literal hashmap syntax" at http://paste.lisp.org/display/81257

22:59 patrick_: nm

23:00 arohner: you found it?

23:01 I have an idea, I just need to wait for my unit tests to finish to try it out

23:01 lisppaste8: paddy annotated #81257 "throws this error:" at http://paste.lisp.org/display/81257#1

23:01 sunwukong: maybe you cannot use the { } syntax inside a syntax-quote

23:01 but you can use hash-map

23:02 so `(hash-map ~@args) should do the trick

23:02 patrick_: yeah, I am thinking so, that did work - I was curious why it wouldn't work within the literal syntax, as the expansion should.

23:03 sunwukong: is `{' implemented as a macro character?

23:03 patrick_: I'm thinking it has something to do with the way Rich enforces hygiene...alternately, could be my error...and lastly, a bug :)

23:05 arohner: sunwukong is right. try (let [properties# (hash-map ~@keyword-params)] ...)

23:05 sunwukong: the problem may be that { } is "run" before the macro definition

23:05 hiredman: http://asymmetrical-view.com/2009/06/02/incanter-amqp-benchmark.html <-- nice

23:06 sunwukong: so it complains because inside the curly brackets you only have one thing, and not pairs

23:06 patrick_: could you expand on that sunwukong? Mr. Hickey does supply the { as the equiv to a reader char - {:key1 "key1 :key2 "key2"}

23:06 sunwukong: yes, so when the parser reads your macro definition, it parses just as you've written

23:07 hiredman: patrick_: that error usually means you are missing a value or a key

23:07 sunwukong: that is, it tries to parse {~@args}

23:07 but it is only one "thing", not a key-value pair

23:07 patrick_: hmmm interesting, you think the reader macro doesn't get defined until after macro expansion?

23:07 hiredman: ,{:a}

23:07 clojurebot: java.lang.ArrayIndexOutOfBoundsException: 1

23:07 hiredman: ,{:a 1}

23:07 sunwukong: (at the parsing stage it does not know that ~@args will actually be expanded)

23:07 clojurebot: {:a 1}

23:08 sunwukong: so the '{' is a kind of "immediate" (a la Forth) kind of thing, even if you are inside a backquote, it is evaluated

23:09 (at least I think so :)

23:09 patrick_: ok, I'm processing what you said :)

23:12 arohner: right. imagine you're writing the parser for {}. the rule for that is { pairs of things }

23:12 you don't have a pair inside your {}

23:28 patrick_: ok, when I (defsomething A-symbol :key1 "key 1" :key2 "another value"), I was under the assumption that the elements :key1 "key 1" :key2 "another value" got packed up in the keyword-params list

23:30 hiredman: erm

23:30 keyword params list?

23:30 never heard of such a thing

23:31 patrick_: its the rest parameter defined in a macro http://paste.lisp.org/display/81257

23:31 I just named it keyword-params, as that is really what I am trying to accomplish.

23:32 hiredman: {} is a literal

23:32 so the reader barfs if it does not have the correct syntax

23:32 I thought this was just explained?

23:33 and in any case, I doubt ~@ will splice into anything but a list

23:33 patrick_: understood...I guess my question then is why isn't the quote unsplice dropping the elements :key1 "key 1" :key2 "another value" in between the braces

23:33 hiredman: it would

23:33 but

23:34 it never gest to that stage

23:34 so you have text source -> reader -> datastructure -> compiler

23:34 patrick_: ahhh *lightbulb explodes*

23:34 I follow you now,

23:35 wow I'm thickheaded

23:35 thanks everyone, its all clear now

23:41 so, the {} literal characters get expanded at "read time", which apparently occurs before "macro-expansion time" :)

23:41 what a crazy world

Logging service provided by n01se.net