View | Details | Raw Unified | Return to bug 16490 | Differences between
and this patch

Collapse All | Expand All

(-)src/library/base/R/attach.R (-2 / +2 lines)
Lines 52-58 Link Here
52
                break
52
                break
53
            }
53
            }
54
        }
54
        }
55
        ob <- objects(db.pos, all.names = TRUE)
55
        ob <- names(as.environment(sp[db.pos]))
56
        if(.isMethodsDispatchOn()) { ## {see note in library() about this}
56
        if(.isMethodsDispatchOn()) { ## {see note in library() about this}
57
            these <- ob[substr(ob, 1L, 6L) == ".__T__"]
57
            these <- ob[substr(ob, 1L, 6L) == ".__T__"]
58
            gen  <- gsub(".__T__(.*):([^:]+)", "\\1", these)
58
            gen  <- gsub(".__T__(.*):([^:]+)", "\\1", these)
Lines 62-68 Link Here
62
        }
62
        }
63
        ipos <- seq_along(sp)[-c(db.pos, match(c("Autoloads", "CheckExEnv"), sp, 0L))]
63
        ipos <- seq_along(sp)[-c(db.pos, match(c("Autoloads", "CheckExEnv"), sp, 0L))]
64
        for (i in ipos) {
64
        for (i in ipos) {
65
            obj.same <- match(objects(i, all.names = TRUE), ob, nomatch = 0L)
65
            obj.same <- match(names(as.environment(sp[i])), ob, nomatch = 0L)
66
            if (any(obj.same > 0L)) {
66
            if (any(obj.same > 0L)) {
67
                same <- ob[obj.same]
67
                same <- ob[obj.same]
68
                same <- same[!(same %in% dont.mind)]
68
                same <- same[!(same %in% dont.mind)]
(-)src/library/base/R/library.R (-4 / +4 lines)
Lines 160-166 Link Here
160
        else {
160
        else {
161
            ## A package will have created a generic
161
            ## A package will have created a generic
162
            ## only if it has created a formal method.
162
            ## only if it has created a formal method.
163
            length(objects(env, pattern="^\\.__T", all.names=TRUE)) == 0L
163
            length(grep(pattern="^\\.__T", names(env))) == 0L
164
        }
164
        }
165
    }
165
    }
166
166
Lines 172-180 Link Here
172
                       ".packageName", ".noGenerics", ".required",
172
                       ".packageName", ".noGenerics", ".required",
173
                       ".no_S3_generics", ".Depends", ".requireCachedGenerics")
173
                       ".no_S3_generics", ".Depends", ".requireCachedGenerics")
174
        sp <- search()
174
        sp <- search()
175
        lib.pos <- match(pkgname, sp)
175
        lib.pos <- which(sp == pkgname)
176
        ## ignore generics not defined for the package
176
        ## ignore generics not defined for the package
177
        ob <- objects(lib.pos, all.names = TRUE)
177
        ob <- names(as.environment(sp[lib.pos]))
178
        if(!nogenerics) {
178
        if(!nogenerics) {
179
            ##  Exclude generics that are consistent with implicit generic
179
            ##  Exclude generics that are consistent with implicit generic
180
            ## from another package.  A better test would be to move this
180
            ## from another package.  A better test would be to move this
Lines 190-196 Link Here
190
	ipos <- seq_along(sp)[-c(lib.pos,
190
	ipos <- seq_along(sp)[-c(lib.pos,
191
				 match(c("Autoloads", "CheckExEnv"), sp, 0L))]
191
				 match(c("Autoloads", "CheckExEnv"), sp, 0L))]
192
        for (i in ipos) {
192
        for (i in ipos) {
193
            obj.same <- match(objects(i, all.names = TRUE), ob, nomatch = 0L)
193
            obj.same <- match(names(as.environment(sp[i])), ob, nomatch = 0L)
194
            if (any(obj.same > 0)) {
194
            if (any(obj.same > 0)) {
195
                same <- ob[obj.same]
195
                same <- ob[obj.same]
196
                same <- same[!(same %in% dont.mind)]
196
                same <- same[!(same %in% dont.mind)]

Return to bug 16490