Hi there,
is it possible to register fields as you can register methods with
getRefClass("Classname")$methods(.)?
I know that you should usually give some thought on which fields you need
and hardcode them in the class def. But I'm playing around with dynamically
creating/extending sort of a template class that already offers basic
functionality shared by all objects that "inherit" from that class. If I
follow the usual inheritance paradigm I would have to actually define those
new "subclasses" and let them inherit from the superclass (contains
argument), right? But can I get around that by sort of registering new
fields? Maybe with 'initFields(.)'?
Thanks for any info on that,
Janko
##### SYSTEM INFO #####
Windows XP SP3
R 2.12.0
Eclipse 3.6.1 (Helios)
StatET 0.9.1
#####################
[Rcpp-devel] Ref classes: can I register fields as I register methods?
2 messages · Janko Thyson, Romain Francois
Hello, Why would you also post here when you posted on R-devel minutes ago. This is not Rcpp specific. Romain Le 21/11/10 23:53, Janko Thyson a ?crit :
Hi there,
is it possible to register fields as you can register methods with
getRefClass("Classname")$methods(.)?
I know that you should usually give some thought on which fields you need
and hardcode them in the class def. But I'm playing around with dynamically
creating/extending sort of a template class that already offers basic
functionality shared by all objects that "inherit" from that class. If I
follow the usual inheritance paradigm I would have to actually define those
new "subclasses" and let them inherit from the superclass (contains
argument), right? But can I get around that by sort of registering new
fields? Maybe with 'initFields(.)'?
Thanks for any info on that,
Janko
##### SYSTEM INFO #####
Windows XP SP3
R 2.12.0
Eclipse 3.6.1 (Helios)
StatET 0.9.1
#####################
Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/9VOd3l : ZAT! 2010 |- http://bit.ly/c6DzuX : Impressionnism with R `- http://bit.ly/czHPM7 : Rcpp Google tech talk on youtube