3 ms·
The example with <- is not an assignment, it is called shadowing and introduces new value with same name, old one isn’t changed But I agree with some ad hoc wo
by galkk 3y ago
The example with <- is not an assignment, it is called shadowing and introduces new value with same name, old one isn’t changed
But I agree with some ad hoc words criticism
- gsuuon 3y agoIt is indeed assignment: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/symbol-and-operator-reference/#symbols-used-in-imperative-expressions https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref... shadowing would be a second 'let a = 2'
- galkk 3y agoYeah, my bad but the code from grandparent is also incorrect, as for it to be compilable variable must be declared as mutable. That confused me, as I assumed that code there is compiling. But the only way for it compile is shadowing, so yeah, I kind of assumed that to shadow is to use this syntax. I'm not working with F# for some time, so should've checked before posting.