4 ms·
> dangerous behavior should be hard to reach and inconvenient to use I understand your point, but to me that is exactly the case. It requires the extra "mut" (
by arve0 7y ago
> dangerous behavior should be hard to reach and inconvenient to use
I understand your point, but to me that is exactly the case. It requires the extra "mut" (harder to reach) and is inconvenient to use (more compiler errors).
My point is; Rust gives you the choice. If you need mutability due to performance, or something like that, you can have it (at the cost of simplicity and convenience).
Also, "dangerous behavior" is not allowed, in this example threads sharing mutable and immutable reference to the same object.
- keymone 7y agowe're at risk of splitting hairs now, but given that rust isn't describing itself as "functional immutable language" i posit that rust users will gladly reach for `mut` whenever they feel like it, while in clojure you will think ten times before using transients (i still haven't found myself in a situation where i'd need them).