Skip to content
Prev 10237 / 63424 Next

s4 methods and base

John Chambers wrote:

            
There is no inheritance in the S3 sense when an object contains an 
object of another class. Am I missing something? Are you using this term 
loosely or is there necessarily inheritance in S4 when one object 
contains another object?
I can see that it feels bad, but it seems like the only way to do a 
partial conversion. My problem is that it is much easier to do a big 
project in small bites.
Now if I understand this correctly, and to be pedantic, one would say an 
object of class B contains and object of class A, and,  the definition 
of class B extends the definition of class A. Or, said differently,  a 
class A object is a subset of a class B object, and a class A definition 
is a superclass of a class B definition. Does that make sense?
Would there be a point in formalizing this so that everyone does not 
need to define extensions of all the basic classes with an extra 
miscellany slot. I'm sure this sounds like herecy, but the alterative is 
that many people will be doing somewhat similar things using different 
class and slot names, and there will be a lot of unnecessary 
incompatibility among packages.

Thanks again,
Paul