lua-users home
lua-l archive

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


I agree that pairs should be changed to look for a __pairs metamethod. Doing
so would resolve a number of problems with using proxy tables.
(Interestingly, ipairs needs no such help...)

I'm not fond of the notion of putting it into a table tied to __metatable
because then locking really needs to turn around and build this using proxy
tables to make it read-only and at some point people would be able to
justifiably complain that Lua just makes things too hard.

Along with pairs, it would be good to have standard metatable entries for
insert and remove.

Of course, then we potentially need the rawtable module with the
non-metamethod savvy routines, though in reality provided one goes through a
proxy this may never actually be needed.

Mark