Why I Use D

Janice Caron caron800 at googlemail.com
Sun Mar 30 13:22:06 PDT 2008


On 30/03/2008, Leandro Lucarella <llucax at gmail.com> wrote:
>  I hope D some can do array[5..-1], array[..-4], array[..], etc. a la
>  Python.

No thanks. I don't want a runtime check slowing down all my array
accesses. array[5..$-1] can be identified as end-relative at
compile-time. Not so array[5..-1].

Worse, array[5..-1] might actually /mean/ "from 5 to minus one" (i.e.
it might be a bug). If so, under the current regime, the bug gets
found at bounds-checking time (in a debug build). If you suddenly make
it legal, the bug slips through.



More information about the Digitalmars-d mailing list