Array indexing and slicing
Luís Marques
luismarques+spam at gmail.com
Mon Apr 3 12:58:39 PDT 2006
In article <e0rrgk$1gko$1 at digitaldaemon.com>, Norbert Nemec says...
>That may be fine for "a", but it scales up very badly if you replace a
>by a more complex expression.
Notice that I did say I still prefer $ to the verbose .length, not that I prefer
using .length
I just find it ugly.
> somearray[1..$-1,1..$-1]
or somearray[1..-2,1..-2]
>* omissive indexes are a nice abbreviation but have far less power than
>the "$" symbol
Which cases are you thinking about?
>* negative indices would have to be checked for at run time giving a
>performace penalty that is unacceptable if D tries to aim for a position
>in the league of high-performance computing languages.
Kind of like array out of bounds exceptions, which is already implemented?
Thanks for you feedback,
Luís
More information about the Digitalmars-d
mailing list