#clojure log - Oct 19 2010

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

0:07 amalloy: jkkramer: since you have the power to make dreams come true, is there a variant of if-let that allows multiple bindings, treating the first as the test? then you wouldn't have to write (if-let [x blah] (let [y foo] body))

0:09 * jkkramer consults his unicorn

0:09 jkkramer: the unicorn says no

0:10 amalloy: aww. well, it wouldn't be too hard to write one, of course. does anyone else find this boilerplate annoying?

0:10 jkkramer: i've wished for an if-let that lets you bind multiple locals, but tests them all

0:10 amalloy: heh

0:10 technomancy: I think that ambiguity is why if-let doesn't already support that

0:11 is it an "and" or an "or"?

0:11 jkkramer: i would think it would be an "and"

0:13 but it's not so much of a pain that i'd write a macro. it could just be an indicator that the code is getting smelly

0:18 amalloy: jkkramer: i agree that or doesn't make any sense. i think it's a question of every? or first

0:19 leifw: personally, I don't really like if-let, I'd rather split it up for readability's sake. I vote for the stink

0:20 and jkkramer, visualvm is fantastic, thanks

0:22 jkkramer: leifw: np. i hear yourkit is also good, but costs $$

0:24 leifw: yeah I read that too

0:24 I am not spending money on an art class :(

0:24 actually, I already have because we have to buy all our own supplies, but that's beside the point

0:28 jkkramer: leifw: going to post your code somewhere? it's always fun to see pretty visualizations done in clojure

0:31 maravillas: has clojars changed ips?

0:31 IPs/host key

0:33 technomancy: maravillas: yes

0:34 maravillas: ah, thanks

0:39 technomancy: mmm... new lein-multi release; nice. =)

0:40 maravillas: did you have to work around some changes to leiningen.core functions?

0:40 maravillas: just a couple things...I noticed the undocumented atom I relied on was gone in lein 1.3

0:41 technomancy: I realized I might be a little premature in making a few things private, so let me know if that's causing you trouble

0:41 maravillas: i did replicate project-needed?

0:41 technomancy: I will be a lot more careful about minimizing the public API in 2.0

0:41 maravillas: otherwise there weren't any issues

0:41 technomancy: the semantics are a bit different; mine works on a single arity while yours works on the full arglists

0:42 cool

0:42 LauJensen: Good morning all

0:45 maravillas: morning LauJensen

0:50 amalloy: the docs for ns/use/require et al are confusing. how do i, in an (ns) form, use only a particular symbol from some namespace?

0:51 notsonerdysunny: I saw there was a function called persistent! .. takes a transient collection and returns a persistent one ... and was wondering how would one end up with a transient collection in clojure?

0:51 Good morning LauJensen

0:51 good morning all

0:52 Kruppe: notsonerdysunny: (transient []) for example

0:52 notsonerdysunny: amalloy: (ns somens

0:53 Kruppe: why would I create a transient one in the first place .. for performance?

0:54 Kruppe: notsonerdysunny: exactly that

0:54 notsonerdysunny: http://clojure.org/transients for more details

0:55 amalloy: i just split my project into three or four namespaces, since it's sorta outgrown the simple core.clj. now it takes ten seconds to compile with C-c C-k instead of ~one second. anyone know why?

0:55 nm, i guess it's just that it takes longer to compile the first time you move a bunch of stuff

0:56 notsonerdysunny: Kruppe: thanks

0:56 Kruppe: notsonerdysunny: no problem, glad i could help

1:08 amalloy: i see defn- defines private functions - is there no def- for private constants/globals?

1:10 Derander: so, inspired by amalloy, I decided to compile my project for fun with C-c C-k in emacs. http://gist.github.com/633647 is the namespace declaration. it works fine in the repl. I get the error in the gist, though

1:10 the strange thing is that the error persists even if the ns call is just (ns desktop.core)

1:10 that's the only clojure file in the project

1:10 anyone know wtf is going on?

1:11 tomoj: Derander: had you use'd clojure.contrib.string earlier?

1:11 Derander: in the repl, yes

1:11 amalloy: Derander: restart your swank server? it might not like the :use being declared in the ns form as well as from the repl

1:11 Derander: ooooooh

1:11 tomoj: or just (ns-unmap *ns* 'repeat)

1:11 Derander: I thought the compilation process was something completely different

1:11 tomoj: then C-c C-k again

1:12 the core binding will fall in

1:12 amalloy: Derander: compilation is just passing all the forms in the file to the repl, more or less

1:12 Derander: restarting swank

1:13 tomoj: Derander: is it just me or have you returned from a long absence?

1:13 Derander: tomoj: I think it's just you

1:13 maybe I wasn't here last night, but it's not as if I'm a pillar of the community anyway

1:14 tomoj: I mean I don't remember seeing you around in months, but my memory sucks

1:14 amalloy: yeah, i don't think Derander's been around that long. a week or two, am i right?

1:14 Derander: tomoj: were you involved in the ruby community at all?

1:14 tomoj: ohh

1:14 Derander: your name is familiar, but it might just be from lurking here

1:14 tomoj: really, shit

1:14 my memory doesn't suck as much as I thought, I guess

1:15 surprised I remember anyone's name from back then

1:15 Derander: hah. :P

1:15 I am vocal over there

1:15 tomoj: were you a bridger?

1:15 Derander: mmhmm

1:15 tomoj: that's it

1:15 amalloy: eh? bridger?

1:16 Derander: amalloy: #railsbridge

1:16 was started to help ruby/rails newbies

1:16 because #rubyonrails got kind of hostile

1:16 tomoj: I never use ruby these days :(

1:16 well, I make an exception for chef...

1:16 ... and there's this one legacy project.. oi

1:17 Derander: it's still my day job

1:17 tomoj: it was my dayjob (hence the legacy project), but then our new CTO happened to love clojure :D

1:17 Derander: awesome

1:17 okay, so restarting the swank server changed the error

1:17 progress

1:17 tomoj: makes me happy to see rubyists showing up here :)

1:18 Derander: clojure is fun

1:18 it's cryptic error messages make me feel right at home

1:18 tomoj: haha

1:18 Derander: its*

1:18 tomoj: you get used to them

1:18 ..well, I'm still stumped every once in a while

1:19 Derander: ever seen "lib names inside prefix lists must not contain periods"?

1:19 tomoj: repaste your ns

1:19 Derander: http://gist.github.com/633647

1:19 wasn't quite fast enough to beat your request :-)

1:19 oh

1:19 tomoj: first, don't quite inside ns

1:19 er, don't quote

1:20 Derander: ah. dropping those pops over t4o "Don't know how to create ISeq from: clojure.lang.Keyword"

1:21 oh

1:21 I think I found it

1:21 clojure.contrib string vs clojure.contrib.string

1:21 compiling

1:22 nope, same error.

1:22 amalloy: Derander: repaste the new one?

1:23 i was under the impression you only got one :use and :import per ns, though i wouldn't be surprised to be wrong

1:23 Derander: http://gist.github.com/633647

1:23 oh, I have no idea

1:23 amalloy: somnium congomongo - no .

1:23 Derander: that one I ripped off of their readme

1:23 trying

1:24 tomoj: https://gist.github.com/1f2f4649056962610bcb

1:25 Derander: tomoj: testing

1:25 tomoj: you will probably need to (ns-unmap *ns* 'repeat) or restart swank again

1:25 Derander: sorry to make you guys sweat so much

1:25 tomoj: because your (:use [clojure.contrib.string :as st]) will have brought clojure.contrib.string/repeat into the namespace, which conflicts with the repeat in core

1:26 Derander: that seems to work

1:26 right

1:26 leifw: wouldn't the ":as st" fix that?

1:26 *shouldn't

1:26 tomoj: I don't think so, testing

1:26 Derander: leifw: it seems cumulative

1:26 leifw: weird

1:26 tomoj: yes, use is like require+refer

1:27 leifw: oh

1:27 bah

1:27 :use

1:27 tomoj: so it gives you the st alias but also refers

1:27 Derander: and bam

1:27 it compiled

1:27 thanks folks. I understand ns much better now

1:27 tomoj: I had to reread the docs on all the ns functions many times..

1:28 Derander: that is a frustrating macro/function pile

1:43 amalloy: Derander: your problem seems to have caused them both to timeout

1:56 Derander: amalloy: victory :-)

2:41 coldhead: thanks, clojurebot

3:39 mrSpec: Hello, I'd like to use clj-doc in my project. Could you tell me what should I put in my project.clj, to download this lib with "lein deps"?

3:53 TobiasRaeder: morning everybody :)

3:59 AWizzArd: Moin Tobi.

4:03 esj: Morning guys

4:04 TobiasRaeder: morning

4:05 LauJensen: Morning everyone

4:07 * esj tips hat to Lau

4:08 sthuebner: good morning *

5:06 zkim: Hah, cool, paul graham credits clojure for making lisp fashionable again: http://news.ycombinator.com/item?id=1803351

5:08 noidi: now that seqs can be poured into maps (fn [& {:keys ...}]), is there something like :as that would bind the original seq to a name?

5:09 I have a function that uses some of its keyword arguments itself, and passes the rest on to another function

5:09 xkb: Is it possible to add a random .jar as a dependency in Lein?

5:10 noidi: but the other function expects a seq of keywords and values, and not a map, so I can't use :as to capture the seq to be passed on using apply

5:12 TobiasRaeder: @xkb you just need to access it from the project? just put it into the lib folder

5:12 noidi: ideally I'd like to do something like this (defn first-fn [& {:as options, :keys [foo bar]}], (do-something foo bar), (apply second-fn options))

5:16 ah, got it

5:16 I can do (apply second-fn (apply concat options))

5:20 xkb: TobiasRaeder: jup, thanks. That works

5:20 TobiasRaeder: should remember not to use lein clean ;)

5:23 TobiasRaeder: @xkb yeah thats kind of annoying, might wanna check those libs into your project (if you use git and git lib in .gitignore use git add -f lib/mylib.jar

5:23 @xkb then u can always use git checkout lib/mylib.jar if you accidentially lein clean

5:23 @xkb *(if you use git and got lib in your .gitignore use git add -f lib/mylib.jar to track it anyway)

5:25 LauJensen: ,(letfn [(t [& {:keys [x y z ] :as w}] w)] (t 1 2 3 4))

5:25 clojurebot: {1 2, 3 4}

5:25 LauJensen: noidi: like that you mean ?

5:35 esj: xkb: or use maven to deploy the jar to your local repository so that lein will fetch it automatically for you and save you the heartache.

5:36 mrSpec: Could you tell me how to make function public?

5:37 esj: mrSpec: it is by default

5:37 you have to use (defn- to make it private

5:39 noidi: LauJensen, I was trying to do something like (letfn [(bar [& {:keys [bar-1 bar-2]}] ...), (foo [& {:keys [foo-1 foo-2], :as options}] (apply bar options))])

5:40 and of course it didn't work, because I can't call apply directly on a map (its seq is ([key value] [key value]) instead of (key value key value))

5:40 but (apply bar (apply concat options)) worked

5:40 mrSpec: esj: ah thanks

5:41 xkb: esj: so how you declare the dependency

5:41 pretty much a maven noob here ;)

5:42 mrSpec: ah, but I have still some problem with this public functions. I'm trying use autodoc, and it cant see any public functions in my package :(

5:43 esj: xkb: The jar must have an address, something like org.xkb.fancything. Make a pom.xml file describing this, then use mvn install, which will put it into your .m2 directory.

5:44 mrSpec: I had a similar problem... trying to remember how I got around it.

5:44 xkb: esj: hmm that's pretty simple

5:44 raek: mrSpec: it doesn't list functions without dosctrings, I think

5:44 esj: xkb: it probably wont turn out to be simple.... maven has that habit :P

5:44 raek: GENIUS !

5:44 mrSpec: raek: I have doc strings :)

5:45 btw. how should I "add" files to my project? Maybe here is the problem.

5:46 In project.clj, I have :main MyProject.core

5:46 raek: autodoc has an option for selecting which namespaces docs should be generated for

5:47 mrSpec: but what if I have 2 files, where should I put name of the second one?

5:47 raek: ok, I'll read about this

5:47 raek: i think the value gor that key was a vector

5:49 lypanov: ah crap, netsplits again? dang

5:49 freakazoid: heh yeah that's a pretty big chunk to bite off

5:50 lypanov: freakazoid: mind wise its fine. but apparently i reach a muscle memory limit at that point.

5:51 repeated mind warp experiences every time i tried to use a keyboard seq.

5:51 freakazoid: yeah, that makes sense

5:51 I wonder why viper isn't more popular

5:51 lypanov: think its the lack of consistency when you attempt to use both emacs and vim keybindings at the same time

5:51 freakazoid: modal makes a lot more sense to me

5:51 lypanov: its really jarring to attempt to use slime while navigating with vi bindings

5:52 freakazoid: I only use emacs because vim isn't nearly as extensible and because the people who use it don't see to value extensibility as much I don't get so many cool extensions to support it

5:52 I can imagine

5:52 lypanov: got myself up and running and productive already in vimclojure

5:52 freakazoid: cool

5:52 lypanov: just missing a few minor things that i really liked about slime

5:52 eg, i'm too dumb to remember what i just typed sometimes

5:52 and with vimclojure when i send shit to the clojure instance i don't see what i sent. just the output of it

5:52 freakazoid: I managed to get vim working as a debugger with C++

5:53 but then switched to emacs because the erlang stuff wasn't very good

5:53 oh that's strang

5:53 lypanov: vim blows frankly. but yeah.. i just love the keybindings for general editing.

5:53 freakazoid: yeah, modal makes much more sense to me

5:53 lypanov: a few years back i wrote a partial vim in ruby

5:53 freakazoid: emacs's key combinations are just horrible

5:54 lypanov: but quit half way through as ruby wasn't fast enough for sane syntax highlighting

5:54 freakazoid: using vim all these years is probably waht's kept me from ahving any wrist problems

5:54 lypanov: my syntax highlighter became its own little phd level research project

5:54 freakazoid: heh

5:54 lypanov: freakazoid: i actually quit vim a few years back

5:55 back to it due to clojure

5:55 i quit because i moved to dvorak for the above reason

5:55 freakazoid: if you ask me, I think it's goofy that we have to have all these different specifications for language grammars to get proper highlighting and error detection

5:55 all because we insist on using an ancient format for storing our source code

5:55 lypanov: but got one of those little alum keyboards from apple with the arrow keys that are semi close to the rest of the keys so dvorak + that was enough to stop my wrists falling apart

5:55 freakazoid: oh yeah I love those keyboards

5:55 I used one at Linden

5:56 fell in love with it immediately

5:56 I just use a macbook pro keyboard where I'm at now

5:56 esj: lypanov: I use exactly that setup

5:56 lypanov: yeah, modern laptop ones are great also.

5:56 * lypanov just bought a magic trackpad to replace a bamboo

5:56 lypanov: its actually good.

5:57 using a mice kills me.

5:57 mouse*

5:57 freakazoid: yeah my dad switched to a left-handed mouse

5:58 I should have shown him how to swap the buttons

5:58 lypanov: freakazoid: on the topic of syn hl. my greatest love atm is the rainbow parens

5:58 lol

5:58 freakazoid: I used to use a logitech trackball that I loved

5:58 * jarpiain is using vim with a Dvorakish layout

5:58 freakazoid: but after a while it would get gummed up every single day

5:58 lypanov: jarpiain: you switched from qwerty?

5:58 jarpiain: I have hjkl where qwerty has wvrs

5:58 freakazoid: rainbow parens sounds awesome

5:58 lypanov: jarpiain: i had to take a break. i just couldn't do it.

5:58 freakazoid: I can imagine exactly what that looks like from teh description

5:58 jarpiain: didn't get longer to get used to it than switching qwerty->dvorak in general

5:58 esj: lypanov: the best ever were the ThinkPad's with the little nipple thing. It was pure genius.

5:59 freakazoid: oh yeah, I used to ahve one of thos

5:59 I wonder where it went

5:59 lypanov: never had enough money for one of those :P

5:59 freakazoid: I think my ex wife's roommate ended up with it

5:59 esj: lypanov: i bought a series of them 2nd hand, and well out of date, from ebay.

5:59 lypanov: esj: .nl here. ebay basically doesn't exist.

6:00 or you mean recently?

6:00 esj: lypanov: ongelukkig !

6:00 lypanov: hehe

6:01 jarpiain: i was primarily coding java back then in intellij with a vim extension thing and couldn't get my head around either the switch, or the remapping.

6:01 raek: I have a thinkpad. It is awesome.

6:01 freakazoid: I've since converted to mac

6:01 (from Linux)

6:01 * lypanov is saving up for a 27" imac

6:02 esj: raek: pretty jealous, they're top notch kit.

6:02 LauJensen: Zzzzz

6:02 lypanov: i was wondering where lau was.

6:02 LauJensen: vimclojure really isn't that bad fwiw.

6:02 esj: LauJensen: I thought you were all about the best tools ?

6:02 lypanov: he's doing that for the mac stuff.

6:02 LauJensen: Man this Apple/Vim worship is like being in a mental institution for boys that want to be pretty and have pretty things. Luckily C-x b, will fix that, later suckers

6:02 lypanov: or he just woke.

6:03 esj: lol

6:03 lypanov: lol, says the emacs user...

6:03 * lypanov gets macs for free

6:03 esj: i say again - seduced by the power of the dark screen he has become !

6:03 lypanov: fall of trucks do they ?

6:03 LauJensen: Seriously. If somebody gave me a Mac I'd sell it the same day

6:03 lypanov: (just not the next one, currently unemployed)

6:04 esj: second one (first gen mbp) i got from apple for my work on safari.

6:04 esj: second my last employer bought me.

6:04 third*

6:04 freakazoid: all my macs have been employer-purchased

6:05 * esj is a about to return his employer provided mac - side effect of quitting :)

6:05 lypanov: my company went bust and never collected it.

6:05 so didn't have to return it.

6:05 :D

6:05 esj: sweet

6:05 lypanov: downside, they owe me enough to buy 2 new ones...

6:08 LauJensen: hehe, lypanov its insane how you categorize everything as the number of macs it will buy you

6:08 * esj wonders how anybody ever figured out JFreeChart w/o the benefit of the Clojure repl

6:09 lypanov: LauJensen: just making the point that the free mac due to bankruptcy would much rather be the 2 months of missing pay :(

6:09 LauJensen: esj: yea, its a nightmare

6:09 esj: its a bit sprawly

6:09 LauJensen: lypanov: and Im just making the point that you need a cold shower, slap across the face and a cookie

6:10 lypanov: i'd go for just the last one and a cup of tea.

6:11 LauJensen: and a little rainbow colored sweather to get all nice and cozy? Come on now! :)

6:11 lypanov: sweater

6:12 LauJensen: hehe

6:12 yea

6:12 lypanov: sweather has 350'000 google hits tho :/

6:12 ah, for "sweat her" mainly :P

6:17 fliebel: Morning

6:18 LauJensen: Morn'

6:18 fliebel: Can I do if-let inside of cond?

6:19 LauJensen: ,(cond (odd? 3) (if-let [x nil] (println "yes")))

6:19 clojurebot: nil

6:19 esj: ello

6:20 fliebel: Right… *tries to read some code*

6:21 LauJensen: esj: Did you get a new job as a Clojure cons?

6:21 esj: LauJensen: I'm trying very hard to give myself a job :)

6:21 LauJensen: ah :)

6:22 esj: my motivation has a lot to do with wanting to code Clojure.

6:22 but i'm not good enough to be a cons yet: i'll leave that to you and cgrand :)

6:24 LauJensen: Alright, we'll take it from here :)

6:25 fliebel: What is a Clojure cons? I don't assume you mean clojure.core/cons?

6:25 esj: consultant, i'm guessing

6:25 :)

6:25 LauJensen: fliebel: I just meant Consultant

6:25 fliebel: right :)

6:25 LauJensen: But it would certainly be ambitous for esj to transform himself into clojure.core/cons

6:25 esj: it would be a striking metamorphosis

6:25 fliebel: He would be kind of lazy though....

6:26 LauJensen: of epic proportions

6:26 esj: (into clojure.cons/cons esj)

6:26 easy.

6:26 LauJensen: throws ClassCast Exception: Too Lazy

6:27 fliebel: He could be lazy-esj… (lazy-esj [1 2 3])

6:27 esj: rotfl !

6:28 fliebel: Good irc handle for mondays as well

6:28 mfex: fliebel, perhaps you are looking for c.c.cond/cond-let as a combination of cond and if-let

6:30 fliebel: mfex: I think I just misread the cond. I was thinking he was using if-let as a clause and an expression at the same time, but the code had some parens mixed, so it's alright now…. Except tht it doesn;t work :)

6:34 lypanov: esj: would like the same - to be doing clojure.

6:34 * lypanov sick and tired of ruby and its community

6:35 esj: lypanov: too right !

6:35 * esj has never been accused of being reasonable.

6:36 * lypanov wishes he had enough saved to go awol for a year and make a clojure editing env for the ipad :(

6:36 lypanov: (that even Lau would like to use...)

6:36 esj: oh that's easy !

6:36 take away the ipad, and replace with anything else running emacs :)

6:37 lypanov: :P

6:37 LauJensen: HAHA.. Clojure for the Ipad.. you crack me up lypanov

6:38 If you do decide to go awol for a year for that reason, please dont come back :)

6:38 esj: so mean !

6:38 LauJensen: Sorry, it was written with a smile on my face

6:38 lypanov: thats why i said "that even lau would like"

6:38 i wouldn't bother if it would suck

6:38 i don't believe it would suck

6:38 so either 1 year later i'd return knowing its impossible and just plain sucks

6:38 or, lau would like it.

6:39 fliebel: Good iPad is multitouch for all emacs finger twisting.

6:39 * esj is still looking for a set of emacs pedals.

6:39 LauJensen: haha

6:40 esj: i used to play the pipe organ, so I figure it would be easy

6:40 lypanov: esj: set up a webcam and use your eyelids.

6:40 LauJensen: pedals would be great

6:40 bOR_: "Parameter declaration intern should be a vector"

6:40 fliebel: esj: you could craft them yourself if you really want to :)

6:40 esj: fliebel: the thought has actually crossed my mind

6:40 bOR_: does anyone know why that happens when I try to embed an intern in a function?

6:40 lypanov: you can already get usb pedals.

6:40 dunno if they last / feel good.

6:41 fliebel: lypanov: I'd modify a keyboard pedal to fit in my mic plug and go form there.

6:41 bOR_: nevermind

6:41 :)

6:42 forgot to specify function name

6:42 lypanov: http://www.instructables.com/id/USB-Foot-Pedal/

6:42 neat.

6:42 fliebel: *is playing with midi*

6:42 bOR_: dumb :-).

6:45 lypanov: cemerick: are you looking for eg vimclojure to also use your remote repl stuff?

6:59 LauJensen: lypanov: If its not a 4.6 Gb install which requires 1200+ lines of XML config, cemerick doesnt care about it. Its simply not a tool in his world.

6:59 On the other hand, he loves netbeans :)

7:00 lypanov: only 4.6? you could fit 5 copies on a single bluray. who cares?

7:01 obviously you don't need to do anything difficult like print for example or you'd completely grok 4.6 as being a minimal install set for any given piece of softwar

7:02 (half joking..)

7:04 cemerick: lypanov: yes, I've been working with Meikel from the beginning to make sure his requirements are met

7:04 lypanov: cemerick: awesome!

7:04 cemerick: LauJensen: I've not used netbeans for some time now.

7:05 LauJensen: cemerick: really? Im surprised, CCW?

7:05 cemerick: Yes.

7:05 LauJensen: cemerick: how are you liking it ?

7:05 compared to netbeans I mean

7:05 lypanov: ccw?

7:05 clojurebot: ccw is http://github.com/laurentpetit/ccw

7:06 cemerick: NetBeans failed me. Occasional segfaults. I couldn't take it anymore.

7:06 lypanov: ah, eclipse. pure evil.

7:06 cemerick: I don't know how they managed it, since it doesn't use any native libs.

7:07 octe: how would i make a multimethod with the dispatch function being if the argument map has a specifi key?

7:07 don't know if i'm expressing the question well

7:07 LauJensen: cemerick: So its just the occasional segfaults, not big diffs in how they support clojure dev?

7:07 cemerick: I wonder what people around here are going to do when Clojure begins its eternal september, and the vast majority of devs are using eclipse or netbeans.

7:08 lypanov: give them free copies of intellij and pray they see the One True Light?

7:08 ccw looks nice.

7:08 LauJensen: cemerick: So its just the occasional segfaults, not big diffs in how they support clojure dev?

7:08 cemerick: LauJensen: Enclojure has better workflows, but ccw is more capable, strictly speaking. The former will no longer be true, once Laurent and I finish up the new REPL.

7:09 octe: (defmulti foobar :the-key-you-want-to-check)

7:09 LauJensen: cemerick: looking forward to the screencast

7:10 octe: cemerick, cemerick that's for checking one key

7:10 cemerick, i want it dispatched to one function if :foo is in there, another if :bar is in there

7:11 for example

7:11 raek: octe: so that there will only be two possible method implementation? (one of true and one for false)

7:12 lypanov: maybe if i get that new 27" imac and have 8gb finally i'll dig back into an ide

7:12 while i'm stuck with the now minute quantity of 4gb of memory i'll use vim

7:13 cemerick: vim needs 4GB? :-P

7:13 lypanov: no but osx sure does ;)

7:13 cemerick: I've never grokked that. I run eclipse with 768MB of heap with very good results.

7:13 octe: raek, not sure what you mean

7:13 lypanov: safari + spotlight + a few other random apps are you're already in the 2gb range.

7:14 cemerick: ditto. but 1gb is an insane env when you have a bunch of other stuff running also.

7:14 fine on linux with a sane desktop. but hell on a mac.

7:14 cemerick: Yeah, 'cause linux is so different?

7:15 lypanov: aye.

7:15 cemerick: Right-o. :-P

7:15 fliebel: lypanov: I'm on 2GB and doing fine.

7:15 lypanov: not when its running the same sort of stuff, but you can afford to be more minimal.

7:15 fliebel: (mac)

7:15 lypanov: fliebel: you obviously have a different work load to me then :)

7:15 * cemerick looks at his env running eclipse, vista in a 1.5GB vbox, firefox w/ 30 tabs, etc etc.

7:16 raek: (defmulti foobar #(contains? m :the-key)) (defmethod foobar true [m] ...code...) (defmethod foobar false [m] ...code...)

7:16 lypanov: cemerick: safari alone is using 1gb on my box currently.

7:16 (wave *kills*)

7:16 raek: if the disptach value can only be 'true' and 'false', there can only be two defmethods

7:17 lypanov: (love it tho..)

7:17 tomoj: how should I sink the output of an external process? (Runtime/exec)

7:17 cemerick: octe, raek: could try (defmulti foobar (juxt :key1 :key2)), and dispatch on vectors.

7:17 raek: and in that case is seems simpler to just do a (defn foobar [m] (if (contains? m :the-key) ...code... ...code...))

7:17 fliebel: raek: Then why is there a prefer function, or something similar of name?

7:17 octe: raek, i'm not explaining correctly

7:17 cemerick, alright, yeah,. that's one way

7:19 raek: prefer is useful for situations where the dispatch value consists of multiple parts (e.g. when it is a vector)

7:19 all elements of the vector are checked pair-wise with 'isa?', which can lead to multiple solutions

7:20 cemerick: prefer-method is useful for any case where there's ambiguity, which can happen without vector dispatches.

7:20 octe: cemerick, it's quite a list of keys

7:20 i'm considering if it'd be better to use condp

7:21 cemerick: octe: In that case, it sounds like you've got quite the combinatorial issue on your hands, esp. if key presence isn't exclusive in each case.

7:21 raek: hrm. I see.

7:22 octe: cemerick, they're exclusive. it'm translating old code from another languagenad it's basically handled with a big switch

7:22 http://paste.lisp.org/display/115689

7:22 shouldnt that work?

7:22 cemerick: If they're exclusive, then perhaps dispatching on sets of keys would work.

7:23 LauJensen: octe: (case data :one 1 :two 2 :default)

7:23 oh, contains?, missed that sorry

7:23 cemerick: LauJensen: data is a map, not a kw

7:23 LauJensen: yea thanks big guy

7:23 check in, try to help, immediately punished! yea! :)

7:23 octe: haha :)

7:24 * cemerick is always sadistic :-P

7:26 cemerick: octe: condp may be the simplest route; depending on how many keys you're tracking, I'd bite the bullet and use a set of the privileged keys to produce those keys as dispatch values.

7:27 octe: cemerick, any idea what's wrong with the condp-code i pasted?

7:28 raek: octe: in the end, (contains? :foo data) is called

7:29 octe: oh

7:29 hm

7:29 raek: replacing contains? with #(contains? %2 %1) should work, I think

7:29 but as cemerick said, you could perhaps dispatch on (set (keys data))

7:30 or maybe (clojure.set.intersection #{...interesting keys...} (set (keys data)))

7:31 *clojure.set/intersection

7:32 cemerick: octe: If they keys in question really are exclusive, then dispatching on sets is unnecessary: http://paste.lisp.org/display/115689#1

7:33 (if you go for multimethods, then the body of the case value there is essentially your dispatch fn)

7:36 lypanov: ah. bummer with cake + vimclojure

7:36 vimclojure doesn't do sync dump of buffer output to console

7:36 it instead goes to the cake console

7:36 but cake doesn't print it unless you manually hit return repeatedly... so didn't realize it went there

7:36 does so with lein

7:55 edoloughlin: Is there an idiomatic way to remove elements from a map? (remove) turns my map into a collection of vectors: http://pastebin.com/SL6uGrxX

7:55 fliebel: lypanov: You have vimclojure working with cake?

7:56 edoloughlin: dissoc?

7:56 edoloughlin: Will check it out. Thanks.

8:02 fliebel: Anyone else who can get me started with vimclojure and cake? I have vimclojure working, but without the nailgun part.

8:13 lypanov: fliebel: aye working. can help. gimme a bit tho, just eating lunch :)

8:13 fliebel: sure

8:13 lypanov: in summary, add [vimclojure/server "2.2.0"]

8:13 to dev deps in cake global project

8:13 then run (require 'vimclojure.nails)

8:13 (vimclojure.nails/start-server-thread)

8:13 from cake repl

8:14 fliebel: *googles cake global project*

8:21 lypanov: That seemed to work. Now, where do I find the keyboard shortcuts to use it?

8:29 lpetit: Hello everybody, everybody hello

8:30 fliebel: lpetit: Een voor allen, allen voor een!

8:30 lpetit: "Un pour tous, tous pour un" !

8:37 LauJensen: "En for alle, alle for en" !

8:42 lpetit: Is there an english idiom for this maxim ?

8:43 (of course I know its origin are rooted into a french not-so-historical book)

8:44 TobiasRaeder: i think its "all for one, one for all"

8:44 altho it's reversed

8:44 lpetit: ok.

8:45 Me, OT ? nahhhh :)

8:45 TobiasRaeder: ;)

8:46 LauJensen: TobiasRaeder: I think its "One for all and all for one"

8:47 TobiasRaeder: yeah i thought so too atleast wikipedia states it otherwise but i guess that doesn't mean anything really

8:49 LauJensen: TobiasRaeder: Well, you mustn't confuse the frenchmen, you know how they get

8:50 TobiasRaeder: :D

8:52 LauJensen: lpetit: Did you catch that little Laurent? :)

8:52 lpetit: LauJensen: now what is this urban legend about french men ? :-)

8:53 LauJensen: yeah, he's near the tall Christophe ! :-D

8:53 LauJensen: lpetit: I think its that you're incredibly arrogant and humor-forsaken. Though I must admit I've never met a frenchmen who acted like that. Except the police perhaps. But even the french police cant beat Officer Bubbles

8:54 fliebel: Does anyone happen to know how to get <localleader> in MacVim? I thought it was set to \ but it just gives me a *punk* when I press it.

8:54 lpetit: Hmm, so I don't feel french (but I recognize that saying so somehow makes me arrogant and humor-forsaken, so it's a vicious circle you've locked me in :-) )

8:54 LauJensen: haha

8:59 fliebel: Strange, can someone explain me vicious?

9:00 I don't think my dictionary contains the implied meaning, although Google translate gives me vicious for the Dutch equivalent of that.

9:00 "deliberately cruel or violent"

9:01 cemerick: fliebel: "vicious cycle" = inescapable repetition of behaviour

9:01 LauJensen: That aligns with my understanding as well

9:01 lpetit: fliebel: not in that meaning in the above context. But rather "pernicious", if you will. The more you try to escape, the more you're locked. Like if there was "sadistic pleasure"

9:02 esj: quick sand !

9:02 LauJensen: Going Counter Clockwise is a vicious cycle, invented by a vicious man, from a vicious land

9:02 lpetit: cemerick: more like a spiral = the more you try to get out, the more you go inside

9:02 :)

9:03 LauJensen: so that's what we all are in the clojure community: vicious men going Counter clockwise, wanting to bring lisp its lost powers back :-)

9:04 fliebel: Right, so my dictionary is just wrong, or at least… (lost another word there…)

9:04 LauJensen: yea.. Maybe we should consider throwing in the towel, just go back to Java. Be more mainstream and conformant. How about it guys? #java?

9:04 Raynes: Morning!

9:05 LauJensen: Morning Raynes

9:05 esj: Hey Raynes

9:05 fliebel: Morning :)

9:05 Raynes: With the help of an alarm clock, I'm slightly able to maintain my relatively average sleep schedule in anticipation of the Conj. Of course, it's more difficult when it takes some 3 hours to get to sleep every night.

9:06 * Raynes runs off to get breakfast.

9:09 lypanov: fliebel: vicious is just mean / gemeen.

9:09 fliebel: found kbd shortcuts already?

9:09 fliebel: set your localleader. i use ,

9:10 example : let maplocalleader = ","

9:10 fliebel: lypanov: but the circle isn't just gemeen.

9:10 lypanov: It has no default?

9:10 lypanov: ,sr and ,et are the most interesting ones

9:10 clojurebot: java.lang.Exception: Unable to resolve symbol: sr in this context

9:10 lypanov: don't think so

9:10 sr -> start repl

9:10 et -> evaluate top level expression

9:11 i start a nailgun thingy. then use ,et a bunch of times

9:11 notsonerdysunny: what is the difference btw ancestors and supers

9:11 fliebel: I found the help ;) Now, let's see...

9:11 lypanov: it magically understands current file etc. so you can randomly ,et in other files and it automatically does the ns stuff etc

9:12 fliebel: yeah, vicious circle is just an expression.

9:12 fliebel: lypanov: Still the punk sound when I press ,

9:13 lypanov: fliebel: um. i dont have any punk sounds anyway so wouldn't know

9:13 what happens if you type ,et?

9:13 fliebel: It's just the *boink* sound a Mac gives when nothing is happening, and nothing is ever going to happen with that key in this situation.

9:14 lypanov: and you did the local header thing?

9:14 local leader sorry

9:14 and the non local normal leader?

9:14 fliebel: what's that?

9:14 Is htere any way to read those values?

9:15 lypanov: well i have let mapleader = "," also

9:16 fliebel: Nothing but boink sounds

9:16 lypanov: just "let localleader"

9:16 shows me ,

9:17 (on the : prompt whatever thats called)

9:17 orry i meant maplocalleader, or mapleader

9:17 s

9:18 * lypanov is using vim.app btw not macvim as macvim is teh suck

9:18 fliebel: I get "maplocaloeader ,)

9:18 well, something like that anyway.

9:19 lypanov: in what mode are you typing ,? insert mode right?

9:19 er sorry, non insert mode. whatever thats called.

9:19 * lypanov has been out of vim for 5+ years

9:19 LauJensen: Lets give the man a round of applause!

9:20 fliebel: lypanov: I can't hit comma in insetr mode without typing it, right?

9:20 lypanov: LauJensen: i was using textmate.

9:20 LauJensen: hehe :)

9:20 fliebel: yea, I'm in… that normal mode

9:21 lypanov: then i don't get it. for me it just magically works

9:21 did you try other such shortcuts?

9:21 you sure vimclojure / nailgun is all getting started correctly?

9:21 when you open a .clj file do you see a new window pop up if nailgun isn't started?

9:22 fliebel: nothing, just the file

9:23 bartj: lypanov, are you trying to setup the Clojure REPL on vim ?

9:23 notsonerdysunny: what does with-loading-context form clojure.core do?

9:23 lypanov: fliebel is yes.

9:23 * lypanov is all go and stuff

9:24 notsonerdysunny: ,(clojure.repl/source with-loading-context)

9:24 clojurebot: Source not found

9:25 notsonerdysunny: ,(doc with-loading-context)

9:25 clojurebot: "([& body]); "

9:25 notsonerdysunny: ,*clojure-version*

9:25 clojurebot: {:interim true, :major 1, :minor 2, :incremental 0, :qualifier "master"}

9:28 LauJensen: ,(clojure-version)

9:28 clojurebot: "1.2.0-master-SNAPSHOT"

9:35 fliebel: lypanov: They don't even know in #vim :(

9:36 lypanov: um.

10:11 rhickey: http://groups.google.com/group/clojure/browse_frm/thread/c40ff3e876b4b370

10:12 esj: that's great news

10:12 rhickey: has anyone tried yesterday's stable var caching?

10:14 esj: i recently chose jira&friends for inhouse stuff, so I'm pretty glad you guys came to the same decision.

10:16 fliebel: rhickey: Nice :)

10:20 chouser: rhickey: nicely worded announcement.

10:21 rhickey: chouser: sorry it took so long - thanks for getting the repo up

10:21 chouser: but I've got no time to try out new clojure versions

10:21 you do know you've got a 1.5-hour keynote in 3 days?

10:22 goodness, no need to apologize for delay. I started writing finger trees over a year ago(!)

10:23 rhickey: chouser: yeah, need to work on keynote but am on a roll with Clojure atm

10:24 * cemerick is bummed he didn't move over nREPL already :-(

10:24 * lypanov watched the empty project anyway

10:24 LauJensen: cemerick: You're still famous on my blog :)

10:28 G0SUB: Can someone help me with this binding/map related issue? http://paste.lisp.org/display/115699

10:29 basically binding doesn't work as intended if any of the functions are using map underneath.

10:29 so to use dynamic bindings, I have to change a lot of things

10:30 I thought this was only the case with pmap.

10:30 Raynes: rhickey: Awesome announcement. I can't wait for all the new toys.

10:31 AWizzArd: G0SUB: could it be that map doesn't work because it is lazy? Did you try to put a doall around your map?

10:32 G0SUB: AWizzArd: possible. let me check.

10:32 kryft: When I was young, maps were eager to work.

10:32 G0SUB: AWizzArd: you are right. I forgot the doall.

10:33 rhickey: cemerick: no worries

10:36 fliebel: rhickey: Where do/did you learn to make and design programming languages?

10:36 don333: a Java method expecting a boolean doesn't accept 'nil' and I used (nil? x) to get it run

10:37 but somehow it feels not right

10:37 rhickey: fliebel: I'm still learning

10:37 ,(boolean nil)

10:37 clojurebot: false

10:38 TobiasRaeder: @don333 since boolean is the type and Boolean is the object nil cant be passed (as you cant pass null to a boolean parameter in a function)

10:38 cemerick: rhickey: I pushed what I've got into the new repo, just so people won't get a quasi-404. Namespace mods and such will flow tomorrow or thursday afternoon.

10:39 fliebel: rhickey: Sure, never stop learning :) But where and what do you need o learn to make compilers and stuff?

10:39 rhickey: cemerick: ok thanks

10:39 don333: so I am doing the right thing after all, using it like (.setEnabled some-button (nil? some-choice)) ?

10:40 fliebel: don333: As rhickey said, boolean is better because (nil? false) is false.

10:40 chouser: don333: 'nil?' will reverse your meaning, 'boolean' won't.

10:41 lpetit: fliebel: because (nil? true) is false

10:41 don333: chouser: I just realised that and put (not (nil? some-choice)) that looks even worse

10:41 fliebel: lpetit: Right...

10:42 rhickey: fliebel: http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH is a start

10:43 don333: that makes me wonder if a refactoring to have a boolean value instead of that nil wouldn't be better

10:43 chouser: don333: right, when you have to use 'not', reconsider. it may be best, but there should at least be another option that ought to be considered.

10:44 fliebel: rhickey: Second time in a week I encounter "The Art of the Metaobject Protocol"

10:44 lypanov: fliebel: after you've read them all pls go port clojure to llvm

10:45 chouser: don333: casting with 'boolean' for the sake of a Java method call feels to might like a straight-up interop cost. I wouldn't assume that means you're doing anything else wrong.

10:46 AWizzArd: ,(boolean 0)

10:46 clojurebot: true

10:46 fliebel: lypanov: Nice idea, but probably not going to happen by me. I'm more interested in making my own toy language for now.

10:46 don333: so perhaps I'll explain my problem - I'd like to enable a JButton when a LazySeq contains an element and disable the button otherwise

10:47 mbuf: are there any available benchmarks that people here have done between java 6 and clojure?

10:47 don333: now I got to (not (not-any? #{:element} collection)) and again it doesn't look right :/

10:48 because I feed it to (.setEnabled some-button ...)

10:48 fliebel: don333: Why the double not?

10:48 chouser: (some #{:element} coll)

10:48 G0SUB: mbuf: check the shootout results on alioth, but take them with a bag full of salt.

10:49 don333: yes, I tried (.setEnabled some-button (some #{:element} collection))

10:49 mbuf: G0SUB, okay

10:49 don333: but some returns nil or :element and .setEnabled doesn't like that

10:49 AWizzArd: I think this is the only interesting difference to Javas (boolean)0

10:50 chouser: (boolean (some #{:element} collection))

10:50 AWizzArd: casting to bool of null, false or a primitive zero leads to ==> false

10:50 lpetit: (.setEnabled theJButton (if (seq coll) true false))

10:50 * lrenn wonders if some of the contrib issues could be solved if the community switched from maven to ivy :)

10:50 chouser: the (some ...) is good idiomatic Clojure, and wrapping in (boolean ...) is clean interop

10:50 lpetit: don333: ^^^ stick to basics

10:51 don333: :)

10:51 lpetit: really

10:51 AWizzArd: lpetit: why the if?

10:51 Can one not simply say (seq coll)?

10:52 lpetit: AWizzArd: have you read don333's problem ? he wants a true true or a true false :) for java interoperability.

10:53 woops

10:53 AWizzArd: So, implicit casting won't solve this.

10:53 lpetit: don333: it's just (.setEnabled theJButton (true? (seq coll))) you're after

10:53 micahmartin: How does one change a field of a deftype after it's been created?

10:53 lpetit: ,(true? nil)

10:53 clojurebot: false

10:54 lpetit: ,(true? false)

10:54 clojurebot: false

10:54 lpetit: ,(true? ())

10:54 clojurebot: false

10:54 lpetit: ,(true? (seq ()))

10:54 clojurebot: false

10:54 don333: thanks lpetit, that looks like a winner

10:54 lpetit: no, it's a looser

10:54 AWizzArd: ,(map true? [nil false () (seq ()) (seq [1 2 3])])

10:54 clojurebot: (false false false false false)

10:54 lpetit: (true? [:a])

10:54 ,(true? [:a])

10:54 clojurebot: false

10:54 AWizzArd: ,(map boolean [nil false () (seq ()) (seq [1 2 3])])

10:54 clojurebot: (false false true false true)

10:55 lpetit: don333: sorry

10:55 don333: aww, right

10:55 lpetit: don333: so back to Rich's suggestion. In your case:

10:55 don333: seems like chouser and his boolean solution wins

10:55 lpetit: ,(boolean [:a])

10:55 clojurebot: true

10:55 lpetit: ,(boolean (seq [:a]))

10:55 clojurebot: true

10:55 lpetit: ,(boolean (seq []))

10:55 clojurebot: false

10:56 don333: yeah, rhickey suggested boolean first ;)

10:56 lpetit: don333: place a call to seq

10:57 don333: (boolean (seq yourcoll)) <- the coll to seq will ensure that empty colls like [] will be nullified and not get the call to boolean get true

10:59 AWizzArd: ,[(boolean 0) (Boolean. "0")]

10:59 clojurebot: [true false]

10:59 don333: @lpetit, @chouser - thanks

11:05 micahmartin: (deftype Foo [foo])

11:05 (def f (Foo. :foo))

11:05 (set! (. f foo) :bar)

11:05 java.lang.IllegalAccessException: Can not set final java.lang.Object field user.Foo.foo to clojure.lang.Keyword

11:05 Does anyone know what I'm doing wrong here?

11:06 AWizzArd: micahmartin: seems you try to modify an object.

11:06 Foos are immutable.

11:06 instead try (assoc f :foo :bar)

11:06 micahmartin: According to documentation, deftypes are muttable.

11:07 AWizzArd: Ah, deftype. Well, no. You can declare fields mutable.

11:07 :volatile-mutable or :unsynchronized-mutable

11:08 micahmartin: What's the syntax to do that?

11:08 lpetit: micahrmartin: you're trying to use CL generalized setters in clojure. It's not working like that ;-)

11:09 Freenk: is there a faster way to call java than .

11:09 lpetit: micahrmartin: oh, sorry for the too fast answer.

11:09 Kototama: hi, is there a way to generate dynamically a java object with a static method? for instance with proxy

11:10 AWizzArd: micahmartin: ^{:unsynchronized-mutable true}

11:10 notsonerdysunny: I just came across with-loading-context .. can somebody help me understand that..

11:10 micahmartin: lpetit: Here's the root problem. I need to implement two interfaces that reference eachother. (deftype Foo [bar]) (deftype Bar [foo])

11:10 AWizzArd: (deftype Foo [^{:unsynchronized-mutable true} foo])

11:10 notsonerdysunny: It seems to have no documentation

11:11 micahmartin: AWizzArd: cool, thanks.

11:11 AWizzArd: You should decide if you need volatile or unsychronized

11:11 lpetit: micahmartin: of course you know you're not in clojure pasturages at all by doing so ? No controlled mutation via refs, etc. ..

11:12 AWizzArd: But then again: very fast mutation.

11:12 Freenk: (.getContentPane frame) works about 400 times slower than java equivalent

11:12 how do I fix this?

11:13 AWizzArd: (.getContentPane ^JFrame frame)

11:13 micahmartin: lpetit: I rather stay in clojure pasturages, but how it it possible with cyclic dependencies?

11:13 lpetit: Kototama: static methods are held by classes, not objects

11:13 AWizzArd: micahmartin: for those you will have to use the mutable field feature of deftype.

11:14 Kototama: then i need to use gen-class because of a stupid java api :-(

11:15 lpetit: micahmartin: atoms or refs, I'd say. "refs as values" are possible. The semantics being that you hold the identity of the other object, not a value of this object at a particular time.

11:16 Kototama: ?

11:16 Kototama: which stupid java api ?

11:17 Kototama: this one https://wizard.dev.java.net/

11:17 AWizzArd: lpetit: sometimes it is indeed a bit unfortunate. Say you want to implement your own IO stream. java.io.OutputStream is an abstract class. Not an interface. This means you can't use deftype. gen-class is possible, but its :state slot will only contain an atom or ref or something like that, and thus not give you maximum speed.

11:18 Kototama: https://wizard.dev.java.net/nonav/javadoc/index.html

11:18 "Have a static method with the following signature: ... public static String getDescription()"

11:19 (on the WizardPage class)

11:20 AWizzArd: lpetit: if you want to use (deftype LpetitOutputStream ...) then your deftype will not be a java.io.Outputstream.

11:20 lpetit: Kototama: the first possibility is really not an option for you ? "Pass an array of already instantiated WizardPages to createWizard(). Note that for large wizards, it is preferable to construct the panels on demand rather than at construction time."

11:20 AWizzArd: So, for issues like that, or like Kototama's it is sometimes required to do Java.

11:23 Kototama: lpetit: well maybe, i need to test

11:23 lpetit: AWizzard: sorry,maybe I didn't make my point clear. It was about whether micahmartin wanted (or not) to create datastructures that could play by clojure datastructure rules, so that they can be composed as other datastructures fearlessly.

11:23 Kototama: thanks

11:24 replaca_: rhickey: shall we look at autodoc for the new libraries?

11:24 defn: So I just read about the new contrib style

11:25 How will people with signed CAs be migrated over to the new system?

11:25 micahmartin: lpetit: I'd like very much to stick to clojure idioms. It seems to me that the atom/ref idea fits... I'm going do that path right now.

11:26 lpetit: autodoc ! autodoc !

11:26 Freenk: wow

11:26 replaca_: the masses demand it! :)

11:26 defn: riot!

11:27 Freenk: giving a typehint in function call made the call 3000 times faster

11:28 (defn f [#^String s] (println s)) <- do I also need to hint in the call to println?

11:31 G0SUB: Freenk: hints are only for Java method calls.

11:32 Freenk: really?

11:32 don't think so

11:32 I saw an example otherwise somewhere

11:32 G0SUB: Freenk: any counter-examples?

11:33 Freenk: in general, you shouldn't need hints if you are dealing with Clojure data structures and clojure functions.

11:33 Freenk: http://clj-me.cgrand.net/2010/06/10/primitive-types-support-for-fns-coming-to-a-clojure-branch-near-you/

11:33 but then I'm stuck with this huge performance gap

11:33 G0SUB: Freenk: that's for functions to return primitives.

11:33 Freenk: it's really really reall really really bad

11:34 here's another example

11:34 G0SUB: Freenk: right now, Clojure functions can't return primitives since they get boxed automatically.

11:36 Freenk: (time (dotimes [n 1000000] (.get #^rec rec1 :ll)))

11:36 "Elapsed time: 28.454599 msecs"

11:36 (time (dotimes [n 1000000] (.get rec1 :ll)))

11:36 "Elapsed time: 3290.01511 msecs"

11:36 G0SUB: Freenk: what's that .get method call?

11:36 Freenk: yeah well rec generate java

11:36 defrecord

11:37 G0SUB: Freenk: you can use (:ll rec1)

11:37 lpetit: replaca_: masses, masses, I'm not *that* big ! :)

11:37 Freenk: interesting

11:38 (time (dotimes [n 1000000] (. #^rec rec1 :ll)))

11:38 "Elapsed time: 6.527401 msecs"

11:38 even faster

11:38 G0SUB: Freenk: what about (:ll rec1) ?

11:38 jk_: Freenk: what about without the type hint?

11:39 Freenk: 27 msec

11:39 for (:ll rec1)

11:39 so thats still 4 times faster

11:39 without type hint it's 5000 msecs

11:39 AWizzArd: That is understandable.

11:40 Freenk: it narrows down the use of language somewhat

11:40 AWizzArd: And hiredman mentioned some days ago, when I talked about this, that HotSpot may translate (:foo rec) to (.foo rec).

11:40 defn: haha LauJensen : Your "taking uncle bob to school" post is unparalleled.

11:41 AWizzArd: Freenk: but (.foo ^Rec rec) should be the same as (.get ^Rec rec :foo), yes?

11:41 Freenk: (:foo rec) <=> (.get :foo rec with typehint)

11:41 let's see

11:42 nope

11:42 G0SUB: Freenk: what kind of software do you want to build with Clojure?

11:42 lpetit: defn: well, at least Uncle Bob's version is working correctly :-p

11:42 Freenk: actually the .foo version with typehind is the same as (. ^Rec rec foo)

11:42 6 msec

11:43 defn: lpetit: oh he broke it? :)

11:43 lpetit: ,(macroexpand-1 '(.toString ""))

11:43 clojurebot: (. "" toString)

11:43 lpetit: Freenk: ^^

11:43 Freenk: clearly

11:43 macros take time

11:43 :P

11:44 AWizzArd: Freenk: yes, this is what I meant. The (.field ^Type obj) accessor is the most efficient.

11:44 G0SUB: Freenk: nope. macros are expanded once at compile time.

11:44 Freenk: what kind of software? I was evaluating it

11:44 seems to be like perl or Ruby

11:44 sorry not perl

11:44 G0SUB: Freenk: really? Interesting.

11:44 Freenk: python

11:45 and by that I mean mostly useful for IO and DB bound software

11:45 lpetit: defn: well, Lau was too smart in some areas ... : replaced (defn- plus-key? [c] (or (= \+ c) (= \= c))) by #(= \+ %) for example

11:45 Raynes: defn: Seems like he got a lot of heat for it though.

11:45 G0SUB: Freenk: what about concurrency?

11:45 Raynes: Of course, I agree. Excellent post.

11:45 Freenk: if you use IO and databases you can usually take the performance hit on the order of a few dozens

11:46 lpetit: Freenk: "take time" as in "time to learn" ? If not, then G0SUB is right, macros take no runtime time !

11:46 Freenk: you'll need concurrency because the java app outpaces you on singlecore

11:47 defn: Raynes: for what?

11:47 G0SUB: Freenk: what about correctness of your code?

11:47 Raynes: defn: That blog post.

11:47 Freenk: java got generally useful when they got the performance down below the factor of 2 compared to C

11:48 and it's still not used for performance critical things like games

11:48 defn: Raynes: oh geez -- Uncle Bob's ego is massive. I was happy to see the post.

11:48 AWizzArd: Freenk: Java is not used for games?

11:48 Raynes: defn: No, it wasn't Uncle Bob.

11:48 fliebel: Freenk: Minecraft :D

11:48 Freenk: dynamically typed languages never seriously got past the "I can do websites and DB queries" apps

11:49 Raynes: defn: I don't think Lau disclosed who he got heat from.

11:49 defn: Uncle Bob was apparently happy about it.

11:49 defn: Raynes: oh... *shrug*

11:49 yeah it's good to have dialog

11:49 Freenk: lol yeah I don't think I've ever played a single java game

11:49 defn: learn from mistakes and all of that

11:49 Freenk: minecraft has some leet graphics

11:49 defn: it's like remote pair programming or something

11:49 G0SUB: Freenk: what about Erlang?

11:49 Freenk: don't know about Erlang

11:49 defn: time lapse remote pair programming

11:49 aka feedback

11:49 AWizzArd: Freenk: what about Poisonvill? http://www.youtube.com/watch?v=XSfR5Q6KBBw&fmt=22

11:50 This is written in Java, but could in principle be done with Clojure.

11:50 djpowell: interesting experiment: hack LockingTransaction to always retry transactions 5 times before continuing, then try to run the tests.

11:51 Freenk: doubt it AWizzArd

11:51 djpowell: (hint: it fails)

11:51 Freenk: only if you type hinted every call

11:51 and even then

11:51 ask game developers

11:51 nobody seems to pick java for some reason, they all pick C++

11:52 they must have their reasons

11:52 AWizzArd: Freenk: they typically prefer C++ as this still offers the best speed.

11:52 For many it does not matter that Java is fast enough. They want the fastest.

11:52 Freenk: right...as I said

11:52 djpowell: there is an interesting presentation about alternative languages for gamedev, hang on...

11:52 Freenk: 40% is 40%

11:53 steven_t: scala vs clojure.. go!

11:53 Freenk: dynamically typed languages with their 3x to 500x slowdowns stand no chance at all

11:53 AWizzArd: http://bytonic.de/html/benchmarks.html looks more like 20%

11:53 djpowell: http://groups.csail.mit.edu/cag/crg/papers/sweeney06games.pdf

11:54 lpetit: I found Lau's article a little bit unfair: more a matter of style than anything else. Letting closing parens not together, really, who cares ? Using refs before atoms ? Better than premature optimization with atoms and then subtle problems. Using condp over cond. Why not, but not general enough for the problem, and introduced a bug just to make a point ...

11:54 Raynes: http://blog.acidrayne.net/?p=12 My first Clojure Conj blog post. Probably kicking off a short series documenting my trip.

11:54 lpetit: The last point on dynamicity I liked, though, because I myself tend to not think like this, and it's refreshing to be reminded of that :-)

11:55 AWizzArd: Freenk: for game development with Java/Clojure have a look at http://www.jmonkeyengine.com/

11:57 TobiasRaeder: @Raynes is there an atom feed to the blog?

11:57 Raynes: Um, I'm not sure. I haven't had it long.

11:57 TobiasRaeder: k :)

11:57 Raynes: Probably isn't hard to add one with a plugin or something. I'll check it out in a few.

11:58 lrenn: TobiasRaeder: http://blog.acidrayne.net/?feed=atom

11:58 Raynes: Oh really? Hrm.

11:58 Protip: Learn about wordpress before using wordpress. ;)

11:58 TobiasRaeder: thx

11:59 hugod: would anyone have a stable-sort?

11:59 lrenn: Raynes: rhickey's hair _is_ pretty amazing...

11:59 djpowell: (summary of that gamedev link, it suggested that constantly manipulating mutable object graphs pretty much confines them to single threading, as multithreading would be a deadlock-fest - so the author suggests STM as an alternative; and for heavy mathematical calculations suggests a more functional language would lead to less bugs)

11:59 Raynes: It certainly is.

11:59 Kruppe: Raynes: heh, learning by doing is also a pro technique though

12:00 LauJensen: defn: Unparalleled?

12:00 lpetit: honestly you dont know what you're talking about

12:01 lpetit: LauJensen: maybe, those things happen :)

12:01 LauJensen: Though it seems like Uncle Bob was the only one who liked that post

12:01 lpetit: LauJensen: I'm trying to be arrogant, today ... seems like I've been unsubconscioulsy influenced by some sentences :-p

12:02 LauJensen: oh really ? Why the only one ?

12:02 LauJensen: lpetit: keep it up and I'll award you a fist fight

12:03 lpetit: Well. Uncle Bob thanked me for it and liked the tips. A lot of other people started crying that public code reviews where poor style and that Bob deserved more respect. They must have missed the fact that he publicly asked for it

12:03 defn: LauJensen: exceptional

12:03 esj: LauJensen, lpetit: are you two brothers or something ?

12:03 LauJensen: haha

12:03 Raynes: LauJensen: For what it's worth, I enjoyed the post.

12:03 <3

12:03 LauJensen: Raynes: Thats nice, my one loyal fan :)

12:03 defn: yeah i liked it, not sure what people are whining about

12:04 lpetit: LauJensen: I was not aware of the heat. And I've honestly said how I feeled when I read the post. That's all. And I'm not responsible for the "heat".

12:04 defn: it's a good post demonstrating clojure idioms

12:04 LauJensen: Thanks

12:04 Gotta go eat now, have a good evening everyone :)

12:04 defn: you too lau, cheers

12:04 lpetit: cu

12:04 bro ;)

12:07 Freenk: djpowell I read it

12:08 but know this...while mutating object confines them to single thread

12:08 changing non-mutable objects creates strong slowdowns

12:08 and I'm not just talking about pure cost of copy

12:08 but also in object alocations

12:09 Bahman: Hi all!

12:09 Freenk: you need to alocate tree nodes to wrap the objects you insert into lists

12:09 with ArrayList, you only insert reference into array

12:10 rhickey: replaca_: yes, we should get together a plan for that

12:10 * hugod notices core/sort uses java.util.Arrays/sort is therefore a stable sort

12:19 replaca_: rhickey: ok, shouldn't be too hard. I'll need the github hooks, of course

12:20 rhickey: probably, it's going to wait until after conj before it's operational - I'm still fine-tuning my preso.

12:21 rhickey: replaca_: sounds sensible

12:35 ivey: Any google group admins around that can approve my membership?

12:40 rhickey: ivey: done

12:40 ivey: Cool. Thanks!

12:43 G0SUB: rhickey: can you kindly approve my membership request to clojure dev group? my email is b.ghose at gmail.com

13:05 ivey: rhickey: how soon is the contrib assembla -> something else change?

13:18 reburg: wrapping up a java lib that takes a byte[] as a parameter... is there a more idiomatic clojure thing that should be wrapped in?

13:21 cemerick: reburg: nope, byte arrays are what they are :-)

13:21 unless the data involved is *actually* a string or someting

13:21 But that's pretty rare.

13:21 reburg: cemerick: figured. it's the payload for an http request, so it makes sense.

13:22 chouser: or a vector of bytes, perhaps

13:36 Drakeson: is *out* not dynamic?

13:37 AWizzArd: :)

13:37 Drakeson: do you use a fresh clojure.jar?

13:38 Drakeson: AWizzArd: would I care otherwise? ;)

13:38 Raynes: MayDaniel: That ->_ macro is neat.

13:39 It reminds me of frying (I think) in Factor.

13:40 AWizzArd: Drakeson: it is possible that some vars are not defdynamics yet.

13:40 leifw: ,(doc ->_)

13:40 clojurebot: It's greek to me.

13:41 Raynes: leifw: http://github.com/MayDaniel/cljandbox/blob/master/src/cljandbox.clj#L7

13:41 leifw: sexy

13:42 cemerick: There's a much more common name for macros like ->_, but I can't think of it.

13:43 leifw: that's how I always wanted -> to work :)

13:45 cemerick: There's a lot of history around people pushing for such a thing. It's never gotten much traction.

13:47 raek: what is this defdynamic I hear people mention?

13:48 AWizzArd: raek: like def, but it allows a var to be bound in a (binding [your-deftynamic-here 123] ...)

13:49 Raynes: Whoa, you have to explicitly make vars dynamic now?

13:50 pieterbreed: Hi everyone, sorry for barging in like this, I'm looking for help with clojure-couchdb, specifically (attachment-create). Is this a good place to ask for help?

13:50 ohpauleez: Raynes: yeah, but it's a good idea

13:50 because more often than not, you don't want them dynamic, and these changes setup for huge optimizations

13:51 Raynes: ohpauleez: I think it's neat. But still: whoachanges

13:51 raek: I could live with that.

13:51 ohpauleez: for sure

13:51 raek: the mock people will cry

13:51 cemerick: raek: they've been mollified, so I hear

13:51 ohpauleez: raek: There's already a plan for that

13:52 cemerick: pieterbreed: don't know anything about clojure-couchdb. I could help if you were using clutch. *shrug* :-)

13:52 AWizzArd: In principle it should not be a too big change when the compiler tells us where the problems are. Only thing is that a few vars might have been forgotten in those first versions of it :)

13:52 raek: but for me, I guess I'l just have to change all (def *var-with-earmuffs* ...)s into (defdynamic *var-with-earmuffs* ...)s

13:52 so, since which version does this apply?

13:53 pieterbreed: cemerick: I'm taking the plunge with clojure and I have a hella lot to learn all at once for a project I'm tackling... I just don't know what I don't know that causes my stuff to fail

13:53 AWizzArd: What is this thing about earmuffs?

13:53 I thought those are things that protect your ears from too loud sound.

13:54 raek: the asterisks

13:54 cemerick: pieterbreed: Understood. Feel free to paste exceptions or whatever, but I don't know of any clojure-couchdb users here. Maybe yours is a purely clojure-related issue.

13:54 chouser: indeed. and also protect your var from being static

13:54 cemerick: Or perhaps there's a clojure-couchdb list somewhere.

13:55 pieterbreed: For full disclosure, I'm a committer on http://github.com/ashafa/clutch

13:55 * raek puts on his dynamism earmuffs

13:55 * cemerick almost sent a message with disclosure spelled 'disclojure' :-/

13:55 pieterbreed: no exceptions, I'm just not seeing the data in the db as what I'm expecting... I'l look around some more, but thanks! :)

13:56 tbatchelli_: cemeric, my fault :(

13:56 AWizzArd: raek: but what vars, besides those in let and constants are *not* within asteriks?

13:56 * raek *

13:56 cemerick: tbatchelli_: Hey, that's the way it goes. :-)

13:57 raek: well, functions

13:57 cemerick: tbatchelli_: I think it's a phonetic tendency, rather than a simple familiarity with disclojure

13:57 raek: I got my view from here: http://www.assembla.com/wiki/show/clojure/Clojure_Library_Coding_Standards

13:57 Yeanno: hi, I wonder about how to develop clojure applications. The only IDE that provides a standard compile-and-run is enclojure - which I've used up until now because of this. I understand how to use a repl but I don't understand how to develop a complete (swing-)application like this? what am I missing?

13:57 raek: it mentions the *earmuff* thingy

13:57 AWizzArd: For one moment I thought there were vars that you def’ed which don’t have the *

13:58 tbatchelli_: cemerick, ah, then it is rhickey's fault :)

13:58 raek: AWizzArd: I guess you disregard defns from that?

13:58 ohpauleez: raek: There was talk about auto dynamisizing (I made that word up) when you see earmuffs, but I think that was abandoned

13:58 and that change went in sometime in the past three days

13:58 cemerick: tbatchelli_: sssshhh, that might be the straw that breaks rhickey's back ;-) ;-) ;-)

13:59 auto dynamisizing is there AFAIK, but will be removed before release

14:00 ohpauleez: cemerick: Ahh, thanks for the correction

14:01 tbatchelli_: Is there a way to call a java method from the method name as a string? (. (symbol "toString") "hello world") doesn't work

14:01 * ohpauleez needs to get his CA in so he can start cutting things over to contrib

14:01 AWizzArd: raek: yes the mention of “def” made me think you were talking about those, and not defns.

14:01 raek: oh, yeah. now I see.

14:01 ohpauleez: tbatchelli_: You can use standard java reflection

14:01 cemerick: wooby: hey, are we a go for having a "sign & submit your CA here" table at the conj?

14:01 ohpauleez: I don't know about built in clojure stuff

14:02 raek: I was thinking about vars in general, but what I wrote did non reflect that...

14:02 cemerick: tbatchelli_: clojure.lang.Reflector is handy

14:02 tbatchelli_: ohpauleez: that was plan B. Wondering if there was a plan A

14:02 AWizzArd: raek: and why would you change all earmuffers to defdynamic vs. just those 2-3 that are realy supposed to be rebound?

14:02 tbatchelli_: ohpauleez, cemerick: reflection it is then!

14:03 ohpauleez: use cemerick's suggestion, that's a good idea. Makes things feel much more natural

14:03 raek: I thought the convention was to only put earmuffs on the vars that was supposed to be rebound...

14:03 Raynes: Some people seem to use it for globals though.

14:04 I'm not one of them.

14:04 ohpauleez: tbatchelli_: or else you end up with something like: (.getMethod Cassandra$Client method# (into-array Class (map type args#)))

14:04 in a macro or fn

14:04 raek: I think the set of vars that are neither constants nor intendet to be rebound is very small, anyway

14:08 AWizzArd: in my experience, those 2-3 vars were all the earmuffed... :-)

14:09 AWizzArd: I did not want to sound too critical, I was just curious.

14:10 Typically I have 10% of all defs that need to become defdynamic

14:10 ylando: hello

14:10 raek: I understand... I just wanted to sound less ignorant

14:12 now back to studying LR parsing...

14:12 Raynes: raek: http://acidrayne.net/logs/irc.freenode.net/clojure/current.txt sexpbot can log now. Let that be motivation to complete timeouts in Irclj. :>

14:29 tbatchelli_: cemerick, ohpauleez: following up. this seems to work (defmacro method-call [object method-name & params] (let [method-symbol (symbol method-name)] `(. ~object ~method-symbol ~@params)))

14:30 e.g. (method-call "hello" "concat" " world!") -> "hello world!"

14:31 klang: I'll just let this http://gosu-lang.org/comparison.shtml sit here for a moment ..

14:31 chouser: tbatchelli_: only when you give a literal string in the macro form

14:32 cemerick: klang: You're just a rabble-rouser. :-)

14:32 jkkramer: "not lisp"...nice

14:32 tbatchelli_: chouser: you're right :(

14:33 kotarak: Hmmm... Is "modifying existing types" called "monkey-patching"?

14:33 cemerick: tbatchelli_: If you're in runtime land, reflection is your only friend -- or, eval, which may be more or less evil, depending on the case.

14:34 * tbatchelli_ admitting defeat on this one

14:34 chouser: tbatchelli_: I wrote a longish stack overflow answer about this

14:35 ohpauleez: tbatchelli_: See my macro above, if you want to roll your own

14:35 klang: cemerick: .. fair enof. The "not lisp" just caught my eye there :-)

14:35 ohpauleez: but I suggest you just use the clojure.lang.Reflector call

14:35 it does exactly what you want

14:36 _fogus: klang: The Not Lisp column is the best part. :-)

14:36 cemerick: klang: indeed...quite funny :-D

14:36 kryft: Not lisp where?

14:37 lrenn: I like how they say "solid tooling support" but none of the links, including the download work.

14:37 cemerick: There's no not lisp here! Run!!

14:37 lrenn: I'm pretty sure it's all very tongue-in-cheek.

14:38 talios linked to the author's slides from the jvm language conf, I presume it's real

14:39 klang: _fogus: I guess we have to welcome all new languages to the JVM .. makes the ecosystem stronger.

14:39 technomancy: gosu was going to be presented at the emerging langs conf, but they couldn't make it

14:40 * dnolen mmm, wants Qi's sequent calculus types in Clojure

14:40 cemerick: Bummer. That "not lisp" feature sounds killer.

14:41 ohpauleez: dnolen: I'm thinking the new contrib would be a good destination

14:41 jump on it!

14:41 dnolen: ohpauleez: haha I got a lot of reading to do.

14:42 ohpauleez: :)

14:43 kryft: Oh, I guess I could read the backlog a bit further.

14:43 Or sleep at night, hmm.

14:43 * _fogus wishes Clojure had more of those not-Lisp features

14:44 _fogus: dnolen: The Qi book shows how to implement it (I think)

14:44 chouser: tbatchelli_: this is related and might help: http://stackoverflow.com/questions/3748559/clojure-creating-new-instance-from-string-class-name/3752276#3752276

14:44 kryft: I ended up reading "Lisp is not an acceptable lisp"

14:44 http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptable-lisp.html

14:44 tbatchelli_: chouser: thanks, I couldn't find it!

14:45 chouser: tbatchelli_: yeah, me either. I ended up going through my profile :-/

14:47 * kotarak has no humor it seems.

14:57 jweiss: technomancy: i am using the latest version of slime (2010-10-09) because it works better with sbcl, but now when i run slime-connect to a lein swank process, i get the user prompt, if i type "(+ 1 1)<enter>" nothing happens.

14:57 the point goes to the next line and just sits there

14:58 technomancy: jweiss: yes, trunk slime breaks frequently

14:58 jweiss: technomancy: what version of slime should i try?

14:58 technomancy: I don't have time to follow it closely myself

14:58 20100404 is the supported one

14:59 jweiss: ah ok

14:59 _fogus: kotarak: Try writing a book... it does wonders for your sense of humor. ;-)

15:00 amalloy: but you often catch some kind of footnote disease

15:01 kotarak: _fogus: I have a lot of humor at work: Galgenhumor. (roughly: gallows humour) I hope the book one would be different. :]

15:02 _fogus: kotarak: Gallows humor helps a ton.

15:03 cemerick: amalloy: I've got the beginnings of that. It's not pretty. :-P

15:07 _fogus: amalloy: I suffering from massive footnote disease

15:07 amalloy: _fogus: i had you in mind when i said it :)

15:08 _fogus: amalloy: I make no apologies! I have a blog post in the works that is 5 words with a 7-page footnote. ;-)

15:08 amalloy: and i will enjoy reading it!

15:10 Raynes: _fogus: I aspire to be. Unfortunately, markdown doesn't have built in footnote syntax, so you have to drop to html to make psudofootnotes in stackoverflow.com answers.

15:19 petrilli: _fogus: That sounds like the average page of some of my college textbooks.

15:23 The web truly needs better footnoting and bibliographies

15:29 jweiss: is there a functional way to take a seq and have some input rows map to multiple output rows?

15:29 amalloy: jweiss: rows?

15:29 jweiss: s/rows/list items/

15:29 sexpbot: <jweiss> is there a functional way to take a seq and have some input list items map to multiple output list items?

15:29 jweiss: sorry

15:29 chouser: mapcat

15:30 * raek throws away his line of text

15:30 amalloy: yeah. make every list item map to a seq of items, and glue them together however you want

15:31 raek: (aaply concat (mapcat f coll)) ; seems to be a common pattern

15:31 *apply

15:32 of waut

15:32 chouser: really?

15:32 raek: /facedesk

15:32 chouser: ,(mapcat #(list % (inc %)) [2 4 6 8])

15:32 clojurebot: (2 3 4 5 6 7 8 9)

15:32 raek: more like (defn mapcat [f coll] (apply concat (map f coll)))

15:32 chouser: raek: ah, that's better. ;-)

15:35 amalloy: fwiw raek, (apply concat (map f coll)) is a common antipattern i keep accidentally putting in my code

15:37 raek: I have had a similar experience with (map (fn [x] ...) coll) --> (for [x coll] ...)

15:37 cemerick: "store" is an actual project name?

15:38 chouser: raek: I tend to flip back and forth on that one

15:38 raek: and become vaguely annoyed the format of the code is so different between the two

15:39 raek: for large function bodies, the latter tend to be a lot easier to indent in a pretty way

15:54 zmyrgel: hi, could someone point whats wrong with my ns definition, http://pastebin.com/jScdHnmQ

15:56 amalloy: (:use (tursas game move state0x88))

15:56 () and [] have different semantics in (ns) forms and i don't really know what they are, but i think this form works

15:58 raek: zmyrgel: I think your code should work. I only got a "Could not locate tursas/game__init.class..." error, which suggests that the ns macro accepts the syntax. are you sure there error is not in another ns form?

15:59 also, you don't need them wrapped vectors if you don't pass any options

16:01 I vagely recall that the error file and line number is for the first ns form evaled, and not for the ns form where the error actually happened

16:01 zmyrgel: nice

16:05 astoddard: This may not even be a sensible question but is there anything like 'pfor' in place of "for in the same way "pmap" can be used in place of "map"?

16:05 raek: zmyrgel: maybe the original exception is in the cause of the one you see

16:05 zmyrgel: if you use emacs with slime, you can press 1 in the exception buffer

16:06 chouser: astoddard: perfectly sensible question. the answer is "no"

16:07 zmyrgel: raek: I'm using emacs but I don't know how to trigger the error in it

16:08 raek: are you using slime?

16:08 zmyrgel: yeah

16:08 lein swank + M-x slime-connect

16:08 raek: great. do a C-c C-k in the buffer you wish to evaluate

16:08 that compiles the file

16:09 then a new buffer should pop up with the stack trace

16:09 (well, actually "compile" means (require 'the-ns :reload) in this case)

16:10 zmyrgel: raek: just got slime-compile buffer with just the error message and it points to the ns form

16:10 nickik: Strg Alt X on something and you throw an error too

16:11 raek: zmyrgel: ok, then click on the cause line, or press 1

16:11 nickik: german keyboard?

16:11 nickik: yes

16:12 zmyrgel: raek: 1 gives buffer read-only error and clicking the error line gives me the state:1 as in the pastebin

16:13 astoddard: chouser: Thanks. I have some expensive calculations over product of two sets of inputs. I'll try a pmap over the second variable inside a for over the first variable.

16:13 over _the_ product.

16:15 raek: zmyrgel: sorry, the C-c C-k commands gives a different exception dialog that doing a M-C-x on the ns form...

16:16 but when I edited the ns form in b.clj to contain an error, and then doing C-k C-k in a.clj (which uses b.clj), the error is reported to happen in b.clj

16:30 bartj: has anyone here used Mallet (Java MachineLearning library)?

16:59 plathrop: lancepantz: you around?

16:59 Raynes: Is it a cake question?

17:00 plathrop: No, it's a yaml question. I've got to parse some yaml that is getting output by a ruby application and I can't figure out how to do it.

17:00 His library is failing on me because the stuff is tagged as a ruby object

17:00 Raynes: Oh

18:02 defn: i have a hare-brained scheme

18:03 chouser: can't be worse that the one I just came up with. What's yours?

18:03 defn: I want to read in a file that looks like [(ns foo.bar (:require foo.xyz)) [:html [:body]]]

18:04 and then eval everything at the front of the collection

18:04 so a user can define a namespace for functions to exist in which apply to this specific template

18:04 Once: I was thinking of something like that yesterday.

18:04 defn: am i missing some underlying complexity, or does this actually work?

18:04 Once: Using hiccup

18:05 defn: Once: I beat you to it! wahahaha!

18:05 Once: I didn't get around to trying it.

18:05 I was just thinking about it.

18:08 defn: I don't know if it's a Good Idea(tm)

18:09 the whole namespace changing thing is a little funky

18:10 chouser: you want to change namespaces more than once in the same file?

18:11 jjido: how do you expand a macro?

18:11 Once: macroexpand

18:11 raek: jjido: (macroexpand-1 '(code...)) or (macroexpand '(code...))

18:11 jjido: aah there is no dash

18:12 raek: ,(macroexpand-1 '(cond (even? x) :even (odd? x) :odd))

18:12 clojurebot: (if (even? x) :even (clojure.core/cond (odd? x) :odd))

18:15 rhickey: so, who would be crushed if you couldn't mix doubles and longs in primitive sigs?

18:15 just longs + objects or doubles + objects

18:17 dnolen: rhickey: it does seem like a weird limitation. hmm wonder if that would cause trouble in some kind of accumulation scenario.

18:21 chouser: I agree it feels weird. I'm guessing this is to support primitive args for closures?

18:22 rhickey: yeah, supporting 4 args with both is about 360 interfaces

18:22 less than half that is discrete

18:22 I still don't know yet what the cost is for the interfaces

18:23 if discrete

18:24 jjido: do you use Java to get a file Reader or is it in Clojure already?

18:25 ossareh: ,(doc slurp)

18:25 clojurebot: "([f & opts]); Reads the file named by f using the encoding enc into a string and returns it."

18:25 raek: jjido: you can use clojure.java.io/reader

18:26 jjido: ossareh: I cannot use a String, or else I need a string reader

18:26 raek: rhickey: any ideas why all the docs on http://clojure.github.com/clojure/ seems to be for 1.1?

18:26 ossareh: jjido: my bad, I read "read a file"

18:26 jjido: ossareh: np

18:27 raek: ...or maybe I should bug Tom Faulhaber about that instead...

18:29 technomancy: the slurp docstring needs updating; it takes more than just filename args now

18:32 raek: I love that new BufferedReader(new InputStreamReader(new FileInputStream(filename), "UTF-8")) translates to (clojure.java.io/reader filename)...

18:42 jjido: how can I tell the filenames passed to the program as arguments?

18:43 *command-line-args*

18:45 raek: jjido: if the program is started with a gen-class'ed main method, then the arguents are passed as the arguments to -main. if the program is started with clojure.main, they are put in *command-line-args*

18:47 so it depends on whether you run it as a class (main method) or a script (clojure.main)

18:49 gfrlog: does anyone know if I can use the magical new type system to make (sort) respond to a seq of sets?

18:50 ,(sort [#{1 3} #{3 2}])

18:50 clojurebot: java.lang.RuntimeException: java.lang.ClassCastException: clojure.lang.PersistentHashSet cannot be cast to java.lang.Comparable

18:51 jjido: raek: thanks. I do not do ahead-of-time

18:51 gfrlog: ooh, I can't sort maps either

18:52 I guess I spent too much time in erlang

18:53 jjido: Looks like I need a single Reader that chains the files together

18:54 hiredman: http://download.oracle.com/javase/1.4.2/docs/api/java/io/SequenceInputStream.html

18:59 jjido: hiredman: cool!

19:01 ,(doc reduce)

19:01 clojurebot: "; "

19:02 rhickey: ok, only 10k more jar for the ~360 interfaces needed for all L/D/O combinations to arity 4

19:02 * rhickey writes Java with Clojure

19:03 zkim: rhickey: you getting a chuck norris thing going here? :)

19:04 rhickey: zkim: what does that mean?

19:05 zkim: rhickey: like "chuck norris turns off the sun at night" http://www.chucknorrisfacts.com/

19:05 rhickey: ah

19:06 no

19:09 octe: how do i access an inner class in clojure?

19:09 like proxying java.lang.Thread.UncaughtExceptionHandler

19:10 ah, Thread$UncaughtExceptionHandler

19:16 polypus: add-watch allows references to be mutated between the mutation that causes a watch to be called and the calling of that watch. is there a way of ensuring that some side effect inducing function is called iff a ref is succesfully mutated w/o allowing any "in between" mutations?

19:52 clizzin: How can I run 'lein swank' but allocate more memory for the JVM?

19:53 zkim: clizzin: I believe lein picks up JAVA_OPTS

19:54 clizzin: zkim: ah, cool. thanks!

19:54 zkim: clizzin: np

19:56 maravillas: gary_poster: are you around?

19:56 rickmode: Are there some good guidelines for using dynamic binding? I'm building some web form validation, and am trying to figure out where to put a keys to field name map (like {:username "Username, :password "Password"}). This name map would be used through many functions in a nested call tree

19:57 hiredman: don't

19:57 rickmode: So I could have a *name-map* and use a binding... but... it feels odd

19:58 hiredman: thanks... heh

19:58 Is there any other clever way to pass a chunk of data through many levels of a call tree short of ... actually passing it around?

20:00 dnolen: rickmode: that's what binding is for.

20:05 hiredman: rickmode: they're called monads

20:07 amalloy: yeah, i was gonna volunteer monads except that i have no actual experience with them

20:09 rickmode: hiredman: trying to grok. I looked at monads over a year ago when I got into Scala. I'm reading up....

20:16 amalloy: rickmode: i've been trying on-and-off for a month or so. i think i get the idea but i haven't found an excuse to use any yet

20:17 http://intensivesystems.net/tutorials/monads_101.html was the best description i could find

20:17 rickmode: amalloy: i'm reading the on clojure version at the moment: http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/

20:18 amalloy: yeah, i read that but it was too short. i liked the painstaking detail in the other

20:18 ivey: technomancy: i'm going to the beach for a few days, and have some hack time. you still have low-hanging lein fruit?

20:18 rickmode: when I was poking around with common lisp back in February or so (before I gave up on it and moved to Clojure), I was trying to wrap my head around continuations. I ... almost got it. But then I barely get the Y Combinator. Those are the sort of things that I have to learn and actively use a while before they sink in.

20:19 amalloy: heh, that's about when i was giving up on trying CL too

20:19 technomancy: ivey: if you have any mixed java/clj projects you could test and document the new javac task

20:20 ivey: sadly for you, and joyously for me, i do not.

20:20 technomancy: hehe

20:20 ivey: I'd like to get more eyes on http://github.com/trptcolin/lein-plugin and merge it into leiningen if it's ready

20:21 dnolen: rickmode: Little Schemer seems to be an excellent intro to Y so far. Seasoned Schemer covers call/cc. Fun books. Looking forward to digging into the Reasoned Schemer.

20:21 ivey: that i can do.

20:22 technomancy: ivey: also (not sure how hard this would be) a way to enable offline mode would be nice. might take some diving into the maven-ant-tasks API. haven't looked into it much myself.

20:22 thanks!

20:22 DeusExPikachu: is clojure.java.* going to be added back into core? anyone know why it was removed?

20:22 rlb: To answer my question from yesterday -- for large xml files, xml-picker-seq seems to work well (and lazy-xml doesn't).

20:24 rickmode: dnolen: ya - read little schemer and have seasoned schemer on my "to read" shelf. I'm working through "on lisp" first though. I like how little schemer when from trivial to complicated to mind blowing in the last few chapters.

20:27 dnolen: rickmode: the chapter on continuations in On Lisp is good, there was an excellent PDF out on the web as well, but I can't find it anymore.

20:45 yayitswei: as a newbie I often accidently overwrite existing methods and get "WARNING: deref already refers to: #'clojure.core/deref in namespace: tracker.core, being replaced by: #'tracker.core/deref"

20:45 is there a way to undo this? something like (def deref 'clojure.core/deref) ?

20:46 rickmode: yayitswei: ns-unmap

20:46 yayitswei: ,(doc ns-unmap)

20:46 clojurebot: "([ns sym]); Removes the mappings for the symbol from the namespace."

20:47 yayitswei: rickmode: perfect. thanks!

20:48 rickmode: yayitswei: np... I had the same problem at first... when picking names these days I sometimes to put the name into the REPL and make sure it bombs. That at least makes sure is the collision isn't accidental.

20:49 yayitswei: that makes sense

20:51 somewhat unrelated, but I just found a way to get rid of the "Fontifying *SLIME Compilation*" message every time I run C-c C-k in SLIME, for the longest time I thought the compilation was slow (http://common-lisp.net/pipermail/slime-devel/2009-September/016717.html)

20:51 this should go on the "tips for newbies" list

21:02 rickmode: yayitswei: nice!

21:38 _Vi: http://clojure.org/compilation says that "To speed up application startup".

21:38 Why my application starts more that 2 seconds in both cases? I don't see any visible startup speed benefit.

21:39 tomoj: _Vi: do you see class files for your code in classes/ ?

21:39 _Vi: tomoj, Yes. I start as "java -cp classes:/usr/share/java/jsch.jar:/usr/share/java/clojure.jar jscfi__init"

21:50 [reposting due to netslits] tomoj, Yes. I start as "java -cp classes:/usr/share/java/jsch.jar:/usr/share/java/clojure.jar jscfi__init"

21:51 chouser: you'd see the biggest difference if you had a large amount of .clj source code

21:51 _Vi: chouser, Is there a way to speed up startup of little clojure applications?

21:52 chouser: _Vi: the only say to get anything close to "fast" that I know of is to have a JVM running already, and ask it to run your code

21:52 there are a couple ways to do this. probably the easiest is to use cake

21:52 _Vi: Can we keep a pool of pre-loaded JVMs with clojures?

21:53 eslick: Anyone online who has used clojure with Hadoop?

21:53 chouser: I think cake keeps one or two loaded for you

21:53 _Vi: (I've tried ng-sever, but applications misbehave there)

21:54 chouser: eslick: I just learned about Cascalog last week. Sounds really interesting, but I haven't had a chance to play with it yet.

21:56 _Vi: What is "cake"? Is it JVM thing or Clojure one?

21:56 (google give many tasty cakes, but not one I want)

21:56 *gives

22:02 maravillas: _Vi: clojure - see http://github.com/ninjudd/cake

Logging service provided by n01se.net