Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make network base class an environment? #78

Open
krivit opened this issue May 21, 2022 · 0 comments
Open

Make network base class an environment? #78

krivit opened this issue May 21, 2022 · 0 comments

Comments

@krivit
Copy link
Member

krivit commented May 21, 2022

The current implementation of modifiers for network objects attempts to modify it in place, emulating behaviour of C++, Java, and Python classes, and R6 classes in R. This is accomplished by gabbing the expression for the network from the calling function and then assigning to it at the end if possible. This is quite kludgey, and may produce inconsistent or unpredictable behaviour, say, when a network object is passed to a function and modified there, or when a network is produced by an expression.

This may be possible to avoid using the same approach as R6 classes: whereas R lists are copied on modification, R environments are always references and need to be copied explicitly. Thus, if a network base class is an environment, changes to it will always change it in place automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant