Invariant -- question #2

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Oct 21 08:09:37 PDT 2008


On Tue, Oct 21, 2008 at 9:25 AM, KennyTM~ <kennytm at gmail.com> wrote:
> Bill Baxter wrote:
>>
>> Does using immutable for things that won't change mean that the
>> compiler will eventually revert back to accepting the D1 function-like
>> syntax for class invariants?
>>
>> I.e.
>>  invariant() {  some stuff  }
>> Instead of
>>  invariant { some stuff }
>>
>> Not a huge deal for me.  I was just curious.  I seem to remember
>> people saying this was one thing that made it hard to write code that
>> is portable between D1 and D2.
>>
>> --bb
>
> but
>
>  invariant() { ... }
>
> is valid in D1 when D2 was released, isn't it?
>

Erm... I was going to say "no" but it does indeed compile.

In fact the D1 spec even shows it.

Walter, why was this never mentioned or announced?



More information about the Digitalmars-d mailing list