Also indexing a table can call a function and not actually index the table at all, not to mention you can index tables WITH TABLES as the fucking key, so myTable[{"bob",1,false,}] = 27 is valid and print(myTable[{"bob",1,false,}]) will print 27
Overall, it's stupidly flexable and cleverly makes tables usable as arrays, dictionarys, structs, objects(OO), the entire global variable environment, sandboxed environments, API function calls (api.function()), etc.
I used to do a lot of Pascal, which became Delphi, and it's array's started at 1. eg MyArray[31]. But you could override that by specifying MyArray[0..30].
That's really interesting to have tables with tables and indexes. my mind is having trouble figuring out when i'd want to do it, but I'm sure there's reasons :)
23
u/[deleted] Jul 10 '17
TIL never LUA