[Submission] D Slices

Nick Sabalausky a at a.a
Tue May 31 13:11:50 PDT 2011


"eles" <eles at eles.com> wrote in message news:is3h9b$on3$1 at digitalmars.com...
>> Array indices do not form a field in D. What's the point bringing it
> in?
>
> Yes, they are (it is true no matter that we speak of D or not). Or,
> more exactly, they should be a field. They are numbers, after all.
>
> Secondly, why they should not be a field? Yes, the current approach
> introduces a "n+1"th parameter needed to characterize an array with
> just... n elements. Why that?
>

Because that's not supposed to be n, it's supposed to be the length. In 
programming, length tends to a much more useful way to descrbe the size of 
something than the index of the last element.




More information about the Digitalmars-d mailing list