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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!watmath!clyde!att!ucbvax!BUDDY.CSS.GOV!mark From: mark@BUDDY.CSS.GOV (Mark Nelson) Newsgroups: comp.lang.ada Subject: Help on Inheritance Message-ID: <8812062228.AA05054@buddy.css.gov> Date: 6 Dec 88 22:28:41 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: --Question: --I am working on a method for inheriting procedures, types and packages -- from within an Ada prospective. I am developing -- a full Ada toolkit that will use the previously defined Ada binding to -- the X Window System. I seem to run into a problem exploiting the idea of -- nested generics and visibility. -- -- I am requesting help from other programmers that have used OOD in their -- design and used inheritance. Can it be done, or is it only a mirage -- from the Ada world. -- -- I am trying to make the elemnents of a specific package visible within a -- package that is nested two levels down. -- -- Enclosed is an example of what is being attempted. I'm not sure I -- fully have the concept down so be kind. ------------------ package Xt_Super is generic package Super is type This_Type is (One, Two, Three); end Super; end Xt_Super; ------------------ with Xt_Super; package Xt_Sub_Class is generic package Sub_Class is package Super_Class is new Xt_Super.Super; use Super_Class; type This_Rec is record First_Element : This_Type; end record; end Sub_Class; end Xt_Sub_Class; ------------------- --vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv --and on to the problem --vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv with Xt_Sub_Class; package Xt_My_Class is generic package My_Class is package New_Super_Class is new Xt_Sub_Class.Sub_Class; use New_Super_Class; type New_Record is record The_Element : This_Type; --PROBLEM, How do I make this visible; end record; end My_Class; end Xt_My_Class; --I am trying to make pieces visible that should have a way to be done. --Being pretty sure that this should be able to be done some how, I --turn to my fellow programmers. I am sure I am missing something? But what? -- --Please reply directly and I will post solutions to this inheritance --problem once I figure it all out. -- --Thanks for the flame mom! -- -- -- ____ _ ____ -- / / / | / / / -- /___ /__| / / -- / / | / / -- /___/ / | / /____/ -- --Mark A. Nelson | --Geophysics Division | {ucbvax!ucsd,uunet!seismo}!esosun!mark --Science Applications Int'l Corp. | esosun!mark@seismo.css.gov --San Diego, CA |