Thanks for the tips, alpaca, quite to the point! Before getting into Lua I read them and they made absolutely no sense whatsoever. Now after a week and some hours into it they make perfect sense. But this one has me confused:
I don't know if I understand what you're saying here.
#a would indeed be 2, because we only have two sequential elements, [1] and [2]. Sequential elements are stored in the array part, and non-sequential and non-number keys are stored in the hashmap. The length operator applies only to the array part.
Where does that index of the lowest non-empty integer - 1 come from?
[*]Numeric arrays are implemented as tables, too. Numbering starts at 1, in contrast to Python. They have a length function invoked by writing #a which returns the index of the lowest non-empty integer - 1. That is, if a = {[1] = 1, [2] = 2, [4] = 3} then #a = 2. Very weird but that's why I'm mentioning it.
I don't know if I understand what you're saying here.
#a would indeed be 2, because we only have two sequential elements, [1] and [2]. Sequential elements are stored in the array part, and non-sequential and non-number keys are stored in the hashmap. The length operator applies only to the array part.
Where does that index of the lowest non-empty integer - 1 come from?