Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-10 Thread Renaud Gaujoux
Nice, I'll see which methods suits better my use. It's just that I was expecting the initialize-callNextMethod-validity workflow to work automatically in such a situation. Thanks so much Martin. Martin Morgan wrote: Renaud Gaujoux wrote: Hi, The technique of writing constructors prevent

Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-10 Thread Martin Morgan
Renaud Gaujoux wrote: > Hi, > > The technique of writing constructors prevent from using simply the > 'new' function (which I find nice as it takes the class to construct as > a character string (useful in my project) and provides a single > interface for object creation). > So doesn't the built-i

Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-10 Thread Martin Morgan
Renaud Gaujoux wrote: > Thanks Martin, > > I'll try that. One question about memory though, just to be sure. When > one does: > > # create new instance of A > a <- new('A', ...) > # create new instance of B based on a > b <- new('B', a, b=...) > > Will two instances of A be created (using twice

Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-10 Thread Renaud Gaujoux
Hi, The technique of writing constructors prevent from using simply the 'new' function (which I find nice as it takes the class to construct as a character string (useful in my project) and provides a single interface for object creation). So doesn't the built-in schema of initialize-validate

Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-10 Thread Renaud Gaujoux
Thanks Martin, I'll try that. One question about memory though, just to be sure. When one does: # create new instance of A a <- new('A', ...) # create new instance of B based on a b <- new('B', a, b=...) Will two instances of A be created (using twice the memory) or will there be a single in

Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-09 Thread Martin Morgan
Hi Renaud -- Renaud Gaujoux writes: > Hello list, > > I'm having troubles setting up a basic calss hierarchy with S4. > Here is a simplified schema of what I'd like to do: > > - Two classes: A and B that extends A > - Ensure that the slots added by B are consistent with the slots of A > - Let A

[R] How to: initialize, setValidity, copy-constructor

2009-07-09 Thread Renaud Gaujoux
Hello list, I'm having troubles setting up a basic calss hierarchy with S4. Here is a simplified schema of what I'd like to do: - Two classes: A and B that extends A - Ensure that the slots added by B are consistent with the slots of A - Let A initialize itself (I'm not supposed to know the inte