From: William Djaja Tjokroaminata Date: 2002-10-17T23:27:14+09:00 Subject: Re: Multiple constructors in a .c extension? Hi, From the "Programming Ruby" book: "... Data_Make_Struct. However, although this allocates memory for the object, it does not automatically call an initialize method; you need to do that yourself: .... rb_obj_call_init(... This has the benefit of allowing subclasses in Ruby to override or augment the basic initialize in your class. ..." If you just write everything in C, then it will be fine. However, when a subclass is created in Ruby (not in C), then you will see the consequence. I think the best way to understand this is by experimentation by, as Nobu pointed out, having a base class and a derived class. Regards, Bill ========================================== nobu.nokada@softhome.net wrote: > Hi, > At Thu, 17 Oct 2002 19:46:45 +0900, > Paul E.C. Melis wrote: >> The defined initialize method in the extension actually does nothing, so I >> would rather leave it out. I don't see any reason myself why object >> construction and initialization can't be done completely by the C functions >> implementing new and new_from_file. Is there anything special about the >> "new" singleton method other than that it implicitly calls "initialize"? > You would be surprised when you create a subclass. > -- > Nobu Nakada