Skip to content
Prev 13705 / 63421 Next

prototype in setClass.

It works better if you give setClass the right arguments.

In your second call,  you omitted the representation= argument, so you
need to name the prototype argument:

setClass("AtomList"
         ,contains="List"
         ,prototype =
prototype(content="Atom")                                ## would like
to specify this
         )

With this change:

R> new("AtomList")
An object of class "AtomList"
list()
Slot "uniq":
[1] FALSE

Slot "content":
[1] "Atom"

(We can probably do some bullet-proofing, since the object returned from
prototype() has a specific class, but that may have to wait until
2.0.1.)
Wolski wrote: