#clojure log - Feb 19 2010

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

0:22 konr: Any idea for a project name (related with money) better than coinj?

0:24 currenjy, haha

0:31 TheBusby: konr: I'm doing some automated trading stuff why?

0:33 konr: TheBusby: Do you do it as a side project or commercially? Do you use open-source software? I'm interested in finding out how much time it consumes

0:34 TheBusby: for fun, trying to start an "automated stock trading fastasy league" with some friends

0:34 rewriting a bunch of it in clojure now, time=(results you want)

0:35 and a lot of conditions deal with frequency/time-delay

0:35 konr: TheBusby: hmm, is it open source? can I take a look?

0:35 TheBusby: unfortunately most it is in ruby now,

0:35 if I clean up some clojure code I'll post it though

0:37 if you're in a hurry, I'd take a quick look at the google financial web-api

0:37 and write some clojure wrappers on top of that (what I'm just starting now)

0:37 danlarkin: hiredman: On the phone you mentioned your clojure reader and another impl, whose was that again?

0:38 konr: interesting... I've got a couple of friends that are writing investment programs as their main jobs, so I guess it must be pretty lucrative

0:39 TheBusby: most of the professional stuff I've heard about is all high-frequency

0:40 I've heard of people, in articles, doing it out of their house though

0:41 my favorite quote though "you only have to be right 51% of the time" (if you have enough volume)

0:41 lots and lots and lots of horror stories though, but I think most companies keep them under wraps

0:42 konr: hahaha, this whole trading thing sounds very exciting

0:42 I'll keep you informed if I write something relevant

0:43 TheBusby: I'll ping you if the league comes together too

0:43 the idea is for everything to be open source and to share

0:44 you'll want to get your api together quickly though so you can have a history to run any trading logic over. I also recommend taking a look at ESPER (http://esper.codehaus.org/) for adding CEP

0:47 konr: Thanks! I'll check it out!

0:48 TheBusby: if you find more people interested, please contant me and we may have enough to get a league going

0:49 slyphon: is there a way to treat a blocking queue as a seq?

1:24 hiredman: danlarkin: Chousuke's

1:26 danlarkin: hiredman: excellent, thanks

1:30 lancepantz: is there a function that will allow me to see if a var is bound without throwing an exception?

1:33 hiredman: lancepantz: :( why?

1:34 devinus: is clojure-install deprecated ?

1:35 lancepantz: well, i'm coming from ruby, so i'm probably doing something wrong, but i'd like to do something like this: (def env (or env (System/getenv "APP_ENV") "development")))

1:36 i guess i need a way to represent ||=

1:37 i'm reading in config file from yaml, and i want to use different values from it if i'm in a test

1:37 hiredman: why are you using yaml?

1:38 lancepantz: i want to read the same config files as a rails app

1:38 hiredman: and why don't you just do something like (def env (read-env))

1:39 lancepantz: read-env?

1:39 hiredman: you definitely don't want to use binding for a config

1:39 lancepantz: read-env is the function that reads in the env information

1:40 lancepantz: is that documented?

1:40 hiredman: lancepantz: you have to writ it

1:40 write

1:41 lancepantz: ah :)

1:41 hiredman: you aren't re-def'ing env in your code right?

1:41 (just making sure)

1:42 lancepantz: kinda, i was using different namespaces

1:43 clearly, i'm doing it wrong, i'm going to re-think my approach

1:43 hiredman: how is different namespaces like re-def'ing?

1:45 lancepantz: i was def'ing a var in a test.utils namespace, and defining the same var in a namespace in my app, but i wanted the app namespace to ignore it if it was already def'ed

1:45 which would occur only in my test

1:46 suppose i did rails too long

1:47 hiredman: you can't have the same var in multiple namespaces without a lot of jumping through hoops (and even it's more like you have a var in the other namespace pointing to the var in this namespace)

1:50 you must be using use or similar, which lets you refer vars from other namespaces without having to namespace qualify them

1:51 lancepantz: exactly

1:59 jcromartie: I want to automatically create some vars in a namespace

1:59 with a macro

2:00 but I can't get the macro syntax right

2:00 if I syntax-quote the body of the macro then it qualifies the symbols that I want to def

2:00 hiredman: why would you do that?

2:00 jcromartie: hiredman: why?

2:01 hiredman: because generally there are easier ways

2:01 jcromartie: because I want to create accessors for some resources

2:01 tomoj: have you written out the macro form you want and the form you want it to compile to?

2:01 jcromartie: basically I have a mongodb collection name and a struct definition, and I want to create find, find-one, create!, update!, and delete! functions

2:02 yeah I have written it out tomoj

2:03 I think I figured it out... I was being too liberal with syntax quoting

2:03 * slyphon still thinks future-cancelled? is darkly runny

2:03 slyphon: er

2:03 funny

2:04 jcromartie: heh

2:04 Future cancelled due to rain.

2:04 tomoj: I read that as "train"

2:04 :(

2:04 slyphon: :D

2:07 jcromartie: tomoj: are there any good macros you would recommend me to look at?

2:07 2AM I'm not thinking clearly

2:08 tomoj: huh?

2:09 ,def for

2:09 clojurebot: java.lang.Exception: Unable to resolve symbol: def in this context

2:09 tomoj: hmm

2:09 slyphon: can you destructure with a def?

2:09 tomoj: @def for

2:10 * slyphon tries

2:10 * slyphon sighs

2:10 tomoj: I don't think "destructure with a def" makes sense

2:11 slyphon: yeah, that's one i shouldn't have bothered asking out loud

2:12 tomoj: jcromartie: http://github.com/richhickey/clojure/blob/master/src/clj/clojure/core.clj#L3141

2:12 :P

2:12 just kidding

2:12 jcromartie: heh

2:12 at 2 AM

2:14 this is what I'm wrestling with http://gist.github.com/308514

2:15 TheBusby: are most of the folks here on the US west coast?

2:15 jcromartie: I don't understand why the resulting template is what it is

2:16 for instance (clojure.core/list coll)

2:16 hiredman: because you have a quote inside a quote

2:16 jcromartie: hmm

2:16 so should I just stick with syntax-quote?

2:17 oh, beautiful

2:17 ~'foo

2:17 clojurebot: It's greek to me.

2:17 jcromartie: that's what I need

2:19 now I just need to wire it up with compojure routes and I'm golden :)

2:28 tomoj: TheBusby: TX here

2:31 TheBusby: so mainly night owls it seems like then ;)

2:42 jcromartie: night owl... I wish

2:43 more like night slug

2:43 I'm not soaring that's for sure

2:54 zaphyr: hi folks, is there any documentation on what the classes the compiler generates do? i'm poking around the output and it is... very magical :)

2:59 slyphon: can you remove a reference to resolve a name conflict?

3:00 oh ns-unmap

3:06 tomoj: hmm

3:07 slyphon: why exactly are you using that?

3:07 slyphon: nah, i just restarted my repl

3:07 tomoj: oh, ok

3:07 slyphon: i'd gotten into some weird state

3:07 and was kind of curious

3:07 tomoj: I thought you were using it as a replacement for :exclude

3:08 slyphon: oh, heh

3:08 * slyphon is inching closer to having something

3:09 miltondsilva: hi.. what is the best way to translate something like this: groundTransform.setIdentity(); groundTransform.origin.set(new Vector3f(0.f, -56.f, 0.f));

3:09 slyphon: it's hard to come up with names for all the little functions

3:11 * slyphon is sure he's structuring this badly, but at least he's having fun doing it

3:12 miltondsilva: I was trying to use doto and .. but somehow it keeps throwing No matching field found

3:13 Chousuke: miltondsilva: something like (.setIdentity groundTransform) (-> groundTransform .origin (.set (Vector3f. 0. -56. 0.))

3:14 miltondsilva: so the doto and .. are a bad idea?

3:14 Chousuke: well, not nexessarily

3:15 I guess you'd need to do it like (doto groundTransform .setIdentity (-> .origin (.set ...)))

3:15 I prefer -> over ..

3:16 wooby: Chousuke, any particular reason?

3:16 miltondsilva: ok thank you very much

3:16 Chousuke: wooby: -> allows for clojure functions as well, and you type the . in java method names, keeping it clear which is which

3:16 wooby: Chousuke, i see, thank you

3:18 miltondsilva: Chousuke: also thanks for explaning -> vs ..

3:19 explaining*

3:22 clojure 21 lines... java 100+ it's really a joy to see this

4:08 vstein: I'm newbie-macro-stuck :| I want to do a for on a variable seq-expr, and matching body-expr. Like (for a b). Guess its been done many times. Any directions?

4:10 TheBusby: vstein: I can't help you, but you may want to look at the definition of the "for" macro in clojure source or look in clojure-contrib for any similar examples

4:11 vstein: TheBusby: Yes, I am :)

4:15 LauJensen: Morning team

4:16 esj: Morning Lau

4:17 spariev: Morning

4:19 AWizzArd: Moin Lau

4:19 oh

4:19 Hi Lau

4:19 Raynes: Morning teammate.

4:19 LauJensen: Moin Andre

4:19 Raynes: The giant!

4:19 AWizzArd: Europe is waking up.

4:20 LauJensen: While America slumbers perpetually.... ok enough with the US jokes :)

4:20 spariev: have you guys read http://www.infoworld.com/d/developer-world/oracle-set-merge-java-virtual-machines-935 ?

4:20 LauJensen: Raynes: I would like to host a Clojure Symposium on a ranch sometime in the near future - And every morning we should all wake up to the sound of chickens clucking while you get us started with a little tune on the Banjo

4:21 Raynes: Whoa. You put effort into that one. :)

4:21 LauJensen: Not really, just a thought I had

4:21 Raynes: We actually used to have chickens that lived in the yard. Wild chickens. They got killed by wild cats last year.

4:22 LauJensen: oh :(

4:23 Raynes: Of course, there is are some chicken houses within walking distance from here. About 4-5 miles I imagine.

4:23 there are*

4:23 Probably less than that.

4:24 LauJensen: Well - It was fun hearing about chickens - Hows your Factor experiment coming along ?

4:25 Raynes: How did you know I was using Factor? :o

4:26 LauJensen: Its my business to know

4:26 Raynes: Heh heh.

4:26 It's going great. Doing some rosettacode stuff with it.

4:26 LauJensen: Great - Uploaded it yet?

4:27 Raynes: http://rosettacode.org/wiki/Send_email#Factor Well, all I've actually done so far is that. :>

4:28 LauJensen: Oh ok, looks simple enough

4:29 Raynes: The swapping was awkward, but it makes sense.

4:29 LauJensen: What do you like about Factor?

4:30 Raynes: Made me feel like Scorpion in Mortal Kombat vs the second item on the stack. "GET OVER HERE!!!!!!"

4:30 I like how bizarre it is to me mostly. I've never done anything with stack-based languages before.

4:31 I don't really know enough about it to really say what I like and don't like yet.

4:31 LauJensen: Clojure makes me feel like Epic Beard guy

4:32 Raynes: You should do one of your patented Clojure vs <language> comparisons with Factor one day.

4:32 Would be interesting.

4:32 LauJensen: If I was going to do another one of those, I think I'd look into Haskell

4:33 Raynes: That would be interesting as well, I imagine, albeit probably not a very fair comparison.

4:33 LauJensen: Would wouldn't it be fair?

4:33 jcromartie: what's this "seqable? is not public" crap?

4:33 LauJensen: Why

4:34 Raynes: You'd be comparing an inpure fp language to a pure one.

4:34 jcromartie: I'm not using seqable? anywhere in my code

4:35 vstein: I found out how to do a (for a b). In LauJensen:s excellent blog. Thanks Lau

4:35 LauJensen: Raynes: I dont think that tells you anything about fairness - Fair to me, means taking a look at the relevant angles and not supressing comments - People have accused me of the latter, but mostly for not understanding that I censor any and all foul language

4:35 np vstein :)

4:35 jcromartie: WTF

4:36 LauJensen: jcromartie: If you have a problem state it, but please stop ranting

4:36 Raynes: The flaming you get for the comparisons is amazing.

4:36 jcromartie: OK here's the problem: where requiring a lib I wrote which does not use seqable? clojure 1.1.0 complains that seqable? is private

4:36 Raynes: Especially since you always point out that it's simply the way you see things.

4:37 zaphyr: Raynes: yes. but it's that old affliction "someone's wrong on the internet" xD

4:37 jcromartie: hmm, looks like it's deep in congomongo

4:38 Raynes: jcromartie: You aren't thinking about going in there are you? I hear there's monsters in those caves!

4:38 ;)

4:38 patrkris: LauJensen: Please do a comparison with Haskell :)

4:39 LauJensen: hehe

4:39 I might, but getting a good feel for Haskell takes a while

4:39 wooby: hm, LauJensen, had you written something in the past about updating clojure fn highlighting in emacs?

4:40 LauJensen: wooby: yea "Enlive Vs Clojure-mode" I think I called it

4:40 patrkris: LauJensen: Yeah, it does. How much Haskell have you done?

4:40 wooby: LauJensen, thanks. love your stuff btw... waiting for clojure vs. php >:)

4:40 LauJensen: patrkris: Not nearly enough, just simple experiments and reading others code

4:40 wooby: Clojure vs PHP was the very first Post I ever did, but it wasn't looking at direct examples, just the overall approach of PHP

4:41 Raynes: I never saw that one.

4:41 wooby: nor i

4:41 LauJensen: Wasnt much to see, but its still there

4:41 Raynes: Just Python and Scala.

4:41 patrkris: LauJensen: I used it during a course at university on Programming Paradigms. There is a certain beauty about its relatively concise syntax and all of the type inference stuff. But I simply can't get myself to think about it as a practical language.

4:42 LauJensen: patrkris: Perhaps not - But it does fascinate me as well

4:42 Raynes: In order to see the practicality of the language, you have to really know the language.

4:42 piccolino: I remember the #scala reaction to your Scala vs. Clojure piece.

4:42 Raynes: The benefit may not be worth the time spent, however.

4:42 LauJensen: piccolino: It was quite intense. Some from their ranks actually made fake profiles on various social sites and openly slandered me, quite nasty

4:43 (although, a little amusing nevertheless)

4:43 patrkris: piccolino: is there a log somewhere?

4:43 Raynes: ^ what he said.

4:44 patrkris: Raynes: I agree about knowing the practicality. Maybe I'll get around to it someday, i.e. really learning and using the language.

4:44 piccolino: patrkris, I'm afraid I don't know.

4:45 Lot of complete jerks in there.

4:45 patrkris: isn't scala a product of academia? maybe that's the reason for all the arrogance :)

4:46 piccolino: Must be.

4:46 Guys in the channel weren't academics, though.

4:48 LauJensen: Also lets not start bad-mouthing #scala, I love #clojure for the polite and friendly tone which is always found here

4:48 (except maybe for Raynes)

4:48 :)

4:48 Raynes: Hah!

4:49 I'm the nicest person in here. hiredman is the mean one.

4:49 :>

4:51 piccolino: Of course, there's thought police in any channel.

4:51 zaphyr: you're not allowed to think that, piccolino.

5:07 mikem: hi, trying to get lein-nailgun to work with my project. I have :dev-dependencies [[lein-nailgun "0.1.0"]] and `lein nailgun` starts NGServer on port 2113, but once I run vim it complains that the file I'm editing is not in the classpath

5:07 am i missing some configuration? is there a way to check what classpath the nailgun server is configured with?

5:08 but shouldn't `lein nailgun` "do the right thing" and start NGServer with the correct classpath set?

5:09 Chousuke: The idea is to concentrate on making Clojure look good rather than making other languages look bad.

5:09 though

5:09 ~scala

5:09 hm

5:10 clojurebot: you have failed me :(

5:10 clojurebot: I will hold the money!

5:10 Chousuke: clojurebot: scala

5:10 meh, I liked those :P

5:13 LauJensen: scala: 2 + 2

5:13 ~scala: 2 + 2

5:13 I think he used to be able to do that

5:13 Chousuke: yeah

5:19 fanatico: mikem: didn't lein-nailgun need a patched version of leiningen?

5:20 found the thread http://groups.google.com/group/leiningen/browse_thread/thread/66c6c72dba4bbd47.

5:20 looks like that could be your problem.

5:23 * mikem reads the thread

5:25 mikem: fanatico: those patches seem to address this faster testing with leiningen, not `lein nailgun` and vim, though

5:26 Hali_303: what can be the reason that code completion with TAB does not work in clojure paredit? is it bound to somethin else then tab?

5:27 fanatico: the patches also make sure that changes are reloaded while the jvm is still running.

5:29 mikem: yeah, that's true. still, it seems my issue is with the classpath that the nailgun instance started with `lein nailgun` has

5:35 does anyone know where the source is for the lein-nailgun plugin?

5:41 Hali_303: no idea :( the lein-swank is in the lein repo

5:43 mikem: Hali_303: actually, leiningnen/nailgun.clj is inside the jar file. it's only about 9 lines long

5:46 Hali_303: mikem: lein-swank is about the same length, too

5:50 when working with SQL code, I repeatedly get No matching method found: println for class swank.util.io.proxy$java.io.StringWriter$0. Does anyone have an idea why?

5:50 probably my query is wrong, but then it should display the DB's error message instead of this

5:50 maybe it is a lein/swank thingie?

6:21 Raynes: join #concatenative

6:21 /fail

7:31 AWizzArd: wb angerman

7:31 angerman: thanks :D

7:33 nuba: can you use clojure with GWT?

7:34 AWizzArd: nuba: I think GWT compiles Java code to JavaScript.

7:34 So, when it finds Clojure code this may unfortunately no longer work.

7:36 LauJensen: There has been an attempt at using GWT with Clojure, but I think it fail0red

7:39 nuba: oh, this is nice, from http://code.google.com/webtoolkit/learnmore-sdk.html: Use the backend language of your choice

7:41 heh, i was kinda hoping not having to touch java, and do it all with clojure

7:49 AWizzArd: nuba: interesting

7:50 nuba: hmm, i think you may have misunderstood this part

7:50 I understand this section as: “Your server can be programmed in Visual Basic.”

7:50 nuba: i understand i'll have to write my interface in java, compile to JS, and write my backend in my language of choice

7:50 somnium: VB + Clojure = huge win

7:50 AWizzArd: Before that they write: “With the GWT SDK, you write your AJAX front-end in the Java programming language which GWT then cross-compiles into optimized JavaScript [...]”.

7:51 The really nice thing would be, if they offered a compiler clj2js

7:52 LauJensen: I'll make a GUI in Visual Basic so we can track the IP address

7:52 nuba: heh

7:53 hamza_: LauJensen: lol and you get unlimited enhance functionality.....

7:53 LauJensen: haha, only if you zoom in far enough

7:58 Hali_303: how to create a keyword from a string?

7:58 somnium: I have a prototype of a clj->js translator for the adventurous. this kind of clj: http://paste.lisp.org/display/95247 -> this kind of js: http://pastie.org/832602

7:59 Hali_303: ah, keyword :)

7:59 somnium: Ive been using it for my omn work in and trying to work out the kinks

8:00 Im starting to think it would be better to make a minimalist scheme-to-js compiler and extend it with macros

8:00 boojum: could clojure be targeted for v8 or tracemonkey?

8:01 somnium: I think there are some questions about how the data-structures will be implemented in js, but lisp->js is really just healing js :)

8:02 Chousuke: it might be possible in the long term

8:03 once most of Clojure is written in Clojure. But that's not happening right now :)

8:04 somnium: theres only about 10-15 keywords you need to encompass js compared to the 200 + opcodes in c.c.Compiler

8:05 and no threads, shouldnt it be a relatively easy target?

8:05 Chousuke: Well, there was a clojure-to-js translator at some point

8:06 woefully incomplete, of course. :)

8:06 somnium: Chousuke: Ive written one that can do TCO and varargs, so it cant be that hard :)

8:07 Chousuke: I suppose javascript is an easy target, because it's already dynamic

8:07 somnium: and it has lambda as a first class construct

8:09 Hali_303: how to convert the resultset coming from a with-query-results into a simple map that can be used later outside of a transaction?

8:10 Chousuke: Sheesh, TeXLive is quite huge. Need 2.7GB of space to even be able to unpack the installer.

8:12 LauJensen: somnium: Why didnt you just extend Clojurescript ? Tons of work have gone into making that compiler

8:12 Chousuke: I'm just glad I have a fast internet connection so it didn't take hours to download the 1.3GB zip file :P

8:12 somnium: LauJensen: clojurescript is extremely complex

8:13 LauJensen: Its a complex task to implement Clojure in JS - Will be a little better once cinc is in place

8:13 somnium: LauJensen: implements a hierarchical system symilar to javas

8:14 javascript is scheme with an object system that enables duck-typing

8:14 I wanted to try compiling a tiny-subset and building straight up

8:15 LauJensen: how complex is implementing clojure in Scheme?

8:16 LauJensen: Well, you have to implement the datatypes, like PersistVector, sets etc, and although its faster to do in Scheme its still a job - When CINC is in place, PV will be implemented using Clojure so thats one less thing to bootstrap

8:16 Chousuke: Clojure needs persistent vectors to compile though.

8:17 it's an interesting bootstrap problem :P

8:17 somnium: why cant you use lists and alists?

8:17 Chousuke: you can't compile the Clojure-PV implementation without an existing PV implementation :)

8:18 somnium: javascript is not a great platform for implementing datastructures

8:18 Chousuke: somnium: if you used just lists and alists it wouldn't really be Clojure, would it? :/

8:19 somnium: and Clojure code itself is more than just lists and symbols.

8:19 somnium: Chousuke: ok, but if in the kernel, you can represent everything with a list and an alist, and then extend the reader and type system once you can say, new and lambda

8:20 and whatever else you need to describe yourself, well, that was my thinking

8:20 Chousuke: it might be possible to make a bootstrap vector implementation with lists, yeah

8:21 it would be horribly slow, but I suppose speed would not matter in the bootstrap phase

8:22 somnium: right, and javascript arrays are VM optimized, faster than linked lists

8:23 anyway, there are no threads, node.js and mozilla have message passing, so I wonder what the eventual official ClojureScript will be like

8:25 relatedly, this js-language is getting some momentum: http://jashkenas.github.com/coffee-script/

8:26 I would be very happy to see many alternative 'JSVM' languages as on the JVM

8:54 AWizzArd: Is there a update-in! that works on transients?

9:07 chouser: I don't think so

9:07 I may have written something like that, but if so the performance was surprisingly bad.

9:49 hamza: guys, when clojure code is aot compiled, does the macros in the code already expanded?

9:52 ohpauleez: hamza: yes, they're expanded

9:52 hamza: kk great thanks.

9:53 ohpauleez: totally welcome

9:54 stuarthalloway: clean slime/swank install from elpa is dead in the water this morning. did something change?

10:12 AWizzArd: Hallo ordnungswidrig.

10:13 chouser: do you think update-in! performed worse than its non-transient counterpart?

10:14 chouser: I think so. the problem was that converting a transient to a persistent is O(1), but converting a transient of transients to a persistent of persistents is O(n)

10:15 I think so. the problem was that converting a transient to a persistent is O(1), but converting a transient of transients to a persistent of persistents is O(n)

10:15 AWizzArd: rhickey: When I extend Number to have a (transient-of/value-of [n] n), will that then also work with primitives?

10:15 chouser: AWizzArd: doubt it. primitives are not Numbers

10:16 AWizzArd: my repl tests with such cells work, I just don't want to run into exceptions during runtime

10:17 Chousuke: I think they will get autoboxed

10:17 you can't put primitives in references anyway

10:17 they need to be Objects

10:22 AWizzArd: ok, then it is autoboxing

10:22 Leafw: AWizzArd: write a few tests to catch all these possibilities of non-object inputs. I also think they should just be autoboxed.

10:22 AWizzArd: ,(class (int 5))

10:22 clojurebot: java.lang.Integer

10:22 AWizzArd: Also some magic autoboxing?

10:22 Chousuke: yes

10:26 AWizzArd: One thing about deftypes: can we have automagic behaviour when listing the Editable and Transient Protocols that automatically provide an implementation à la identity?

10:27 Otherwise I would (extend-class ::Foo Editable (transient-of [foo] foo)) for a deftype Foo.

10:27 Nice would be (deftype Foo [a b c] clojure.lang.IPersistentMap Editable Transient)

10:27 And that immediately allows me to Cell Foos.

10:30 Saves us to type “:as this” and saves us to provide implementations for transient-of and value-of.

10:40 rhickey: could that make sense?

10:41 rhickey: AWizzArd: I've thought about default of identity for val/trans, but it is only safe for immutables

10:42 but oyu should really wonder why you would be putting numbers or struct-like deftypes in cells

10:42 raek: I'm trying to figure out if it would make sense to put a socket (or any input or output stream) in cell

10:42 AWizzArd: numbers I don't want, that was just for playing/testing

10:42 But a complex deftype I want.

10:43 I want to modify one and do IO inside in-cells.

10:44 raek: AWizzArd: how does your IO inside in-cells look like?

10:45 AWizzArd: well, the pseudocode is like this: (in-cells [c] (modify1 c) (modify2 c) ... (modifyN c) (when (all-was-good?) (do-IO) @c))

10:46 raek: ah, ok

10:46 AWizzArd: Cells are ideal for that, because I need cooperation, sychronization and serialization.

10:48 chouser: ping?

10:48 clojurebot: ping

10:48 AWizzArd: ,(time (println "pong"))

10:48 raek: I want something for a situation where multiple readers want to proccess the lines of a stream (in their own tempo) and multiple writers want to write lines to another stream

10:48 clojurebot: PONG!

10:48 PONG!

10:48 pong "Elapsed time: 0.172 msecs"

10:48 AWizzArd: :)

10:49 raek: making a lazy-seq from a BufferedReader becomes very beatyful...

10:49 but writing requires some kind of locking

10:50 i'm thinking about making a Source/Sink library

10:51 this is still only philosophizing...

10:51 rhickey: raek: how would it differ from j.u.c.queues?

10:52 raek: probably not much...

10:52 all sources and sinks might not be connected to a j.u.c.queue

10:54 rhickey: raek: ok, but the interfaces still work

10:54 ?

10:54 raek: btw, if one would like to synchronize access to a POJO, what would the Editable object one passes to (*-cell ...) be

10:54 yes, this will be built around Protocols

10:55 AWizzArd: raek: it should be a clone/copy of the POJO

10:56 On that copy you can then use setters as you wish.

10:56 raek: and for things like sockets or open files? (maybe not very "plain" java objects, but anyway...)

10:57 AWizzArd: What operation do you want to do on a file that requires cells?

10:57 raek: writing lines from multiple threads

10:58 AWizzArd: An agent can't do it?

10:58 Or a j.u.c blocking queue?

10:58 All threads could add a job to a writer agent perhaps.

10:58 raek: well, I guess those solve the problem pretty well...

10:59 AWizzArd: If you don't insinst on a specific write order an agent may be okay. Otherwise a queue can keep your order.

11:00 hiredman: erm

11:00 raek: agents don't keep the order?

11:00 hiredman: why would a queue keep order better than an agent?

11:01 AWizzArd: rhickey told me some weeks ago that an agent is a sink, not a queue, and if i want a queue i should use one.

11:01 hiredman: send adds and action to be executed to the agent's queue

11:01 an

11:01 AWizzArd: I don’t remember the details, it was between September and November I guess.

11:01 raek: I would be surprised if the implementation of agents doesn't include a j.u.c.queue somewhere

11:02 rhickey: you can't 'consume' an agent like you can a queue - the consuming end is predefined

11:02 hiredman: AWizzArd: that has nothing to do with ordering though

11:02 AWizzArd: ok

11:03 hiredman: adding things to a queue and sending actions to agents are both just as "ordered"

11:03 raek: a question about lazy-seqs... the body of a lazy-seq is only evaluated once, right?

11:04 hiredman: each node in a lazy-seq is evaluated once

11:04 raek: and if the node is being evaluated, other threads trying to read that node will block?

11:05 ...until its value is ready

11:06 i.e. will (repeatedly (.read stream)) only do .read in one thread at a time?

11:06 AWizzArd: rhickey: if identity becomes the default for immutables (deftypes), could the compiler then eliminate calls to produce a transient/persistent object?

11:06 rhickey: AWizzArd: you are worried about a call to identity?

11:07 AWizzArd: no, I just remember you mentioned something yesterday about the compiler being able to remove cells for thread-local changes, or something like that.

11:07 Thought it could be possible here as well.

11:08 raek: yes, this would read only in one thread.

11:08 raek: perfect!

11:08 AWizzArd: .read blocks when nothing is .available but when the stream is still open.

11:12 raek: btw, I love (extend ...)

11:12 it's just fun to make protocols

11:12 that one can make old things fit into one's new abstraction

11:13 AWizzArd: Does in-cell nest within one thread?

11:13 noidi: should the slime in ELPA work with sbcl?

11:13 rhickey: AWizzArd: no

11:14 noidi: I'm starting to read On Lisp in the hope it would make me a better Clojure programmer, but for that I need to set up a Common Lisp environment :P

11:15 tomoj: it should work, I think

11:15 AWizzArd: Would there be a problem if it would nest inside the same thread?

11:15 tomoj: only problem is setting it up to use multiple lisps

11:15 noidi: M-x slime starts a Clojure REPL on my Emacs. When I try to start a Common Lisp REPL with C-u M-x sbcl, I get the following error

11:16 Couldn't load "/home/noid/.emacs.d/elpa/slime-20091016/swank-loader.lisp": file does not exist.

11:16 tomoj: hmm, maybe it's not enough

11:16 AWizzArd: (dosync (alter foo conj 1)) works as well as (dosync (dosync (alter foo conj 1)))

11:16 rhickey: AWizzArd: yes, because in-cells enforces lock order - consider (in-cells [a c] ... (in-cells [b] ...)))

11:16 tomoj: yeah, I think I remember hearing technomancy say that the slime there is just a tiny part of slime

11:16 you may have to install the real thing and get rid of your elpa version

11:17 noidi: okay, thanks

11:17 that's what I was afraid of :)

11:17 tomoj: and do you have slime-lisp-implementations set?

11:17 noidi: yes

11:17 AWizzArd: Maybe it is fine the way it is, but perhaps (in-cells [a b] ... (in-cells [a b] ..)) could be okay. Don't know if this makes sense though.

11:17 tomoj: then, that should work with real slime

11:18 noidi: there are no *.lisp files in my .emacs.d, so ELPA probably has a stripped down version of slime like you said

11:18 tomoj: I haven't tried to get other lisps working since I switched to using elpa

11:19 AWizzArd: When the set of cells are the same it won't hurt, and there may be a useful function that can be called on its own, but also as an inner call inside a in-cells block.

11:19 raek: AWizzArd: (defmacro in-cells .... (assert (nil? *in-cells*)) ... (binding [*in-cells* true]

11:20 rhickey: AWizzArd: that's possible, as is (in-cells [a b] ... (in-cells [c] ...))), but you'd have to have a deterministic knowledge of lock ordering. I had a broader design for lock-based references that put more control over lock ids and hierarchy in hands of users. Not sure how much of that will make it into cells

11:20 AWizzArd: I see.

11:21 rhickey: AWizzArd: but that kind of nesting is really fraught - so let's see how hard it is to work within current limits of in-cells

11:21 will certainly yield simpler designs

11:22 AWizzArd: Yes, in fact I can easily arrange my code so that it will work with the current model.

11:23 I have only one entry point to in-cells and don't need to nest them.

11:23 noidi: yay, my whole ELPA installation broke when I tried to uninstall slime :P

11:23 argh

11:24 note to self: never ever touch a working installation. even if you need a feature that it doesn't have.

11:26 AWizzArd: rhickey: one suggestion to << and >> is: please add an arglists for them :)

11:29 noidi: this just keeps getting better, instead of ELPA I just removed my whole .emacs.d

11:30 and apparently the default setting in backintime is to exclude backing up hidden files and folders

11:30 I should probably step back from my computer before I throw it off the balcony

11:30 tomoj: ouch

11:31 Hali_303: is there a way to do a trace that prints the arguments and evaluates every subexpression?

11:32 noidi: phew, I found a backup from december \o/

11:35 bsteuber: hali_303: could you give a simple example how you would like to use it?

11:35 Hali_303: I mean something like that I can also emualte by inserting some (do expressions and doing printlns

11:35 chouser: I think I have a use for &env that would otherwise require macrolet

11:35 * esj can't believe Clojure will obligingly proxy an object that is a java wrapper around a com event spitting object and do it dynamically. Mercy !

11:35 chouser: assuming I have a clue how macrolet would work of course.

11:35 Hali_303: bsteuber: (trace (+ *(1 2) 3))

11:36 and that should print a call trace in the repl

11:37 bsteuber: like "called + with ...., called * with ..., returned 2, returned 5?"

11:37 sounds difficult to me

11:38 stuartsierra: Hali_303, bsteuber: a limited version of that exists in clojure.trace

11:38 arohner: Hali_303: it's possible, with a macro

11:38 stuartsierra: I mean clojure.contrib.trace

11:38 Hali_303: stuartsierra: in what way it is limited? actually I've tried it, but stuck with enabling the :debug loglevel

11:39 stuartsierra: Hali_303: you have to declare which fns you want to trace

11:39 bsteuber: Oh yeah, dotrace looks promising

11:39 chouser: A form has an outer macro with some args and a body. The body can contain uses of an inner macro.

11:40 The outer macro expands to a let that creates a local with some metadata on its symbol. The inner macro uses &env to collect that metadata and uses it in its expansion.

11:43 oh, but :inline doesn't get &env. pity.

11:43 AWizzArd: esj: what are you talking about? :)

11:43 bsteuber: hali_303: dotrace won't do inlined ops like +, but otherwise it should be a good tool

11:44 AWizzArd: What is the difference between “pass” and “>>”?

11:44 arohner: hrm, this is fun

11:44 lein is downloading some jars for me

11:44 ohpauleez: AWizzArd: Nothing I don't think. >> is an alias for pass

11:44 but I may be wrong

11:45 arohner: and rather than getting a jar, it returns a "moved permanently"

11:45 Hali_303: thanks all, I'll play around with (dotrace

11:45 StartsWithK: chouser, like: (letmacro [a ([x] `(println ~x)] (some-form (a 1))) and then some-form inspects a &env for 'a?

11:45 arohner: but it sticks that moved permenantly html file into a .jar extension, which java then tries to load

11:46 which 1) doesn't checksum, and 2) causes java to throw an exception when trying to unzip the "jar"

11:47 esj: oh, just blathering. I being impressed in Clojure doing something that I was sure was too absurd to contemplate. I have to connect to an API meant for C#, so is exposed via COM objects. These object in turn generate COM events that I have to listen for. COM doesn't play with jvm, so you have to generate 3rd party wrappers, which expose java objects. Then clojure can get at the java objects with proxy, reify what not. This is too

11:47 baroque to work. Only it bloody well does.

11:47 chouser: StartsWithK: I don't think so. The user can do something like (foo [x XClass] ... (bar x a b c))

11:48 esj: oh yeah, and its on Windows. Nothing on Windows ever works.

11:48 chouser: both foo and bar are macros, and bar wants to know at expansion time that x is an XClass

11:49 so foo expands to (let [#^{::foo-data XClass} x (whatever)] ...)

11:49 StartsWithK: chouser, but in a normal macro bar can't see value of x at expansion time

11:49 chouser: that allows the bar macro to look up x in it's &env, check the metadata, end produce code based on info about XClass

11:50 StartsWithK: right, not that *value* of x, but using this trick can see the symbol XClass

11:51 StartsWithK: chouser, but isn't a symbol XClass a value of x (if foo is let-like in that example)

11:51 chouser: something similar could perhaps be done if we had macrolet and foo produced a macrolet block, or if foo did a code-walk of its body.

11:51 StartsWithK: the problem with code-walk is

11:51 you can't do it

11:51 chouser: right. so I don't do it.

11:51 StartsWithK: you have to macroexpand your body first

11:51 chouser: the problem with macrolet is clojure doesn't have one

11:52 so this is a neat trick, seems to me.

11:52 StartsWithK: it is easy to construct it

11:52 no need for &env

11:52 i think a implementation is in contrib

11:52 chouser: I think the one in contrib uses code-walking

11:52 StartsWithK: if i remember that one correctly, but it has some missing parts/errors

11:53 chouser: right, so maybe not so easy to construct a correct macrolet

11:53 StartsWithK: it dosn't expand metadata.. and i think it will not expand in sets or something like that

11:53 chouser: and this remains an neat trick.

11:53 StartsWithK: but i think if that two parts are fixed it would be fully functional

11:53 rhickey: &env is a precursor to support for macrolet

11:54 because macroexpand will have to take an env arg

11:54 chouser: arguably this technique would still be preferred even in macrolet existed.

11:54 even if

11:55 StartsWithK: &env is needed for macrolet nesting? or am i missing something

11:55 replaca: Hali_303: I have preferred Craig McDaniel's tracer (http://paste.lisp.org/display/71656) to the one in contrib. It's more repl centric (easier to turn tracing on and off, etc.)

11:56 rhickey: StartsWithK: macros can do macroexpansion, but if macrolet existed, how could they macroexpand something and make sure any macrolets were respected? only by passing &env to macroexpand

11:59 StartsWithK: rhickey, if macrolet does a full recursive expansion of it's body and treats 'macrolet as special symbol that is not expanded and reinserts its own definitions at the begining of its bindings vector, woudn't that have a same effect?

12:00 rhickey: StartsWithK: that's not what macrolet does. macrolet defines a local macro

12:01 the interesting variant of which is symbol-macrolet

12:02 StartsWithK: i used the above procedure based on a code from contrib for my own usage, it worked ok.. maybe there are some cases i overlooked

12:02 rhickey: with which you can do things like: every time I say x in this context turn it into (getx foo)

12:02 bsteuber: apropos: why are there no (native) symbol-macros in clojure?

12:02 StartsWithK: where i would define a new macroexpander with new special form inserted

12:03 AWizzArd: Are those needed for Clojure-in-Clojure?

12:04 rhickey: bsteuber: just not done yet

12:04 bsteuber: ic

12:04 AWizzArd: Please continue with Cells first :p

12:04 rhickey: StartsWithK: oh, you are talking about the implementation of macrolet

12:04 StartsWithK: yes :)

12:05 rhickey: I don't think it can be done correctly as a library

12:06 StartsWithK: did you see the one in contrib?

12:06 rhickey: yes

12:06 StartsWithK: how 'broken' is it? should i mimic what is done there?

12:07 rhickey: StartsWithK: I don't recall

12:07 StartsWithK: so symbol-macrolet could be used for something like import-static from java

12:08 rhickey: StartsWithK: if allowed at top level. I'm not sure I have seen compelling use cases for other than symbol-macrolet

12:09 I guess there was some use for macrolet in monads?

12:11 arohner: leiningen is completely choking on log4j, attempting to download bad jars. (I think) I have the appropriate exclusion, directly copied out of the docs. Has anyone else seen this problem?

12:13 StartsWithK: it looks like that, but only symbol-macrolet version, to remove extra () around monad function

12:13 letfn but macrolet?

12:16 Chousuke: macrolet is the CL name, isn't it?

12:16 stuartsierra: Chousuke: yes

12:16 Chousuke: letmacro would be more consistent with letfn, but then what about symbol-macrolet? :/

12:16 letsymbolmacro is not so hot :P

12:16 rhickey: symbol-macrolet and macrolet are different

12:16 http://www.lispworks.com/documentation/lw50/CLHS/Body/s_symbol.htm#symbol-macrolet

12:18 my experience has been symbol-macrolet is the most useful

12:19 mattrepl: arohner: I don't think the exclusion support is in the current release, you'll have to grab the latest from github

12:19 rhickey: the only one I have plans to support

12:19 AWizzArd: sounds ok

12:20 Chousuke: I suppose macrolet wouldn't be that useful as you can just define a private macro

12:22 vy: How can I make a Java array of native types?

12:22 arohner: mattrepl: ah, thanks

12:22 bsteuber: chousuke: this could be an argument against letfn, too. but people use it

12:23 arohner: mattrepl: turns out, using log4j 1.2.14 rather than 1.2.15 also avoids the problem

12:24 mattrepl: iirc, the earlier version of log4j didn't have those dependencies

12:24 arohner: right

12:25 Chousuke: bsteuber: local functions are *much* more common than local macros

12:25 bsteuber: sure

12:25 but sill I think local macros are useful in some cases

12:25 where you need code-walking otherwise

12:25 Chousuke: yeah, but the point is that those cases are not frequent enough to warrant a real local macro construct :)

12:26 vy: Nevermind.

12:26 Chousuke: still, I wouldn't oppose a letmacro if one were introduced

12:26 bsteuber: phew, that seems hard to decide for me :)

12:27 AWizzArd: rhickey_: in your Cells gist, in lines 83 and 84, why do you overwrite (set! ..) the :trans slot of the LockCell?

12:27 StartsWithK: sometimes i would like to make a local macro inside another macro instead of writing a new stared version

12:27 dakrone: vy: what kind of type? (int-array <size>) would work for ints

12:27 vy: dakrone: What about 2D arrays?

12:27 Chousuke: StartsWithK: are you sure you're not just wanting a local function?

12:27 stuartsierra: vy: Java doesn't actually have 2D arrays.

12:28 vy: stuartsierra: Hrm... I'm not that Java expert, I just need an object of type int[][].

12:29 stuartsierra: vy: Can't do that in Java.

12:29 rhickey_: AWizzArd: the transient/persistent protocol demands that the transient 'become' the persistent, that's how that can be O(1). So another transient will be created iff needed

12:29 stuartsierra: vy: Either make an int[] and compute indicies in your code, or make an array of arrays.

12:30 vy: Clojure has helpers to make arrays of arrays (make-array-2d or something)

12:30 AWizzArd: rhickey_: okay, that makes sense, now that I look at what pass does plus what you've just said. Thank you.

12:30 hiredman: ,(doc make-array)

12:30 clojurebot: "([type len] [type dim & more-dims]); Creates and returns an array of instances of the specified class of the specified dimension(s). Note that a class object is required. Class objects can be obtained by using their imported or fully-qualified name. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE."

12:31 hamza: gents, is there a predicate that will return true for both vector and list, something like seq? and vector? combined?

12:31 Chousuke: coll? would :P

12:31 but it will also return true on other things.

12:32 dakrone: so (make-array Integer/TYPE 2 2) would make a 2x2 matrix

12:32 ,(pprint (make-array Integer/TYPE 2 2))

12:32 clojurebot: [[0, 0], [0, 0]]

12:32 hamza: chousuke: that would do fine thanks...

12:36 AWizzArd: rhickey_: if I don't want to make my transient persisent inside an in-cells I must not deref my cell. So, is the right way to access my full celled object (<< identity obj)?

12:37 Here obj is a map and I would like to (let [{:keys [bar foos]} (<< identity obj)] ...)

12:37 rhickey_: AWizzArd: returning non-values from << is a mistake

12:38 AWizzArd: Why?

12:38 clojurebot: why not?

12:39 Chousuke: AWizzArd: the cell can't control access anymore

12:39 AWizzArd: rendering it useless

12:40 vy: dakrone: But it is not of primitive type int.

12:40 AWizzArd: Chousuke: can you please tell me more about this?

12:40 hiredman: vy: yes it is

12:43 Chousuke: AWizzArd: well, if you have a direct reference to the transient inside the cell, the sentry can no longer enforce the access policy (eg. ensure locks are held for concurrent access, etc.)

12:44 AWizzArd: (deftype Foo [a b c] ...) And then (in-cells [foo] (let [{:keys [a b]} (<< identity foo)] (>> assoc foo :c (bar a b)) @foo))

12:44 Chousuke: AWizzArd: or even if you only read from the transient, you may observe changing or inconsistent values

12:45 AWizzArd: well, in that case foo is a value. but it might not be.

12:46 AWizzArd: What is a non-value then?

12:46 Chousuke: a StringBuilder for example

12:46 or a transient

12:46 ie. TransientVector

12:46 or whatever it's called

12:46 basically, anything mutable

12:47 AWizzArd: So, is there a better way than (<< identity foo) if I just want to destructure it (maps, deftypes, structs)?

12:47 And is it okay to do it in such a case?

12:47 Hali_303: is there a function that transforms a value in a map given a function?

12:48 Chousuke: what you should do in your example is something like (>> foo (fn [[a b c]] (Foo a b (bar a b))))

12:48 Hali_303: update-in

12:48 Hali_303: Chousuke: thx

13:00 vy: Is it possible to type-hint the return type of a function?

13:00 ala (declare (function ...) ...) in Common Lisp?

13:02 dakrone: vy: (let [#^String foo (some-function ...)] ...) ?

13:03 stuartsierra: or (defn #^String foo [args] ...)

13:06 vy: stuartsierra: Thanks.

13:13 What's wrong with this function: http://privatepaste.com/739a4144e4

13:15 Hrm... Can't I use a native type in a type hint?

13:16 dakrone: vy: why do you want to use int instead of Integer?

13:16 out of curiosity

13:17 vy: dakrone: For performance reasons?

13:20 dakrone: "Instead, use the let technique shown to place args in primitive locals if they need to participate in primitive arithmetic in the body. (let [foo (int bar)] ...) is the correct way to get a primitive local. Do not use #^Integer etc."

13:20 from the java interop page on clojure.org

13:21 the Coercion section

13:22 hiredman: dakrone: which has nothing to do with arrays

13:23 dakrone: hiredman: would coercing them with (let ...) in the coord-to-idx function give the performance boost instead of trying to type-hint the type for the function result?

13:24 hiredman: dakrone: sorry, i thought vy was still asking about arrays

13:24 dakrone: oh, I was referring to the paste he/she posted

13:26 vy: dakrone: I think this is the right clause that explains it all: All arguments are passed to Clojure fns as objects, so there's no point to putting non-array primitive type hints on fn args.

13:34 dakrone: vy: okay, sorry I couldn't help

13:35 vy: dakrone: I figured out the problem, but IMHO it's a bug that Clojure couldn't compile the code.

13:36 hiredman: why?

13:36 clojurebot: http://clojure.org/rationale

13:36 hiredman: clojurebot: bzzt

13:36 clojurebot: No entiendo

13:36 dakrone: p4 sync

13:36 err... whoops, not a terminal window

13:38 Hali_303: is there a nice easy way to do pattern matching on keyword?

13:39 I've tried match, but as far as I understand, it does not support keywords

13:39 dakrone: ,(re-find #"oba" (name :foobar))

13:39 clojurebot: "oba"

13:40 Hali_303: hm, ok it does support keywords, i just messed it up

13:40 thx

13:42 the-kenny: mh :/ A "minijob" (german..) next to school really steals my time for clojure

14:06 * AWizzArd is thinking... can the compiler emit warnings for derefs in in-cells that are *not* in tail position?

14:14 stuartsierra: Any reason extend-type for the interface clojure.lang.IFn would throw a NullPointerException?

14:21 Does extend work on Java interfaces?

14:22 kotarak: I would think so.

14:23 stuartsierra: I know you can put Java interfaces in deftype, but the docs for 'extend' don't explicitly say that you can put interfaces there.

14:25 kotarak: I thought this was the point about protocols. That you can also extend other types, not under your control. I would be really surprised, if this didn't work.

14:25 stuartsierra: Protocols, yes. I don't know if that works with Java interfaces.

14:41 konr: Is there a way to mimick a this variable in a def? something like (def foo {:n 2 m (+ 2 (:n this))})

14:42 stuartsierra: konr: there's a lib for that

14:43 konr: stuartsierra: on clojure.contrib?

14:49 tomoj: mmm (-> timestamp parse-timestamp .getTime (- (* 1000 60 60 24 days)) Date. format-date)

14:49 stuartsierra: konr: yes

14:50 tomoj: I got hit with cupid's ->

14:50 chouser: hehe

14:51 stuartsierra: (-> cupid (:heart me))

14:52 jcromartie: So tell me about running a remote repl that I can use to reload my running web server.

14:54 tomoj: jcromartie: emacs?

14:54 and, leiningen?

14:54 jcromartie: I want to be able to push my code to the server (rsync) and tell the server to reload some namespaces.

14:55 tomoj: hmm, I don't think there's a way to do that with lein-swank out of the box

14:55 unless you have the appropriate :reloads in the right ns declarations, I guess

14:56 I've just been keeping emacs with a repl open in a screen, so I can pull changes then C-c C-k the changed files

14:56 less than ideal

14:57 jcromartie: tomoj: I've had success with a reload function

14:57 stuartsierra: You can run a swank server on a (secured!) port, then tell a local emacs to connect to it.

14:57 jcromartie: just gotta remember to reload the reload function :)

14:58 I have just been leaving a repl running in screen

14:58 tomoj: hmm

14:58 I tried using a local emacs before, but then you can't C-c C-k

14:58 stuartsierra: Or do it my way: start up a new instance of your app on another virtual server, then reroute the public IP address. :)

14:59 tomoj: unless you deal with tramp mappings or whatever

15:00 jcromartie: rlwrap + the repl is pretty good, I can C-r to find previous commands and things

15:00 but I'd like to trigger it from rsync

15:00 tomoj: if you don't want emacs stuff, I think http://richhickey.github.com/clojure-contrib/server-socket-api.html might help

15:00 jcromartie: not sure how it would work

15:00 ooh

15:00 konr: stuartsierra: hmm, I'm not being able to find it... do you remember it's name or part of the name of one of its functions?

15:00 tomoj: then just forward that port over ssh and you can access that repl locally

15:01 jcromartie: I've built a socket-server repl before :) I should know better

15:01 for a MUD

15:02 stuartsierra: konr: not really, something like let-map or def-map

15:02 the-kenny: isn't there something like repl-server or so in contrib? I remember it as a one-liner to create a telnet-repl

15:02 stuartsierra: let-map I think

15:02 the-kenny: oh sorry.. didn't see the link

15:03 tomoj: I don't see how that's any better than just using a repl in a screen over ssh, though

15:03 oh, easier to do stuff programmatically, I guess?

15:03 jcromartie: tomoj: I want to have a "one-button" deployment

15:03 tomoj: yeah

15:03 thanks for asking this question :)

15:04 I need to think some about my strategy, it currently sucks

15:04 technomancy: jcromartie: you shouldn't rely on live-reloading for your primary deployment strategy

15:04 it's really hard to ensure you don't have any state left around from the last run

15:04 jcromartie: this: http://renesd.blogspot.com/2010/02/secret-to-my-web-development.html

15:04 technomancy: that's true

15:04 technomancy: it's really easy to get slimed

15:04 jcromartie: yes indeed I've run into it

15:04 technomancy: that said, it's really handy to have around for when you need it.

15:04 cemerick: enclojure provides a ready-made repl-server for just this purpose, BTW *shrug*

15:05 * cemerick shouts into the wind :-/

15:05 tomoj: what's the state here that is problematic?

15:05 stale var bindings, for example?

15:05 jcromartie: tomoj: vars

15:05 tomoj: ah, yeah

15:05 jcromartie: tomoj: the best thing to do would be to unbind everything in a namespace and then reload

15:06 how about (require 'foo :no-seriously-reload)

15:06 tomoj: yeah, I had that problem the other day, where it worked with live-reloading, then when I tried to start it later I had to go in and reorder all my functions

15:06 would that solution be safe?

15:06 or does it still leave problems?

15:07 jcromartie: tomoj: I believe that it would work

15:07 but you will have to reload the reloader first :)

15:08 BTW I wrote this the other day but I'm not sure if it duplicates something in the API already http://gist.github.com/309148

15:08 for specifying namespaces to reload :P

15:15 what can I do with a Var?

15:16 how can I get its fully-qualified symbol

15:16 dakrone: hmm, http://pastie.org/833266 anyone know if it's possible to get docstrings in a macro'd defn?

15:17 chouser: ,[(.ns #'map) (.sym #'map)]

15:17 clojurebot: [#<Namespace clojure.core> map]

15:17 drewr: ,(resolve #'map)

15:17 clojurebot: java.lang.ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.Symbol

15:17 drewr: ,(resolve 'map)

15:17 clojurebot: #'clojure.core/map

15:18 chouser: dakrone: perhaps ~docstring instead of docstring?

15:18 drewr: that's starting with a symbol though

15:19 jcromartie: hmm, maybe I'll just stick with the symbol

15:19 I'm iterating over ns-interns

15:19 drewr: chouser: yeah, true

15:19 dakrone: chouser: hmm, gets Can't use qualified name as parameter: opennlp/p1_1296

15:19 is that due to using %? in the lambda

15:20 chouser: jcromartie: if you are iterating over some ns that has a var named "map" and you use resolve, you may get clojure.core's map instead.

15:20 jcromartie: yeah

15:20 unless I specify the namespace

15:20 which is trivial in this case

15:21 chouser: dakrone: perhaps. I don't think I've used #() in a macro expansion.

15:21 or in a syntax-qoute, rather.

15:21 quote. sheesh.

15:22 dakrone: chouser: I changed the #() to be a (fn ..) and it works now, thanks

15:23 oh drat, the doc string still doesn't :-/

15:23 chouser: do you mean ~n where you have n

15:23 ?

15:24 dakrone: if I do that, I get Var clojure.core/unquote is unbound.

15:24 jcromartie: http://gist.github.com/309148

15:24 really-reload

15:26 chouser: `(defn ~n ~docstring [elements#] ...)

15:27 oh, then use it like (post-filter nouns #"^NN") ... don't put quotes around the value you're passing to n

15:28 vy: What would be the easiest way to iterate over a list without a return value? All for/map/etc. tools tend to pack the execution result of the body into a list.

15:29 stuartsierra: vy: doseq

15:29 dakrone: chouser: huh, well that defines alright and then has the correct docstring, but the function doesn't work all of a sudden :)

15:30 vy: I should have read that book again.

15:34 dakrone: updated version, with macroexpand it looks like it should be working, http://pastie.org/833307

15:35 but it's still not, for some reason

15:35 hiredman: you are missing a set of parens

15:37 dakrone: hiredman: ahaha, that was it, silly me

15:37 thanks for the extra eyes :)

15:39 and thanks for the macro help chouser

15:42 slyphon: what is the appropriate use for a *binding*

15:42 ?

15:43 i know it's kind of a special case

15:43 hiredman: you can use it to emulate multiple return values

15:43 slyphon: hrm

15:44 stuartsierra: hiredman: don't you mean destructuring?

15:44 hiredman: nope

15:44 slyphon: i'm working on a protocol-level irc bot, like, porting pircbot, and i find myself passing around this 'bot' structure which has the configuration profile, and the socket itself and the output queue etc.

15:45 hiredman: (declare *return2*) (defn f [x] (set! *return2* (* x 2)) (+ x 2)) (binding [*return2* nil] (print (f 1) *return2*))

15:46 slyphon: don't do it!

15:46 slyphon: and then destructuring that struct to get at the components

15:46 no?

15:46 clojurebot: da da king of the road

15:46 slyphon: i'm just doing it for fun

15:46 hiredman: I mean don't use binding for implicit parameter passing

15:46 slyphon: oh, ok

15:47 that's the advice i was looking for

15:47 stuartsierra: yeah, just made that mistake again myself

15:47 opqdonut: why not?

15:47 stuartsierra: opqdonut: Breaks multi-threaded code, usually.

15:47 ordnungswidrig1: hiredman: again, parameter passing. seems to become a hot topic in clojure

15:47 chouser: opqdonut: because if you do, hiredman will yell at you

15:48 ordnungswidrig1: chouser: *g*

15:48 slyphon: well

15:48 opqdonut: wasn't binding supposed to be thread-safe?

15:48 slyphon: thread-local

15:48 hiredman: if you ever want more than one db/bot/etc

15:48 ordnungswidrig1: opqdonut: it is, because it's thread local

15:49 slyphon: hiredman: i thought then you would just assign the binding before taking an action on the given bot

15:49 opqdonut: as long as you know it won't propagate outside the thread

15:49 I think it makes for nice concise code

15:49 stuartsierra: The real problem is when you introduce things like agents, or pmap, that execute outside of the current thread.

15:49 hiredman: slyphon: or you could, you know, pass parameters around explicitly

15:49 slyphon: hiredman: sure

15:50 it just seems clunky, coming from mostly an OO world

15:50 having to set up your context in every function

15:50 opqdonut: it seems clunky coming from Haskell too :)

15:50 hiredman: opqdonut: how so?

15:50 slyphon: that's more a comment about me than clojure, of course

15:51 opqdonut: hiredman: well the reader monad for example can be used to hide stuff like that

15:51 hiredman: you can write a monad if you want

15:51 opqdonut: sure, but it's not very idiomatic

15:52 ordnungswidrig: hiredman: but combining multiple reader monads is a pain.

15:52 hiredman: you can write a macro that always adds a "this" parameter to functions

15:52 opqdonut: nah, just keep the things in a map

15:52 also, i can never decide whether to make a higher-order function or a macro :)

15:52 slyphon: hrm

15:52 hiredman: you can smuggle values in through metadata

15:52 opqdonut: no there's a good idea!!

15:52 ...

15:52 hiredman: all of this is a better solution than binding

15:53 you can pass a map

15:53 slyphon: how would you "always add a 'this' parameter"?

15:53 yeah, that's what i'm doing

15:53 opqdonut: so all the with-* macros should be banned too?

15:53 slyphon: passing a map and then destructuring it in a let

15:53 hiredman: banned is harsh

15:53 slyphon: overandoverandover

15:54 hiredman: slyphon: why destructur in a let?

15:54 slyphon: seems to make things more readable to me

15:54 hiredman: ,((fn [{:keys [a b]}] [a b]) {:a 1 :b 2})

15:54 clojurebot: [1 2]

15:54 slyphon: oh

15:54 * slyphon duhs

15:54 dakrone: is there a version of the (flatten ...) in contrib.seq-utils that does a variable amount of flattening?

15:54 hiredman: if you are doing the same destructuring over and over you can, of course, roll it into a macro

15:54 slyphon: ok, i didn't realise that

15:54 * slyphon nods

15:56 slyphon: hiredman: wait, huh?

15:56 hiredman: where is this stuff documented?

15:56 hiredman: what kind of stuff?

15:56 slyphon: syntactical stuff like that

15:56 hiredman: destructuring?

15:56 clojurebot: destructuring is http://clojure.org/special_forms#let

15:56 hiredman: clojurebot: botsnack

15:56 clojurebot: thanks; that was delicious. (nom nom nom)

15:57 slyphon: hahahaha

15:57 i put that in all my bots

15:57 hiredman: there was the "language specification" that CL had, which while a bit too much like legaleze was useful

15:58 * slyphon looks at that special forms page

15:58 slyphon: ah, this is a piece of it

15:58 stuartsierra: slyphon: And Clojure's syntax is quite different from CL.

15:58 hiredman: clojurebot: hyperspec?

15:58 clojurebot: hyperspec is not applicable

15:58 slyphon: stuartsierra: indeed

15:58 hiredman: ah, yes, the hyperspec

16:02 hiredman: this is good (http://clojure.org/special_forms#let), i've been reading the prag-prog book, but it kind of just provides an overview

16:03 brandonw: i thought it actually covered de-structuring pretty well

16:03 especially compared to alter & commute :D

16:03 slyphon: heh

16:03 i think it's just organized in a way that i find somewhat confusing

16:04 lancerx: Hey, experienced hacker but emacs/clojure noob here. I haven't touched emacs in 20+ yrs but am now having a great and gleeful time diving into it (with a bit of "I can't believe I didn't do this sooner"). I got clojure up and running using the ELPA method, but then tore it all down and did a manual install just to learn more. Can someone take a quick look at this gist http://gist.github.com/309085 ? I'm wondering if I need both the

16:04 (eval-after-load "slime...) and the (slime-setup) calls?

16:04 slyphon: then again, i mean, this is all kinda new to me, so

16:04 brandonw: yeah me too

16:05 dnolen: lancerx: did you install slime via ELPA?

16:05 brandonw: part of passing stuff around to funcs is to make everything explicit though

16:05 konr: Examining the contents of a jar, I've noticed that there is, say, FooLibrary.class and FooLibrary$Versions.class. I'm being able to load the latter, but not the prior. Any idea why? Are they the same thing?

16:05 slyphon: is it possible to destructure *into* a nested map for instance?

16:05 lancerx: I did, but then tore it all out and am using the git rev's from technomancy

16:05 brandonw: it appears to make method definitions more verbose compared to OO, but that's only because from the function definition, you know everything that it takes and and computes

16:05 slyphon: {:a { :b "c" }}

16:06 brandonw: yeah, indeed

16:06 brandonw: and=in

16:06 slyphon: brandonw: i'm still struggling a bit with how to use the namespaces effectively, to avoid naming conflicts and make things clear without having functions-that-are-named-so-long-that-it-becomes-impractical-to-use-them

16:06 brandonw: yeah i am running in to that too

16:07 combined with me never having used java classpaths seriously

16:07 :D

16:07 slyphon: hiredman's clojurebot code seems to be a good example in that regard

16:07 hah

16:08 dnolen: lancerx: I maintained my clojure setup by hand for year, but I switched to ELPA so I don't have my .emacs settings setup for that anymore. I found it easy to use ELPA for initial setup and just symlink to my clojure jars that I build from source.

16:08 brandonw: my problem is that clojure has bewitched me, and i want to use it more

16:08 but instead i have to work on C# at work

16:08 slyphon: hahahaha

16:08 brandonw: with the possibility of using clojure/scala in teh future

16:09 hiredman: slyphon: sorry, waht?

16:09 brandonw: except that i keep getting sidetracked by how cool clojure is compared to c# :O

16:09 slyphon: hiredman: no, i was just saying how your clojurebot code seemed to use namespaces well, to avoid naming conflicts and such

16:09 as a conceptual/organizational tool

16:10 which i'm still kind of struggling with

16:10 dakrone: brandonw: just need the clojure-clr port to be finished and you'll be able to sneak it in with your C# :)

16:10 hiredman: slyphon: the namespace structure is mostly result of a re-org Chousuke did

16:10 slyphon: ah

16:10 brandonw: well, honestly i'd rather use it in the java environment

16:12 lancerx: dnolen: Since all the relevant packages are available on technomancy's git repo, it's actually easier for me to just clone them, that way I can refresh/fork etc as needed. The only effort for me has been to figure out how to get it all wired together, but I'm attributing that to my noobness with emacs/clojure/slime

16:13 that, and the fact that the tutorials are all horribly out of date for manual installs

16:13 dnolen: lancerx: no, it's not you. I always forget how to set it up. I got tired of forgetting. What error are getting from Emacs when you load a .clj file?

16:13 or run M-x slime?

16:14 lancerx: dnolen: actually, it all works! I was just wondering if the two slime-setup calls were redundant. I just don't know enough to tell

16:15 (ha, "it all works!"... after hacking against since last night that is...)

16:15 konr: In my Jar, there is Foo.class and Foo$Versions.class, which does really look like a class. What is it?

16:16 lancerx: konr: that's an inner class (Versions)

16:16 dnolen: lancerx: heh, your elisp looks OK to me, but I know very little Elisp, and even less about the relationship between slime/slime-repl

16:17 lancerx: konr: here's the Java centric overview from Sunacle: http://java.sun.com/docs/books/tutorial/java/javaOO/innerclasses.html

16:18 stuartsierra: Sunacle - nice

16:18 lancerx: :)

16:18 brandonw: hahaha

16:18 chouser: ha. "Sunacle" sounds a little rude.

16:18 lancerx: chouser: exactly

16:18 brandonw: seems to give sun the emphasis, though

16:18 slyphon: it's when one of your testicles falls out of your shorts while sunbathing

16:18 konr: lancerx: thanks!

16:19 stuartsierra: But "Orasun" sounds worse.

16:19 lancerx: well, do you really want to be saying "Oracun" in public?

16:19 brandonw: having never been involved with the java ecosystem from a business perspective, what are java people's thoughts on it? i know mysql's future is a lot more hazy.

16:19 but i'm not too knowledgeable about java in the hands of sun vs java in the hands of oracle

16:20 Chousuke: stuartsierra: that almost sounds like the genitive form of my last name (orasen) :P

16:20 stuartsierra: Chousuke: Make them hire you because of that.

16:20 Chousuke: heh

16:21 lancerx: from an enterprise perspective? Java is "too big to fail". Oracle has a java monetization strategy called BEA, so expect serious cutbacks in the free stuff and more payware.

16:21 slyphon: can you :/

16:21 sorry

16:22 stuartsierra: But if Oracle seriously screws Java, IBM or somebody will be happy to step in.

16:23 technomancy: lancerx: it's pretty complicated/error-prone to manually install swank even for experienced Emacs users; has nothing to do with noobness.

16:23 lancerx: and everything rickey has said about JVM's is dead on

16:23 technomancy: that's why I try to get people to install things the easy way

16:23 stuartsierra: And there's always good 'ol inferior-lisp-mode.

16:24 technomancy: true; that doesn't get enough mention

16:24 stuartsierra: Which gives you 9/10 the benefit of SLIME for 1/10 the effort.

16:24 ordnungswidrig: where is ->> ?

16:24 technomancy: 90% is a bit generous; /me doesn't know what he would do without M-.

16:24 lancerx: technomancy: yeah, I really did it as an emacs learning exercise - I can write it up if you think it'd be useful

16:24 hiredman: in 1.1

16:24 technomancy: I guess you could build a manual tags table, but ick.

16:25 lancerx: actually it'd be better if you didn't unless you were careful about keeping it up to date.

16:25 lancerx: ok, consider it !done :)

16:25 technomancy: lancerx: the #1 problem with swank installation is people finding out-of-date tutorials on peoples' blogs and using them instead of the official docs.

16:25 opqdonut: :D

16:26 lancerx: yup, that was my problem :)

16:26 technomancy: appreciate the thought though. =)

16:26 hiredman: hmm

16:27 sounds like we need a bug database where you can file bugs against urls

16:29 * dnolen agrees with technomancy about M-., C-c <return> also

16:29 lancerx: Getting the ELPA versions running was really straightforward, but what wasn't clear to me was how to point them at my git clones of clojure and clojure-contrib, so that was a secondary motivation. I understand now 'swank-clojure-classpath', but I just didn't get it the first time around.

16:30 stuartsierra: hiredman: Or comment on the blog posts.

16:30 dnolen: lancerx: I couldn't get swank-clojure-classpath to work. I symlinked to my built jars.

16:30 but perhaps it changed.

16:30 technomancy: lancerx: standalone M-x slime sessions really aren't the common case it's designed to work with.

16:31 but I agree it could use some streamlining/extra explanation for that case.

16:31 lancerx: Oh, I was starting with that ants.clj tutorial

16:31 which sends you in that direction

16:32 stuartsierra: clojurebot: def ants.clj is old

16:32 hiredman: clojurebot: ants.clj?

16:32 clojurebot: ants is http://clojure.googlegroups.com/web/ants.clj

16:32 hiredman: clojurebot: def ants.clj?

16:33 hmmm

16:33 I must have broke it

16:34 lancerx: so is there a more canonical/updated short tutorial?

16:36 arohner: what requirements does lein test have?

16:36 hiredman: oh, it thinks you are trying to lookup the definition for a symbol ants.clj

16:36 arohner: it's complaining about not finding files in my class path, that work fine if I start with 'lein repl'

16:37 nm, stupid mistake

16:38 konr: I'm not being able to import a class (NoClassDefFoundError), but importing its inner class works fine. What could be wrong? The jar?

16:40 Hali_303: (match [:a :b] [:a] "startswithA" [:a :b] "AandB") can someone explain why this evals to "startswithA"?

16:40 hiredman: clojurebot: def ants.clj?

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

16:41 dnolen: hmm, is there an easy way to flip between functions in a mapping operation? (map foo-on-even-bar-on-odd v)

16:41 ?

16:41 hiredman: cond

16:44 chouser: 'if' with 'indexed' would work

16:45 dakrone: ,(map #(cond (odd? %) (inc %) (even? %) (dec %)) (range 10))

16:45 clojurebot: (-1 2 1 4 3 6 5 8 7 10)

16:45 hiredman: oh

16:46 yeah, I assumed even? and odd?

16:46 you can always split the seq apart, map seperately, then interleave

16:46 dnolen: (map (flip-flop foo bar) v)

16:46 hiredman I need them to be in order for side-effects (OpenGL)

16:47 hiredman: ah!

16:47 but they will be!

16:47 dnolen: oh yes

16:47 you're right :)

16:48 hiredman: ,(let [x (range 10)] (interleave (map inc (take-nth 2 x)) (map dec (take-nth 2 (rest x))))

16:48 clojurebot: EOF while reading

16:48 hiredman: ,(let [x (range 10)] (interleave (map inc (take-nth 2 x)) (map dec (take-nth 2 (rest x)))))

16:48 clojurebot: (1 0 3 2 5 4 7 6 9 8)

16:48 hiredman: or something

16:50 dnolen: hiredman I like yours don't need to index the collection.

16:51 hiredman: it will generate more garbage

16:51 ephemera

16:54 jlilly: Anyone have an example of a good, concurrent clojure app? Looking for how people flow info through their programs.

16:57 lancerx: so looking at the four options outlined for clojure development in emacs (via swank-clojure), it looks like I should setup Leiningen and develop via options 3 or 4?

16:57 bsteuber: jlilly: did you read ants.clj?

16:57 hiredman: :D

16:58 http://github.com/hiredman/Repl

16:58 dnolen: hmm also this, (map (fn [[a b]] (foo a) (bar b)) (partition 2 v))

16:58 hiredman: Repl ends up with something like 21 threads just at start up

16:59 dunno if it is a good example

17:01 jlilly: bsteuber: I did. Looking for a 2nd code sample to compare / contrast.

17:02 technomancy: lancerx: that's probably the most straightforward way to go

17:03 bsteuber: jlily: too bad, I don't know another one =) so you could might start with hiredman's repl

17:03 lancerx: technomancy: thanks...maybe those could be promoted to items 1 & 2 in the list? :)

17:05 hiredman: Repl essential does message passing via a shared queue

17:14 stuartsierra: Second draft of new testing framework: http://paste.lisp.org/+21G4/1

17:14 Now with laziness!

17:15 Which was a heck of a lot harder than I expected.

17:17 * stuartsierra just noticed that paste.lisp.org highlights parens under the mouse

17:38 lancerx: whoa, it looks like lein copies jars from the local maven repo and populates lib/? how come?

17:39 technomancy: lancerx: because calculating the classpath out of ~/.m2 would be a pain

17:39 putting things in lib is a pretty common convention

17:41 lancerx: I guess seeing all the maven cruft made me shudder a bit :)

17:41 technomancy: it's a common symptom; you'll recover soon.

17:42 take two aspirin and contact a medical professional if you're still shuddering in the morning

17:43 lancerx: no, my maven antibodies are already flooding my system...

17:46 chouser: any chance it could use symlink on platforms that support it?

17:46 lancerx: chouser: I was just thinking that same thing

17:47 as an intermediate step to a fullblown classpath hack of course :)

17:47 oddly enough, my ~/.m2/repository is already a symlink :)

17:50 pro tip: I keep my maven repo and other java tools/libs outside my homedir because then I can share it to my vm's without worrying about them peeing in my ~

17:51 and it's easier to exclude that whole tree from Time Machine

18:03 kwertii: Is there yet any standard/preferred way to get more useful stacktraces in Emacs/SLIME? CLJDB, maybe?

18:05 The only lines in stacktraces that apparently refer to my code (loaded via SLIME) give (NO_SOURCE_FILE:1) as the line number, which isn't terribly helpful for tracking down the bug.

18:06 hiredman: you have load the whole file at a time

18:06 (I think)

18:06 or it's like one of those compile vs. eval options slime has, which are just silly

18:07 kwertii: I've been in a tight edit-test loop where I just reload forms on the fly with C-M-x. this is great for rapid development, not so great for debugging... is this just the price one pays for not loading the whole file?

18:08 hiredman: I believe so, but my experience with slime is not extensive

18:08 kwertii: SLIME knows where the fn is coming from. in theory, it could just tag whatever it pipes over to Clojure with the appropriate line numbers

18:09 I don't remember whether CL works this way too

18:09 the-kenny: kwertii: This should be fairly easy

18:09 kwertii: the-kenny: famous last words :)

18:09 hiredman: the-kenny: are you sure?

18:09 the-kenny: hiredman: Not absolutely, but I read the lines in the swank-source some time ago

18:11 kwertii: the-kenny: do you know whether the fix needs to be in SLIME or on the Clojure end?

18:11 hiredman: I think it would need both

18:12 the-kenny: kwertii: hm.. looks like it won't be that easy: http://github.com/technomancy/swank-clojure/blob/master/src/swank/commands/basic.clj#L43

18:12 hiredman: slime would need to get at the code between, read and compile time to alter line number information

18:12 the-kenny: the eval-stuff only gets a string, no line-numbers etc

18:14 kwertii: eval-region has a signature for [string file line].. if that is available somewhere from Emacs/SLIME, it would just be a matter of changing it to pass it along

18:14 I guess that would only get you the first line number of the function anyway

18:15 arohner: kwertii: I use C-c C-l (load file), that way the line numbers stay in place

18:15 kwertii: arohner: yeah, I guess that's a good workaround for now. I can just reload the whole file when bugs come up

18:16 arohner: when using lein swank, where can I set *print-length* and *print-depth*?

18:23 kwertii: arohner: in the REPL?

18:23 arohner: kwertii: automatically, on startup

18:23 I know I can set! it

18:24 kwertii: arohner: there must be some SLIME hook you can use in your .emacs

18:25 arohner: lein repl/swank both call clojure.main. I guess I can just do it with an --init

18:25 though it would be nice to create tasks in the project.clj file

18:30 hamza: aroher: check the last message in the tread, though i could not get it to work, http://groups.google.com/group/clojure/browse_thread/thread/11ee44e988022289

18:31 technomancy: arohner: you can create tasks in project.clj

18:32 you just need to define a fn named after the task in the leiningen/$TASK ns

18:32 lancepantz: technomancy: is there a way i can have lein test set environment variables?

18:32 technomancy: lancepantz: the JVM doesn't allow that

18:32 hamza: technomancy: i did that but lein does not pick the task defined?

18:33 technomancy: hamza: did you try it on 1.1.0?

18:33 it was a recent fix that enabled it

18:33 lancepantz: k

18:35 hamza: kk that may be it i'm on 1.0.1, one other thing i had was when developing plugins i have to compile it and cp it to lib folder to test otherwise it does not pick it up is this also fixed in 1.1.0?

18:36 technomancy: hamza: it should be fixed, yeah.

18:37 boojum: hmm, ldap search filters are like lisp

18:37 arohner: technomancy: I should have been more clear. I mean more like project-specific tasks

18:37 technomancy: like rake tasks

18:37 hamza: though i am sure i did self-install 2 days ago after i had a problem with maven folder do i have to get the new script too?

18:38 technomancy: arohner: no, I gotcha. you can do that now.

18:38 arohner: technomancy: how?

18:40 technomancy: arohner: just a make a function in the leiningen/my-task ns

18:40 arohner: cool

19:02 AWizzArd: rhickey: I switched now successfuly from hacks to Cells with my DB. Works nicely so far!

19:02 jcromartie: boojum: they most certainly are

19:03 boojum: several RFCs use s-expressions to define protocols and such (IMAP is a s-expression protocol)

19:11 Scriptor: hi everyone

19:13 noob question: why does Clojure use symbols for keys in something like structs, and not strings? efficiency?

19:15 mDuff: Scriptor, ...needing to test only for identity and not equality does improve efficiency, yes...

19:18 * mDuff is a noob here too, and thus uncomfortable querying Scriptor about whether "keywords" was actually meant as opposed to "symbols".

19:28 * mDuff is a bit disappointed to find that incanter appears to lack spline-fitting functionality.

19:33 jcromartie: man... wrangling text with ranges and all that junk is just so not fun in ObjC

19:37 tomoj: the other day I saw stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding

19:38 i.e. urlencode

19:38 :'(

19:38 * the-kenny is working with ObjC too

19:38 the-kenny: Way more fun than pure java or C++ in my opinion

19:38 tomoj: sorry

19:39 sure

19:39 still makes me wanna cry

19:43 Scriptor: mDuff, er, so the :foo syntax is for keywords?

19:44 the-kenny: Scriptor: It is

19:45 tomoj: ,(keyword? :foo)

19:45 clojurebot: true

19:45 tomoj: ,(symbol? 'foo)

19:45 clojurebot: true

19:46 Scriptor: argh, should've known that from before

20:09 uninverted: Anybody know how to set the classpath from clojure?

20:21 hamza: (System/setProperty "java.class.path" "same/path") should work

20:22 technomancy: uninverted: there's no way to do it reliably

20:24 uninverted: Hmm, even with the classpath set to the dir where foo.clj is, I still get java.io.FileNotFoundException: Could not locate foo__init.class or foo.clj on classpath: (NO_SOURCE_FILE:0)

20:52 dnolen: not sure if there's anyone into OpenGL, but I started porting the Nehe tutorials to Clojure, http://github.com/swannodette/clj-nehe, thanks to Penumbra and Lein it's a pretty simple affair to start hacking at OpenGL interactively right away.

21:06 dabd: I'm using json-str from clojure.contrib.json.write and I don't understand why it escapes all forward slashes like this: (json-str "http://localhost/foo") returns "\"http:\\/\\/localhost\\/foo\""

21:19 qed: evening gents

21:43 BrandonW: i'm building incanter... this is my first build of anything java. is it normal for a build to require downloading of about a million different small files?

21:44 konr: haha, yes, I had the same surprise

21:44 BrandonW: i guess it is a pretty decent size project

21:45 all that for matrix multiplication :)

21:50 chouser: incanter includes a bunch of other libs I believe

21:55 BrandonW: yes it sure does

22:06 konr: Do (read-line) work in your emacs? Here, it leaves SLIME waiting for more input indefinitely

22:07 BrandonW: in hind-sight, incanter is a lot of overhead to deal with for a simple one line puzzle solver, haha

22:08 konr: Well, you can always roll your own functions :)

22:45 redalastor: Does someone have a suggestion for key-value store for java / clojure?

23:00 dnolen: redalastor: I like CouchDB, and Clutch seems like it's getting a lot of development. There's also a library for MongoDB that people seem excited about.

23:00 lancepantz: redalastor: tokyocabinet is definitly the fastest

23:02 redalastor: I would need something that is pure java (or pure clojure).

23:02 Due to a "can't install anything on the server" limitation.

23:03 devlinsf: Voldemort?

23:03 lancepantz: all i can think of is the pure java berkeley db

23:03 voldemort, cassandra as well

23:03 those are intended to be distributed though

23:03 if you're doing voldemort on one node, might as well use bdb

23:05 redalastor: I'll check bdb.

23:07 dnolen: redalastor: fleetdb is pure clojure

23:09 redalastor: Ooooh... I'll check that too!

Logging service provided by n01se.net