The demise of T[new]

Yigal Chripun yigal100 at gmail.com
Mon Oct 19 13:11:48 PDT 2009


On 19/10/2009 19:10, BCS wrote:
> Hello Yigal,
>
>> I think that Arrays and AAs need to be removed from the language. I
>> prefer to have a collections framework as part of Phobos without
>> special cases in the language for specific containers.
>
> If it can be assured that all the current array ops will get inlined is
> all cases and can result in identical asm I'd be willing to consider this.
>
>> List!(Foo) list = new Array!(Foo); // instead of Foo[new]
>
> For me to not dislike the idea you would also need to find a cleaner
> syntax.
>
>
See Leandro Lucarella's posts which describe the same idea.

currently, AAs and arrays are implemented in the run-time. What I 
suggest is to move them to the stdlib. I don't see how such a move can 
impact performance which you're concerned with above. on the contrary, 
moving these types outside the runtime will make it easier to improve 
their implementations.

regarding syntax, what's cleaner than calling an array an "Array"?
T[new] is less clear and hackish.



More information about the Digitalmars-d mailing list