Re: [Rd] Same class name, different package

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Mon, 25 Jul 2011 09:07:30 +0200

>>>>> John Chambers <jmc_at_r-project.org>
>>>>> on Sun, 24 Jul 2011 14:58:23 -0700 writes:

> A point that has come up a couple of times with the new
> test is that two classes from two packages may be "the
> same class". Should that turn on duplicate classes?

> One situation where the answer seems to be No is when the
> two classes are identical declarations of S3 classes, via
> setOldClass().

> A recent update (rev. 56492) tries to check for equivalent
> classes, with some special leeway for that case, and does
> not turn on the duplicate class flag. It's not clear what
> is really needed or wanted in all circumstances, so
> further experience will be helpful.

> If duplicate classes do exist, a utility
> findDuplicateClasses(details = FALSE) will give the names
> of the duplicated classes. It's not yet exported so you
> need to call methods:::findDuplicateClasses()

> John

I haven't yet looked into the many situations that are "out there" for CRAN and Bioconductor packages and am just speaking from my own S4-using perspective:

I think

  ImportClassesFrom(...)

should be much more widely used, in order to diminish such class "conflicts".
Wherever the new code produces warnings (does it?) about duplicate class names, it would be good to "advertize" the ImportClassesFrom() clause for those cases where the two class definitions look to be identical.

Martin

> On 7/21/11 10:29 AM, John Chambers wrote:

    >> In principle, two separately developed packages could use
    >> the same class name, and a user could then attach both
    >> and attempt to use methods for both classes.
    >> 
    >> That has never worked, but some changes have been added
    >> to r-devel to handle this case.  The changes involve
    >> extending the "signature" class to include package
    >> information.  For compatibility, packages will need to be
    >> re-installed from a version of R labelled 56466 or later,
    >> although an attempt is made to fill in missing
    >> information.
    >> 
    >> John

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 25 Jul 2011 - 07:09:23 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 26 Jul 2011 - 08:40:13 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