lua-users home
lua-l archive

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


On Fri, 30 May 2003, [iso-8859-1] Tobias Käs wrote:

> As the question required the list to be kept existend by a pointer to _any_
> element in the list, the solution you gave is insufficient. If the pointer
> does not point to the first entry, the weak part will get lost. If you make
> the weak part strong you have cycles ;-)

Hm, true.  What we typically do in practice: use raw pointers for the
internal links, and keep the objects alive through other means
(e.g. have strong references in an array somewhere).

-Thatcher