From milo.chen at outlook.com  Thu Jan 23 13:42:21 2014
From: milo.chen at outlook.com (milo)
Date: Thu, 23 Jan 2014 04:42:21 -0800 (PST)
Subject: [Rd] R reference classes - how to extend a generator object?
Message-ID: <1390480941189-4684029.post@n4.nabble.com>

Hello, 

I want to extend a generator object, but all the R help files have on this
subject is:

"Note that if one wanted to extend the reference class generator capability
with a subclass, this should be done by subclassing 'refGeneratorSlot', not
'refObjectGenerator'."

OK, but how do you actually do this? So I've tried:

MyGenerator <- setRefClass("MyGenerator",
    contains = "refGeneratorSlot",
    methods = list(
        new = function(...) {
            message("Hello, I'm being instantiated now!")
            callSuper(...)
        }
    )
)

but now what? How do I actually use this in conjunction with my class
definitions that use setRefClass()?

Many thanks,


M



--
View this message in context: http://r.789695.n4.nabble.com/R-reference-classes-how-to-extend-a-generator-object-tp4684029.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] R reference classes - how to extend a generator object?
milo