Invariant -- question #2

Lars Ivar Igesund larsivar at igesund.net
Tue Oct 21 08:14:19 PDT 2008


Jarrett Billingsley wrote:

> 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?

It was changed when invariant was introduced to D2 as to make a transition
path ... I think it was announced too.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango



More information about the Digitalmars-d mailing list