Immutable

Bill Baxter wbaxter at gmail.com
Mon Oct 20 18:34:42 PDT 2008


On Tue, Oct 21, 2008 at 10:27 AM, Moritz Warning <moritzwarning at 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



More information about the Digitalmars-d mailing list