Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mst
on Aug 24, 2021
|
parent
|
context
|
favorite
| on:
The Nelua Programming Language
I do appreciate languages that allow -1 for the last index.
layer8
on Aug 24, 2021
[–]
That makes it difficult to calculate the distance (length of the slice) between two arbitrary indices though.
romwell
on Aug 25, 2021
|
parent
[–]
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: