[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Module finalization (along the lines of calling a function on exit)
- From: Lisa Parratt <lisa@...>
- Date: Fri, 19 Aug 2005 13:40:06 +0100
Antero Vipunen wrote:
Oh my god.
<crazy mad idea>
Another option, though it's horrendously evil. Instead of using
functions directly from the packages, you use tables with their __call
metamethods overridden so they behave like the functions, but they (or
their metatables) contain a reference to the main module table, so that
it can't be collected until all references to functions within the table
have expired.
It'd be so much easier with individual metatables for functions.
</crazy mad idea>
--
Lisa
http://www.thecommune.org.uk/~lisa/