lua-users home
lua-l archive

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

If you don't care about order within a priority, you can also maintain a
sorted array of weak sets. You can implement a weak set as a fully weak
table mapping items to true. Throw in priority = number and you can skip an
extra level of table structure. (This is safe since both "priority" and the
number won't get destroyed by weak collection.)

This does, however, lead to iterating over weak tables for which I am less
certain of the semantics particularly under Lua 5.1. A definitive statement
about the degree of safety here would be useful...