From timh at insightful.com  Mon Feb 25 19:44:43 2008
From: timh at insightful.com (Tim Hesterberg)
Date: Mon, 25 Feb 2008 10:44:43 -0800
Subject: [Rd] Standard method for S4 object
In-Reply-To: <47C3066B.8030804@ebi.ac.uk> (message from Oleg Sklyar on Mon, 25
	Feb 2008 18:18:19 +0000)
References: <47C06F0A.4090505@u-paris10.fr> <uy79957by.fsf@insightful.com>
	<47C2F422.6040608@ebi.ac.uk> <uve4c6hor.fsf@insightful.com>
	<47C3066B.8030804@ebi.ac.uk>
Message-ID: <uskzg6fl0.fsf@insightful.com>

Hi Oleg,

If there as a class to inherit from, then my point about an S4 class
requiring lots of methods is moot.  I think it would come down then to
whether one prefers flexibility (advantage S3) or a definite structure
for use with C/C++ (advantage S4).

Tim

>well, I am not arguing that there are situation when one needs to 
>rewrite everything from scratch. However it is always worth at least 
>considering inheritance if there is a candidate to inherit from. It 
>saves a lot of work.
>
>Anyway, your examples of S3 class usage are obviously valid in sense 
>that they are indeed S3 methods providing desired functionality. 
>However, I still do not see WHY using attributes with S3 is better than 
>slots and S4 for structures like those inherited from 'array' or 
>similar. S3 gives more freedom in assigning new attributes, but this 
>freedom also means that one has little control over the structure of an 
>object making it, for example, more difficult to use with C/C++ code. 
>Are there any specific benefits in not using S4 and slots (apart from 
>some known performance issues)?



[Rd] Standard method for S4 object
Tim Hesterberg