On Fri, 22 Jan 2010 08:50:17 +0100, bearophile <[email protected]> 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

Reply via email to