Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do appreciate languages that allow -1 for the last index.


That makes it difficult to calculate the distance (length of the slice) between two arbitrary indices though.


Well, that's when you can use the mod operator instead of having to do it when indexing into an array (a much more common operation).




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: