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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.36.74.5 with SMTP id k5mr4579485itb.30.1516570276118; Sun, 21 Jan 2018 13:31:16 -0800 (PST) X-Received: by 10.157.1.193 with SMTP id e59mr236587ote.13.1516570275969; Sun, 21 Jan 2018 13:31:15 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g80no1655929itg.0!news-out.google.com!b73ni5733ita.0!nntp.google.com!w142no1650974ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 21 Jan 2018 13:31:15 -0800 (PST) In-Reply-To: <6378807a-d938-4fac-938b-d3a8616d7f25@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.245.160.161; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.245.160.161 References: <193126c2-f171-43ed-8c7c-00570f1dd4d4@googlegroups.com> <1eb1f57d-36fa-4bf0-8a40-5b32d71e5c28@googlegroups.com> <6378807a-d938-4fac-938b-d3a8616d7f25@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <297e4450-9934-40b8-9b55-1b16b3e421e4@googlegroups.com> Subject: Re: making a son benefit access ton an instanciation of a generic package required as a formal parameter to his father and instanciated by him From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Sun, 21 Jan 2018 21:31:16 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2529 X-Received-Body-CRC: 2069178049 Xref: reader02.eternal-september.org comp.lang.ada:50043 Date: 2018-01-21T13:31:15-08:00 List-Id: > But you can use an exception from a generic instance=20 > still.=20 I thought so too ! Maybe I should, but I can't: the exception handler "when P1.Zero_Denominateur =3D> sth;" raises: P2_G.Child.adb:66:25: exception "Zero_Denominator" is declared in generic f= ormal package P2_G.Child.adb:66:25: and therefore cannot appear in handler (RM 11.2(8)) BUT: the said exception is NOT defined here, but in P1_G -> generic with package P1 is new P1_G(<>); -- IN THERE package P2_G is >The rule is too keep it as simple as possible. If there is any way to ditc= h generics, do it. Use interfaces and tagged types, mix-ins, class-wide acc= ess discriminants etc to achieve polymorphism. =20 Eurg... From the little bit I read (and could understand), you're not very = popular about this here... I'll rather follow the majority, besides, I do l= ike the idea of generics. And one can ALWAYS find loopholes and flex a lang= uage beyond common sense. Do you expect lawyers to be gods ?