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

deadalnix deadalnix at gmail.com
Wed Jul 3 23:21:31 PDT 2013


On Wednesday, 3 July 2013 at 16:55:59 UTC, bearophile wrote:
> deadalnix:
>
>> Why not simply [] ? After all, an array is just a very simple 
>> type of hashmap, with the identity as hash function.
>
> In a language it's very often handy for different data types to 
> have different textual representations and different literals.
>

[] can be int[] or foo!bar[], so you'll have to justify why it is 
specifically good to make the difference in this case, while it 
is generally not needed.


More information about the Digitalmars-d mailing list