What is Voofie?
Voofie organizes knowledge, discovers useful resources and recognizes knowledgable users.
Bookmark your blog in Voofie to get more traffic as well as building a reputation in your field!
Explore more about it. Become a member—our FREE Registration takes just seconds.
Ross Tang (ross_tang)
Degree in Physics and Mathematics, Master in Physics
香港
Adding Garbage collector to MathOO
Is it possible to add garbage collector to MathOO which is practical?
In Mathematica, variables with downvalues will not be collected even it has the attribute "temporary".
In: $HistoryLength = 0; x = Module[{y},y[1]=1;y]; Names["y$*"] Out: {"y$111"} In: x = 1; Names["y$*"] Out: {"y$111"}Since MathOO makes extensive use of downvalues for both class and object, is it possible to overcome the problem to add automatic garbage collector to it?
From this post, Temporary variables in Mathematica, Simon has suggested using Dynamic to do so:
I have considered this option too. But I just don't like the idea of using dynamic, which needs to be enable by user. I wondered if all calculations are done by package, it will still work or not.