On Thu, 2 Jun 2005, hadley wickham wrote:
An environment is a hash table, and copying occurs only on modification,
when any language would have to copy in this context.
Yes, I'm aware that copying only occurs on modification. However, it
was my understanding that
a <- list(a =1)
a$b <- 4
would create a new copy of a, whereas in Java say
It depends, but I was talking about *environments*, not lists, and
a<-new.env()
assign("b",4,a)
assign("c", 42, a)
etc
wouldn't copy anything. Bill Venables had an article about environments
for caching previously computed results in an early issue of R News.
-thomas
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html