As Iâve been asked, Iâll clarify a bit more. When I said it worked before I was actually wrong because I had forgotten to remove some alternative cleanup code (the alternative works but itâs like using a cannon to kill a fly). This is part of the interpreter for Live Robot Programming that Miguel and I are working on. As part of that we need a data structure that holds scopes, for variables but also for other things. It turns out that for the variables part we can map rather nicely to classes, which gives us a bunch of advantages. So for each scope I generate a class. The scope keeps that class in a âvarsâ instance variable (there are never any instances of these classes BTW). When the scope is garbage collected I want to remove the class from the system. So I put #finalize in the scope with the idea to remove the class, but it turns out that âvarsâ is always nil. So in the end it did not work out ...
On Jan 15, 2015, at 15:10, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
Removing a class you're an instance of might be a bit fishy as well. (as I understand were to be the case if you only implement #finalize), though it'd be nice with some details why it "didn't work out" for Johan.
---> Save our in-boxes! http://emailcharter.org <--- Johan Fabry - http://pleiad.cl/~jfabry PLEIAD lab - Computer Science Department (DCC) - University of Chile