On Tue, 26 Sep 2006, Sebastian P. Luque wrote:
Thank you all for your comments, which confirm the feeling I had that
'slot' is only needed in the rare occasions Roger mentioned. Although
'slot' is an accessor function, it seems it's not quite analogous to
functions or methods for accessing
Hi,
I'm usually confused about when to use 'slot' or '@'. I've frequently
read that it's always preferable to use accessor functions, so I would
think the '@' operator should be avoided. However, ?slot contains the
following advise:
Generally, the only reason to use the functional form rather
I think the point is that if you use @ and then later redesign the
internals of the class so that that component is not longer stored
but is, instead, computed then @ will no longer be possible to
use in that instance and a method call will be required which means
that the internal change implies
I think slot() is only necessary in the case where you have
a - myslot
slot(object, a)
which is equivalent to
[EMAIL PROTECTED]
It seems unlikely that you would use slot() during interactive use, but perhaps
more so in programming. Even still, I rather infrequently find the need for
slot()
I believe that the accessor functions you've read about are not the
slot() function, rather they are functions specifically designed for
extracting certain data from an object. An example is the 'coef()'
extractor function, which extracts coefficients from many model objects.
The name of
Thank you all for your comments, which confirm the feeling I had that
'slot' is only needed in the rare occasions Roger mentioned. Although
'slot' is an accessor function, it seems it's not quite analogous to
functions or methods for accessing components of objects.
Cheers,
--
Seb