From luke@nokomis.stat.umn.edu  Wed Aug  8 01:08:00 2001
From: luke@nokomis.stat.umn.edu (Luke Tierney)
Date: Tue, 7 Aug 2001 19:08:00 -0500
Subject: [Rd] R 1.3.0 bug: after "y _ 10; x[[1]] _ y", assigning to "y[1]" modifies "x" (PR#1043)
In-Reply-To: <x28zgvr3oi.fsf@blueberry.kubism.ku.dk>; from p.dalgaard@biostat.ku.dk on Tue, Aug 07, 2001 at 10:54:53PM +0200
References: <200108072038.WAA01720@pubhealth.ku.dk> <x28zgvr3oi.fsf@blueberry.kubism.ku.dk>
Message-ID: <20010807190800.A6993@nokomis.stat.umn.edu>

On Tue, Aug 07, 2001 at 10:54:53PM +0200, Peter Dalgaard BSA wrote:
> buhr@stat.wisc.edu writes:
> 
> Confirmed with 1.3.0-patched on RedHat 7.1. For easier reproduction:
> 
> x <- list()
> y <- 10
> x[[1]] <- y
> x
> y[1] <- 20   # should only modify "y"
> # y <- 20 # Works OK with this instead
> x
>  

Should be fixed.  The particular branch in
subassign.c:SubassignTypeFix did not duplicate the RHS when it is
NAMED--I added that on R-1-3-patches.

I've looked briefly at the subassign code before and had the nagging
feeling that there may be several places where this sort of change is
needed but I haven't had the stomach to look carefully.

luke

-- 
Luke Tierney
University of Minnesota                      Phone:           612-625-7843
School of Statistics                         Fax:             612-624-8868
313 Ford Hall, 224 Church St. S.E.           email:      luke@stat.umn.edu
Minneapolis, MN 55455 USA                    WWW:  http://www.stat.umn.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] R 1.3.0 bug: after "y _ 10; x[[1]] _ y", assigning to "y[1]" modifies "x" (PR#1043)
Luke Tierney