Re: Single method interface proxies

2009-09-18 Thread John Newman
I agree though, proxy is off-putting. It just looks so much less clean than the rest of Clojure. On Fri, Sep 18, 2009 at 6:43 PM, CuppoJava wrote: > > Hi Nikolay, > In my opinion it's hard to reduce the verbosity of proxy without > sacrificing some of its generality. For my own code I just made

Re: Single method interface proxies

2009-09-18 Thread CuppoJava
Hi Nikolay, In my opinion it's hard to reduce the verbosity of proxy without sacrificing some of its generality. For my own code I just made a new_listener macro that simply returns a new actionListener for me. This worked fine since 99% of the time, I only use proxies for actionListeners anyway.

Re: Single method interface proxies

2009-09-18 Thread Nikolay Petrov
Hi, Thanks that is good to know. However the origin of my problem was in implementing ActionListeners :) Best Regards, Nikolay Petrov On Sep 18, 3:59 pm, "David Powell" wrote: > > Hi, > > > I was thinking can we do some magic to easily implement single method > > interfaces? What i mean how ca

Re: Single method interface proxies

2009-09-18 Thread David Powell
> Hi, > > I was thinking can we do some magic to easily implement single method > interfaces? What i mean how can we reduce the noise in the following: > > (proxy [java.lang.Runnable] [] (run [] (println "running"))) FYI: For this specific case, the answer is fairly simple. Clojure fn's implem

Single method interface proxies

2009-09-18 Thread Nikolay Petrov
Hi, I was thinking can we do some magic to easily implement single method interfaces? What i mean how can we reduce the noise in the following: (proxy [java.lang.Runnable] [] (run [] (println "running"))) (proxy [java.util.concurrent.Executor] [] (execute [runner] (.run runner))) And settled on