Huh, invariant() {...} ?

Kristian Kilpi kjkilpi at gmail.com
Tue Jun 19 03:13:09 PDT 2007


On Tue, 19 Jun 2007 05:06:08 +0300, Derek Parnell  
<derek at nomail.afraid.org> wrote:

> On Mon, 18 Jun 2007 11:25:32 -0700, 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.
>
>  ... at the cost of understanding for humans ...
>
> The "overloaded" keyword problem with D is just getting worse and worse.
>
> I know you are a compiler writer and doing such things as you are makes  
> it
> easier for the compiler, but the continually overloading of keywords with
> different (but similar) meanings in D is bordering on the illegible. What
> you are doing, inadvertently, is making D harder for people to learn,
> understand, and read.
>

I agree.

(I have a feeling that Walter is reluctant to do something like this, but)  
if the keyword for the class invariants will be changed, I vote for:

   invarianttest

It's similar to 'unittest', and who knows, maybe there will be structure  
invariants someday also.



More information about the Digitalmars-d mailing list