[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: problem with lists and weak references in pure LUA
- From: Mark Hamburg <mhamburg@...>
- Date: Tue, 26 Oct 2004 12:07:33 -0700
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...
Mark