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

deadalnix deadalnix at gmail.com
Thu Jul 4 18:46:25 PDT 2013


On Thursday, 4 July 2013 at 23:52:35 UTC, bearophile wrote:
> Andrei Alexandrescu:
>
>> Where does the whole "stronger typing" comes in? This is 
>> poppycock. We need real arguments here.
>
> Maybe it's a matter of definitions, for me having "null" as 
> literal for empty array, null pointer, empty associative array, 
> and more is more weakly typed compared to having a literal like 
> [] usable only for empty dynamic arrays (and strings), a 
> literal as [:] usable only for empty associative arrays, and 
> null for pointers, class references (and little else like a 
> Nullable).
>
> Bye,
> bearophile

[] and [:] aren't even remotely close to be strongly typed. I 
still don't see any reason to have a distinction.


More information about the Digitalmars-d mailing list