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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: "Nick Roberts" Subject: Re: OOP & Packages in Ada Date: 1998/01/31 Message-ID: <01bd2ea0$ae551ae0$LocalHost@xhv46.dial.pipex.com>#1/1 X-Deja-AN: 320946268 Content-Transfer-Encoding: 7bit References: <6asp37$q8b$1@Masala.CC.UH.EDU> <34D32AE3.87031F98@elca-matrix.ch> Content-Type: text/plain; charset=ISO-8859-1 Organization: UUNet UK server (post doesn't reflect views of UUNet UK) Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-01-31T00:00:00+00:00 List-Id: I would agree with Mats' advice, but, for the record, I think the answer to your question is more or less as follows. First, let's assume that there is a function X defined for type Parent in package Parents as: function X (P: Parent) return Result_Type; and another function X defined for type Child in package Children as: function X (C: Child) return Result_Type; Programmers would then put something like with Parents.Children; in front of their units which were going to use the type Child. This 'with' clause makes the entities specified by Parents available as well as those specified by Children. So the function X which takes Parent as its parameter would be available as well as the X which takes the type Child as its parameter (but neither are directly visible, note). Now, the programmer could either put use Parents, Children; and then declare P: Parent; C: Child; and then put Y := X(P); Z := X(C); where the two calls to X will be resolved by overloading; or the programmer could simply declare P: Parents.Parent; C: Children.Child; and then put Y := Parents.X(P); Z := Children.X(C); where the two calls to X are differentiated explicitly. Perhaps the point is that the programmer _should_ have to make explicit reference to the package Parents when using the type Parent, because that's where it is declared. If the type Child provides all the same functionality of Parent (with, perhaps, more added), then the programmer is using type Child all the time: type Parent remains unused -- it just provides a 'baseline' from which other types are to be derived. -- == Nick Roberts ================================================ == Croydon, UK =========================== == ================ == Proprietor, ThoughtWing Software ========== == Independent Software Development Consultant ====== == Nick.Roberts@dial.pipex.com ==== == Voicemail & Fax +44 181-405 1124 === == == == I live not in myself, but I become == === Portion of that around me; and to me == ==== High mountains are a feeling, but the hum == ======= Of human cities torture. =========== -- Byron [Childe Harold]