#clojure log - May 23 2009

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

0:00 danlarkin: greetings clojurecrats

0:08 cads: how do I represent a lexical context, where I have a set of co-recursive functions defined in terms of each other, and I'd like to store the bindings in a structure and possibly manipulate them later?

0:11 I can represent a list of mutually non-recursive functions as a map of [:fname fn]

0:11 and I guess that in the case of co-recursive functions a trampoline can be used

0:12 brb

0:17 durka42: what's the best way to make {:a 1, :b 2} into [:a 1 :b 2] (order immaterial of course)

0:17 #(vec (flatten (seq %))) seems a little excessive

0:18 #(vec (interleave (keys %) (vals %))) works too

0:20 danlarkin: the second one, I guess

0:29 unlink: ,(reduce concat {:a 1 :b 2})

0:29 clojurebot: (:a 1 :b 2)

0:30 danlarkin: I like that better

0:35 durka42: me too

0:36 ,(apply concat {:a 1 :b 2})

0:36 clojurebot: (:a 1 :b 2)

0:36 * durka42 wonders what the difference is in this case

0:38 danlarkin: concat might reduce internally

0:38 durka42: it does something clever that looks sort of like a reduce

0:38 but i would have to study it to understand

0:38 ~def concat

0:47 Raynes: XMonad is awesome.

0:53 danlarkin: hooray, pushed http://github.com/danlarkin/clojure-couchdb/

1:44 Guest34615: hey, how do I flatten a nested sequence?

1:45 cgrand: Guest34615: flatten in contrib or (tree-seq seq? seq '((1 2 (3)) (4))) which gives you more options

1:48 Guest34615: ,(tree-seq seq? seq '((1 2 (3)) (4))

1:48 clojurebot: EOF while reading

1:48 Guest34615: ,(tree-seq seq? seq '((1 2 (3)) (4)))

1:48 clojurebot: (((1 2 (3)) (4)) (1 2 (3)) 1 2 (3) 3 (4) 4)

1:50 cgrand: hmmm no coffee yet, please wait, brain is booting

1:50 ,(remove seq? (tree-seq list? seq '((1 2 (3)) (4))))

1:50 clojurebot: (1 2 3 4)

1:51 Guest34615: ,(filter #(not seq?% ) (tree-seq seq? seq '((1 2 (3)) (4))))

1:51 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: core$not

1:51 Guest34615: ,(filter #(comp not seq? ) (tree-seq seq? seq '((1 2 (3)) (4))))

1:51 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--1679$fn

1:51 Guest34615: ,(filter (comp not seq? ) (tree-seq seq? seq '((1 2 (3)) (4))))

1:51 clojurebot: (1 2 3 4)

1:51 Guest34615: heh

1:54 actually I think I can use reduce concat in this case because they're nested only one level deep

1:59 xolus: Anyone out there have any experience using clojure in .NET via IKVM? I got some clojure code that I compiled to a jar, but only see the main method in the generated library from ikvmc. I want to call my other clojure functions but don

1:59 *dont see them

2:11 cgrand: Guest34615: (mapcat identity ...) or (apply concat ...) are lazy (reduce concat ...) isn't

2:40 Guest34615: check it out http://paste.lisp.org/display/80698

2:43 by wrapping the notion of a pairwise operation between two maps of :keyword Number pairs, I'm able to create vector space operators

2:45 so if I had a map of {:word frequency-of-use}, I could represent a vector of words associated to a numerical value

2:45 which I could extract from a document, for example

2:46 then, it would be possible to compare the distance between two document word vectors

2:46 or search in a collection of documents for documents that have the same word usage profile

2:52 cgrand: Guest34615: how odes this differ from merge-with?

2:52 (merge-with + {:a 23, :b 2, :c 6, :d 5} {:b 2, :c 6, :f 5, :g 9})

2:52 ,(merge-with + {:a 23, :b 2, :c 6, :d 5} {:b 2, :c 6, :f 5, :g 9})

2:52 clojurebot: {:g 9, :f 5, :a 23, :b 4, :c 12, :d 5}

2:53 Guest34615: oo, that's nice

2:54 cads: ,(merge-with * {:a 23, :b 2, :c 6, :d 5} {:b 2, :c 6, :f 5, :g 9})

2:54 clojurebot: {:g 9, :f 5, :a 23, :b 4, :c 36, :d 5}

2:55 cads: ,(merge-with * {:a 23, :b 2, :c 6, :d 5} {:b 0, :c 0, :f 0, :g 0})

2:55 clojurebot: {:g 0, :f 0, :a 23, :b 0, :c 0, :d 5}

2:57 cads: in multiplication, you'd like to take all the pairs in the maps that have the same key value, and multiply their two values. If there's only one value for a given key, or if the multiplication of the two values yields zero, then drop that key

3:00 cgrand: cads: it depends, but if you are using maps as sparse vectors then you certainly want this

3:31 cads: cgrand check this out: http://paste.lisp.org/display/80698#1

3:31 they're a kind of sparse vector

3:34 how could I read a string into a map where each unique word in the string is associated to the number of times the word was in the string?

3:35 cgrand: cads: quick tip, (or (a %) 0) can be written (a % 0)

3:37 ,(apply merge-with + (map (fn [w] {w 1}) (.split "Returns a map that consists of the rest of the maps conj-ed onto" "\\s+")))

3:37 clojurebot: {"a" 1, "Returns" 1, "conj-ed" 1, "that" 1, "the" 2, "rest" 1, "of" 2, "maps" 1, "onto" 1, "consists" 1, "map" 1}

3:38 cads: nice

3:39 cgrand: see http://clj-me.blogspot.com/2009/04/counting-occurences-solution-to.html

3:43 cads: haha, according to my program, the above map was about 0.5 radians closer to a map extracted from the doc string of another function than it was to {"a" 3 "b" 12 "c" 10 }

3:44 of course, the latter is nearly perpendicular to your map, as the only shared element is "a"

3:47 the neat thing is that if we change things to (def op #(fn [a b] map % a b) (def zero (repeat 0)) (defn dot [a b] (reduce + ((op *) a b))), then we get normal vectors

3:49 so that (add [1 2 3] [3 4 5 6]) => [4 6 8] or (dot (repeat 1) [0 1 1]) => 2

3:50 in this case, operations between vectors of different dimension are automatically truncated

3:52 cgrand, cool post

3:56 with my code, I'm trying to see how much can be factored out of the code required to represent a general linear space, so that I can generate linear space operations from a few basic parameters

4:01 for example, (def op #(fn [a b] (fn [x] (% (a x) (b x))))) (def zero (fn [x] 0)) lets you add and subtract functions

4:02 but the definition of dot suddenly becomes a lot more complex

4:03 because the inner product between two functions is defined as an integral of the product of the functions

4:04 hehe, I think prod breaks down here too

5:30 unlink: ...

5:30 this works: java -Dclojure.compile.path=$PWD/classes -classpath $HOME/Lib/clojure.jar:src:classes clojure.lang.Compile hello

5:31 but this doesn't: java -Dclojure.compile.path=classes -Djava.ext.dirs=$HOME/Lib -classpath src:classes clojure.lang.Compile hello

5:31 why?

5:59 noidi: is there a shorthand for (:require [foobar.baz.xyzzy :as xyzzy]) ?

5:59 I keep doing that a lot...

6:03 StartsWithK: unlink: do you get any error messages?

6:04 noidi: i don't think there is

7:20 cemerick: shouldn't this return 5?

7:21 ,(let [{a :a :or {:a 5}} {}] a)

7:21 clojurebot: nil

8:00 cgrand: cemerick: (let [{a :a :or {a 5}} {}] a)

8:00 ,(let [{a :a :or {a 5}} {}] a)

8:00 clojurebot: 5

8:19 rhickey: gnuvince: where's that node counter code?

8:27 cgrand: rhickey: http://paste.lisp.org/display/80683 ?

8:28 rhickey: thanks

9:19 minciue: hi, is anyone here using compojure with emacs and slime and clojure-mode? I was wondering if someone could help me with setting that up

9:47 gnuvince_: rhickey: the code cgrand linked to is the one.

11:57 eliantor: hi i'm try to use parallel, but when i try to load the file parallel.clj it throws an exception

11:58 ClassNotFoundException jsr166y.forkjoin.ParallelArray

11:59 StartsWithK: eliantor: you will need forkjoin lib

11:59 eliantor: i downloaded jsr166y.jar and added it to the claspath

11:59 but still no luck

11:59 StartsWithK: hmm

11:59 eliantor: i also downloaded the extra jar

12:00 because looking at the javadoc it tells that ParallelArray is in that jar

12:00 but it doesn't work

12:01 StartsWithK: you are right, just tried it

12:02 eliantor: i'll try to give a look at parallel but i'm really new to clojure

12:02 StartsWithK: eliantor: http://is.gd/CHki

12:03 eliantor: oh thanks

12:10 lisppaste8: durka42 pasted "fix the forkjoin imports" at http://paste.lisp.org/display/80715

12:10 durka42: eliantor: ^^

12:11 eliantor: thanks durka

12:34 quidnunc: Is there a "drop-nth"?

13:52 cgrand: quidnunc: I saw you were struggling against Enlive selectors some days ago

13:53 dnolen: speaking of which ... :) ... cgrand: I guess it not possible to select a text node yet based on it's content?

13:54 cgrand: dnolen: you can... if you write your own predicate

13:56 dnolen: and it's possible to make a pred that compares the content of a node to any string?

13:56 quidnunc: cgrand: Thanks, I mostly got it sorted out. I was surprised though that for class="foo bar" you need to do (has-class "foo" "bar").

13:57 dnolen: [:div (text= "foobar")] is possible?

13:57 cgrand: dnolen: (def match [re] (sm/pred #(and (-> % z/node string?) (re-matches re %)))) ; or something like that

13:58 (def match [re] (sm/pred #(and (-> % z/node string?) (re-matches re (z/node %))))) ; or something more like that

13:59 kotarak: StartsWithK: Hi. I think, one cannot specify the dependencies between artifacts in Ivy. One has to use configurations to model this. Or one has to do one module per contrib module.

13:59 cgrand: quidnunc: I annotated your paste back then http://paste.lisp.org/display/80388#1

13:59 quidnunc: Thanks cgrand.

14:00 dnolen: thanks, does it make sense to include something like this Enlive, since matching in XML documents usually requires text node matching?

14:01 cgrand: dnolen: why not, I don't know which one to include

14:02 dnolen: of the two that you just wrote? :)

14:02 cgrand: the one that works maybe? :-)

14:07 quidnunc: cgrand: How is "chaining" selectors different from intersection of the results of selectors?

14:13 cgrand: [[:div :.foo]] matches <div class="foo"> while [:div :.foo] doesn't

14:16 eliantor: join #vimclojure

14:17 :)

14:17 does anyone use vimclojure?

14:18 cgrand: quidnunc: [:div :.foo] matches the span <div><span class="foo"></span></div> or in <div><p><span class="foo"></span></p></div>

14:18 kotarak: yep

14:18 eliantor: is it possible to use a user.clj file to store things for the repl?

14:19 kotarak: eliantor: not at the moment.

14:19 I can add that.

14:19 eliantor: kotarak: no other solution to reload configurations?

14:19 kotarak: eliantor: (load-file "/your/user.clj")

14:20 eliantor: yep

14:20 ok

14:20 anyway i really like it

14:20 cgrand: dnolen: would you be happy with (text-matches pattern-or-string)?

14:21 eliantor: i'm trying to learn clojure, and it's really a pleasure to write code in that environment

14:24 kotarak: eliantor: :)

14:33 cemerick: rhickey: it's a small thing, but: a type hint should be added to the multifn arg in defmethod, to avoid the spurious warnings when warn-on-reflection is true (it's the only multimethod-related fn that isn't type-hinted).

14:41 cgrand: dnolen: added text-pred for now

14:49 dnolen: cgrand: sounds good!

16:07 unlink: What's the idiom for transforming a seq of 2-tuples into a map?

16:09 cmvkk: (into {} ...)

16:36 dmiles: about once a week i google for "pipe stderr" and RSchulz is the first entry :)

16:37 RSchulz: My ears are ringing...

16:37 dmiles: http://www.google.com/search?q=pipe+stderr

16:38 RSchulz: Yeah. I own piping to standard error. That's from my Cygwin days.

16:39 dmiles: indeed

16:40 hrrm clojure over IKVM is pretty nice.. however have ot make it think more in .NET types for the basic primitives

16:46 unlink: What is http://github.com/kevinoneill/clojure-contrib/tree/master ?

16:48 Chousuke: unlink: "what"? an unofficial git mirror of clojure-contrib

16:49 unlink: ok

16:49 What's the proper place to suggest patches to clojure-contrib?

16:50 Chousuke: the google group. but be aware that you need a CA to contribute patches :/

16:50 unlink: certificate authority?

16:50 Chousuke: contributor agreement :p

16:51 unlink: oh, how do I do that?

16:51 kotarak: http://clojure.org/contributing IIRC

16:51 Chousuke: yeah.

16:53 unlink: I grant him perpetual, irrevocable, worldwide, royalty-free license to all my patents?

16:54 kotarak: *shrug* Don't have any patents and probably will never anyway...

16:55 unlink: oh

16:56 clojure and clojure-contrib is what he means by project name?

16:57 Chousuke: unlink: concerning the code you contribute, anyway

16:58 tashafa: #^Ifn

16:58 is id #^IFn or #^Function?

16:58 is it*

16:59 unlink: tashafa: depending on what you mean, #^clojure.lang.IFn or #^clojure.lang.Fn

16:59 Fn means (fn ...), IFn includes {}, keywords, etc

16:59 tashafa: ah

16:59 thanks

17:00 im trying to enforce some strong typing... is there a reference for this

17:01 for maps, vecs, sets, etc..?

17:01 unlink: tashafa: Clojure already does enforce strong typing...if you're looking for static typing, Clojure doesn't have that.

17:02 kotarak: There is no such thing as string typing. Type hints are just hints. The compiler does not *enforce* the type, but believes the programmer that the object is actually of that type.

17:02 unlink: tashafa: Return-value tags and type hints don't enforce types, either. They only perform casts, and then only when needed.

17:02 tashafa: ah

17:02 so when i have (defn f [#^String s]... it's just a type hint

17:03 unlink: ,((fn [#^String x] x) 1)

17:03 clojurebot: 1

17:03 kotarak: tashafa: yes

17:03 It's also not a cast.

17:03 unlink: however: ,((fn [#^String x] (.toUpperCase x)) 1)

17:03 tashafa: cool thanks

17:03 unlink: er...

17:04 that would give: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

17:04 tashafa: The only purpose for those type annotations is to avoid having to reflect on objects for method/field access

17:05 tashafa: unlink: gotcha

17:05 unlink: tashafa: If you do (.foo bar), and you didn't tell clojure what type bar is, it doesn't make any effort to statically infer the type, and simply looks it up at runtime

17:06 tashafa: This comes with a big performance penalty, so you can annotate parameters and return values with a type, so instead of having to look up the type, it casts to that type at runtime.

17:06 tashafa: However this gives you only minimal type safety over reflection. It is 99% an optimization.

17:14 tashafa: i wonder why i was thinking type hints did static typing

17:16 dreish: The difference is somewhat subtle.

17:24 StartsWithK: kotarak: yes, one artifact (inside a module) can't depends on another

17:24 kotarak: you will need to split modules by name to something like contrib.xml contrib.def ... and create relation between them

17:24 kotarak: StartsWithK: so one has to use either configurations or one module per contrib module.

17:25 StartsWithK: kotarak: one module

17:25 so module can have artifacts like contrib-def.jar contrib-def-sources.jar contrib-def-docs.jar ..

17:26 in another module you will then depend on contrib.def and only on let say aftiract sources

17:27 kotarak: -.- ant needs a for loop ....

17:27 StartsWithK: btw, i just pushed to my cloak fork new action clojurec that works like (clojurec [src-dirs] dest-dir)

17:28 it scans a src-dirs for clojure namespaces definitions in clj files and compiles them

17:28 kotarak: Cool.

17:28 StartsWithK: so, not it has somethink like <javac srcdir='' destdir=''/>

17:28 now*

17:29 for a 'for' loop, there is a solution, in a way

17:29 you could create module.xml that will have a generic build for every module (i guess they have a same build)

17:30 then by using a ivy:buildlist you can construct a list of subant builds (it will order them by there deps in ivy.xml)

17:30 and execute them with subant

17:33 kotarak: Yes. I know. But this was rather arkward with the current setup of contrib.

17:33 But this was also my first experiment with Ivy.

17:33 So maybe I should revisit this approach.

17:33 StartsWithK: yes, contrib will need to split modules in separate directories for this to work

17:34 but thats a standard practice for multi-module projects any way

17:34 kotarak: Hmm.. I don't want to mess with the directory structure too much.

17:35 At the moment it seems, that maven will be the main distribution way for clojure.

17:35 So I think it's not an option to mangle the dir structure for an approach, which will probably not be used anyway.....

17:36 StartsWithK: i don't think it can work without it, you'll get mixed compilation units in the same directory, and there is no way to split them up later

17:36 kotarak: That's what I do now....

17:36 StartsWithK: but maven will need a directory split too

17:36 and it will go even deeper

17:36 kotarak: Ok. I don't know maven...

17:37 StartsWithK: like clojure/contrib/contrib-defs/main/src/clojure/clojure/contrib/def.clj

17:37 from the top of the project tree

17:37 kotarak: I wrote an email to Rich, but haven't received an answer, yet. So I don't know what his plans are at the moment.

17:37 I think, he's avoiding this question at the moment.

17:38 StartsWithK: if it is just about generating a .pom, ivy can generate one too

17:38 if its a maven based build.. god save us all :)

17:39 kotarak: Maybe this could work: compile is it is done now. Build jars as it is done now. Provide different ivy-bla.xml files for the different modules. Loop through the ivy-bla.xml files on publish.

17:41 StartsWithK: if you don't do a aot, just sources, it could be easyer to leave current directory structure

17:42 i don't know how to separate (proxy) once compiled

17:42 it dosn't generates .class in clojure.xxx namespace

17:42 is that a problem in contrib?

17:43 kotarak: StartsWithK: as I said: at the moment the jars are separated from the common compilation directory. The proxy things is ugly, though. It a special jars which is included in all configurations which need it...

17:44 Oh dear.... It is a special jar ....

17:44 StartsWithK: that could be a problem on the consumer side

17:44 lest say i dep on common.jar v1.0 from defs v1.0 and on common.jar v1.1 for xml v1.1

17:45 no need for me to have all modules in sync in my project

17:46 kotarak: Well. Here some resolution is needed anyway, no? xml v1.1 might also depend on defs v1.1... What now? So this is a general problem which will happen anyway.

17:48 StartsWithK: yes, but if defs v1.0 and xml v1.0 don't share any deps (take miglayout and xml), but they have a new commons.jar they are now tied together for no reason

17:50 kotarak: That's an ugliness of proxy....

17:51 StartsWithK: and not only proxy, java has Proxy class that will do something like that (not used in contrib) and anything can use asm lib to generate bytecode (not used in contrib)

17:53 i was plangin to do a ant wrapper for cloak first then ivy one, but, maybe ivy should go first

17:53 planing*

17:53 i know it won't be used to build a contrib

17:54 but, most clojure build will be simple like get-deps -> clojurec-my-src-dir

17:54 only thing that is needed is jar task from ant, more or less

17:56 this is a simple build http://paste.pocoo.org/show/118763/ based on cloak clojurec that i created for some experiment yesterday

17:57 it compiles a src dir and generates completitions file

17:57 so, my first all clojure build :)

17:57 kotarak: hehe :)

18:07 StartsWithK: hmm.. ok, maybe a solution

18:07 to preserve current directory structure

18:07 in build create alternative directory strucutre just for modules

18:08 so, it is as it is, but when you build it, rearange it to beat proxy problem

18:08 kotarak: Hmm.. That would be a possibility. But it would require several clojure.lang.Compile calls.

18:08 clojurebot: clojure is a very attractive hammer with a nice heft to it

18:09 StartsWithK: sure, and in a way, thas just what you want

18:10 so you can compile different modules to different classes/ dirs

18:10 no proxy proble, and real structure is at it was

18:10 kotarak: Hmm...

18:10 Let's see...

18:11 Guest40739: hey, you guys know if konrad hinsen chats here?

18:12 kotarak: Not that I am aware of it....

18:14 dreish: Anyone have an example of using :reload-all with (ns x (:require [...]))?

18:14 I keep getting the error "No value supplied for key: true"

18:15 kotarak: (require :reload-all 'my.name.space)

18:15 dreish: Ah, thanks, outside the square brackets. That works.

18:15 slashus2: I was trying to do the programming problem http://www.haskell.org/haskellwiki/Programming_performance and my solution seems to be very slow for some reason. Any pointers? http://paste.lisp.org/display/80730

18:17 dreish: What does the profiler show?

18:17 slashus2: Running it now.

18:19 How should I run the profiler just -Xprof ?

18:19 dreish: I see two things: 1. (map vector closing-prices ...) -- I don't see why that's needed; 2. destructuring is handy, but not optimally fast.

18:19 slashus2: I wanted a way to easily get at the previous closing price.

18:20 dreish: Oh, I see, I was misreading that. Still, that doesn't look like the fastest way to do that.

18:21 I think something like (map #(take 2 %) (take-while identity (iterate rest closing-prices))) might be faster.

18:21 slashus2: I tried with destructuring and without. It didn't seem to make much difference.

18:22 dreish: man java gives some examples for using the profiler.

18:22 slashus2: I just did -Xrunhprof

18:22 It gave a lot

18:23 dreish: Actually, I guess it just has a URL with some more extensive documentation.

18:24 slashus2: I cut it down quite a bit just type hinting a few strings.

18:24 cads: what is the lisp ide that has that feature where the code is turned into a mini-bitmap that lets you scroll through large amounts of code while still seeing the code's shape?

18:26 StartsWithK: cads: i don't know a name, but maybe you are refering to a demo for scheme language where they manipulate a code with a mouse as different shapes?

18:26 cads: I think it's in dr-scheme, actually

18:27 moving code around like that would be scary to me :)

18:27 StartsWithK: we need something like that :)

18:28 cads: I want something that takes one of my one-liners and converts it to multi-line indented code of the type that I write for quick understanding

18:28 StartsWithK: cads: pprint in contrib maybe?

18:28 cads: it's wierd how I can parse code by shape now

18:30 lisp is such a blessing with no delimiters in lists or hashes, and the square braces for vectors really make things like function definitions and lets very easy to read

18:31 i'll try it out

18:55 replaca: cads: if you use pprint, use *code-dispatch* for code

19:08 kotarak: StartsWithK: it seems to work :)

19:08 StartsWithK: kotarak: :)

19:09 * StartsWithK wants zero to full clojure setup in 10 min for a new user :)

19:09 kotarak: added module subdir with subdirs for every module contain a small build.xml sourcing the common.xml at toplevel as well as an ivy.xml giving the deps.

19:09 StartsWithK: kotarak: will you paste your build on ml soon?

19:10 i would like to look at that, so i can model cloak based on it

19:10 kotarak: StartsWithK: Hopefully. It works only partially but I will move the whole thing. I'm pretty busy tomorrow, but maybe I can hack something up for tomorrow evening.

19:11 StartsWithK: ne rush, i don't think i can add a ivy wrapper in a day

19:11 kotarak: Currently c.c.def, lazy-seqs and lazy-xml work.

19:11 proxy is tamed with this setup. :)

19:11 StartsWithK: :)

19:13 kotarak: Oerk. Now comes all the moisture for providing custom ivy.xml and build.xml for each module..... :/

19:15 StartsWithK: maybe you could use clojure.xml for that

19:16 like alldeps.clj with clojure encoded ivy descriptions, and just emit them to right places before you build modules

19:16 (def def-deps [{:org o :name n :rev r :arfifacts []}])

19:16 kotarak: Hmmm... yeah. That would be a possibility.

19:17 StartsWithK: it will be much shorter than xml files, and not scatered all around

19:27 blbrown: is clojure.lang.Script in clojure 1.0

19:27 kotarak: I think it's superseded by clojure.main

19:42 StartsWithK: kotarak: http://paste.pocoo.org/show/118780/ something like this maybe (unfinished)

19:45 kotarak: Ok. This is more sophisticated. (and probably the Right Way). Was about to use format, but you are right. Thanks for the snippet.

20:27 Raynes: One of the HWN quote's of the week: "roconnor: Damn it, I don't know how to make this as slow as python."

20:52 chessguy: anybody know of a good example of using proxy to create an instance of an interface? particularly an interface with a function that returns void

20:54 StartsWithK: (gen-interface :name my.org.ISomething :methods [[foo [] void]]) (proxy [my.org.ISomething] [] (foo [] (println "I think this will work")))

20:57 chessguy: ,(proxy [(gen-interface :name ns :methods [[foo [] void]])] [] (foo [] (println "test")))

20:57 clojurebot: java.lang.RuntimeException: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol

21:02 Chouser: no, gen-interface is compile-time only

21:03 you have an inteface already?

21:03 clojurebot doesn't let you use proxy anyway

23:28 blbrown: http://paste.lisp.org/display/80734 what is wrong with this code, referencing a member of an object

23:28 durka42: the evt/gc syntax is for static members

23:28 clojurebot: for is a loop...in Java

23:28 durka42: you want (.gc evt)

23:28 blbrown: cool

Logging service provided by n01se.net