On 2/10/12 6:32 AM, Niko Matsakis wrote:
3. *Change mutability to be "all-or-nothing".* This actually builds on solution #2. The goal is to address the complicated story about when fields are mutable or immutable that results. The basic idea is that we do not mark individual fields of a record as mutable or immutable, but rather the entire record itself. Interior records then naturally inherit the mutability of their container, and records stored in mutable local variables can be overridden without problems. I spelled out this idea a bit in <https://github.com/mozilla/rust/wiki/Proposal-for-all-or-nothing-mut>, though this is more of a sketch than a detailed proposal. The main downside of this option is that we lose the ability to specify "field x is mutable but field y is not" (but then, that was the idea: the mutability of fields is supposed to come from the outside now).
Thinking more about this, I am not sure that option #3 has any point. It is basically the same as option #2 but less expressive. It's a case of "when I started playing with this idea, it was different, but I found inconsistencies and over time it evolved to be the same thing as I started with."
Niko _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
