Resizable Arrays?

Tim M a at b.com
Fri Feb 27 16:02:55 PST 2009


On Sat, 28 Feb 2009 12:55:44 +1300, Jason House  
<jason.james.house at gmail.com> 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 stl vectors to make it up for lack of resizeable arrays. Theres  
nothing stopping you from having all your arrays static in D. I think your  
crazy :)



More information about the Digitalmars-d mailing list