Re: [Rd] delayedAssign changing values

2012-04-26 Thread peter dalgaard
On Apr 27, 2012, at 00:10 , ghostwheel wrote: > > Simon Urbanek wrote >> >>> More intuitive would have been the behavior >>> delayedAssign("x", local({y <- 7; y+3}) ) >>> which only changes x. >> >> That is questionable - I think it is more logical for both environments to >> be the same as d

Re: [Rd] delayedAssign changing values

2012-04-26 Thread ghostwheel
Simon Urbanek wrote > >> More intuitive would have been the behavior >> delayedAssign("x", local({y <- 7; y+3}) ) >> which only changes x. > > That is questionable - I think it is more logical for both environments to > be the same as default. Just think if it -- the point here is to access > l

Re: [Rd] delayedAssign changing values

2012-04-26 Thread Simon Urbanek
On Apr 26, 2012, at 11:59 AM, ghostwheel wrote: > It is really strange that the delayedAssign is evaluated in the environment > it is called from, Not quite, it is evaluated in the environment you specify - and you have control over both environments ... see ?delayedAssign > and thus can hav

Re: [Rd] delayedAssign changing values

2012-04-26 Thread ghostwheel
It is really strange that the delayedAssign is evaluated in the environment it is called from, and thus can have side effects. so x=2 y=3 delayedAssign("x", {y <- 7; y+3}) gives > x [1] 10 > y [1] 7 Both x and y changed. More intuitive would have been the behavior x=2 y=3 delayedAssign("x", loca

Re: [Rd] delayedAssign changing values

2012-04-26 Thread Simon Urbanek
On Apr 25, 2012, at 5:18 PM, McGehee, Robert wrote: > I'm not sure if this is a known peculiarity or a bug, but I stumbled across > what I think is very odd behavior from delayedAssign. In the below example x > switches values the first two times it is evaluated. > >> delayedAssign("x", {x <-

Re: [Rd] delayedAssign changing values

2012-04-26 Thread McGehee, Robert
.@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of McGehee, Robert Sent: Wednesday, April 25, 2012 5:19 PM To: r-devel@r-project.org Subject: [Rd] delayedAssign changing values I'm not sure if this is a known peculiarity or a bug, but I stumbled across what I think is

[Rd] delayedAssign changing values

2012-04-25 Thread McGehee, Robert
I'm not sure if this is a known peculiarity or a bug, but I stumbled across what I think is very odd behavior from delayedAssign. In the below example x switches values the first two times it is evaluated. > delayedAssign("x", {x <- 2; x+3}) > x==x [1] FALSE > delayedAssign("x", {x <- 2; x+3})