On Thu, 8 Jan 2004, Heywood, Giles wrote: > I have encountered an issue which I have been unable to resolve, involving > an S3 generic (print) being declared S4 generic in a package, and the method
I believe you should not be doing that. The S4 generic for displaying objects is show() and not print(). This matters because auto-printing will use show() rather than print(). > being exported. This all works fine - the problem occurs when I try to > import the method to another package. The other thing I noticed is that you have `import(methods)'. That is dangerous, as loading the methods namespace without attaching the package is known to have problems. (Take a look at how package mle does this.) One reason it is dangerous is the following: R_DEFAULT_PACKAGES=NULL R > loadedNamespaces() [1] "base" > .isMethodsDispatchOn() [1] FALSE > loadNamespace("methods") <environment: namespace:methods> > .isMethodsDispatchOn() [1] TRUE > loadedNamespaces() [1] "base" "methods" > library(MASS) > detach("package:MASS") [1] TRUE > .isMethodsDispatchOn() [1] FALSE so if you only load the methods namespace, any call to detach() switches off methods dispatch! That is not the only problem which has been noted. -- Brian D. Ripley, [EMAIL PROTECTED] 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 ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-devel