www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Dynamic Array Initialisation

reply "John C" <johnch_atms hotmail.com> writes:
What's holding back the implementation of dynamic array initialisation? I 
know it's scheduled to be included post-1.0 (or so I've read here), and I'm 
aware of (and am using) the well-known workarounds (assigning a static 
array/template with variadic args), but shouldn't this be in the language 
for its big debut?

D aims to have great array-handling capabilities, and for the most part it 
does, yet the fact that a built-in syntax for creating a dynamic array and 
filling it with values is missing seems incompatible with such an aim. All 
of D's main competitors have such a feature, and to be honest it's a pretty 
fundamental one to any language.

While the current focus on bug fixing is laudable, this long-standing 
omission if beginning to feel like an oversight. 
Nov 28 2005
next sibling parent reply James Dunne <james.jdunne gmail.com> writes:
John C wrote:
 What's holding back the implementation of dynamic array initialisation? I 
 know it's scheduled to be included post-1.0 (or so I've read here), 

I wouldn't make such assumptions unless I've read it directly from one of Walter's posts.
 and I'm aware of (and am using) the well-known workarounds (assigning a static 
 array/template with variadic args), but shouldn't this be in the language 
 for its big debut?
 
 D aims to have great array-handling capabilities, and for the most part it 
 does, yet the fact that a built-in syntax for creating a dynamic array and 
 filling it with values is missing seems incompatible with such an aim. All 
 of D's main competitors have such a feature, and to be honest it's a pretty 
 fundamental one to any language.

I haven't found a use for it yet - IMO it doesn't seem all that critical. By competitor do you mean C#? I'd hardly call it a competitor =P. I use C# in my daily job, and have yet to find a good use for dynamic array initialization. Mainly it's used as a workaround for things which could've been implemented better in the .NET framework. I can't even think of any good examples off-hand since it's so rarely used. If you mean C++, then I'm fairly certain C++ has no such feature (except perhaps in STL but we're talking language features here not library). I'm not sure about Java, or any of the other lesser used OO languages like Eiffel, O'Caml, Ada, ML, Smalltalk, etc. (I'm not lumping Java in with the lesser-used OO languages here, although I'd certainly like it to be =P) I'm pretty sure at least one of these languages should have such a feature, but if not I wouldn't be surprised.
 
 While the current focus on bug fixing is laudable, this long-standing 
 omission if beginning to feel like an oversight. 
 

I suggest patience. I've heard Walter has a very long TODO list, with many more items taking higher priority than this. It's merely syntactic sugar.
Nov 28 2005
next sibling parent reply "John C" <johnch_atms hotmail.com> writes:
"James Dunne" <james.jdunne gmail.com> wrote in message 
news:dmfjdj$2o05$1 digitaldaemon.com...
 John C wrote:
 What's holding back the implementation of dynamic array initialisation? I 
 know it's scheduled to be included post-1.0 (or so I've read here),

I wouldn't make such assumptions unless I've read it directly from one of Walter's posts.
 and I'm aware of (and am using) the well-known workarounds (assigning a 
 static array/template with variadic args), but shouldn't this be in the 
 language for its big debut?

 D aims to have great array-handling capabilities, and for the most part 
 it does, yet the fact that a built-in syntax for creating a dynamic array 
 and filling it with values is missing seems incompatible with such an 
 aim. All of D's main competitors have such a feature, and to be honest 
 it's a pretty fundamental one to any language.

I haven't found a use for it yet - IMO it doesn't seem all that critical. By competitor do you mean C#? I'd hardly call it a competitor =P.

Competitors. Plural. Other C-like languages in general.
 If you mean C++, then I'm fairly certain C++ has no such feature (except 
 perhaps in STL but we're talking language features here not library).

In C/C++, you do this to initialise an array: int data[] = { 1, 2, 3 }; To initialise a multidimensional array, the syntax is this: int data[][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 } };
 I'm not sure about Java, or any of the other lesser used OO languages like 
 Eiffel, O'Caml, Ada, ML, Smalltalk, etc.  (I'm not lumping Java in with 
 the lesser-used OO languages here, although I'd certainly like it to be 
 =P)  I'm pretty sure at least one of these languages should have such a 
 feature, but if not I wouldn't be surprised.

Java: int[] data = new int[] { 1, 2, 3, 4 };
 While the current focus on bug fixing is laudable, this long-standing 
 omission if beginning to feel like an oversight.

I suggest patience. I've heard Walter has a very long TODO list, with many more items taking higher priority than this. It's merely syntactic sugar.

So are most language constructs.
Nov 28 2005
parent reply James Dunne <james.jdunne gmail.com> writes:
John C wrote:
 "James Dunne" <james.jdunne gmail.com> wrote in message 
 news:dmfjdj$2o05$1 digitaldaemon.com...
 
John C wrote:

What's holding back the implementation of dynamic array initialisation? I 
know it's scheduled to be included post-1.0 (or so I've read here),

I wouldn't make such assumptions unless I've read it directly from one of Walter's posts.
and I'm aware of (and am using) the well-known workarounds (assigning a 
static array/template with variadic args), but shouldn't this be in the 
language for its big debut?

D aims to have great array-handling capabilities, and for the most part 
it does, yet the fact that a built-in syntax for creating a dynamic array 
and filling it with values is missing seems incompatible with such an 
aim. All of D's main competitors have such a feature, and to be honest 
it's a pretty fundamental one to any language.

I haven't found a use for it yet - IMO it doesn't seem all that critical. By competitor do you mean C#? I'd hardly call it a competitor =P.

Competitors. Plural. Other C-like languages in general.

Right. I gathered as much; I was just trying to demonstrate a few examples of competitors.
 
If you mean C++, then I'm fairly certain C++ has no such feature (except 
perhaps in STL but we're talking language features here not library).

In C/C++, you do this to initialise an array: int data[] = { 1, 2, 3 }; To initialise a multidimensional array, the syntax is this: int data[][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 } };

This isn't what you're requesting then. AFAIK D can do this. This is just static array initialization. There's nothing truly dynamic in the sense of "run-time" dynamic here. One could say this is dynamic in the sense that the array dimension was not explicitly specified, but it can be inferred from the initialization data. Does D do this? If not I agree it would be nice, but not critical. To be honest, I'm not sure what exactly this does in C++.. Last I recall I don't think it creates a dynamic array. Then again, there is no such thing as a dynamic array in C++. lol
I'm not sure about Java, or any of the other lesser used OO languages like 
Eiffel, O'Caml, Ada, ML, Smalltalk, etc.  (I'm not lumping Java in with 
the lesser-used OO languages here, although I'd certainly like it to be 
=P)  I'm pretty sure at least one of these languages should have such a 
feature, but if not I wouldn't be surprised.

Java: int[] data = new int[] { 1, 2, 3, 4 };

This is more what you're after I'm thinking, and it was what I was originally talking about with regard to C#. It looks exactly the same in C#, and is just as useless =P.
 
While the current focus on bug fixing is laudable, this long-standing 
omission if beginning to feel like an oversight.

I suggest patience. I've heard Walter has a very long TODO list, with many more items taking higher priority than this. It's merely syntactic sugar.

So are most language constructs.

Not necessarily.
Nov 28 2005
next sibling parent reply Ivan Senji <ivan.senji_REMOVE_ _THIS__gmail.com> writes:
James Dunne wrote:
 John C wrote:
 In C/C++, you do this to initialise an array:
     int data[] = { 1, 2, 3 };

 To initialise a multidimensional array, the syntax is this:
     int data[][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 } };

This isn't what you're requesting then. AFAIK D can do this.

No it can't.
 This is 
 just static array initialization.  

No it isn't. The thing that is being asked for is this: int[] numbers = [x+y, y+z, z+x]; Try to do this in D. The static/const trick will not work if x,y,z are non-constant variables so you will have to do: int[] numbers = new int[3]; numbers[0] = x+y; numbers[1] = y+z; numbers[2] = z+x; Wich is nicer is obvious.
 There's nothing truly dynamic in the 
 sense of "run-time" dynamic here.  

There should be.
Nov 28 2005
next sibling parent Sai <Sai_member pathlink.com> writes:
Its called "Array literal expression" 

It is mentioned in "future features" page
http://www.digitalmars.com/d/future.html

But I too think it is fundamental and most basic feature. What is the reason for
it being a less priority feature ? What is soo hard in implementing it ? 

Currently I am using code like

Matrix m = new Matrix(4, 1);
m.array[0] = x;
m.array[1] = y;
m.array[2] = z;
m.array[3] = 1;

I whish I could do 

double[] arr = [x, y, z, 1];
Matrix m = new Matrix(arr);

It gets real ugly for large dimensions.

Sai
Nov 28 2005
prev sibling parent BCS <BCS_member pathlink.com> writes:
/**
this with array ops would work.
**/

int main()
{
int a = 1, b = 2, c = 3;
int x = 4, y = 5, z = 6;
int[] array = make!(int)(&a, &b, &c);
int[] array2 = make!(int)(&a, &b, &c);

array[] += arry2[];

foreach(int i, int j; array)
printf("[%d] = %d\n", i,j);

return 2;
}


template make(T)
{
T[] make(T*[] p ...)
{
T[] ret = new T[p.length];

foreach(int i, T* v; p)
ret[i] = *v;

return ret;
}
}




In article <dmfuq5$310j$1 digitaldaemon.com>, Ivan Senji says...
James Dunne wrote:
 John C wrote:
 In C/C++, you do this to initialise an array:
     int data[] = { 1, 2, 3 };

 To initialise a multidimensional array, the syntax is this:
     int data[][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 } };

This isn't what you're requesting then. AFAIK D can do this.

No it can't.
 This is 
 just static array initialization.  

No it isn't. The thing that is being asked for is this: int[] numbers = [x+y, y+z, z+x]; Try to do this in D. The static/const trick will not work if x,y,z are non-constant variables so you will have to do: int[] numbers = new int[3]; numbers[0] = x+y; numbers[1] = y+z; numbers[2] = z+x; Wich is nicer is obvious.
 There's nothing truly dynamic in the 
 sense of "run-time" dynamic here.  

There should be.

Nov 28 2005
prev sibling next sibling parent reply "John C" <johnch_atms hotmail.com> writes:
"James Dunne" <james.jdunne gmail.com> wrote in message 
news:dmfu0g$30f0$1 digitaldaemon.com...
 John C wrote:
 "James Dunne" <james.jdunne gmail.com> wrote in message 
 news:dmfjdj$2o05$1 digitaldaemon.com...

John C wrote:

What's holding back the implementation of dynamic array initialisation? 
I know it's scheduled to be included post-1.0 (or so I've read here),

I wouldn't make such assumptions unless I've read it directly from one of Walter's posts.
and I'm aware of (and am using) the well-known workarounds (assigning a 
static array/template with variadic args), but shouldn't this be in the 
language for its big debut?

D aims to have great array-handling capabilities, and for the most part 
it does, yet the fact that a built-in syntax for creating a dynamic 
array and filling it with values is missing seems incompatible with such 
an aim. All of D's main competitors have such a feature, and to be 
honest it's a pretty fundamental one to any language.

I haven't found a use for it yet - IMO it doesn't seem all that critical. By competitor do you mean C#? I'd hardly call it a competitor =P.

Competitors. Plural. Other C-like languages in general.

Right. I gathered as much; I was just trying to demonstrate a few examples of competitors.

I should have been clearer. And yes, there are numerous languages that don't allow array assignment on declaration, but you just need to Google a little to see their users asking for ways to do exactly that. It's not so rare as you have found in your own experience.
If you mean C++, then I'm fairly certain C++ has no such feature (except 
perhaps in STL but we're talking language features here not library).

In C/C++, you do this to initialise an array: int data[] = { 1, 2, 3 }; To initialise a multidimensional array, the syntax is this: int data[][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 } };

This isn't what you're requesting then. AFAIK D can do this. This is just static array initialization. There's nothing truly dynamic in the sense of "run-time" dynamic here. One could say this is dynamic in the sense that the array dimension was not explicitly specified, but it can be inferred from the initialization data. Does D do this? If not I agree it would be nice, but not critical.

In D, the elements in the initialiser must be constants. C/C++ allows this, D doesn't: int el = 2; int data[] = { el, el + 1 };
 To be honest, I'm not sure what exactly this does in C++..  Last I recall 
 I don't think it creates a dynamic array.  Then again, there is no such 
 thing as a dynamic array in C++.  lol

I'm not sure about Java, or any of the other lesser used OO languages 
like Eiffel, O'Caml, Ada, ML, Smalltalk, etc.  (I'm not lumping Java in 
with the lesser-used OO languages here, although I'd certainly like it to 
be =P)  I'm pretty sure at least one of these languages should have such 
a feature, but if not I wouldn't be surprised.

Java: int[] data = new int[] { 1, 2, 3, 4 };

This is more what you're after I'm thinking, and it was what I was originally talking about with regard to C#. It looks exactly the same in C#, and is just as useless =P.

Please explain why it's useless. You might as well say that constructors on classes are useless.
While the current focus on bug fixing is laudable, this long-standing 
omission if beginning to feel like an oversight.

I suggest patience. I've heard Walter has a very long TODO list, with many more items taking higher priority than this. It's merely syntactic sugar.

So are most language constructs.

Not necessarily.

Nov 28 2005
parent Tomás Rossi <Tomás_member pathlink.com> writes:
In article <dmg00l$lk$1 digitaldaemon.com>, John C says...
"James Dunne" <james.jdunne gmail.com> wrote in message 
news:dmfu0g$30f0$1 digitaldaemon.com...
 John C wrote:
 "James Dunne" <james.jdunne gmail.com> wrote in message 
 news:dmfjdj$2o05$1 digitaldaemon.com...

John C wrote:

What's holding back the implementation of dynamic array initialisation? 
I know it's scheduled to be included post-1.0 (or so I've read here),

I wouldn't make such assumptions unless I've read it directly from one of Walter's posts.
and I'm aware of (and am using) the well-known workarounds (assigning a 
static array/template with variadic args), but shouldn't this be in the 
language for its big debut?

D aims to have great array-handling capabilities, and for the most part 
it does, yet the fact that a built-in syntax for creating a dynamic 
array and filling it with values is missing seems incompatible with such 
an aim. All of D's main competitors have such a feature, and to be 
honest it's a pretty fundamental one to any language.

I haven't found a use for it yet - IMO it doesn't seem all that critical. By competitor do you mean C#? I'd hardly call it a competitor =P.

Competitors. Plural. Other C-like languages in general.

Right. I gathered as much; I was just trying to demonstrate a few examples of competitors.

I should have been clearer. And yes, there are numerous languages that don't allow array assignment on declaration, but you just need to Google a little to see their users asking for ways to do exactly that. It's not so rare as you have found in your own experience.
If you mean C++, then I'm fairly certain C++ has no such feature (except 
perhaps in STL but we're talking language features here not library).

In C/C++, you do this to initialise an array: int data[] = { 1, 2, 3 }; To initialise a multidimensional array, the syntax is this: int data[][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 } };

This isn't what you're requesting then. AFAIK D can do this. This is just static array initialization. There's nothing truly dynamic in the sense of "run-time" dynamic here. One could say this is dynamic in the sense that the array dimension was not explicitly specified, but it can be inferred from the initialization data. Does D do this? If not I agree it would be nice, but not critical.

In D, the elements in the initialiser must be constants. C/C++ allows this, D doesn't: int el = 2; int data[] = { el, el + 1 };
 To be honest, I'm not sure what exactly this does in C++..  Last I recall 
 I don't think it creates a dynamic array.  Then again, there is no such 
 thing as a dynamic array in C++.  lol

I'm not sure about Java, or any of the other lesser used OO languages 
like Eiffel, O'Caml, Ada, ML, Smalltalk, etc.  (I'm not lumping Java in 
with the lesser-used OO languages here, although I'd certainly like it to 
be =P)  I'm pretty sure at least one of these languages should have such 
a feature, but if not I wouldn't be surprised.

Java: int[] data = new int[] { 1, 2, 3, 4 };

This is more what you're after I'm thinking, and it was what I was originally talking about with regard to C#. It looks exactly the same in C#, and is just as useless =P.

Please explain why it's useless. You might as well say that constructors on classes are useless.
While the current focus on bug fixing is laudable, this long-standing 
omission if beginning to feel like an oversight.

I suggest patience. I've heard Walter has a very long TODO list, with many more items taking higher priority than this. It's merely syntactic sugar.

So are most language constructs.



I agree. You could write the same programs in assembly (if you're nuts). High level languages are essentially abstractions of low level ones (at least practically speaking). I would say, in an exaggerated manner, that high level languages are basically complex syntactic sugar constructions. A lot of D's beauty resides in it's beautiful syntax sugars.
 Not necessarily. 


Why not? IMHO if you make such an imprecise affirmation, you have to explain why. Tom
Nov 28 2005
prev sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"James Dunne" <james.jdunne gmail.com> wrote in message 
news:dmfu0g$30f0$1 digitaldaemon.com...
 This isn't what you're requesting then.  AFAIK D can do this.  This is 
 just static array initialization.  There's nothing truly dynamic in the 
 sense of "run-time" dynamic here.  One could say this is dynamic in the 
 sense that the array dimension was not explicitly specified, but it can be 
 inferred from the initialization data.

How about: char[] str = "hello"; It's a dynamic array with an initializer. In other words, D can already do it, just not with any types besides (w|d)char. As a point of interest, you can use a string of dchars to initialize an int[]: int[] a = cast(int[])cast(void[])"\U00000001\U00000002\U00000003"d; foreach(int i; a) writefln(i); So the mechanism is there..
Nov 28 2005
parent reply "John C" <johnch_atms hotmail.com> writes:
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
news:dmgln8$gno$1 digitaldaemon.com...
 "James Dunne" <james.jdunne gmail.com> wrote in message 
 news:dmfu0g$30f0$1 digitaldaemon.com...
 This isn't what you're requesting then.  AFAIK D can do this.  This is 
 just static array initialization.  There's nothing truly dynamic in the 
 sense of "run-time" dynamic here.  One could say this is dynamic in the 
 sense that the array dimension was not explicitly specified, but it can 
 be inferred from the initialization data.

How about: char[] str = "hello"; It's a dynamic array with an initializer. In other words, D can already do it, just not with any types besides (w|d)char.

The compiler treats strings as a special case. It doesn't see "hello" and ['h', 'e', 'l', 'l', 'o'] as the same thing.
 As a point of interest, you can use a string of dchars to initialize an 
 int[]:

 int[] a = cast(int[])cast(void[])"\U00000001\U00000002\U00000003"d;

 foreach(int i; a)
    writefln(i);

 So the mechanism is there..

Is it? As shown above, you can't initialise char[] with an array of chars, only with a string.
Nov 29 2005
parent reply Don Clugston <dac nospam.com.au> writes:
John C wrote:
 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
 news:dmgln8$gno$1 digitaldaemon.com...
 
"James Dunne" <james.jdunne gmail.com> wrote in message 
news:dmfu0g$30f0$1 digitaldaemon.com...

This isn't what you're requesting then.  AFAIK D can do this.  This is 
just static array initialization.  There's nothing truly dynamic in the 
sense of "run-time" dynamic here.  One could say this is dynamic in the 
sense that the array dimension was not explicitly specified, but it can 
be inferred from the initialization data.

How about: char[] str = "hello"; It's a dynamic array with an initializer. In other words, D can already do it, just not with any types besides (w|d)char.

The compiler treats strings as a special case. It doesn't see "hello" and ['h', 'e', 'l', 'l', 'o'] as the same thing.
As a point of interest, you can use a string of dchars to initialize an 
int[]:

int[] a = cast(int[])cast(void[])"\U00000001\U00000002\U00000003"d;

foreach(int i; a)
   writefln(i);

So the mechanism is there..

Is it? As shown above, you can't initialise char[] with an array of chars, only with a string.

There are a huge number of related issues. When I asked recently if we could have const int [] a = [1, 2, 3] ~ [4, 5, 6]; evaluated at compile time, Walter said: "The reason it does not currently work is because there is no syntax for array literals as a PrimaryExpression. This is fixable, but not at the moment." I conclude: (a) Including array literals will involve major structural change in both the parser and semantic analyser. Many bugs will be introduced, it will take a long time for the compiler to stabilise afterwards. (b) Walter does intend to do it eventually. Probably, a lot of minor things need to be tidied up before it can be considered.
Nov 29 2005
parent "John C" <johnch_atms hotmail.com> writes:
"Don Clugston" <dac nospam.com.au> wrote in message 
news:dmhkl6$1ebj$1 digitaldaemon.com...
 John C wrote:
 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
 news:dmgln8$gno$1 digitaldaemon.com...

"James Dunne" <james.jdunne gmail.com> wrote in message 
news:dmfu0g$30f0$1 digitaldaemon.com...

This isn't what you're requesting then.  AFAIK D can do this.  This is 
just static array initialization.  There's nothing truly dynamic in the 
sense of "run-time" dynamic here.  One could say this is dynamic in the 
sense that the array dimension was not explicitly specified, but it can 
be inferred from the initialization data.

How about: char[] str = "hello"; It's a dynamic array with an initializer. In other words, D can already do it, just not with any types besides (w|d)char.

The compiler treats strings as a special case. It doesn't see "hello" and ['h', 'e', 'l', 'l', 'o'] as the same thing.
As a point of interest, you can use a string of dchars to initialize an 
int[]:

int[] a = cast(int[])cast(void[])"\U00000001\U00000002\U00000003"d;

foreach(int i; a)
   writefln(i);

So the mechanism is there..

Is it? As shown above, you can't initialise char[] with an array of chars, only with a string.

There are a huge number of related issues. When I asked recently if we could have const int [] a = [1, 2, 3] ~ [4, 5, 6]; evaluated at compile time, Walter said: "The reason it does not currently work is because there is no syntax for array literals as a PrimaryExpression. This is fixable, but not at the moment." I conclude: (a) Including array literals will involve major structural change in both the parser and semantic analyser. Many bugs will be introduced, it will take a long time for the compiler to stabilise afterwards. (b) Walter does intend to do it eventually. Probably, a lot of minor things need to be tidied up before it can be considered.

I appreciate you reasoning it through. That's all I wanted to hear.
Nov 29 2005
prev sibling parent clayasaurus <clayasaurus gmail.com> writes:
James Dunne wrote:
 John C wrote:
 
 What's holding back the implementation of dynamic array 
 initialisation? I know it's scheduled to be included post-1.0 (or so 
 I've read here), 

I wouldn't make such assumptions unless I've read it directly from one of Walter's posts.
 and I'm aware of (and am using) the well-known workarounds (assigning 
 a static array/template with variadic args), but shouldn't this be in 
 the language for its big debut?

 D aims to have great array-handling capabilities, and for the most 
 part it does, yet the fact that a built-in syntax for creating a 
 dynamic array and filling it with values is missing seems incompatible 
 with such an aim. All of D's main competitors have such a feature, and 
 to be honest it's a pretty fundamental one to any language.

I haven't found a use for it yet - IMO it doesn't seem all that critical. By competitor do you mean C#? I'd hardly call it a competitor =P. I use C# in my daily job, and have yet to find a good use for dynamic array initialization. Mainly it's used as a workaround for things which could've been implemented better in the .NET framework. I can't even think of any good examples off-hand since it's so rarely used. If you mean C++, then I'm fairly certain C++ has no such feature (except perhaps in STL but we're talking language features here not library).

You have to remember that D prides itself in having core features builtin instead of needing a seperate library.
 
 I'm not sure about Java, or any of the other lesser used OO languages 
 like Eiffel, O'Caml, Ada, ML, Smalltalk, etc.  (I'm not lumping Java in 
 with the lesser-used OO languages here, although I'd certainly like it 
 to be =P)  I'm pretty sure at least one of these languages should have 
 such a feature, but if not I wouldn't be surprised.
 
 While the current focus on bug fixing is laudable, this long-standing 
 omission if beginning to feel like an oversight.

I suggest patience. I've heard Walter has a very long TODO list, with many more items taking higher priority than this. It's merely syntactic sugar.

Nov 28 2005
prev sibling parent Ivan Senji <ivan.senji_REMOVE_ _THIS__gmail.com> writes:
John C wrote:
 What's holding back the implementation of dynamic array initialisation? I 
 know it's scheduled to be included post-1.0 (or so I've read here), and I'm 
 aware of (and am using) the well-known workarounds (assigning a static 
 array/template with variadic args), but shouldn't this be in the language 
 for its big debut?

I think it should because it is souch a fundamental feature.
 
 D aims to have great array-handling capabilities, and for the most part it 
 does, yet the fact that a built-in syntax for creating a dynamic array and 
 filling it with values is missing seems incompatible with such an aim. All 
 of D's main competitors have such a feature, and to be honest it's a pretty 
 fundamental one to any language.
 
 While the current focus on bug fixing is laudable, this long-standing 
 omission if beginning to feel like an oversight. 
 

I would also like to add something that 100% isn't goint to be in D1.0 an it is dynamic alocation of rectangular arrays. It is something I miss and is also IMO a very fundamental thing for a language that is so good with arrays to have.
Nov 28 2005