From: "ara.t.howard" Date: 2008-07-26T01:40:00+09:00 Subject: Re: simple module for "count my instances" behaviour On Jul 25, 2008, at 7:22 AM, Julien Thewys wrote: > I meant other than for hacking purpose. there are many good reasons - one is for subclassing, if you override new clients do not have to remember to call 'super' class C def C.new *a, &b (object = allocate).instance_eval do init *a, &b initialize *a, &b self end end def init @you = 'do not have to remember to call this' end end class D < C def initialize end end another reason is for instance in the case of dike.rb, by re-defining 'new' it can track object creation, register a finalizer, and thereby track the object lifecycle to detect memory leaks regards. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama