3 ms·
A distinct notion of “immutable” and “referentially transparent” are somewhat less useful in Rust, ownership essentially means most objects/types have the usefu
by dbaupp 5y ago
A distinct notion of “immutable” and “referentially transparent” are somewhat less useful in Rust, ownership essentially means most objects/types have the useful aspects of those properties by default (e.g http://smallcultfollowing.com/babysteps/blog/2018/02/01/in-rust-ordinary-vectors-are-values/ http://smallcultfollowing.com/babysteps/blog/2018/02/01/in-r... ).
The key issue with ranges and mutation is specifically that they’re an Iterator (rather than just convertible, as you reiterate from the post). It’s fine to be directly mutable, and allow updating the fields as desired.