The R Project SVN R

Rev

Rev 41600 | Rev 48780 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 41600 Rev 47570
Line 12... Line 12...
12
        envtable <- function() {
12
        envtable <- function() {
13
            idx <- 0
13
            idx <- 0
14
            envs <- NULL
14
            envs <- NULL
15
            enames <- character(0)
15
            enames <- character(0)
16
            find <- function(v, keys, vals)
16
            find <- function(v, keys, vals)
17
                for (i in seq(along=keys))
17
                for (i in seq_along(keys))
18
                    if (identical(v, keys[[i]]))
18
                    if (identical(v, keys[[i]]))
19
                        return(vals[i])
19
                        return(vals[i])
20
            getname <- function(e) find(e, envs, enames)
20
            getname <- function(e) find(e, envs, enames)
21
            getenv <- function(n) find(n, enames, envs)
21
            getenv <- function(n) find(n, enames, envs)
22
            insert <- function(e) {
22
            insert <- function(e) {
Line 75... Line 75...
75
            if (length(vars) != length(from) || any(nchar(vars) == 0))
75
            if (length(vars) != length(from) || any(nchar(vars) == 0))
76
                stop("source list must have names for all elements")
76
                stop("source list must have names for all elements")
77
        }
77
        }
78
        else stop("source must be an environment or a list");
78
        else stop("source must be an environment or a list");
79
 
79
 
80
        for (i in seq(along = vars)) {
80
        for (i in seq_along(vars)) {
81
            if (is.environment(from))
81
            if (is.environment(from))
82
                key <- lazyLoadDBinsertVariable(vars[i], from, datafile,
82
                key <- lazyLoadDBinsertVariable(vars[i], from, datafile,
83
                                                ascii, compress,  envhook)
83
                                                ascii, compress,  envhook)
84
            else key <- lazyLoadDBinsertListElement(from, i, datafile, ascii,
84
            else key <- lazyLoadDBinsertListElement(from, i, datafile, ascii,
85
                                                    compress, envhook)
85
                                                    compress, envhook)