From: Eric Hodel Date: 2006-04-11T03:15:37+09:00 Subject: Re: new/initialize On Apr 10, 2006, at 11:07 AM, Tom Allison wrote: > When I call > Obj.new() > > I actually call the > clall Obj > def initialize() > end > end Not exactly. You call Object::new. Object::new calls initialize after allocating a new instance. > so there is an implied connection between new() and initialize()? There is an explicit connection between Object::new and Object#initialize Object::new is implemented something like this, but in C: class Object def self.new(*args, &block) obj = allocate obj.send(:initialize, *args, &block) return obj end end > Historically is there some reason why we didn't just stick with the > 'def new()' > or did I miss something. That would be an instance method. Object::new is a class method. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com