From: Nat Pryce Date: 2002-07-02T02:25:58+09:00 Subject: Re: Ruby implementation Q's > As a final point, I hear a lot of talk about finalization and it's > pitfalls. It seems to me that finalization happens to late to be > truly useful. What would the theoretical implications be of an > optional destroy mechanism? [details elided] I have heard this mentioned a lot and never understood these comments. Can you explain in more detail? Why do you think finalization happens too late to be useful? I have used the existing finalisation mechanism many times, from simple uses (e.g. ensuring the release of external resources) to quite complex classes (e.g. a weak hashtable that removes entries when keys are garbage collected). I have *never* found a limitation with the finalization system. On the other hand, I have found it conceptually simpler than Java's finalisation system (just look at the complexity of the java.lang.ref package), and less prone to dangling pointers than C++ destructors. Cheers, Nat. ________________________________ Dr. Nathaniel Pryce B13media Ltd. Studio 3a, Aberdeen Business Centre, 22/24 Highbury Grove, London, N5 2EA http://www.b13media.com