Seth Falcon wrote:
> Paul Gilbert <[EMAIL PROTECTED]> writes:
>
>> Let me back up a bit, I may be making another mistake. My code has
>>
>> setGeneric("TSdoc<-",
>> def= function(x, value) standardGeneric("TSdoc<-"),
>> useAsDefault= function (x, value) {attr(x, "TSdoc") <- value ; x })
>>
>> setGeneric("TSdoc",
>> def= function(x) standardGeneric("TSdoc"),
>> useAsDefault= function(x) attr(x, "TSdoc"))
>
> Aside:
>
> It seems odd to me to define such defaults. How do you know x is
> going to have a TSdoc attribute?
attr returns NULL if the attibute does not exist so, in my S3 way of
thinking, it seems very natural. Now knowing only a very little about S4
classes, I can see you might think it is odd.
Paul
====================================================================================
La version française suit le texte anglais.
------------------------------------------------------------------------------------
This email may contain privileged and/or confidential inform...{{dropped}}
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel