Alignments, semantics from asserts, auto-count
Ellery Newcomer
ellery-newcomer at utulsa.edu
Fri Jul 31 20:08:28 PDT 2009
Andrei Alexandrescu wrote:
> Ellery Newcomer wrote:
>>> -------------------------
>>>
>>> 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];
>>
>> ?
>
> Well we've concluded a while ago that it's vastly better for everyone if
> the automatic type of array literals is T[], not T[n].
Ah. I didn't think it would happen. I can't wait!
More information about the Digitalmars-d
mailing list