-
Notifications
You must be signed in to change notification settings - Fork 8
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
Immutable design #2017
Comments
Does assignment vs inner mutability matter? I have a netconf client actor that keeps track of module capabilities for a device. This is stored in However, a client can reconnect, in which case the capabilities are replaced, so we need |
A very good example of how assignment differs from (inner) mutation. I don't think we've reached a good conclusion yet of what the As long as 'someone else' is another actor the case is a bit clearer -- here we've always assumed that data structures are frozen (i.e., made immutable) because of the message transfer. The open issues are perhaps more about when the compiler can avoid cloning as part of the freezing process, and what the exact relation between mutable classes and their immutable counterparts should be. However, assuming frozen mirrors of common data structures are in place, there is indeed a technically straightforward approach available that resolves the general issue: let A good thing with this approach is that it doesn't oversimplify the underlying issue, and it works well with type inference. This means that the choice between a mutable or immutable data structure The only drawback I can see with this approach is that it really requires the programmer to understand the difference between reassignment and mutation. And that is maybe a bit much to ask, at least from newbies. It's the |
No description provided.
The text was updated successfully, but these errors were encountered: