On 19 дек, 01:42, MonkeeSage <MonkeeS... / gmail.com> wrote:
> On Dec 18, 10:23 am, DNNX <6aLLIaPu... / gmail.com> wrote:
>
> > On 18 , 17:54, Robert Klemme <shortcut... / googlemail.com> wrote:
>
> > > On one hand you are right. On the other hand, begin and end indexes
> > > are asymmetric anyway: you know that the starting index is always 0
> > > but the ending index can have arbitrary values. ...
>
> > Hm... On the other hand, end and begin indexes are asymmetric anyway:
> > you know that the ending index is always -1 but the starting index can
> > have arbitrary values.
>
> > Isn't this a symmetry?
>
> > Best regards,
> > Viktar
>
> No, because "-1" is a special value...it's got magic in it. It can
> magically mean 5, or 10, or even 12 (because it's magic). ;) "-1" is
> just sugar for #length, and #length is always a side-effect of a
> container, whereas '0' is a constant entry point.
>
> Regards,
> Jordan

-1 is more special and magic than 0? Hm... 0 also can magically mean
-6, -11, or even -13 (because it's magic too).

-1 is sugar for #length? Not sure I understand correctly. Never heard
such an interpretation of -1 earlier. Why #length but not #length-1?
Why 0 is not
sugar for -#length? What do you mean saying -1 is a sugar for
something?

0 is a constant entry point? Great, -1 is a constant exit point.

Anyway, is there any symmetry or no, I still believe that returning
'asd' in one case and nil in other is not consistent (please see my
example in the first message).

Regards,
Viktar