Array indexing and slicing

novice2 novice2_member at pathlink.com
Tue Apr 4 07:20:26 PDT 2006


Thanx, Luís Marques for reply, but...

>When you add bounds checking or negative
>indexes, other operations must be performed. For bounds checking a conditional

it is not depends on syntax or index sign. this check must be performed (if
enabled), either positive or negative index.
Even more: we all know, source code and compiler output is not the same. and
source code with negative indexes or other index syntax will be compiled into
the same cpu operations, if it means the same.

>inner loops -- plus they add footprint). For negative indexes the corresponding
>positive offset must be calculated before accessing the array index. Under some

this is not true. when we use other syntax for some operations the compiler
output will be the same. even if we replace some several operations with one
syntax construction compiler can generate more optimized code.

i just want to say, IMHO, all changes in index/slicing syntax will change
compiler only. not generated binary.





More information about the Digitalmars-d mailing list