const, final, scope function parameters
Walter Bright
newshound1 at digitalmars.com
Sun May 27 12:24:20 PDT 2007
Frank Benoit wrote:
> Perhaps we look at it from the wrong side.
>
> If we want to change the D language to make it more const, the keywords
> 'const', 'invariant'... are probably the wrong choice.
>
> How about restricting keywords and add their opposites: 'mutable',
> 'once' (write once) and then make every variable declaration const by
> default? Each variable/parameter needs to be made modifyable with
> modifiers if needed.
I think having to write:
mutable int x;
instead of:
int x;
just isn't going to please people.
More information about the Digitalmars-d
mailing list