Graydon Hoare <[email protected]>: > Really I think the question hinges on intuitions about transitivity, figuring > out which is more counterintuitive: > > - Something you mark as mutable that you find yourself restricted > from mutating due to its sub- or super-structure being immutable. > > - Something marked as immutable that still manages to change > bits-in-memory due to part of its sub- or super-structure being > mutated. > > Neither is really great.
Exactly. However, as far as I understood this language, immutability is the default. So if you have an immutable struct that imports a mutable substructure, the substructure should become immutable, too. Immutable wins. This of course means that if a function expects a mutable substructure, that function does not apply. However, you can always call the function on a copy of the structure, if you must. Just my two cents, Kosta PS: I'm new here btw. And I have written about 5 lines of Rust in total so far. _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
