Re: [Rd] Changes to correct problems with classes in namespaces

From: John Chambers <jmc_at_research.bell-labs.com>
Date: Wed 25 Aug 2004 - 05:21:57 EST

Prof Brian Ripley wrote:
>
> John,
>
> Looks like several packages are failing to dump or load with messages like
> (SparseM)
>
> Error in warning("Undefined slot classes in definition of \"",
> classDef@className, :
> Object "classDef" not found
>
> So far I have seen this with SparseM, dynamicGraph (and hence deal and
> gRbase). Should that be `ClassDef'?

It should. Thanks.

> And is this a new error detected?

You mean a new test? Yes, there's a sufficient chance of a typo-- that the user didn't really mean to insert an undefined class as a slot -- that a warning (not an errorr) seems desirable. (S3 classes are fine as slots, but unless setOldClass is used they can't be verified.)

John

>
> Brian
>
> On Tue, 24 Aug 2004, John Chambers wrote:
>
> > An extensive set of changes to the methods package has been committed
> > today to allow non-exported classes from packages with namespaces (and
> > some related fixes in dealing with generic functions from namespaces as
> > well).
> >
> > The namespace mechanism requires packages to export any class
> > definitions that are part of the API. Unfortunately, NOT exporting
> > classes has never really worked.
> >
> > The problem was essentially that computations such as method dispatch
> > used the character-string name of a class, with no information about
> > where that class came from. For non-exported classes, this caused many
> > computations down the line to fail. Related problems came from not
> > using the generic function objects and the class definition objects.
> >
> > The modified code passes the usual check and check-devel tests, plus
> > some tests for dealing with private classes, but if you have packages
> > that use methods extensively, please try these with the current r-devel
> > as soon as possible.
> >
> > John
> >
>
> --
> Brian D. Ripley, ripley@stats.ox.ac.uk
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595

-- 
John M. Chambers                  jmc@bell-labs.com
Bell Labs, Lucent Technologies    office: (908)582-2681
700 Mountain Avenue, Room 2C-282  fax:    (908)582-3340
Murray Hill, NJ  07974            web: http://www.cs.bell-labs.com/~jmc

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Aug 25 05:25:04 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:09 EST