Alignments, semantics from asserts, auto-count

Ellery Newcomer ellery-newcomer at utulsa.edu
Fri Jul 31 17:39:17 PDT 2009


> -------------------------
> 
> This is unrelated, but I need D to become more handy:
> 
> If I don't put a number there arr becomes a dynamic array, so if I want a static array I must count items first. Even C is more handy here. Can some auto-guessing syntax be added, like this?
> 
> int[$] arr = [6,5,-1,-1,-3,-4,4,-3,1,3,0,-4,6,-3,3,4,-4];
> int[?] arr = [6,5,-1,-1,-3,-4,4,-3,1,3,0,-4,6,-3,3,4,-4];
> 
> Thank you.
> 
> Bye,
> bearophile

What's wrong with

auto arr = [6,5,-1,-1,-3,-4,4,-3,1,3,0,-4,6,-3,3,4,-4];

?



More information about the Digitalmars-d mailing list