From hb at stat.berkeley.edu  Wed Mar 17 17:11:38 2010
From: hb at stat.berkeley.edu (Henrik Bengtsson)
Date: Wed, 17 Mar 2010 17:11:38 +0100
Subject: [Rd] Suggestion: Not having to export .conflicts.OK in name spaces
Message-ID: <59d7961d1003170911o38814b59h3fdb4de42e21b723@mail.gmail.com>

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



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