Deprecate C style declerations?

Bill Baxter dnewsgroup at billbaxter.com
Wed Dec 20 17:36:39 PST 2006


Jarrett Billingsley wrote:
> "Bill Baxter" <dnewsgroup at billbaxter.com> wrote in message 
> news:emcjig$30qo$1 at digitaldaemon.com...
>> The syntax of static multidimensional arrays is better using C-style I 
>> think:
>>
>> int[2][3][4] a; //  means a[3][2][1] is max legal index
>>
>> int a[2][3][4]; //  means a[1][2][3] is max legal index
> 
> That's true.  In fact, I think there's a flag in the DMD frontend to make it 
> so that the D-style
> 
> int[2][3][4] a;
> 
> would have a max index of [1][2][3].  But that goes against the 
> right-to-left rule of declarations..

Yeh, that's not a good enough reason to break the nice strict 
right-to-left consistency D has now.  But I think it may be a good 
enough reason to leave in the "int a[2][3][4]" syntax.

>> I hope D gets real multidimensonal arrays eventually though.  Then the 
>> need for all those brackets will go away and you'll just have:
>>
>>    int[2,3,4] a;
> 
> Though they are two different concepts.  

Yep, different.  I shouldn't have said "all" of them would go away.  I 
was thinking "many of them".  But maybe even then I was overestimating.

--bb



More information about the Digitalmars-d mailing list