[Rd] Suggestion: Not having to export .conflicts.OK in name spaces

Henrik Bengtsson hb at stat.berkeley.edu
Wed Mar 17 17:11:38 CET 2010


Currently library() and attach() fail to locate an existing
'.conflicts.OK' in a package wit name space, unless it is exported.
Since there should be little interest in exporting '.conflicts.OK'
otherwise, one may argue that those methods should look for
'.conflicts.OK' even if it is not exported.  If so, a patch for
library() is:

>svn diff library.R
Index: library.R
===================================================================
--- library.R   (revision 51296)
+++ library.R   (working copy)
@@ -312,7 +312,7 @@
                     nogenerics <-
                         !.isMethodsDispatchOn() || checkNoGenerics(env, package
)
                     if(warn.conflicts &&
-                       !exists(".conflicts.OK", envir = env, inherits = FALSE))

+                       !exists(".conflicts.OK", envir = ns, inherits = FALSE))
                         checkConflicts(package, pkgname, pkgpath,
                                        nogenerics, ns)
                     runUserHook(package, pkgpath)


In order to be consistent, a patch for attach() should also be
provided, which requires some more changes, but I won't spend time on
that unless the above is a wanted feature.

/Henrik



More information about the R-devel mailing list