I have started with F# and some code structure wonder me. For example:
I have next code:
let mutable s = 10
s <- 1 + s
printf "%i" s
Everything is clear from math side. I marked "s" as mutable and assigned the new value to "s". Result is 11.
Let me try other part of code:
let mutable s = 10
s = 1 + s
printf "%i" s
This code was worked. But I see that s = 1 + s
is a bit strange from the math side. Result of executing of this was 10.
My question, what go on in the last sample? Why didn't I get a error? Is s = 1 + s
just ignored? Why? I didn't get any error in the output.