lua-users home
lua-l archive

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

I've just realized that "pos" for tinsert() is actually the key value for
<key,value> pair in the table and it doesn't have any correlation
whatsoever with the internal ordering of tables (in regard to next())

I've done some experiments creating numeric sets and using next()
to traverse them, and the internal ordering of tables resembles a kind
of tree or something, it's definately not the analogous of a
STL vector<>

Any better alternatives, to solve my specific problem, than 
1 - use foreachi() or numeric for, or
2 - implement my own container in C and interface it to Lua (if things
get slow)

(I'm using Lua 4)


On 31 Jan 2003, at 16:32, Fabio Reis Cecin wrote:
> (....)
> "tinsert()" asks for the position where I want the
> element inserted. so I guess that what I need is
> a function that does a binary search. (?)

Fábio R. Cecin