I need to understand something very important regarding F#: how it handles references and values. I know that F# defines immutable and mutable objects and also know the reason why.
But there is one thing that I do not know: how are objects treated?
I mean, in C# everything is a pointer and when assigning to an object the reference of another one, data are the same, and we'll have two pointers pointing the same data.
So in C# if I have this:
Object myobj1 = new Object();
Object myobj2 = myobj1;
bool myobj1 == myobj2; // It is true
Well, what about f#?
let myvar: MyObj = new MyObj ()
let myvar2: MyObj = myvar
What's the situation here? Does the assignment involves copy? or not.
And, generally speaking, what's f# approach to this topic? (I mean value vs reference).