On 5/30/13, Russel Winder <[email protected]> wrote:
> I still like:
>
> x := 1
>
> for a declaration and initialization with type inference.
Well the saying goes, even a broken clock..
Personally I think it's way too late for such a feature. What if you
make a typo and instead of declaring a new shadowed variable you end
up modifying an existing one?
int x;
void main()
{
auto x = 5; // so far so good, it's obviously a new variable
}
vs:
int x;
void main()
{
x := 5;
}
which with a typo becomes:
int x;
void main()
{
x = 5;
}
Could you easily spot the bug?