Why is backward index operator [^1] not zero based [^0]?

2021-09-11 Thread filip
Thanks guys. With Nim aiming to be a Python alternative I guess it makes sense to copy their logic.

Why is backward index operator [^1] not zero based [^0]?

2021-09-10 Thread filip
This might be controversial but if the first element is [0] I think the last element should be [^0]. Intuitively I would expect a[^n] == reversed(a)[n] Run Not really a question, more an opinion, but usability and intuition matters to me.