From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,98f446539174ef31 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: OOP & Packages in Ada Date: 1998/01/31 Message-ID: <34D32AE3.87031F98@elca-matrix.ch>#1/1 X-Deja-AN: 320835261 Content-Transfer-Encoding: 7bit References: <6asp37$q8b$1@Masala.CC.UH.EDU> Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-01-31T00:00:00+00:00 List-Id: > I've got a question for you. Assuming we have two packages, > say Parents and Children, and Children contains a type, > Child, that is inherited from a type in Parents (Parents.Parent), > is there a way to easily make all the methods of Parents.Parent > available to Child, so that just with'ing the Children package will > make these methods available? Wrapper functions/procedures > or renaming might do this, but is there an easier way? Yes, there is. Do yourself a favor: go to , look at the books section, buy one, spend a day reading it, or look at one of the tutorials (but don't even try learning from the Ada 95 RM). That way you will learn how Ada 95's tagged types work and how to use them right. OOP in Ada 95 is a little different form what you have in other OO languages, and it's best to learn before trying or you (or someone else) will have to maintain code that is not written right. > type Parent is tagged > record > ... > end record; > > function X (P : in Parent'Class) returns Integer; > procedure Y (P : in out Parent'Class); > procedure Z (P : out Parent'Class); These are class-wide operations. It's probably not what you want. Sorry for being so paternalistic :-)