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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.133.84 with SMTP id h81mr2231018iod.64.1476378071790; Thu, 13 Oct 2016 10:01:11 -0700 (PDT) X-Received: by 10.157.43.193 with SMTP id u59mr909546ota.16.1476378071754; Thu, 13 Oct 2016 10:01:11 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!l13no1046802itl.0!news-out.google.com!w143ni1931itb.0!nntp.google.com!o19no1047119ito.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 13 Oct 2016 10:01:10 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.21.38.161; posting-account=5zx--goAAAD06H29EnWQGKTO-gctuXHl NNTP-Posting-Host: 91.21.38.161 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <08d81628-f1a6-430b-b023-0166a1bedfaa@googlegroups.com> Subject: Question about generic child packages From: Charly Injection-Date: Thu, 13 Oct 2016 17:01:11 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:32079 Date: 2016-10-13T10:01:10-07:00 List-Id: Hi, I have the following question: Is it possible to have a generic parent package Parent with two (or more) child packages and than use objects defined in one of the children and use it in the other one? Following is a very simple example to show my problem. In Child_A I defined a function Double and want to use it in Child_B. It would also be nice to use objects in Child_A, that are defined in B, not shown in following example. Of course I can make Child_B a subchild of Child_A, but that is unsatisfying because it is asymmetric and does not solve the second part with mutual usage. -------------------- generic type Data is digits <>; package Parent is end Parent; -------------------- generic package Parent.Child_A is function Double (X : in Data) return Data is (2.0 * X); end Parent.Child_A; -------------------- with Parent.Child_A; generic package Parent.Child_B is function Test (X : in Data) return Data is (2.0 * Parent.Child_A.Double (X)); end Parent.Child_B; Charly