Hi,

Is there any way to make a variable single-assignment, regardless of its type? I.e.:

void foo()
{
    <some magical keyword?> int i = 0;
    i = 2; // Error: i cannot be reassigned
}

I realize const and immutable will do this, but they are transitive and infect the type, which I do *not* want. I simply want the variable to be single-assignment. Is it possible?

- Alex

Reply via email to