What's left to do for a stable D2?

Simen kjaeraas simen.kjaras at gmail.com
Fri Jan 22 08:39:22 PST 2010


On Fri, 22 Jan 2010 08:50:17 +0100, bearophile <bearophileHUGS at lycos.com>  
wrote:

> Jesse Phillips:
>> This page[1] has been getting regular updates, so it should do a good
>> job answering the question.
>> 1. http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel#FutureDirections
>
> Most things on that page seems OK and not too much complex to  
> understand. There are two things in that page that I think need more  
> discussion, because I don't understand them or I don't see their need:
> - Remove struct initializers.

Struct initializers on the C form:
   struct S { int n; }
   S s = { 4 };
No need for them when we have this:
   S s = S( 4 );
and static opCall for those special occasions.

This cleans up the language, and makes some things somewhat easier
(e.g., what is the type of { 4, "Hi!" }?

> - Make array literals immutable.

Currently, string literals are immutable, but no other array literals are:
   auto s = "Foo!"; // typeof( s ) == immutable(char)[]
   auto i = [ 1, 2, 3, 4 ]; // typeof( i ) == int[]

Literals are allocated in the static data segment, and thus should be
immutable.

-- 
Simen



More information about the Digitalmars-d mailing list