any news on const/invariant?

Kenny TM~ kennytm at gmail..com
Thu Nov 29 10:55:04 PST 2007


Oskar Linde wrote:

> Const could then be redefined to mean "constant" again.
> const -> protected
> invariant -> const
> 
> The old protection attribute could be renamed:
> 
> private(class),
> 
> and at the same time, the package keyword could be removed and renamed
> 
> private(package),
> 
> with a net result of 1 less keyword than today, and no confusion about 
> what keyword to use for defining constants.
> 

No, please, no. This breaks too many codes, and makes

    protected ubyte[] bitmap_data;

parsed to something unexpected.

I think "readonly" is OK, and also used in C#, but the cons are also 
apparent as discussed before.

Maybe "invariant" for read-only view? :P (ouch, that's even more confusing)

-- 
-- Kenny.



More information about the Digitalmars-d mailing list