#clojure log - Sep 01 2010

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

0:09 anonymouse89: how do I make something like ((a) (b) (c)) -> (a) (b) (c) ?

0:13 more concretely, I have something like `(do ~(for [foo bar] `(my-fn ~foo)))

0:13 arbscht: ~@ instead of ~

0:13 clojurebot: @ has nothing to do with whether sth is evaluated or not

0:14 anonymouse89: and want (do (my-fn foo1) (my-fn foo2))

0:16 so my question is, how do I prevent "for" from returning a single seq

0:17 arbscht: anonymouse89: use ~@ instead of ~

0:17 ~@ will splice

0:17 Raynes: anonymouse89: What he said. ~@ will do it.

0:17 clojurebot: @ splices in a seq and foo# is a symbol, not a seq

0:17 Raynes: clojurebot: We got this one bro. S'okay.

0:17 clojurebot: Excuse me?

0:17 arbscht: ,`(do ~(for [foo [1 2 3]] `(my-fn ~foo)))

0:17 clojurebot: (do ((sandbox/my-fn 1) (sandbox/my-fn 2) (sandbox/my-fn 3)))

0:17 arbscht: ,`(do ~@(for [foo [1 2 3]] `(my-fn ~foo)))

0:17 clojurebot: (do (sandbox/my-fn 1) (sandbox/my-fn 2) (sandbox/my-fn 3))

0:17 anonymouse89: bah, sorry I was not looking at names and the bot fooled me :(

0:18 thanks

0:18 Raynes: :p

0:19 ->`(do ~(for [foo [1 2 3]] `(~'my-fn ~foo)))

0:19 sexpbot: => (do ((my-fn 1) (my-fn 2) (my-fn 3)))

0:19 Raynes: Neat.

1:32 defn: real neat.

1:38 Bahman: Hi all!

1:39 defn: hola

1:39 Bahman: Hola defn!

1:39 defn: I don't know if I can match your intensity.

2:30 bartj: to get a subset of key/values from a map

2:31 I do this: (zipmap keys-subset (map #(me-a-map %) keys-subset)

2:31 Is there any better (in terms of performance, idiomatic) way to do this ?

2:31 eg:

2:31 , (def g #{:a :b :c})

2:31 clojurebot: DENIED

2:32 bartj: , (zipmap #{:a :b :c} (map #({:a 1 :b 2 :c 3 :d 4 :e 5} %) #{:a :b :c}))

2:32 clojurebot: {:b 2, :c 3, :a 1}

2:35 bartj: suggestions please ?

2:38 hoeck: ,(select-keys {:a 1 :b 2 :c 3} [:b :c])

2:38 clojurebot: {:c 3, :b 2}

2:38 hoeck: bartj: ^

2:43 bartj: hoeck, thanks!

2:45 hoeck, the caret means something :) ?

2:46 hoeck: bartj: in this case just "look above" (to make your irc client blinking on your name :)

2:58 LauJensen: Whats available for Java GUIs nowadays? Miglayout? GridLayout? More?

4:03 zkim: Anybody know what the 'Prefer updating over setting' bullet point on the lib coding standard page means? http://www.assembla.com/wiki/show/clojure/Clojure_Library_Coding_Standards

4:33 notsonerdysunny: can anybody suggest a maven-repository which contains jogl.jar ?

4:34 fliebel: Is there a way to listen for key events with Clojure? I mean the type of events that work when your app is not in focus.

4:34 bobo_: notsonerdysunny: http://stackoverflow.com/questions/1962718/maven-and-the-jogl-library tried that one?

4:39 notsonerdysunny: bobo_: I have tried a couple of things .. I have tried using the ones on clojars.org unfortunately they didn't confirm to conventions of native-deps so downloaded those jars and repackaged it and uploaded it to clojars.org/sunilnandihalli/jogl .. but it does not seem to be working I am not sure if the problem is with the jogl .. or is it something else.. I am new to java/jar stuff.. so I...

4:39 ...might be doing something wrong.. I was just hoping somebody had a "native-deps" compatible jogl.jar some-where on the web

4:41 hoeck: fliebel: don't know if that helps but you can install your own java.awt.EventQueue to process all events the application gets

4:43 fliebel: (-> (java.awt.Toolkit/getDefaultToolkit) .getSystemEventQueue (.push <your-custom-java.awt.EventQueue>))

4:43 fliebel: hoeck: iirc, awt doesn't even receive any events when it's not focused. It's just made to do the user-clicked-some-button-in-yout-gui type of stuff.

4:44 hoeck: While I want to have the global events, for doing stuff like quicksilver, or gnome do, if you're into linux.

4:47 hoeck: fliebel: ah, ok

4:48 fliebel: hoeck: I tried to do it in Jython once, for mouse events… fail… Must be a way to do it...

4:50 hoeck: I guess one has to hook into some gnome or X libraries, or some use some strange windows messaging API

4:58 gregh: on windows you might use the CBT hooks but I doubt you can write one of those without introducing native code

5:05 fliebel: gregh: Then I might as well do it in Python, since I already wrote cross-platform native mouse bindings for that.

6:24 jave: it would be nice if clojure docs where available in info format

6:26 esj: is that a volonteer I spy ?

6:27 jave: yes maybe

6:28 how are the docs made today?

6:28 if I can do some form of hack to achieve it I can have a try

6:28 esj: http://github.com/tomfaulhaber/autodoc

6:29 I really like them actually

6:29 jave: but is docs for core fns such as defn made the same way?

6:30 esj: yeah, believe so

6:30 jave: cool

6:30 esj: but I'm usually wrong :)

6:31 jave: heh

6:31 esj: have fun !

6:31 jave: Thanks

6:31 fliebel: is info format those frames generated for java docs? or what?

6:31 jave: no for reading in emacs

6:37 fliebel: I think it'd be great to have references to other functions in the docs.

6:54 esj: fliebel: ^^ :P

7:05 bartj: why aren't optional arguments in functions, accessible inside the function ?

7:06 (defn blah [a b & c]

7:06 (when c (println "hi")))

7:06 (blah 1 2 true) ;will *not* print hi

7:06 ah, never mind

7:07 __debaser: doesn't c stand for a list with the rest of the args?

7:08 fliebel: I thought so, but still:

7:08 ,(when '(true) "yes")

7:08 clojurebot: "yes"

7:09 bartj: ok, I find this behaviour very weird:

7:09 I don't know what I am doing wrong

7:09 let me illustrate

7:09 (defn blah [a b & c]

7:09 (when-not c (println "hi")))

7:09 (blah 1 2 false) ;will *not* print hi

7:09 (defn blah2 [a b c]

7:09 (when-not c (println "hi")))

7:09 (blah 1 2 true) ;will print hi

7:10 er, the last statement must be:

7:10 (blah2 1 2 true) ;will print hi

7:10 LauJensen: ,(when-not false 1)

7:10 clojurebot: 1

7:10 opqdonut: bartj: [false] is true

7:10 use & [c]

7:11 bartj: opqdonut, you mean everything after & is in a vector ?

7:11 opqdonut: (def blah [a b & [c]] (when-not c (println "hi")))

7:11 yes

7:11 bartj: oh thanks!

7:11 opqdonut: that's why its usually called & rest

7:11 it grabs the rest of the arguments

7:11 bartj: I was getting excited that I had found a bug or something ;)

7:12 fliebel: Is there any way to have Python style optional arguments? Like: def test(a b c="default")

7:13 I think this is what bartj was expecting.

7:13 esj: fliebel: i usually do that with multimethods

7:13 sorry, i'm lying,

7:13 bartj: is there a technical term for this sort of behaviour ?

7:13 esj: with variadic functions

7:13 fliebel: esj: difference?

7:14 bartj: I mean in the functional sense.

7:14 esj: (defn foo ([] (foo :default) ([a] (str a)))

7:14 or suchlike

7:14 so if you call foo with no args, it calls foo with one arg

7:14 dunno how canonical that sort of carrying on is , though

7:15 fliebel: esj: ah, and multimethods are the actual fancy things with functions to determine the correct thing and stuff?

7:15 esj: multimethods are another thing that allow you to dispatch a function based on a function of the arguments

7:16 so like in most languages you can dispatch a function on the type of an argument to get your usual polymorphism

7:16 fliebel: very fancy… so you could have a different method for positive and negative numbers for example?

7:16 esj: with them you can dispatch on any function of the arguments

7:16 yup

7:20 bartj: esj: the difference b/w multimethods and protocols is that protocols accept only one argument unlike multimethods ?

7:20 esj: bartj: no, there's much more to it

7:21 bartj: esj, and protocols is much better performance-wise

7:21 esj, s/is/are

7:22 dnolen: cgrand: around? moustache question.

7:23 esj: bartj: that's true, but there is a lot going on under the hood

7:24 i gotta dash, so can't continue this, which is probably just as well, as I'd just mangle it. There's lots on the web you can read though.

7:24 bartj: esj, ok, no problemo

7:25 LauJensen: dnolen: whats the question?

7:26 dnolen: wondering if it's possible to define a route match like "*/foo"

7:26 LauJensen: So to disregard the first level and only match on the second ?

7:26 dnolen: where we don't care what comes before at all, no matter how many levels.

7:26 would a regex work?

7:27 LauJensen: [& levels] (when (= "match" (last levels)) ...) ?

7:28 dnolen: LauJensen, if a handle returns false it moves on to the next handler?

7:28 s/handle/handler

7:28 LauJensen: Im not entirely sure how app dispatches

7:28 dnolen: or nil rather I mean

7:30 hmm sounds like that would work, if handler returns nil it continues on.

7:30 LauJensen: I think it calls match-route on all requests, returning a seq of those that match. Then it might be up to emit-validator to decide which gets run. You'll have to 2x check the source, I think Christophe is a little tied up these days

7:31 I guess what you could do - depending on your situation - was to introduce a middleware that checked for those phrases you want to match ?

7:38 dnolen: LauJensen: Raynes had an interesting idea, would cool to be able to destructure from the end of something, thought clearly perf implications for anything but vectors.

7:38 kumarshantanu: LauJensen: I have a question about Ring -- does it lay down how to match URIs? I can't find any mention of that in the SPEC file in master

7:38 LauJensen: kumarshantanu: No, Ring has nothing to do with routing as far as I know

7:39 dnolen: {dstruc from end} (rseq vec) ?

7:39 dnolen: kumarshantanu: you'll need to use Compojure/Clout/Moustache for that

8:01 mrBliss: is there somebody here with a Mac who is willing to show the output of (. System (getProperty "os.name")) ?

8:01 I'm too lazy to turn mine on ;-)

8:02 kumarshantanu: ,(. System (getProperty "os.name"))

8:02 clojurebot: java.security.AccessControlException: access denied (java.util.PropertyPermission os.name read)

8:02 nlogax: mrBliss: i get "Mac OS X"

8:02 mrBliss: thanks

8:03 fliebel: mrBliss: I'm to slow, but mine also says "Mac OS X"

8:04 mrBliss: just found this: http://lopica.sourceforge.net/os.html

8:14 LauJensen: Is there a Javacomponents which renders html and evalutes JS? (aside from the Qt/webkit)

8:29 cemerick: LauJensen: http://www.webrenderer.com is the only viable "lightweight" option for swing AFAIK. Besides that, DJProject does a very good job of integrating swt's browser control into swing (resolving tough issues like interleaving of heavyweight and lightweight components). Then there's SWT, which supports mozilla across all platforms (defaulting to webkit on OS X and IE 7/8 on Windows).

8:30 LauJensen: Excellent, I'll check them out, thanks Chas

8:31 btw - I wasn't trying to scare that guy with the Windows perf question last night - I was just reminded of some benchmarking results I saw a while back, where Clojure on Windows had some nasty spikes not seen on *nix

8:35 cemerick: ^^

8:36 cemerick: LauJensen: you know me, always looking out for the great unwashed masses not using linux and emacs. ;-)

8:37 LauJensen: I know - And you had a valid point so Im glad you injected it - Im just saying it wasnt purely unbased Windows hatred :)

8:37 cemerick: well, "windows is slow" isn't very ambiguous

8:38 It's fine, as long as you're holding up the extremist front, I can look like a moderate :-D

8:38 LauJensen: hehe

8:38 Don't worry, Im not going anywhere

8:44 bozhidar: I'm not an Windows user, but lets be fair

8:44 if almost everyone is using it - it can't be that bad

8:44 :-)

8:45 LauJensen: bozhidar: That kind of logic will get you killed

8:45 * LauJensen ducks before cemerick sees

8:45 bozhidar: LauJensen: life will get me killed anyways ;-)

8:46 cemerick: bozhidar: Indeed, just another bargain between vendor and user, and a product of its history (just like everything else).

8:46 bozhidar: cemerick: I totally agree

8:46 LauJensen: bozhidar: By that logic PHP is the 5th best programming language in the world

8:46 bozhidar: LauJensen: good and bad are extremely subjective words

8:47 LauJensen: 'if everybody uses it, it cant be that BAD' => PHP is the 5.th most deployed language in the world

8:47 bozhidar: if something has become that wide spread - it has to have some merits

8:47 cemerick: LauJensen: There's no "good" or "bad" involved -- just "works" or "doesn't work" for particular people/orgs and use-cases.

8:47 LauJensen: Alright - Lets leave it here while you ponder a career in PHP development :)

8:47 bozhidar: I personally don't like it very much, but I can see the appeal it has to many developers

8:48 bobo_: yes, join me in php hell!

8:48 bozhidar: lots of docs lying around, easy to get started, easy to deploy

8:48 compare that to a java web app :-)

8:48 bobo_: honestly, php is less horrible then swing

8:48 cemerick: bozhidar: a much stronger comparison would be between mysql and SQLServer admin, but sure. :-)

8:49 bozhidar: bobo_: I've coded a lot of Swing - at first I hated it, but once you get used to it, it's not that bad. Actually that awful api gives you a lot of flexibility

8:49 chouser: I'm actually using PHP these days, and am rapidly cementing an informed opinion.

8:50 ...which is entirely off topic, not to mention rude, so I'll keep it to myself.

8:50 cemerick: chouser: I think #clojure has been off topic all summer.

8:50 fliebel: chouser: I've used PHP for years, and still don't have any. PHP is like Rails in that respect, you don't need to know the language to produce something usefull.

8:50 bozhidar: chouser: I have such secret opinion about Visual Basic ;-)

8:51 fliebel: What does this mean? "Aleph conforms to the interface described by http://github.com/mmcgrana/ring, with one small difference: the request and response are decoupled."

8:51 chouser: bozhidar: me too! though mine wasn't secert. I made a web page detailing my opinion back in '97 or so.

8:53 bozhidar: real story, guys - I go to a job interview for Java developer, they approve me and on the day of the contract signing the HR lady tells me this. "I saw in your resume that you worked 3 months on a PHP project, are you interested in becoming a PHP team leader instead of java developer?"

8:53 I was shocked and amused at the same time

8:53 :-)

8:55 chouser: I'm guessing your shocking and amusing answer was: "no"

8:55 LauJensen: bozhidar: why? 3 months of steady employment should be more than enough qualification to be a PHP team lead :)

8:55 fliebel: bozhidar: You became the PHP team leader I suppose?

8:55 bozhidar: chouser: indeed

8:55 LauJensen: I wasn't even working on something mainstream

8:56 we were migrating the web UI of our flights booking engine

8:56 and there were to enough PHP devs to meet the deadline

8:56 so the C++ and Java teams were involved as well

8:57 before that I hadn't written a line of PHP code in my life and the framework we used for the UI was developed internally so this was not knowledge one could apply somewhere else

8:58 my old employers were pretty fond of useless custom solutions to generic problems

8:58 LauJensen: I said 'steady employment', I meant the ability to get up in the morning and show up for work :)

8:58 bozhidar: before the PHP stint they had developed a programming language(!!!) that according to them was better than PHP :-)

8:59 bobo_: i can belive that

8:59 LauJensen: Yea sounds plausible

8:59 bozhidar: bobo_: you haven't seen HTTL ;-)

8:59 chouser: the Hyper Text Template Language!

8:59 mrBliss: I would like to see it!

8:59 LauJensen: There was a story on HN a few months ago, about this guy being hired to work in JoeX ro something, a personal PHP variant

9:00 s/ro/or/

9:00 bozhidar: chouser: yes, have you heard of it?

9:00 chouser: bozhidar: no

9:00 bozhidar: chouser: lucky man

9:01 btw on the subject of Clojure

9:02 as I mentioned I do a lot of Swing dev and I was wondering something

9:02 generally a Swing frame/dialog has a lot of GUI components in it

9:03 what is the preferred approach to model this in Clojure

9:04 in Java you'd usually have private fields for everything you plan to refer more than once(which is generally everything except labels and separators)

9:04 LauJensen: bozhidar: check out clojure.contrib.miglayout

9:05 bozhidar: LauJensen: 10x

9:05 miglayout is my favourite layout manager, probably this is exactly what I need

9:06 LauJensen: There's a nice wrapper for it, which also lets you label components and refer to them later by id

9:07 bozhidar: great

9:07 just what the doctor ordered

9:25 mrBliss: what's the recommended name for a test of a function (for example defn ms-to-minutes and deftest ms-to-minutes-test)?

9:44 pdk: ,(sym "complex phrase as a symbol name")

9:44 clojurebot: java.lang.Exception: Unable to resolve symbol: sym in this context

9:44 pdk: ,(symbol "complex phrase as a symbol name")

9:44 clojurebot: complex phrase as a symbol name

9:44 pdk: \o/

9:45 ,(symbol "\"that\'s amazing!\"")

9:45 clojurebot: Unsupported escape character: \'

9:45 pdk: welp

9:45 ,(symbol "\"that's amazing!\"")

9:45 clojurebot: "that's amazing!"

9:46 pdk: NOW THE QUESTION IS

9:46 ,(keyword "\"that's amazing!\"")

9:46 clojurebot: :"that's amazing!"

9:49 chouser: pdk: that could stop working at any moment. Well, at any moment during which you upgrade clojure. Just so you know.

9:51 nlogax: is anyone using aleph for something other than http stuff? i want to write an irc bot as my first project, but i can't find any good examples (and clojure is still fairly alien to me)

9:52 aleph looks inviting because it appears to hide the java stuff :)

9:52 fliebel: nlogax: I'm planing to do smtp and imap with it, but nothing done yet.

9:53 (i'm planning A LOT, but not doing everything I plan)

9:53 nlogax: heheh, same here

9:55 mrBliss: (inc that)

9:55 chouser: nlogax: there are some nice Java IRC libs that would let you work at a higher level of abstraction

9:55 and even some clojure wrappers around those

9:55 fliebel: clojurebot: where are you?

9:55 clojurebot: http://github.com/hiredman/clojurebot/tree/master

9:55 bobo_: http://github.com/Raynes/irclj isnt a wrapper

9:55 belive clojurebot uses that aswell

10:03 nlogax: i looked briefly at clojurebot, but it was a bit overwhelming. i'll try and pick it apart if i don't find anything else :)

10:04 bobo_: nlogax: what part is it you want to look at? the irc part?

10:05 nlogax: bobo_: ideally i'd just like a socket to put stuff into and read stuff from

10:06 bobo_: i think you can look att irclj then

10:06 nlogax: so i can learn something

10:06 will do!

10:10 LauJensen: Anybody here tried Apache Pivot for a Desktop App?

10:26 jkkramer: is it ok to assoc a boatload of entries into a record? is it better to give it a single map field that you assoc into instead?

10:27 like thousands or millions of entries

10:28 chouser: jkkramer: it's essentially a single map on the end of record anyway, so go ahead and dump in whatever you need.

10:28 jkkramer: chouser: thanks. i wasn't sure if there was some class field-generating magic behind the scenes or something

10:29 mrBliss: how do you rebind private functions from another namespace? (for testing purposes ofc)

11:02 simard: can clojure use java libs ?

11:02 yacin: yup

11:03 simard: well, then it's perfect isn't it ?

11:03 more seriously, I was wondering why one would use clojure instead of, say, Lisp

11:03 LauJensen: simard: getting there

11:03 simard: Clojure is a Lisp dialect

11:03 simard: which makes it very attractive to me

11:04 LauJensen: If you're wondering if why one would use Clojure instead of Common Lisp there are more reasons than I can count, and few against doing so

11:04 simard: but I kinda dislike the way common lisp has relatively few libs

11:07 LauJensen: Why the 'but' ?

11:07 AWizzArd: simard: with ABCL it has exactly the same available as Clojure

11:07 simard: dunno :)

11:07 AWizzArd: it also has all the datastructures of Clojure available

11:09 LauJensen: AWizzArd: interesting, I didn't know that

11:09 AWizzArd: ABCL is an implementation for the JVM.

11:09 vice versa it means that you can compile tons of CL code with it to .class files and use those from Clojure.

11:10 LauJensen: AWizzArd: Why would you want to ?

11:10 slyrus: LauJensen: why would you want java interop?

11:10 AWizzArd: people may have a code base of a few ten thousand LOC written in CL•

11:10 slyrus: I have far more CL code than java code lying around I'd like to use from my clojure code

11:11 clearly I am in the minority

11:11 LauJensen: Ah like so

11:11 I guess I solved that with a rm -rf, once Clojure was released to the public :)

11:11 AWizzArd: ;)

11:11 Anyway, there are still plenty of highly experienced lisp users who prefer CL over Clojure.

11:11 cemerick: Wow, what a niche: people with existing CL codebases that are usable in ABCL who would like to use them from clojure!

11:12 AWizzArd: They will probably stick with CL.

11:12 LauJensen: cemerick: Yea, you shouldn't start a business doing those ports

11:12 AWizzArd: I must mean that it is possible.

11:12 LauJensen: 'CommonHarvest'

11:12 AWizzArd: must => just

11:15 chouser: http://gist.github.com/560765#file_abomination_desolation.clj

11:20 _fogus_: chouser: now to allow forms like k = i + j :o

11:21 chouser: _fogus_: right, clearly this belongs in unfix

11:21 _fogus_: oooooooo!

11:21 chouser: though without any parens at all, we'd need an expression terminator sigil -- but ; is taken.

11:21 _fogus_: "Are you tired of so-called "let-blocks"?

11:21 chouser: but k = (i + j) could be made to work easily enough.

11:23 LauJensen: chouser: I dont understand, why would you do such a thing?

11:24 chouser: I think it would be possible to have a (start-using-dolet) macro that, when put just after your (ns ...) would make all do-blocks act like dolet

11:24 ...allowing (fn [a] b = (inc a), (prn b))

11:25 LauJensen: for the sheer twisted joy of it.

11:25 metagov: chouser: I'd prefer the alternate abomination in that case: (fn [a] (let b (inc a)), (prn b))

11:26 chouser: metagov: hm.. that would actually be a breaking change. we'd need a different word than 'let'

11:26 oh, or maybe just look for a vector.

11:27 LauJensen: in pom.xml, what is modelversion ?

11:27 chouser: (let a b) is for the outer scope, (let [a b] ...) creates a new scope.

11:29 LauJensen: modelVersion This element indicates what version of the object model this POM is using. The version of the model itself changes very infrequently but it is mandatory in order to ensure stability of use if and when the Maven developers deem it necessary to change the model.

11:31 lpetit: hello

11:31 chouser: what are you talking about ?

11:31 chouser: lpetit: http://gist.github.com/560765#file_abomination_desolation.clj

11:33 lpetit: chouser: it's for more easily be able to write code with side-effects ? :)

11:33 chouser: it's to demonstrate that Clojure's syntax is what it is not because it can't be like more imperative languages, but because it chooses not to be.

11:35 lpetit: chouser: ok. final touch for you book ? :)

11:36 LauJensen: lpetit: I think he's holding off until he's implemented (defmacro c++ [& body] ...)

11:36 slyrus: chouser: what is outer scope?

11:36 lpetit: LauJensen: rofl

11:36 Bjarne, GET OUT of chouser's body :) :)

11:37 chouser: lpetit: nah, but maybe an addition to http://www.fogus.me/fun/unfix/

11:37 LauJensen: hehe

11:37 man fogus has the sickest webdesign chops

11:38 chouser: slyrus: the containing 'do' block that would have been converted to a 'dolet', so the enclosing do, fn, let, etc.

11:39 LauJensen: chouser: did you guys ever finish that shell on his site?

11:39 chouser: LauJensen: That's all _fogus_ -- I know nothing.

11:39 LauJensen: Oh

11:40 chouser: well, that didn't stir up nearly enough uproar. Should I tweet it?

11:41 LauJensen: chouser: naah just commit it to master, then tweet

11:42 chouser: heh. I think that would be my last commit.

11:43 cemerick: I don't think there'll be much uproar. People'll shrug here, and either not grok it elsewhere.

11:50 chouser: hm. dull.

11:50 * chouser goes to lunch.

12:03 bortreb: the DESOLATION!!!!!!

12:03 NOOOOOOOOOOOOOOO11111111111

12:05 chouser: you sir, are a mad genius

12:08 * technomancy hears a "moof" in the distance

12:43 chouser: bortreb: that's better. thanks!

12:43 :-)

12:43 I should mention this came out of dangerous conversations with metagov

14:01 LauJensen: You get the funniest referers when running a website: http://www.ask.com/web?q=I+found+a+red+pill+that+was+cut+in+half+what+could+it+be%3F&qsrc=0&o=0&l=dir

14:02 raek: løl

14:03 _fogus_: chouser: I added you to the unfix contributors, so feel free to add dolet if you feel motivated. :-) http://github.com/fogus/unfix

14:04 LauJensen: _fogus_: got push ?

14:04 chouser: _fogus_: :-) thanks

14:05 _fogus_: LauJensen: Sorry, I meant to but had a kid issue yesterday. I will try again tonight, unless a tar works better right now

14:06 LauJensen: No problem, kid issues take priority 10 out of 10 times :)

14:07 Raynes: LauJensen: 9.5 out of 10 times if you can type and change diapers at the same time.

14:09 s450r1: but still 10 out of 10 times if you can type and change diapers at diapers at the same time but have twins

14:09 LauJensen: Raynes: I guess that explains your code.... :)

14:12 jfields: (= (:price-in-pennies desired) (:price-in-pennies resting))

14:12 is there a more elegant way to do that?

14:14 Raynes: LauJensen: I don't change diapers while I code. I have a strange habit of eating difficult foods while coding, however.

14:14 LauJensen: difficult foods? Sounds unproductive, just have a slice of bread

14:15 Raynes: :p

14:16 dnolen: jfields: a little shorter (reduce = (map :prince-in-pennies) [desired resting])

14:16 _fogus_: jfields: (apply = (map :price-in-pennies [desired resting])) might make for a more generic approach

14:16 dnolen: too fast!

14:17 dnolen: _fogus_: but you win by being 2 chars shorter ;)

14:17 _fogus_: YAY!

14:18 jfields: thanks guyas

14:18 guys

14:18 _fogus_: guyas means "gentlemen of great passion" in cambodian

14:23 Someone kick me for ever thinking that discussing parens was a good idea

14:34 Is there a better way to do (f (butlast s) (last s)) ?

14:35 danlarkin: (apply f (drop (- (count s) s) s))

14:36 but that is certainly not better

14:36 er

14:36 I typoed it

14:36 LauJensen: _fogus_: only if its a vector

14:36 _fogus_: yeah, it's actually (fn [& s] ...)

14:37 dnolen: _fogus_: perhaps another reason to support destructuring from the end?

14:38 _fogus_: dnolen: That would be very nice.

14:38 Although my specific case is too obscure to warrant a change

14:38 http://gist.github.com/561132

14:39 dnolen: (fn [$head x] ...) ?

14:40 _fogus_: (fn [[front &middle end]] ...) ?

14:42 Anniepoo_: this should be trivial, but it's driving me nuts - I want to write a concurrancy-safe 'pop' operation.

14:43 LauJensen: Anniepoo_: (swap! atom pop)

14:43 replaca: jave: are you there?

14:43 Anniepoo_: Lau, I want the top item

14:44 if I do (first @atom) beforehand it's not in the transaction

14:44 LauJensen: (dosync (let [p (first @ref)] (alter ref pop) p)) ?

14:45 Anniepoo_: ok, thanks.

14:45 dunno why that seemed so hard.

14:45 chouser: it's hard with an atom

14:45 Anniepoo_: I'd convinced myself that wouldn't work

14:45 LauJensen: chouser: impossible you mean?

14:46 chouser: no

14:46 messy

14:47 LauJensen: Can you demo ?

14:47 * Anniepoo_ ducks

14:49 chouser: (defn atom-pop [a] (let [box (clojure.lang.Box. nil)] (swap! a #(do (set! (.val box) (peek %)) (pop %))) (.val box)))

14:50 ^^ messy

14:50 LauJensen: Nasty

14:50 But yes, it would work :)

14:50 jave: replaca: hello

14:52 chouser: http://clojure-log.n01se.net/date/2010-08-18.html#11:14

14:55 LauJensen: chouser: Thats really one of the charms of #clojure, on the one hand you and Rich are discussing concurrency semtantics, and at the same time Raynes is pondering how to manually crack eggs - true concurrency! :)

14:57 AWizzArd: a bit cleaner: (defn atom-pop [a] (let [p (promise)] (swap! a #(do (deliver p (first %)) (pop %))) @p))

14:58 Promise injection rocks :)

14:58 chouser: AWizzArd: nice. though that's likely heavier.

14:59 AWizzArd: yes

14:59 chouser: the Box in mine never escapes so there's no need for concurrency support (extra atoms, countdown latches, etc)

14:59 you really do want what rhickey described.

15:00 (swap2! stack (fn [v] [(pop v) (peek v)]))

15:00 AWizzArd: chouser: he described this where you just linked to?

15:00 chouser: (defn swap2! [a f & args] (let [box (clojure.lang.Box. nil)] (swap! a #(let [[state rtn] (apply f % args)] (set! (.val box) rtn) state)) (.val box)))

15:00 all he said was "you might want a version of swap! that takes a fn that returns 2 values, the one to swap and a return"

15:01 AWizzArd: ic

15:02 chouser: I would guess it would act something like my swap2! above

15:02 I wonder if 2 fns would be better than returning a vector.

15:04 (swap2! stack pop peek)

15:05 raek: implicit juxt...

15:06 chouser: hm, yeah.

15:06 raek: (swap2! stack (juxt pop peek))

15:06 _fogus_: implicit juxt is the point of th my cleave fn

15:07 "my" as in the one I stole from countless others

15:10 slyrus: oh, I've been wanting something like juxt and forgot that was there.

15:14 except that the one I was thinking of would have been more like (my-juxt [+ - +] 42 7)

15:18 replaca: jave: sorry, got pulled into a meeting :-)

15:18 jave: if you add info-file building to the autodoc stuff, I'd be happy to merge it into the normal autodoc build

15:19 raek: _fogus_: what is this "cleave fn"? (loved the part about functions returning functions in JoY, btw)

15:19 jave: replaca: cool

15:19 replaca: jave: I don't think it should be too hard, you should be able to just have a "copy" of build-html.clj that is a build-info.clj

15:22 rhickey: chouser: you wouldn't want to define sawp2! in terms of swap!

15:22 chouser: rhickey: yeah

15:22 those were just meant to demonstrate the api

15:22 demonstrate and try out

15:25 rhickey: 2 fns is interesting, because it demonstrates the only interesting case is where they are both functions of the prior value

15:25 since a function of the resulting value could be called after swap! returned

15:26 chouser: passing the same extra args to both seems a little arbitrary though

15:26 fine when there are no extras as with pop and peek, but otherwise not obviously desirable

15:26 rhickey: I'm wondering about the utility in general. Does someone have a use case that doesn't involve side effects?

15:27 jave: replaca: I tried to run autodocs, but couldnt get it to run. README.md could mention how to run it maybe? I guessed "lein deps" but that failed on a missing artifact

15:30 chouser: There'd be a potential use case anytime you're doing something destructive to the value in the atom.

15:30 pop is one such, but also dissoc and disj

15:30 possibly even rest or next, I suppose.

15:32 replaca: jave: it's in a little bit of an intermediate state at the moment. It won't work with lein 1.2/1.3 as a plug-in, but I think it will work standalone

15:33 jave: but I need to build it to run it standalone right?

15:33 replaca: if you want to do it against clojure core, you'll need to set up the directories right casue that one is done mostly by magic

15:33 raek: could one make a priority (set-)queue using this and a sorted-set? the pop operation would let (first queue) and dissoc it...

15:34 rhickey: chouser: it could just return both values and be done with it

15:34 replaca: more doc on running standalone is at http://tomfaulhaber.github.com/autodoc/

15:34 but it may have some probs right now

15:35 jave: ah Thanks

15:35 replaca: jave: to set up a clojure build you need to make a ../autodoc-work-area directory and make a clojure subdirectory there

15:35 chouser: rhickey: hm, nice. The cost of constructing the return value wouldn't be prohibitive?

15:36 hiredman: you could also use binding and set! to emulate multiple returns

15:36 jave: replaca: but in order to hack in info support I need to build autodocs right?

15:37 rhickey: chouser: impossible to answer generally

15:37 replaca: jave: then clone clojure sources into src/ and autodoc/ and, in autodoc, do a "git checkout gh-pages"

15:37 jave: yeah, but that should work ...

15:38 chouser: rhickey: maybe two (or three?) flavors of swap! then? return old, return new, return both? :-/

15:38 rhickey: chouser: pass in a pod

15:38 hiredman: (binding [*r1* nil] (swap some-atom (fn [x] (set! *r1* (pop x)) (peek x))))

15:38 replaca: jave: maybe it's breaking cause of new leiningen

15:38 hiredman: swap!

15:38 replaca: jave: I still have lein 1.1 on my machine and lein deps, lein uberjar seems to work fine

15:38 * chouser doesn't think in pods yet

15:39 hiredman: s/clojurians/pod people/

15:40 chouser: oh, you just mean use a pod the way I used Box and hiredman used a Var?

15:40 jave: replaca: I commented out the lein dev deps in the project.clj, lein deps works then

15:42 replaca: and "lein autodocs" seems to do something. crashes, but at least starts.

15:42 replaca: oh, ok. I'll check out what's up there.

15:42 simard: what is better practice, using [1 2 3] or '(1 2 3) and why ?

15:42 replaca: jave: don't use the lein plugin

15:42 are you aiming to create info file for clojure itself?

15:42 jave: yes

15:43 ihodes: simard: it depends on the situation, but generally [x y z] is used in favor of '(x y z) because it's easier to type and read, and vectors are often faster for the job.

15:43 jave: replaca: but I could try something simpler 1st

15:43

15:43 replaca: jave: clojure itself is different than other things cause autodoc needs to play more games wrt versions and assumptions

15:43 simard: ihodes: k

15:43 replaca: jave: but it should be fine - just a different setup and invocation path

15:44 jave: in fact it may be better because I've been exercising it a lot lately :-)

15:44 raek: simard: when containing self-evaluating things only, they're pretty much equivalent (unless you care about what data structure it is). the vector form is the one I tend to see most as a sequential data literal (and has the most clojure-y feel, for me)

15:45 replaca: jave: just create the directories as described above and then run "./run.sh clojure false" from the root of your autodoc checkout tree

15:45 jave: replaca: ok

15:46 jlf`: anyone have a recommendation about which of the many couchdb clojars to use?

15:46 replaca: jave: it will generate new doc in ../autodoc-work-area/clojure/autodoc

15:46 jlf`: i initially tried the-kenny's, but compilation fails with " error: java.io.FileNotFoundException: Could not locate clojure/contrib/json/read__init.class or clojure/contrib/json/read.clj on classpath:"

15:46 rhickey: chouser: pass the pod in

15:46 replaca: jave: interesting config stuff for clojure is in params/clojure/

15:47 s450r1: jlf`: clutch worked nicely for me

15:48 jlf`: s450r1: that narrows it to 6 :) which one in particular?

15:53 s450r1: jlf`: http://github.com/ashafa/clutch

15:55 jlf`: thanks

15:57 hiredman: I wonder if the clojure mailing list could just move to a new address and not tell people who want to argue about paren placement

15:57 Raynes: hiredman: I second that motion.

15:58 slyrus: :)

15:58 LauJensen: hehe

15:59 Whats the name of that thread?

15:59 "Lisp/Scheme style guide" ?

15:59 lancepantz: maybe just a faq would do

16:00 then point those qs at the faq and ignore thme

16:00 LauJensen: _fogus_: "The beauty of the painting is not that you hang it upside down" haha, classic

16:02 _fogus_: LauJensen: I've decided to never talk about parens again

16:02 hiredman: or just have gmail mark emails from greg as spam

16:02 LauJensen: _fogus_: Im sorry to hear that, I thought your post was hillarious

16:02 I actually never thought I would get to meet someone who could out-troll me :)

16:02 _fogus_: Funny, but pointless

16:05 If I would have first read the post equating people who dislike that style with segregationists, I would have never bothered to post in the first place.

16:05 Oh well, live and learn

16:05 somnium: waaay late just noticed 'the abomination', and can't resist pointing out that its the identity monad: `do x <- blah; y <- blarg; blotz; quux'

16:06 LauJensen: I love how monads turn everything into 'blah blarg blotz quux' :)

16:06 hiredman: what abomination?

16:06 somnium: LauJensen: ooh, let me dig up something really abomniable

16:06 LauJensen: hiredman: http://gist.github.com/560765#file_abomination_desolation.clj

16:07 somnium: https://gist.github.com/0508e6219da9ee0adc01

16:08 hiredman: yeah, it does look like chouser is reaching for do notation

16:08 somnium: (maybe it could scare some sense into the paren haters)

16:08 hiredman: well, there is the monad namespace in contrib

16:08 somnium: its awfully ungainly though

16:09 LauJensen: somnium: I cant look at that

16:09 somnium: :D

16:09 hiredman: somnium: but it also comes with a modaic io namespace

16:09 somnium: hiredman: isnt that just absurd in a non-lazy impure language?

16:10 or, you were probably being ironic

16:10 hiredman: but clojure operations can be lazy

16:10 e.g. line-seq

16:10 which can cause problems

16:11 being able to safely compose that stuff is good

16:12 I think arkham is an interpreter monad

16:12 hmmm

16:12 somnium: hmm, Ill have to actually look at monadic io

16:12 hiredman: maybe not

16:13 somnium: I found a way to spoof return type inference, with a deftype UnTyped, then a protocol for each Monad that 'injects' its type into the UnTyped object

16:13 hiredman: not to say I have ever used contrib monads or the io stuff

16:13 ihodes: hiredman: maybe clojurebot could auto-kick anyone who mentions "style" and "parens" in the same sentence?

16:13 somnium: but once I got it working it all seemed a bit ridiculous

16:13 hiredman: clojurebot doesn't have ops

16:13 or there would be a lot more kickage

16:15 I've been trying to get return type inference for Archimedes working

16:15 given two numeric types, and a hierarchy of numeric types and rules for return types based on that hierarchy

16:15 danlarkin: hindley milner?

16:16 hiredman: I have haerd of it, but I don't know anything about it except for the name

16:16 danlarkin: clojurebot: google hindley milner

16:17 hiredman: maybe I should look into it

16:17 danlarkin: noooooooo where's clojurebot

16:17 hiredman: oh

16:18 huh

16:18 netplit out in lalaland maybe

16:24 jlf: s450r1: would you mind sharing your [query_servers] incantation from local.ini? i get a 500 error when i run the usage example in the clutch readme, and i suspect i'm not specifying the clutch view server properly

16:27 s450r1: jlf: sorry, I never played with clutch's view server

16:28 jlf: oh, you just omit :language "clojure" from the get-database map?

16:29 hiredman: clojurebot: google hindley milner

16:29 clojurebot: First, out of 4760 results is:

16:29 Type inference - Wikipedia, the free encyclopedia

16:29 http://en.wikipedia.org/wiki/Type_inference

16:34 s450r1: jlf: I used (clutch/set-clutch-defaults! {:host host :port port}) and clutch/with-db to connect

16:38 somnium: maybe we should get comp.lang.lisp involved in the Lisp/Scheme Style Guide thread

16:39 Raynes: Oh boy.

16:46 LauJensen: I vaguely recall that theres some repl trick for seeing the constructors of a class?

16:48 somnium: ,(ancestors (class 'foo))

16:48 clojurebot: #{java.util.concurrent.Callable clojure.lang.IMeta java.lang.Runnable java.io.Serializable java.lang.Object clojure.lang.IObj :clojure.contrib.generic/any clojure.lang.Named java.lang.Comparable clojure.lang.AFn clojure.lang.IFn}

16:48 somnium: like that?

16:49 LauJensen: No - I mean something like (Constructor type1 type2 type3)

16:49 somnium: oh, c.c.repl-utils/show?

16:49 LauJensen: maybe, I'll check

16:51 chouser: (show Integer #(re-find #"<init>" (:text %)))

16:56 LauJensen: nice chouser, thanks

16:56 and thanks to somnium for pointing the way

17:03 chouser: (doseq [c (.getConstructors Integer)] (println c))

17:04 LauJensen: nice

17:04 jfields: would you use update-in here: (swap! resting update-in [client-order-id] - quantity)

17:06 Chousuke: looks fine to me.

17:07 jfields: cool. just wanted to make sure there's not a better fn to use when your keyseq is (count 1)

17:07 Chousuke: heh, yeah. a special case called just "update" or update-key would look a bit better.

17:22 AWizzArd: Anyone here who programmed an application for Android in Clojure?

17:36 defn: "Wait, what does your startup do?"

17:36 Anniepoo_: AWizzArd - find George Jahad, he's done it

17:36 defn: So, basically, it's like an API for pets.

17:37 kotarak: It starts up?

17:37 defn: So basically, it's like Flickr for ex-convicts!

17:37 lol. http://itsthisforthat.com/

17:39 tomoj: "node.js server for collegiate jewish women"

17:39 defn: bahahaha.

17:39 Finally!

17:39 I like the ones that are for 'nature blogs'.

17:40 Anniepoo_: lol - a plugin manager for government corruption

17:41 defn: hahahahahahahaha. ah man, brilliant site.

17:42 Anniepoo_: lol - the scariest part is that one small part of my brain is going 'hmm... that's not a bad idea'

17:42 defn: yeah I know -- same here...

17:42 So basically, it's like a mac app for ugg boots.

17:43 a mapreduce query for baristas. lol

17:46 Anniepoo_: even scarier, I've seen some of these deployed - there IS a flickr for Second Life

17:46 defn: yeah i think ive seen a "jewbook" or something -- so there's your collegiate jewish women app

17:47 * defn sets out to write a plugin manager for government corruption

17:47 Anniepoo_: LOL - 'eco friendly marketplace for hunters'

17:47 hey, government corruption's a multi-trillion dollar business globally

17:47 owning the API for it would be worth big bucks

17:48 * slyrus wonders if java coders get paid by the jar, the directory, the depth of the directory hierarchy, or the file. Whatever the case, the results are annoying.

17:49 Anniepoo_: 8c( sadly, the truth is, 'they get paid'

17:49 defn: slyrus: yeah, they only pay a dime (literally 10c) for each layer of depth in the hierarchy

17:49 gotta get deeper! (that's what she said)

17:49 Anniepoo_: viral marketer for medical marijuana - sadly, done thousands of times

17:49 defn: seriously?

17:50 So basically it's like a cloud storage provider for the homeless.

17:50 Anniepoo_: hmm.... probably not commercial - a wikipedia for Erlang

17:51 LOL - CRM for adult dating

17:52 oh heck, there's one I seriously considered

18:00 defn: game-based incentive for beer.

18:00 been done.

18:00 brick-and-mortar solution for government corruption. heh

18:01 Anniepoo_: been done

18:01 recommendation engine for ex-convicts

18:05 somewhere there's a movie treatment generator that scrapes IMDB

18:09 defn: haha -- this one produces a lot of funny results: playboy for ____

18:09 as in playboy for government corruption, ex-convicts

18:18 Chousuke: "cash4gold for world of warcraft" duh

18:21 defn: digg for highway accidents

18:47 slyrus: what the hell is an artefact anyway? and why don't they spell it artifact?

18:58 Anniepoo_: hmm.... should be possible to make a version of this that actually generates the code....socially, that seems like a bad idea.

18:58 maybe you could automate the entire startup process

18:59 slyrus: "Normally you do not need to set the level of a logger programmatically. This is usually done in configuration files." Oh java-people, why, oh why, do you crave such needless complexity? Oh wait, it's because gosling et al. didn't give you a REPL. nvm.

19:00 Anniepoo_: for that matter, exactly WHY do we need to change languages to set the level of the logger?

19:02 slyrus: which, for me, is another way of saying how-the-&$!)^% do I meaningfully turn on logging in one of these accursed, omnipresent log4j loggers from the clojure REPL?

19:03 I can .setLevel the relevant logger, but darned if I know where the output is going

19:03 Anniepoo_: I'm glad to hear I'm not the only person who finds this immensely annoying

19:04 slyrus, I think you have to change the class of the logger to change where it's going

19:04 ssideris: persumably stdout for warnings and such, and stderr for errors

19:04 slyrus: holy-misguided object orientation batman!

19:05 Anniepoo_: log4j has a bunch of kinds of loggers - the idea is to plug in the one you need

19:05 slyrus: then again the logger has to work in tomcat, netbeans, eclipse and a bunch of other crap I have absolutely no interest in

19:05 Anniepoo_: which is borked

19:05 slyrus: oh, clearly I just need to call the AbstractDelegateLoggerFactoryGeneratorFactory

19:27 ihodes: is there a particular reason line-seq is in the core lib instead of in, e.g., clojure.java.io?

19:28 hiredman: c.l.i didn't exist when line-seq was written

19:28 c.j.i

19:28 ihodes: hiredman: right, but it's 1.2 now; couldn't it have been moved?

19:29 hiredman: i guess i'm more interested if it was usuable sans BufferedReasder. direct interop before (reader… and the like

19:29 usable* and BufferedReader* excuse me

19:29 hiredman: it is

19:29 and was

19:29 moving it would break any code that uses it

19:30 ihodes: how was it usable?

19:30 hiredman: (line-seq (-> "foo.txt" File. FileReader. BufferedReader.))

19:30 pardon me

19:31 (-> "foo.txt" File. FileReader. BufferedReader. line-seq)

19:31 ihodes: right, that used BufferedReader directly. which is fine, i was just wondering if that'd always been the case, or if there used to be something in clojure.core that could be used with line-seq

19:32 hiredman: whats wrong with using BufferedReader directly?

19:32 ihodes: nothing at all, just wondering

19:42 bhenry: is there anything in clojure that works kind of like a reverse engineer of format? ie (extract "%d-%d-%d %d:%d:%d" "2010-08-31 14:52:31") => [2010 8 31 14 52 31]

19:42 defn: regex?

19:42 clojurebot: Sometimes people have a problem, and decide to solve it with regular expressions. Now they have two problems.

19:42 defn: haha

19:45 bhenry: defn i think python has something like what i'm talking about. i was curious about an existing function. i don't really want to write crazy reg-ex beasts

19:45 defn: bhenry: im not familiar with one but well

19:45 you could write a macro

19:46 bhenry: i think i'll just pull apart the pieces

19:46 Anniepoo_: you're looking for something equivilent to sscanf?

19:47 bhenry: Anniepoo_: yes

19:48 Anniepoo_: I'd write the regex monster once

19:49 ssideris: the regex is not that big anyway: \d{4}-\d\d-\d\d\s+\d\d:\d\d:\d\d

19:49 xm... no groups though

19:50 ihodes: (re-split #"-| |:" "string") right? don't recall offhand

19:50 then map int

19:51 ,(clojure.string/split "2010-08-31 14:52:31" #":|-| ")

19:51 clojurebot: java.lang.ClassNotFoundException: clojure.string

19:52 ihodes: (map #(Integer. %) (clojure.string/split "2010-08-31 14:52:31" #":|-| ")) works in my REPL

19:53 though it's not extracting your specific format.

19:53 bhenry: i'll see if i can make it work

19:54 ihodes: another option for parsing times is looking at clj-time. you can specify a time format, and it'll return a DateSomething object that you can do whatever with.

19:55 bhenry: (map #(Integer. %) (clojure.contrib.string/split #":|-| " "2010-08-31 14:52:31")) worked in my repl

19:55 ,(map #(Integer. %) (clojure.contrib.string/split #":|-| " "2010-08-31 14:52:31"))

19:55 clojurebot: (2010 8 31 14 52 31)

19:55 bhenry: nice thanks ihodes

19:56 chouser: you can just use .split on a regex

19:56 ,(map #(Integer. %) (.split #":|-| " "2010-08-31 14:52:31"))

19:56 clojurebot: (2010 8 31 14 52 31)

19:58 ihodes: right, and split is on clojure.string now anyway :)

20:12 ninjudd: hmm, does anyone know why the separator is the second argument of clojure.string/split but it is the first argument of clojure.string/join?

20:17 chouser: oh man

20:17 seriously?

20:18 ninjudd: chouser: yeah. i thought there might be some deep reason for it

20:19 chouser: probably because the string is the first arg to all of them.

20:19 tomoj: ninjudd: which clojure.string/split are you looking at?

20:19 oh, I see

20:20 ninjudd: hmm

20:20 ihodes: ninjudd: i always have to go back to the docs when i use split…

20:20 maybe one day i'll remember

20:20 chouser: I wouldn't bother using it. Just use .split

20:21 ihodes: but it has the *dot* yecck. ;) i think i will-thanks for the pointer

20:22 ninjudd: yeah. the only thing i don't like about String.split is that you can't pass a regex in, it has to be a string that it compiles to a regex

20:22 chouser: well, and it'll come back to bite me as clojure reaches other platforms.

20:22 ninjudd: use regex's split instead of string's.

20:23 ,(.split #"/" "a/b/c/d/e/f" 4)

20:23 clojurebot: #<String[] [Ljava.lang.String;@92949f>

20:23 chouser: ,(map keyword (.split #"/" "a/b/c/d/e/f" 4))

20:23 clojurebot: (:a :b :c :d/e/f)

20:23 ninjudd: aha. of course!

20:25 sleepynate: clojurebox on windows makes me sad :/

20:26 chouser: ninjudd: it took me a surprisingly long time to find that.

20:28 defn: sleepynate: is that the one that includes emacs and stuff?

20:28 sleepynate: defn: yea. i'm a vim guy... and i have all linux boxes except the one vista machine. transitioning is rough :)

20:29 without starting and editor war: "the only emacs command I know is C-c C-x"

20:30 but getting vimclojure working on *nix boxes was hard enough... screw trying it on windows

20:31 ssideris: in perl, there is this compiler hack (built-in) that allows you to write qw(a b c) and it compiles as ("a", "b", "c"). Is the following a correct re-implementation of something equivalent in clojure?

20:31 (defmacro qw [& symbols] `(quote ~(map #(str %) symbols)))

20:31 defn: sleepynate: on windows ive been using netbeans

20:32 sleepynate: defn: ahh yea. counterclockwise was my fallback for a while

20:32 defn: using emacs on windows is kind of painful

20:32 sleepynate: but i'm also a scheme-not-java person.. and eclipse took care of that til i got used to it

20:32 defn: so many of the things written for it are not for windows

20:32 plus windows sucks and i hate it

20:33 so there's that

20:33 sleepynate: haha, right?

20:35 defn: I think Clojure running on the CLR is awesome because it's the CLR

20:35 err because it's clojure

20:36 not because it's on the CLR :)

20:36 sleepynate: sure. doesn't that break things like Math/sqrt though?

20:39 chouser: ssideris: looks good to me

20:42 ssideris: chouser: thanks... my main problem is that I don't think I fully grasp what's going on here... the macro is passed a number of symbols that are then converted to a Seq of strings which is then what?

20:42 ...inserted into the parse tree?

20:42 i think i'm having trouble getting rid of the idea that macros are about generating text

20:43 generating text as in generating code

20:43 defn: macros are about generating macros that generate macros that generate macros that generate macros...that generate text

20:43 coldhead: yo dawg i heard you like generating macros?

20:43 ssideris: hahaha

20:43 yeah i know about the recursiveness and all

20:44 but is the end result really text?

20:44 in rhickey's talk he seems to imply that they generate sexps

20:45 defn: code is data

20:45 wouldn't be a lisp without it

20:47 ssideris: yes, but you said "text"

20:47 you didn't say "code"

20:50 Derander: sleepynate: my dependence on *nix has gotten to the point where when I'm forced to use windows for a sustained period of time I will use a linux vm.

20:56 * ataggart adds programmatically changing logging levels to the c.c.logging TODO list

20:56 sleepynate: Derander: yea... i really only boot windows to play battlefield with all my buddies who married or moved away :)

20:57 Derander: "no honey, go on out with the girls... you need some woman time!" ... <launch vent> ... "k guys, game on"

20:59 Derander: hahaha.

21:27 simard: is there a function/macro that does the same thing as macroexpand but recursively ?

21:28 sleepynate: simard: http://github.com/richhickey/clojure/blob/a1eff35124b923ef8539a35e7a292813ba54a0e0/src/clj/clojure/core.clj#L3086 <--- looks pretty recursive to me

21:29 tomoj: maybe you want c.c.macro-utils/mexpand-all

21:31 sleepynate: good call

22:33 * slyrus wishes C-c C-c worked on java code

22:48 slyrus: oh, this makes me feel better: "All of this content is automatically generated by Maven on behalf of the project."

22:51 java: "we've got a lot of libraries!" or "you're going to need a lot of libraries, even if you only want one or two!"

23:01 AWizzArd: /away away

23:01 oops

Logging service provided by n01se.net