Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
aiiane
on Oct 23, 2013
|
parent
|
context
|
favorite
| on:
Why Python uses 0-based indexing. It's because of ...
Also loops will potentially behave awkwardly, due to the table having shifted into dictionary-esq indexing.
anonymoushn
on Oct 23, 2013
|
next
[–]
This won't be a big deal. The 0 key will be in the hash part, and the 1-#t keys will be in the array part. The language doesn't expose the distinction, so the loop-related awkwardness is limited to a tiny performance hit.
ufo
on Oct 24, 2013
|
prev
[–]
If you try to use ipairs to iterate then it will skip the zero-th index but if you use a numeric for loop (for i=0,N do) then you should be fine.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: