Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Michael Klishin
Cedric Greevey: > Then he has a problem, since it doesn't work with reify and proxy, and > gen-class, deftype, and defrecord are top-level things that don't play > nice with putting them inside a defn. > I do not need them to be inside defn. They will be used as defn and defrecord are used, in

Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Michael Klishin
Chris Perkins: > You may want to dig a little deeper into why reify was not working for you. > As far as I can tell, the classes created by reify do have a public, no-arg > constructor, as you require: > > user> (-> (reify Runnable (run [_])) type .getConstructors seq) > (# > #) I have tried

Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Cedric Greevey
On Mon, Jan 23, 2012 at 6:17 AM, Tassilo Horn wrote: > Cedric Greevey writes: > > Hi Cedric, > >>> Do I see it correctly that you need a way (1) to have objects >>> implementing Job which (2) can be instantiated with a zero-args >>> constructor and (3) whose execute behavior is customizable by >>

Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Chris Perkins
You may want to dig a little deeper into why reify was not working for you. As far as I can tell, the classes created by reify do have a public, no-arg constructor, as you require: user> (-> (reify Runnable (run [_])) type .getConstructors seq) (# #) - Chris -- You received this message becau

Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Tassilo Horn
Cedric Greevey writes: Hi Cedric, >> Do I see it correctly that you need a way (1) to have objects >> implementing Job which (2) can be instantiated with a zero-args >> constructor and (3) whose execute behavior is customizable by >> providing an arbitrary function f on the JobExecutionContext?

Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Michael Klishin
Tassilo Horn: > Generally, proxy is for creating proxy objects, and the generation of a > class is more or less a side effect. > > Do I see it correctly that you need a way (1) to have objects > implementing Job which (2) can be instantiated with a zero-args > constructor and (3) whose execute be

Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Cedric Greevey
On Mon, Jan 23, 2012 at 3:54 AM, Tassilo Horn wrote: > Michael Klishin writes: > > Hi Michael, > >> I am trying to make it possible to use functions as Quartz jobs for my >> Clojure DSL on top of Quartz [1]. For that, I need to implement a >> simple 1-method interface. Both gen-class and defrecor

Re: Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-23 Thread Tassilo Horn
Michael Klishin writes: Hi Michael, > I am trying to make it possible to use functions as Quartz jobs for my > Clojure DSL on top of Quartz [1]. For that, I need to implement a > simple 1-method interface. Both gen-class and defrecord with > additional methods work great but seem too heavyweight

Implementing an interface with core/proxy results in UnsupportedOperationException

2012-01-22 Thread Michael Klishin
Hi, I am trying to make it possible to use functions as Quartz jobs for my Clojure DSL on top of Quartz [1]. For that, I need to implement a simple 1-method interface. Both gen-class and defrecord with additional methods work great but seem too heavyweight in many cases so I am trying to add fun