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

call superclass constructor in clojure class generation with defrecord

2015-01-30 Thread coco
Hi everybody, I need implement this java code in clojure public class MyWindow extends Window { public MyWindow() { super("My Window!"); } } MyWindow myWindow = new MyWindow(); unfortunately the clojure documentation for generate classes is

Re: Compilation and Class Generation newbie questions

2010-02-15 Thread Paulo Sérgio Medeiros
Hi! Thanks, i think i haven't executed java from command line for a while and forgot some things. ;-) On Mon, Feb 15, 2010 at 11:32 AM, Meikel Brandmeyer wrote: > Hi, > > On Feb 15, 6:13 am, Paulo Sérgio Medeiros wrote: > > > I think i've not figured out yet how compile and/or namespace works.

Re: Compilation and Class Generation newbie questions

2010-02-15 Thread Meikel Brandmeyer
Hi, On Feb 15, 6:13 am, Paulo Sérgio Medeiros wrote: > I think i've not figured out yet how compile and/or namespace works. > > I'm trying to execute the example posted inhttp://clojure.org/compilation > > I've created a file named "hello.clj" and put the clojure.jar in the same > directory (c:\

Re: Compilation and Class Generation newbie questions

2010-02-15 Thread Alex Ott
Hello If you declared clojure.examples.hello namespace, then you need to have file hello.clj in clojure/examples/ directory. and you need to have c:\clojure_tests in classpath, something like: java -cp clojure.jar:c:\clojure_tests clojure.main Paulo Sérgio Medeiros at "Mon, 15 Feb 2010 03:13:51

Compilation and Class Generation newbie questions

2010-02-15 Thread Paulo Sérgio Medeiros
Hello everyone, I think i've not figured out yet how compile and/or namespace works. I'm trying to execute the example posted in http://clojure.org/compilation I've created a file named "hello.clj" and put the clojure.jar in the same directory (c:\clojure_tests). Then, i started the REPL using

Class generation

2008-10-24 Thread Stephen Wrobleski
On Oct 19, 1:12 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > At that point, I'll have some syntax for adorning defns with metadata   > that will do what was once the work of genclass, and I'll be able to   > incorporate in that the enhancements to genclass that have been   > requested. > > I hope