Const by Default
Reiner Pope
none at here.com
Sun Jun 24 18:37:05 PDT 2007
David B. Held Wrote:
> So if you look at many other areas
> where 'implicit X' has been tried, you see a lot of examples of bad
> features, some of which were actually removed. Let's think very
> carefully and critically before we assume 'implicit in' is not one of
> them...it's only one char away from 'implicit int'. ;>
But what's to stop someone turning your argument completely around? *Without* CbD, you can modify the variables even without asking for it: the variable types are implicitly mutable. But *with* CbD, you have to explicitly say, "I want this to be mutable." Doesn't this make it more explicit: a good thing?
I agree that things like using 'ref' or 'final' don't entirely make sense to 'turn const off.' But I don't see this problem with a 'mutable' annotation, instead.
Reiner
More information about the Digitalmars-d
mailing list