From: Nat Pryce Date: 2002-05-25T21:34:14+09:00 Subject: Re: Stymied by Ruby's garbage collector From: "Sean O'Dell" > Finalizers don't cut it for me. Proper object destruction requires > special tasks much of the time (freeing memory, closing files, etc.). A > proper destructor is helping keep the function of the object > encapsulated. It's an exit routine. Last I heard, finalizers were > called when the object was already gone...so you can't much in the way > of closing anything or freeing anything that the object was > maintaining...it's just not the same thing. This is a common complaint from people used to C++ or Java, probably because they are not used to a language with proper closures. This page on the Ruby Garden wiki explains how to use finalisers to clean up an object's private state: http://www.rubygarden.org/ruby?DiscussionOnUsingFinalizers Cheers, Nat. ________________________________ Dr. Nathaniel Pryce B13media Ltd. Studio 3a, Aberdeen Business Centre, 22/24 Highbury Grove, London, N5 2EA http://www.b13media.com