lua-users home
lua-l archive

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


On Wed, 7 Jul 1999, Luiz Henrique de Figueiredo wrote:
> Lua 3.2 (to be released in a couple of days) has a new built-in function
> tinsert that does this. (You can try it now with 3.2 beta.)

   Thanks, tinsert and tremove are exactly what I was looking for. Looking
   at the documentation, though, i'm a little concerned, given the
   lua equivalent for tinsert. That source implies that tinsert copies
   every object at a given position(after the insert) to that position + 1,
   so that l[3] gets copied to l[4], making room for something at l[3]. 
   Doesn't this make tinsert a O(n) operation, and thus prohibitive for
   dynamic additions to large data sets?

Thanks,
Ken