Why do Lua arrays(tables) start at 1 instead of 0?
Posted
by AraK
on Stack Overflow
See other posts from Stack Overflow
or by AraK
Published on 2010-05-07T01:52:59Z
Indexed on
2010/05/07
1:58 UTC
Read the original article
Hit count: 235
Hi,
I don't understand the rational behind the decision of this part of Lua. Why does indexing start at 1? I have read(as many others did) this great paper. It seems to me a strange corner of a language that is very pleasant to learn and program. Don't get me wrong, Lua is just great but there has to be an explanation somewhere. Most of what I found(on the web) is just saying the index starts at 1. Full stop.
It would be very interesting to read what its designers said about the subject.
Note that I am "very" beginner in Lua, I hope I am not missing something obvious about tables.
© Stack Overflow or respective owner