lua-users home
lua-l archive

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


On 1/10/11 11:50 AM, David Kastrup wrote:

Putting nil in continuously maintained arrays will cause vast
performance problems and unpredictabilities.

Just don't.  nil is there for a reason, and that reason is _explicitly_
not being a table element.

Like you put it, you should not be able to assign it to a table in any way,
ever.

To 'delete' values, however, you kind of have to --- or at least until you
understand you should simply never delete values ... it's all too difficult.

Not being ironic, I think you are highlighting that it is 'too dangerous'
at that language level, and does not belong ther, to even be able to make
such errors.

You also stress by that, that table must not be seen as one type, but two
in one. I would suggest that's also too complicated. A table should not
behave differently depending on how it has been treated before. Simple
as that in my eyes.

Henning