Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDon't rely on buggy as.list.environment behavior #192
Conversation
In R-devel, as.list.environment no longer returns the function for an active binding; instead it returns the value from executing the function. When the object is cloned, we need to get the function definition, but there's now no way to get it from the environment, so we have to store a copy of it.
In R-devel, with the environment var
_R_ENV2LIST_BUGFIX_=true, theas.list.environment()function no longer gives the function associated with an active binding; it calls the function and gives the returned value instead. This will become the default (probably) in R 4.0.This buggy behavior was used when cloning an R6 object with active bindings. This PR fixes the issue by storing the functions for active bindings separately, if the object is cloneable.