[:] as empty associative array literal, plus warning for null

TommiT tommitissari at hotmail.com
Wed Jul 3 11:43:25 PDT 2013


On Wednesday, 3 July 2013 at 18:10:42 UTC, bearophile wrote:
> TommiT:
>> But I would expect [] to mean "empty dynamic array", not null. 
>> [..]
> [..]
>
> This means you have to keep "null" in the language to represent 
> an empty associative array, because someone somewhere will 
> surely want a literal that avoids memory allocations. So lot of 
> people will keep using null, and the coding situation is 
> improved about zero.

Okay, I didn't realize an empty array would need to allocate.


More information about the Digitalmars-d mailing list