From murdoch at stats.uwo.ca  Mon Dec 22 19:55:11 2008
From: murdoch at stats.uwo.ca (murdoch at stats.uwo.ca)
Date: Mon, 22 Dec 2008 19:55:11 +0100 (CET)
Subject: [Rd] Bug in list indexing (PR#13411)
Message-ID: <20081222185511.4E29C282EFF6@mail.pubhealth.ku.dk>

I was wondering if copies were made when a component of a complex nested 
list structure was extracted but not modified.  I was happy that the 
answer was no, but was surprised that copies weren't made even if the 
extracted bit was modified:

 > x <- list(a=list(b=numeric(1000000)))
 > y <- x[[c(1,1)]]
 > y[1] <- 3.14159
 > x[[c(1,1)]][1]
[1] 3.14159

Unfortunately, this exists in today's release of 2.8.1.  I should have 
done this test last week!

Duncan Murdoch

 > sessionInfo()
R version 2.8.1 (2008-12-22)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United 
States.1252;LC_MONETARY=English_United 
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.8.1



[Rd] Bug in list indexing (PR#13411)
murdoch at stats.uwo.ca