> I’ve written several hundred thousand lines of Lua code over the past 10
years or so, and in my experience tables with holes are very rare. In
those few rare cases I’ve had them, it has been no problem to have an
extra ’n’ field. In fact, I have a wrapper module for arrays (similar to
what has been mentioned earlier in this thread) but I think I’ve only
used it a couple of times over the years.
It's more or less the same for me. If you know the details it's very unlikely you'll run into the problem. So as I've said before this is more for the people who are relatively new to Lua. (which might be an unpopular bias I guess).> + it would be possible to have out of bounds checking, but unclear if
they should be errors or behave more like tables (return nil on read and
extend the array on write)?