Path: utzoo!attcan!uunet!decwrl!apple!bbn.com!nic!chaos.cs.brandeis.edu!chaos!phils From: phils@chaos.cs.brandeis.edu (Phil Shapiro) Newsgroups: comp.sys.mac.programmer Subject: Re: And now a question about OOPs and LSC Message-ID: Date: 25 Sep 90 14:53:45 GMT References: <9184@potomac.ads.com> <9189@potomac.ads.com> Sender: @chaos.cs.brandeis.edu Organization: Symantec Corp. Lines: 32 In-Reply-To: jtn@potomac.ads.com's message of 24 Sep 90 19:58:46 GMT In article <9189@potomac.ads.com> jtn@potomac.ads.com (John T. Nelson) writes: > [ stuff deleted ] > > struct A_Class : Superclass { > void *constructor(void); > > void moreMethods(void); > }; > > A_Class should get Superclass's constructor yet in my project it > doesn't so I define the following for A_Class: > > void A_Class::constructor() > { > > this = inherited::constructor(); > return this; > } > > and the linker is happy. This SHOULDN'T be necessary though! When you mention a method name in an object's defintion, you are telling the compiler that you intend to define that method for that particular class. By declaring constructor, you indicate that you wish to override Superclass's constructor method (or declare a new method named constructor). If you want to inherit a method from a superclass, don't mention it in your object's defintion. -phil shapiro, symantec tech support -- Phil Shapiro phils@chaos.cs.brandeis.edu