Prof Brian Ripley <[EMAIL PROTECTED]> writes: > Note that you called > > selectMethod("mget", signature(x="character", envir=class(LLe))) > > by name rather than calling the visible function mget() (which you > could have supplied as fdef). I've never really got to the bottom of > the complicated searches that getGeneric() uses, but the fact that it > does not just look for a visible function of that name tells you it is > doing something different. > > What I would check from your browser is what parent.env() shows, > successively until you get to the imports and then the base > namespace. If mget is not in the imports, something would seem to be > up with your importing of namespaces. find() is not relevant here as > namespace scoping is in play: only if the mget generic is imported > will it take precedence over base:::mget. (It is not clear to me what > is being browsed here, and hence what namespaces are in play.)
This was helpful. It seems that the strange behavior I was seeing was due to stale package installations. After reinstalling the package and all of its depends and imports, things are looking more normal. I used the following function to examine the chain of parent environments while debugging: showEncEnvs <- function() { etmp <- parent.env(parent.frame()) while (TRUE) { ename <- environmentName(etmp) cat(sprintf("Found envirnment: '%s'\n", ename)) if (exists("mget", etmp, inherits=FALSE)) cat("found mget\n") switch(ename, "R_EmptyEnv"=break, "R_GlobalEnv"=break) if (ename == "") { cat("**** first five entires\n") print(ls(etmp)[1:5]) } etmp <- parent.env(etmp) } } One thing to note: One might expect each import to be in the chain of parent environments. Instead all imports are merged into a single environment that is the parent of the package env. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel