www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Immutable

reply "Bill Baxter" <wbaxter gmail.com> writes:
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
Oct 20 2008
next sibling parent reply Moritz Warning <moritzwarning web.de> writes:
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.
Oct 20 2008
parent ore-sama <spam here.lot> writes:
Bill Baxter Wrote:

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

 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).

Oct 21 2008
prev sibling parent "Bill Baxter" <wbaxter gmail.com> writes:
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
Oct 20 2008