ClassS *<-* setRefClass*(*'ClassS',

fields = c*(*

 'field.s'

*)*,

methods = list*(*

 initialize = *function**()* *{*

 *return**(*initFields*(*field.s = 0*))*

 *}*

*)*

*)*


ClassM *<-* setRefClass*(*'ClassM',

fields = c*(*

 'field.m'

*)*,

methods = list*(*

 initialize = *function**()* *{*

 *return**(*initFields*(*field.m = 0*))*

 *}*

*)*

*)*


ClassD *<-* setRefClass*(*'ClassD',

contains = c*(*

 'ClassS',

 'ClassM'

*)*,

fields = c*(*

 'field.d'

*)*,

methods = list*(*

 initialize = *function**()* *{*

 initFields*(*field.d = 0*)*

 *return**(*callSuper*())*

 *}*

*)*

*)*

*
*
===


Browse[2]> d = ClassD$new*()*

Browse[2]> d$field.d; d$field.s; d$field.m

[1] 0

[1] 0

An object of class "uninitializedField"

Slot "field":

[1] "field.m"


Slot "className":

[1] "ANY"


Browse[2]> m


===


In other words, initialize isn't being called for M (these classes are named
as such to indicate superclass, mixin, and derived). Is this a known
problem, or am I missing something?

--
Robert Tirrell | r...@stanford.edu | (607) 437-6532
Program in Biomedical Informatics | Butte Lab | Stanford University

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to