Other language features you'd want in D

downs default_357-line at yahoo.de
Thu Feb 28 03:10:49 PST 2008


dominik wrote:
> for example, though this might've been solved for D2 already:
> 
> char[][int] foo = [1:"barbar", 2:"bar"]; - this won't work with dmd 
> compiler,
> 
> but this will:
> 
> char[][int] foo = [1:"barbar"[], 2:"bar"];
> 

Agreed. Initializers' type deductions should automatically use the most specialized type that can accomodate all the values.
Same thing for delegate/function literal return-type deductions.
so ["foo", "bar"] should be char[3][2], as currently, but ["foo", "barf"] should use char[][2] automatically, (int i) { if (i) return 2; else return 3f; } should be float delegate(int).

That falls under "small stuff that adds to language polish". And language polish, in the long run, is probably more important than groundbreaking features.

Please think about it. :)

 --downs



More information about the Digitalmars-d mailing list