Resizable Arrays?
Tim M
a at b.com
Sat Feb 28 15:47:49 PST 2009
On Sun, 01 Mar 2009 05:30:28 +1300, Sean Kelly <sean at invisibleduck.org>
wrote:
> Jason House wrote:
>> Are there any good reasons to allow built in arrays to be resizable?
>> There's already plenty of empirical evidence that building arrays by
>> appending is incredibly slow.
>> There are also bugs in bugzilla where resizing arrays after assigning
>> one array to another violates type safety. Those bugs can be solved by
>> always reallocatimg arrays when resizing, but that makes performance
>> even worse...
>> While not much of an argument, C# also prevents array resizing.
>> Is it time to rely on standard libraries for data structures and let
>> built in arrays be fixed length? It's a breaking change...
>
> C has dynamic arrays now. If D got rid of them I might just cry.
How do you mean? Are you talking about something like this:
void someFunc(int s)
{
int ar[s];
}
More information about the Digitalmars-d
mailing list