I was perplexed after executing this piece of code, where strings seems to behave as if they are value types. I am wondering whether the assignment operator is operating on
There are three semantic types of entities:
If one makes a copy X of a mutable reference Y and then does something with the copy, any mutation performed upon X will affect Y, and vice versa, since X and Y both refer to the same object. By contrast, if one makes a copy XX of a mutable value type instance YY, changes to XX will not affect YY, nor vice versa.
Because the only semantic difference between reference types and value types is the behavior if they are altered after they are copied, immutable reference types are semantically identical to immutable value types. That is not to imply that there aren't sometimes considerable performance advantages to using one over the other.
(*) Meaning value types which can be partially altered without being completely replaced. Point, for example, is mutable because one can change part of it without having to read and rewrite the whole thing. By contrast, Int32 is immutable, since (at least from "safe" code) it's not possible to make any change to an Int32 without rewriting the whole thing.