auto arr = [1, 2, 3] should be a static array, not a GC allocated array

Nick Treleaven nick at geany.org
Mon Jul 18 16:11:16 UTC 2022


On Monday, 18 July 2022 at 01:29:11 UTC, Mike Parker wrote:
>> It's fairly common terminology. I couldn't tell you when it 
>> first came into usage, but it's used to describe fixed-length 
>> arrays in multiple languages.
>
> And I should add, I don't see it as being an overloaded usage 
> of the term. Static generally means "fixed" in one form or 
> another, in the sense that the properties of whatever it's 
> applied to are determined prior to run time.

Yes, it's not something D invented, static vs dynamic array. But 
we have so many other uses of the `static` keyword. In 
particular, `static int[] x;`, which is an array but not a static 
array! Fixed length array is clearer.


More information about the Digitalmars-d mailing list