From: Sean O'Dell Date: 2002-05-26T01:57:38+09:00 Subject: Re: Stymied by Ruby's garbage collector Nat Pryce wrote: > 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 Yeah, I know...it's not the same thing. I hope we get real destructors one day. Sean