Skip to content

Commit

Permalink
Resurrect TopLevel$find_all()
Browse files Browse the repository at this point in the history
This function was not used in any (non-commented out) code.
Now works again. only.documented argument dropped because
the objects do not contain their own documentation anymore.
  • Loading branch information
BrianDiggs committed Jan 14, 2013
1 parent 551fc5a commit c2e51b1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions R/aaa-.r
Expand Up @@ -10,12 +10,9 @@ firstUpper <- function(s) {
}

TopLevel <- proto(expr = {
find_all <- function(., only.documented = FALSE) {
find_all <- function(.) {
names <- ls(pattern=paste("^", firstUpper(.$class()), "[A-Z].+", sep=""), parent.env(TopLevel))
objs <- structure(lapply(names, get), names=names)

if (only.documented) objs <- objs[sapply(objs, function(x) get("doc", x))]
objs
structure(lapply(names, get, pos=parent.env(TopLevel)), names=names)
}
find <- function(., name) {
fullname <- paste(firstUpper(.$class()), firstUpper(name), sep="")
Expand Down

0 comments on commit c2e51b1

Please sign in to comment.