Huh, invariant() {...} ?

Myron Alexander someone at somewhere.com
Mon Jun 18 12:07:17 PDT 2007


Walter Bright wrote:
> Kristian Kilpi wrote:
>>
>> This is a small detail, but I found myself wondering why the class 
>> invariant declarations have now parenthesis (in 2.0, that is).
> 
> It was to remove syntactical ambiguities.

Walter,

I have nothing against the invariant() syntax. The word invariant has 
specific meaning for contracts but not necessarily for variables.

Was the keyword "immutable" considered and rejected? I only ask because 
you have two semantics for one keyword: one meaning DbC test, another 
meaning changeless value.

Regards,

Myron.



More information about the Digitalmars-d mailing list