lua-users home
lua-l archive

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


On Fri, Apr 01, 2011 at 09:33:39AM +0200, Mateusz Czaplinski wrote:
> 
> What all the others said (generally, "don't use #t when t is table
> with holes"), plus: that's a known pitfall, but unfortunately noone
> has found any smart enough solution for that yet. Where "smart" does
> among others mean "effective", which I think reads like "O(1) in time
> and memory"; although a thought now occured to me that something
> better than O(n) might also be interesting?
> 
The following tasks are O(1) in time and memory:
1. Remember the largest numeric index ever occupied.
2. Remember whether the table has ever had a hole.

We had a long discussion on this about three months ago, which
was moved off-list when Roberto said please stop.  So maybe this 
time we can stop before that happens again.

Dirk