lua-users home
lua-l archive

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


My guess is efficiency for ipairs().

And I don't know what would be the meaning of pairs()
on an non-array type table with metatable.__index .
query everything in the object table itself then the
table of metatable.__index ? But __index doesn't need
to be a table and can be a function then what would it
mean ? It is ok to pass it just an integer(as in
ipairs with __index support) but how to cover the hash
part ? Anything can be a key for a hash and I cannot
think of a way to generate this key value to __index

So pairs() with __index support is kind of useless.

That left us with ipairs(), why would I want an
__index backed array ?

The only thing I can think of is some form of
overlay(copy on write?) an array over another one.


      ____________________________________________________________________________________
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
http://tv.yahoo.com/collections/3658