Re: [Rd] reference classes: question on inheritance

From: Janko Thyson <janko.thyson_at_ku-eichstaett.de>
Date: Mon, 22 Nov 2010 23:34:18 +0100

> -----Ursprüngliche Nachricht-----
> Von: r-devel-bounces@r-project.org [mailto:r-devel-bounces@r-
> project.org] Im Auftrag von John Chambers
> Gesendet: Montag, 22. November 2010 18:51
> An: r-devel_at_r-project.org
> Betreff: Re: [Rd] reference classes: question on inheritance
>
> >>
> >> What am I doing wrong here?
>
> Not using a recent enough version of R probably (and not telling us
> what
> version you are using).
>
> The warning (not an error) should not appear in current r-devel or
> 2.12-patched. In other words, works fine for me.
>
> John

Thanks, I didn't even know there existed a patched build as I usually skipped the x.x.0 versions of R.
But ref classes really seemed worth a try.

Cheers,
Janko

##### SYSTEM INFO #####
Windows XP SP3
R 2.12.0 (patched as of 2010-11-22)
Eclipse 3.6.1 (Helios)
StatET 0.9.1

#####################

>
> On 11/21/10 3:40 PM, Janko Thyson wrote:
> > Hmm, interesting: it's the virtual class that causes the trouble. If
> a
> > virtual class is a ref class, everything works fine. If it's a
> standard S4
> > class, it results in the error below.
> >
> > Regards,
> > Janko
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: Janko Thyson [mailto:janko.thyson_at_ku-eichstaett.de]
> >> Gesendet: Montag, 22. November 2010 00:31
> >> An: 'r-devel_at_r-project. org'
> >> Betreff: reference classes: question on inheritance
> >>
> >> Dear list,
> >>
> >> I have a reference class which should act as a “generic” superclass
> for
> >> other classes. I’ve read the respective section at ?setRefClass and
> put
> >> the name of the superclass to the ‘contains’ argument of an example
> >> subclass (see class defs below). Classnames are set in a way that
> >> shouldn’t result in collation issues (virtual def sourced before
> >> superclass def sourced before subclass). Yet, this results in the
> >> following error:
> >>
> >> Warnmeldung:
> >> unable to find a consistent ordering of superclasses for class
> >> "Shabubu": order chosen is inconsistent with the superclasses of
> >> "JObject"
> >>
> >> ###### CLASS DEFS #####
> >> setClass("JObjectVirtual")
> >> setRefClass(
> >> Class="JObject",
> >> fields=list(
> >> # GENERIC FIELDS (DON'T CHANGE !!!)
> >> .BUFFER="environment",
> >> .GENESIS="environment",
> >> .HISTORY="environment",
> >> .IMAGES="environment",
> >> .LOGS="environment",
> >> .OPTS="environment",
> >> .PLUGINS="environment",
> >> .TMP="environment",
> >> .UID="character",
> >> DATA="data.frame"
> >> # /
> >> ),
> >> contains=c("JObjectVirtual"),
> >> methods=list(
> >> ...
> >> )
> >> )
> >> setRefClass(
> >> Class="Shabubu",
> >> fields=list(
> >> # CUSTOM FIELDS (ADAPT TO YOUR NEEDS)
> >> a="numeric",
> >> b="character",
> >> c="logical",
> >> d="data.frame",
> >> e="matrix",
> >> f="list",
> >> derived.field="function"
> >> # /
> >> ),
> >> contains=c("JObject")
> >> )
> >>
> >> Thanks,
> >> Janko
> >
> > ______________________________________________
> > R-devel_at_r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 22 Nov 2010 - 22:36:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 23 Nov 2010 - 12:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive