You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should we override the default clone method of a connector object to only allow for deep clones following the discussion in #18 ?
As of now a connector object remains cloneable, but with the default deep=FALSE.
So far two ways of changing this has been identified:
Change the default value of the cloning method with: formals(connector$public_methods$clone)[["deep"]] <- TRUE
Pro: Easy solution, and Rd documentation will still be correct
Con: Confusing for experienced R6 users that the standard clone method has a different method
Create a custom clone method for the connector object with only deep cloning available.
One solution could be: connector$set("private", ".clone", connector$public_methods$clone, TRUE) connector$set("public", "clone", \() private$.clone(deep = TRUE), TRUE)
Another could be to internalise the clone method and always have deep = TRUE.
Pro: Robust, and only allows for deep clones
Con: Cannot override the roxygen documentation, and might need us to have cloning under a new method name.
Should we override the default
clone
method of a connector object to only allow for deep clones following the discussion in #18 ?As of now a
connector
object remains cloneable, but with the defaultdeep=FALSE
.So far two ways of changing this has been identified:
Change the default value of the cloning method with:
formals(connector$public_methods$clone)[["deep"]] <- TRUE
Pro: Easy solution, and Rd documentation will still be correct
Con: Confusing for experienced R6 users that the standard clone method has a different method
Create a custom clone method for the
connector
object with only deep cloning available.One solution could be:
connector$set("private", ".clone", connector$public_methods$clone, TRUE)
connector$set("public", "clone", \() private$.clone(deep = TRUE), TRUE)
Another could be to internalise the clone method and always have
deep = TRUE
.Pro: Robust, and only allows for deep clones
Con: Cannot override the roxygen documentation, and might need us to have cloning under a new method name.
Useful references:
The text was updated successfully, but these errors were encountered: