Re: call superclass constructor in clojure class generation with defrecord

2015-02-07 Thread coco
Sorry for don't reply before, thanks so much michael, that works...and gary for the explanation, now it's much more clear to me...thanks guys El viernes, 30 de enero de 2015, 18:35:02 (UTC-4:30), coco escribió: > > Hi everybody, I need implement this java code in clojure > > public class MyW

Re: call superclass constructor in clojure class generation with defrecord

2015-02-01 Thread Gary Verhaegen
The short answer is no, there is no way to override the constructor. proxy is not meant to create a class, it is meant to create an object. You have an API that requires an object of type A. So you can pass it either an object of type A, or an object of a subclass of A. You do not want to create a

Re: call superclass constructor in clojure class generation with defrecord

2015-02-01 Thread Fluid Dynamics
On Sunday, February 1, 2015 at 11:08:19 AM UTC-5, Michael Blume wrote: > > Yes, but that's for methods you're overriding and OP wants a constructor > For that you just replace (proxy foo ...) with (doto (proxy foo ...) (.doThisThingy x) (.addThatComponent y) (.etc)) I would expect. --

Re: call superclass constructor in clojure class generation with defrecord

2015-02-01 Thread Michael Blume
Yes, but that's for methods you're overriding and OP wants a constructor On Sun, Feb 1, 2015, 12:22 AM Fluid Dynamics wrote: > On Saturday, January 31, 2015 at 6:34:10 PM UTC-5, Michael Blume wrote: >> >> The defn wrapping the call to proxy basically is the constructor, so you >> wind up with so

Re: call superclass constructor in clojure class generation with defrecord

2015-02-01 Thread Fluid Dynamics
On Saturday, January 31, 2015 at 6:34:10 PM UTC-5, Michael Blume wrote: > > The defn wrapping the call to proxy basically is the constructor, so you > wind up with something roughly like > > (defn get-window [] > (let [this (proxy [Window] ["My Window!"] > ; any methods you wan

Re: call superclass constructor in clojure class generation with defrecord

2015-01-31 Thread Michael Blume
The defn wrapping the call to proxy basically is the constructor, so you wind up with something roughly like (defn get-window [] (let [this (proxy [Window] ["My Window!"] ; any methods you want to override on Window go here ) ; stuff making panels goes her

Re: call superclass constructor in clojure class generation with defrecord

2015-01-31 Thread coco
thanks Michael this does the job...in this code, now I've other doubt public class MyWindow extends Window { public MyWindow() // <--- not clear where I need declare it { super("My Window!"); Panel horizontalPanel = new Panel(new Border.Invisible(), Panel.Orientation.HORI

Re: call superclass constructor in clojure class generation with defrecord

2015-01-30 Thread Michael Blume
(defn my-window [] (proxy [Window] [])) should do the trick Proxy takes a vector of implemented interfaces and at most one superclass (in your case, Window), and then a second vector of arguments to pass to the superclass constructor (in your case, an empty vector) and then a series of methods