On Aug 10, 2014, at 10:07 PM, Winston Chang wrote:
> Another oddity - even though there's an error thrown in assignment to
> x$y$z, the assignment succeeds.
>
> x <- new.env()
> x$y <- new.env()
> lockEnvironment(x, bindings = TRUE)
> x$y$z <- 1
> # Error in x$y$z <- 1 : cannot change value of
Another oddity - even though there's an error thrown in assignment to
x$y$z, the assignment succeeds.
x <- new.env()
x$y <- new.env()
lockEnvironment(x, bindings = TRUE)
x$y$z <- 1
# Error in x$y$z <- 1 : cannot change value of locked binding for 'y'
x$y$z
# [1] 1
So I assume there must be a bu
If an environment x contains a locked binding y which is also an
environment, and then you try to assign a value to a binding inside of
y, it can either succeed or fail, depending on how you refer to
environment y.
x <- new.env()
x$y <- new.env()
lockEnvironment(x, bindings = TRUE)
# This assignm