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
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.
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
> 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
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