For example I want to declare
let len, (*mutable*) i =
if s.Length >= 2 && s.[0] = '0' && (s.[1] = 'x' || s.[1] = 'X') then
(s.Length - 2, 2)
else (s.Length, 0)
constant binding len and mutable i, is it possible ?
Added :
I will use references then
let len, i =
if s.Length >= 2 && s.[0] = '0' && (s.[1] = 'x' || s.[1] = 'X') then
(s.Length - 2, ref 2)
else (s.Length, ref 0)
No.
mutableapplies to the entireletbinding. You’ll have to do: