Huh, invariant() {...} ?

Kristian Kilpi kjkilpi at gmail.com
Mon Jun 18 12:08:47 PDT 2007


On Mon, 18 Jun 2007 21:25:32 +0300, Walter Bright  
<newshound1 at digitalmars.com> 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.

Oh I see, as Deewiant said in another reply to my original post, one *can*  
write 'invariant {...}' now... (so, yep, it cannot be used for the class  
invariants).

Too much keywords in a language is not good, but maybe a new keyword (e.g.  
'classinvariant') for the class invariants would be justified. Semantic  
ambiguity is not nice either.



More information about the Digitalmars-d mailing list