View mode: basic / threaded / horizontal-split · Log in · Help
October 21, 2008
Immutable
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
Re: Immutable
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
Re: Immutable
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
Re: Immutable
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...
Top | Discussion index | About this forum | D home