| Thread overview | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
October 21, 2008 Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
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
| ||||
October 21, 2008 Re: Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | 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?
| |||
October 21, 2008 Re: Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to KennyTM~ | On Tue, Oct 21, 2008 at 10:25 PM, KennyTM~ <kennytm@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?
>
I'm not really sure what the deal is right now. Partly why I was asking. It's not a feature I use much, so I'm curious if the DbC fans think it should change back to the original syntax once it can.
--bb
| |||
October 21, 2008 Re: Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to KennyTM~ | On Tue, Oct 21, 2008 at 9:25 AM, KennyTM~ <kennytm@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?
| |||
October 21, 2008 Re: Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley wrote: > On Tue, Oct 21, 2008 at 9:25 AM, KennyTM~ <kennytm@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 | |||
October 21, 2008 Re: Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Lars Ivar Igesund | On Tue, Oct 21, 2008 at 11:14 AM, Lars Ivar Igesund <larsivar@igesund.net> wrote:
> It was changed when invariant was introduced to D2 as to make a transition path ... I think it was announced too.
I can't find anything about it in the changelog, but maybe it was buried in the newsgroups somewhere. W has a habit of not announcing important changes until three months later when he mentions it in passing in a reply as if everyone knew about it.
| |||
October 21, 2008 Re: Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley wrote:
> On Tue, Oct 21, 2008 at 11:14 AM, Lars Ivar Igesund
> <larsivar@igesund.net> wrote:
>> It was changed when invariant was introduced to D2 as to make a transition
>> path ... I think it was announced too.
>
> I can't find anything about it in the changelog, but maybe it was
> buried in the newsgroups somewhere. W has a habit of not announcing
> important changes until three months later when he mentions it in
> passing in a reply as if everyone knew about it.
Does anyone know about
=this() {
}
?
| |||
October 21, 2008 Re: Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Ary Borenszweig | On Tue, 21 Oct 2008 21:18:22 +0400, Ary Borenszweig <ary@esperanto.org.ar> wrote:
> Jarrett Billingsley wrote:
>> On Tue, Oct 21, 2008 at 11:14 AM, Lars Ivar Igesund
>> <larsivar@igesund.net> wrote:
>>> It was changed when invariant was introduced to D2 as to make a transition
>>> path ... I think it was announced too.
>> I can't find anything about it in the changelog, but maybe it was
>> buried in the newsgroups somewhere. W has a habit of not announcing
>> important changes until three months later when he mentions it in
>> passing in a reply as if everyone knew about it.
>
> Does anyone know about
>
> =this() {
> }
>
> ?
Looks like a new/alternative syntax for struct postblitting (works in DMD2.019, too).
| |||
October 21, 2008 Re: Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Denis Koroskin | Denis Koroskin wrote:
> On Tue, 21 Oct 2008 21:18:22 +0400, Ary Borenszweig <ary@esperanto.org.ar> wrote:
>
>> Jarrett Billingsley wrote:
>>> On Tue, Oct 21, 2008 at 11:14 AM, Lars Ivar Igesund
>>> <larsivar@igesund.net> wrote:
>>>> It was changed when invariant was introduced to D2 as to make a transition
>>>> path ... I think it was announced too.
>>> I can't find anything about it in the changelog, but maybe it was
>>> buried in the newsgroups somewhere. W has a habit of not announcing
>>> important changes until three months later when he mentions it in
>>> passing in a reply as if everyone knew about it.
>>
>> Does anyone know about
>>
>> =this() {
>> }
>>
>> ?
>
> Looks like a new/alternative syntax for struct postblitting (works in DMD2.019, too).
Yes, it's exactly that, but I didn't see it announced anywhere.
| |||
October 21, 2008 Re: Invariant -- question #2 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley Wrote: > I can't find anything about it in the changelog http://www.digitalmars.com/d/2.0/features2.html | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply