in reply to Garbage collected class attributes with inside out classes.
There's an extra variable that you can't get rid of but also isn't part of the core functionality
So? It's a single scalar. And arguably, it is part of the core functionality -- if you define garbage collection of class variables to recover memory as core.
The other options I thought about involved weak references but that's really just another mechanism for doing what you're doing in #1.
Overall -- an interesting meditation. To some extent, I question whether this is really a "class attribute" in the usual sense of the term, as it only exists when objects exist, but that's just quibbling over names.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Garbage collected class attributes with inside out classes.
by kyle (Abbot) on Mar 02, 2007 at 03:16 UTC | |
by xdg (Monsignor) on Mar 02, 2007 at 03:44 UTC |