5 ms·
There are multiple ways of referring to this stuff. * mutable/immutable (this is the way the book refers to it and used to be the 'official' terms but I don't
by steveklabnik 4y ago
There are multiple ways of referring to this stuff.
* mutable/immutable (this is the way the book refers to it and used to be the 'official' terms but I don't know if they've changed that since I left, partially this is the name because you spell it "&mut".)
* shared/exclusive (this is the name that some people wish we had called mutable/immutable, a very very long time ago thing called the "mutapocalypse.")
Both sets are adjectives for "borrow."
I agree with you that "shared borrow" can feel like a contradiction in terms.
In general, they are duals of each other: it depends if you want to start from a place of "can I change this" or "who all has access to this," making each term more clear depending on the perspective you take.
- endorphine 4y agoThis clears things up, thanks.