Removing the "int foo[];" syntax

Brian Schott briancschott at gmail.com
Tue Apr 30 15:36:43 PDT 2013


It complicates the grammar and doesn't fit with D's style of 
declaraing variables. (type then identifier) I realize that it 
was left in to make C programmers happy, but it doesn't even work 
like it does in C:

int a[10];
int b[10], b[10];
int[10] c, d;
int e[string];
int f[string], g[string];

test.d(2): Error: multiple declarations must have the same type, 
not int[10] and int[10]
test.d(5): Error: multiple declarations must have the same type, 
not int[string] and int[string]



More information about the Digitalmars-d mailing list