Thread overview
Immutable
Oct 21, 2008
Bill Baxter
Oct 21, 2008
Moritz Warning
Oct 21, 2008
Bill Baxter
Oct 21, 2008
ore-sama
October 21, 2008
This works now in D2!

-----
import std.stdio;
void main() {
    immutable(char)[] bar;
    writefln("bar is ", typeof(bar).stringof);
}
----

But it still prints "bar is invariant(char)[]".

Will the internal names change too in the next release?

--bb
October 21, 2008
On Tue, 21 Oct 2008 10:06:03 +0900, Bill Baxter wrote:

> This works now in D2!
> 
> -----
> import std.stdio;
> void main() {
>     immutable(char)[] bar;
>     writefln("bar is ", typeof(bar).stringof);
> }
> ----
> 
> But it still prints "bar is invariant(char)[]".
> 
> Will the internal names change too in the next release?
> 
> --bb

I think it's a bug, should be fixed easily.
October 21, 2008
On Tue, Oct 21, 2008 at 10:27 AM, Moritz Warning <moritzwarning@web.de> wrote:
> On Tue, 21 Oct 2008 10:06:03 +0900, Bill Baxter wrote:
>
>> This works now in D2!
>>
>> -----
>> import std.stdio;
>> void main() {
>>     immutable(char)[] bar;
>>     writefln("bar is ", typeof(bar).stringof);
>> }
>> ----
>>
>> But it still prints "bar is invariant(char)[]".
>>
>> Will the internal names change too in the next release?
>>
>> --bb
>
> I think it's a bug, should be fixed easily.

Well, immutable doesn't appear anywhere in the Phobos source code yet either.  So rather than a bug, I was thinking it was part of a K-part plan to phase in immutable and phase out invariant.  Just curious what that plan was.

My other question is relevant to that too -- will class invariants return to "invariant { ... }" at some stage in that plan (although I think I got old syntax vs new syntax mixed up in that post -- I have very rarely used class invariants).

--bb
October 21, 2008
Bill Baxter Wrote:

> I was thinking it was part of a K-part
> plan to phase in immutable and phase out invariant.
really?

> My other question is relevant to that too -- will class invariants return to "invariant { ... }" at some stage in that plan (although I think I got old syntax vs new syntax mixed up in that post -- I have very rarely used class invariants).
I also noticed inconsistent syntax of unittest and invariant: they have the same nature but different syntax; even wanted to post bug...