Comment by pierrec

Comment by pierrec 16 hours ago

1 reply

I often hear this (probably because PIL is so optimistic about it), but I would say that 1-based indexing is not just a convention, it's a default that's baked into the language:

    > array = {"A", "B", "C"}
    > array[1]
    A
And there's more: built-in functions like ipairs will not work with hacked-up zero indices (which you would have to specify every time you create an array). Overall, straying from the default is not a great idea unless you really need to (like in LuaJIT).
vascocosta 16 hours ago

Yes, it's technically possible, but indeed it's such a default that no one really tries to fight it.