Skip to content

Commit 86a25da

Browse files
author
smeyer
committed
comment unused code
git-svn-id: https://svn.r-project.org/R/trunk@88245 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 939474b commit 86a25da

File tree

1 file changed

+29
-30
lines changed

1 file changed

+29
-30
lines changed

src/library/methods/R/trace.R

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -648,44 +648,43 @@ setCacheOnAssign <- function(env, onOff = cacheOnAssign(env))
648648
}
649649

650650

651-
utils::globalVariables("fdef")
652-
.dummySetMethod <- function(f, signature = character(), definition,
653-
where = topenv(parent.frame()), valueClass = NULL,
654-
sealed = FALSE)
655-
{
656-
if(is.function(f) && is(f, "genericFunction"))
657-
f <- fdef@generic
658-
else if(is.function(f)) {
659-
if(is.primitive(f))
660-
f <- .primname(f)
661-
else
662-
stop("a function for argument 'f' must be a generic function")
663-
} else
664-
f <- switch(f, "as.double" = "as.numeric", f)
665-
assign(.dummyMethodName(f, signature), definition, envir = where)
666-
}
667-
668-
.functionsOverriden <- c("setClass", "setClassUnion", "setGeneric", "setIs", "setMethod", "setValidity")
669-
670-
.setEnvForSource <- function(env) {
671-
doNothing <- function(x, ...)x
672-
## establish some dummy definitions & a special setMethod()
673-
for(f in .functionsOverriden)
674-
assign(f, switch(f, setMethod = .dummySetMethod, doNothing),
675-
envir = env)
676-
env
677-
}
651+
## utils::globalVariables("fdef")
652+
## .dummySetMethod <- function(f, signature = character(), definition,
653+
## where = topenv(parent.frame()), valueClass = NULL,
654+
## sealed = FALSE)
655+
## {
656+
## if(is.function(f) && is(f, "genericFunction"))
657+
## f <- fdef@generic
658+
## else if(is.function(f)) {
659+
## if(is.primitive(f))
660+
## f <- .primname(f)
661+
## else
662+
## stop("a function for argument 'f' must be a generic function")
663+
## } else
664+
## f <- switch(f, "as.double" = "as.numeric", f)
665+
## assign(.dummyMethodName(f, signature), definition, envir = where)
666+
## }
667+
668+
## .functionsOverriden <- c("setClass", "setClassUnion", "setGeneric", "setIs", "setMethod", "setValidity")
669+
670+
## .setEnvForSource <- function(env) {
671+
## doNothing <- function(x, ...)x
672+
## ## establish some dummy definitions & a special setMethod()
673+
## for(f in .functionsOverriden)
674+
## assign(f, switch(f, setMethod = .dummySetMethod, doNothing),
675+
## envir = env)
676+
## env
677+
## }
678678

679679
.dummyMethodName <- function(f, signature)
680680
paste(c(f,signature), collapse="#")
681681

682682
.guessPackageName <- function(env) {
683683
allObjects <- names(env)
684-
allObjects <- allObjects[is.na(match(allObjects, .functionsOverriden))]
685-
## counts of packaages containing objects; objects not found don't count
684+
##allObjects <- allObjects[is.na(match(allObjects, .functionsOverriden))]
685+
## counts of packages containing objects; objects not found don't count
686686
possible <- sort(table(unlist(lapply(allObjects, utils::find))),
687687
decreasing = TRUE)
688-
## message <- ""
689688
if(length(possible) == 0)
690689
stop("none of the objects in the source code could be found: need to attach or specify the package")
691690
else if(length(possible) > 1L) {

0 commit comments

Comments
 (0)