Henrik Bengtsson
2010-Mar-17 16:11 UTC
[Rd] Suggestion: Not having to export .conflicts.OK in name spaces
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.RIndex: 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
Seth Falcon
2010-Mar-19 20:47 UTC
[Rd] Suggestion: Not having to export .conflicts.OK in name spaces
On 3/17/10 9:11 AM, Henrik Bengtsson wrote:> 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.I guess I agree that there is no real value in forcing .conflicts.OK to be exported. OTOH, this seems like a dubious feature to begin. When is it a good idea to use it? + seth -- Seth Falcon | @sfalcon | http://userprimary.net/
Reasonably Related Threads
- .conflicts.OK no longer working regardless of export(.conflicts.OK) due to "stoplist"
- dict package: dictionary data structure for R
- Unable to execute Java MapReduce (Hadoop) code from R using rJava
- Never exporting .__global__ and .__suppressForeign__?
- Finding dynamic shared libraries loaded with a package