|
On 14/12/2010 5.03, Keith Matthews wrote:
So here's yet another proposal for the table length operator. It is simple to understand, simple to implement, useful, and with a low algorithmic cost (i.e. O(1) to update or to query the length of a table.) Even better, arrays with holes and sparse arrays would not be a special case anymore.
I find this proposal interesting (it also has the added advantage of increasing performance); its main problem, as you note, is the amount of code that would break because of "t[#t] = nil".
-- Enrico