Hacker News new | past | comments | ask | show | jobs | submit login

I think the most mathematically natural way to interpret negative indices is to threat them as numbers modulo list length. Then 0 = length, and -1 = length - 1.



C programmers can give you a couple of advises about "correct" modulo on negative numbers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: