i have seen in ruby as well powershell programming we can assign variables like a,b=b,a . it actually swaps the variable .
Is this possible in f# if so please guide me with some reference
i have seen in ruby as well powershell programming we can assign variables like a,b=b,a . it actually swaps the variable .
Is this possible in f# if so please guide me with some reference
Generally, F# doesn't allow variable re-assignment. Rather it favors immutable named values via let bindings. So, the following is not possible:
Unless you explicitly mark
a
asmutable
:However, F# does allow in most situations variable "shadowing". The only restriction to this is that it can not be done on top level modules. But, within a function, for example, the following works fine: