[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Deleting all elements from a table
- From: Andreas Stenius <kaos@...>
- Date: Wed, 13 Sep 2006 11:42:30 +0200
Aaron Brown skrev:
while next (t) do
This doesn't work if false is a key.
Easily fixed by checking specifically for non nil keys:
while next(t) ~= nil do
t[next(t)] = nil
However, another way to go about the "my submodules may have
references..." is to use weak references (but then they'll have to check
that their reference is still valid before using them).