From skostysh at princeton.edu  Mon Apr 14 13:12:55 2014
From: skostysh at princeton.edu (Scott Kostyshak)
Date: Mon, 14 Apr 2014 07:12:55 -0400
Subject: [Rd] duplication regression (?)
Message-ID: <CAE3=dmcfuEOXjoEGcj4+MrWp-Waur4Nb+saPH2OnSkdANc+skA@mail.gmail.com>

Below is an example of output that changed as a result of r64970. I
did not see any NEWS item suggesting this change is expected.

Note that the example is contrived and I don't have a use case for it.
I stumbled across it when playing with recent changes in R relating to
duplication. Does the example use undefined syntax?

-----
fn1 <- function(mylist) {
    fn1a <- function() mylist[[c(1,1)]][[1]] <<- 9
    fn1a()
    return(NULL)
}

fn2 <- function(myarg) fn1(myarg)

test_list <- list(list(list(1)))
print(test_list[[c(1,1,1)]])
fn2(test_list)
print(test_list[[c(1,1,1)]])
-----

Before r64970 the output is
[1] 1
[1] 1

After r64970 the output is
[1] 1
[1] 9

> sessionInfo()
R Under development (unstable) (2014-04-10 r65396)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

Scott


--
Scott Kostyshak
Economics PhD Candidate
Princeton University



[Rd] duplication regression (?)
Scott Kostyshak