lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On Thu, 29 Mar 2018 at 01:52 Axel Kittenberger <axkibe@gmail.com> wrote:
> Moreover, it is not strictly correct to say that Lua has 1-based indexing.

Mixed 1-based and 0-based indexing is the worst possible state of affairs regarding this for a programming system.


It's not if there is proper justification. 0-based indexing should be an "offset". It's justified in C because C array indexing is always an "offset". You can write:

int a[3];
1[a] = 5;
*(a+2) = 6;

Not the case for all languages' arrays.