== Quote from Walter Bright ([email protected])'s article > Leandro Lucarella wrote: > > Do you remember when people asked for default immutability? I do :) > Yes, but it would break every other line of code already written in D. > > I like the idea of making x := y an alias for immutable x = y (or even > > enum x = y). That would make this style much more attractive without > > breaking backward compatibility as immutable-by-default would do. > Actually, > const x = y; > is better than immutable, because if y is a T*, it cannot be implicitly > converted to immutable, while it can be implicitly converted to const.
Refresh my memory, is there any difference whatsoever between const and immutable for pure value types (int, float, char, etc.), including in terms of the compiler optimizations they allow? As far as I can tell, the difference only comes into existence when there's indirection involved.
