C-Style declarations, are they here to stay?!! Walter?

BCS BCS_member at pathlink.com
Fri Mar 31 15:16:02 PST 2006


Hasan Aljudy wrote:
> << I don't know if this has been discussed before, but I don't remember 
> seeing any discussion about it. If it has been, please direct me to one 
> of the old threads that discussed it. >>
> 
> I noticed that D supports the klumsy C-Style declarations, like
> 
> int (*x[5])[3];       // x is an array of 5 pointers to arrays of 3 ints
> 
> I hate them!
> To be honest, I never understood them; never tried to. This example is 
> taken from the docs, and I really don't understand how does it make x an 
> array of 5 pointers to arrays of 3 ints!!
> 
> D has nicer syntax,
> int[3]*[5] x;    // x is an array of 5 pointers to arrays of 3 ints
> 
[...]
> 
> Since D has a more intelligent way of declaring the same things, the 
> C-Style syntax is unnecessarily redundant IMHO.
> 
> My understanding is that it's supported to attract the C/C++ people and 
> get them familiarized with D quickly.
> 
> But, does this mean that C-Style declarations are gonna stay with D 
> forever?
> 
> I personally would like to see them gone. but that's not for me to decide.
[...]
> So Walter, I would like to please hear your opinion/decision about 
> C-Style declarations; are they here to stay? or will they be deprecated 
> at some point?
> 
> 
IIRC the c style types are for convenience when porting from C. I think a better 
solution would be a type translator tool. Give it a listing of types in C and it 
gives you the same type in D (and vise versa).

I would like to see them go also.



More information about the Digitalmars-d mailing list