The R Project SVN R

Rev

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

Rev 53382 Rev 53385
Line 280... Line 280...
280
stopifnot(identical(as.environment(a), environment(foo)))
280
stopifnot(identical(as.environment(a), environment(foo)))
281
xx <- 1:10; environment(xx) <- a # environment attribute
281
xx <- 1:10; environment(xx) <- a # environment attribute
282
stopifnot(identical(as.environment(a), environment(xx)))
282
stopifnot(identical(as.environment(a), environment(xx)))
283
 
283
 
284
 
284
 
-
 
285
## tests of [[<- and $<- for subclasses of environment.  At one point methods for these assignments were defined
-
 
286
## and caused inf. recursion when the arguments to the [[<- case were changed in base.
-
 
287
setClass("myEnv", contains = "environment")
-
 
288
m <- new("myEnv")
-
 
289
m[["x"]] <- 1; m$y <- 2
-
 
290
stopifnot(identical(c(m[["x"]], m$y), c(1,2)))