Extended Type Design.

Dave Dave_member at pathlink.com
Fri Mar 23 21:25:49 PDT 2007


Andrei Alexandrescu (See Website For Email) Wrote:
> We have talked about a design. In short, the intent is to define three 
> flavors of immutability:
> 
> a) final - a simple storage class controlling the immutability of the 
> bits allocated for the symbol per se;
> 
> b) const - type qualifier meaning an immutable view of an otherwise 
> modifiable data. const does not control the bits of the object, only the 
> storage addressed indirectly by it (transitively);
> 
> c) "superconst" - denoted as "const!" or "super const": type qualifier 
> meaning that the data is genuinely unmodifiable.
> 

'invariant' seems to be the consensus (instead of super const or const!)? If so, I'd agree that's the best of the three.

> There is talk about deprecating lazy if it's best implemented via other 
> mechanisms. There is also talk about deprecating "inout" in favor of 
> "ref" on grounds that the often-useful "inout const" is likely to become 
> #1 reason for bashing D.
>

I haven't noticed 'ref' come-up on subsequent posts, but I would strongly favor this change as well.

- Dave




More information about the Digitalmars-d mailing list