Is empty array null?

bearophile bearophileHUGS at lycos.com
Mon Feb 27 15:42:26 PST 2012


Jonathan M Davis:

> Arrays treat null kind of funny.

Seen with the knowledge of today, the D confusion between pointers and dynamic arrays was a design mistake.
Recently a bit of this mess was fixed, now this is a syntax error, thanks to Don support too:

void main() {
    auto a = new int[5];
    *a = 2;
}

But I'd like this whole situation to be fixed a bit more.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list