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

Mike Parker aldacron at gmail.com
Sun Jul 17 09:23:23 UTC 2022


On Sunday, 17 July 2022 at 08:58:58 UTC, Salih Dincer wrote:

>
> Because it is a proposal that has been forgotten for 7 years. 
> The DIP may have been withdrawn, but it was never given a 
> chance to be tried.

It hasn't been 7 years. DIP 1039 went through the first round of 
Community review in January of last year. The author withdrew it 
because the he got the impression that the feedback was largely 
negative, and he felt that he couldn't formulate a good case for 
why the proposed feature was sufficiently of more benefit than 
`staticArray` to justify the new syntax.

You can see the review summary and the links to the Discussion 
and Feedback threads here:

https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1039.md#reviews

Again, anyone who wants to take this up is totally free to do so.

On a personal note, I like the idea. Having to match static array 
length with initializer length has annoyed me more than once in 
my years of D. And having to import another symbol to get around 
it hardly alleviates the annoyance. `int[$]` is a sensible syntax 
for it. So I hope someone does pick this up one day and manages 
to convince the right people that it's worth the implementation.


More information about the Digitalmars-d mailing list