Empty array and AA literals

bearophile bearophileHUGS at lycos.com
Sun Apr 6 03:11:33 PDT 2014


anonymous:

>> You can increase by one of the length of the outer array, or 
>> you can append an empty one:
> [...]
>> nested ~= [];
>
> That doesn't add an element. [] is interpreted to be an empty
> int[][]. You need to write [[]] which is an int[][] holding one
> empty int[].

Thank you catching my mistake.
But adding a null increases the length by 1:

a ~= null;

This difference is another reason for me to desire the removal of 
"null" as array literal.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list