Extended Type Design.

kris foo at bar.com
Fri Mar 16 19:21:06 PDT 2007


Andrei Alexandrescu (See Website For Email) wrote:
> kris wrote:
[snip]
>> So, "invariant" is already a keyword ... what about that?
>>
>> "Invariant" is currently used to stipulate a condition that must 
>> remain constant (or true) for the extent of the enclosing/relevant 
>> scope. Right now, it is used within a class only, but the semantics 
>> could presumably extend elsewhere too:
>>
>> invariant int * p = &x;
>>
>> void myFunc (invariant char[] arg) {}
>>
>> in both these cases, the "invariance" should remain for the extent of 
>> the relevant scope?
> 
> 
> I completely missed that one. I think it's a good idea to look into it 
> as a candidate for a qualifier name. Thank you.

yw

If it gets tossed for whatever reason, It might be worthwhile renaming 
the current "invariant" to whatever is settled upon? That may reclaim a 
keyword at least.



More information about the Digitalmars-d mailing list