Open mb706 opened 4 years ago
It's actually still possible to retrieve the functions for the active bindings, but not with as.list.environment()
. There are currently two ways to do it:
self$.__enclos_env__$.__active__
is a list containing the functions for active bindings. (But this may go away in a future version.)activeBindingFunction()
, which gives the function for an active binding.So an all.equal.R6
method could use of one of these.
R-devel has changed their handling of
as.list.environment()
regarding active bindings. Instead of turning the ABs into functions, it now gives the values that the ABs would have had, had they been accessed normally. This currently breaksall.equal()
behaviour in some cases with R6-objects (becauseall.equal.environment()
callsas.list()
internally). An example is(currently only in R-devel). The fact that ABs are expanded to values also makes comparisons very inefficient in cases where the ABs construct large objects for user convenience out of a small amount of data that is more compactly stored in a
private$
slot.I suggest the implementation of
all.equal.R6
which should skip active bindings for R6 objects.