DIP 1025--Dynamic Arrays Only Shrink, Never Grow--Community Review Round 1

Walter Bright newshound2 at digitalmars.com
Mon Nov 11 21:32:19 UTC 2019


On 11/11/2019 3:17 AM, Jonathan M Davis wrote:
> Ouch. This would be a _huge_ breaking change. The ability to grow dynamic
> arrays is used all over the place. It's also one of the great benefits of
> D's dynamic array IMHO. The fact that you append to a dynamic array without
> caring where it came from can be incredibly useful, and if you really care
> about checking whether it has the capacity to grow or whether it's managed
> by the GC, we have functions to check for that.

While:

    a ~= b;

would no longer be allowed,

    a = a ~ b;

would be. Yes, it is a breaking change, but the fix for when that behavior is 
desired is pretty simple.


More information about the Digitalmars-d mailing list