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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada 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 Date: Sun, 21 Jan 2018 23:20:53 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <193126c2-f171-43ed-8c7c-00570f1dd4d4@googlegroups.com> <1eb1f57d-36fa-4bf0-8a40-5b32d71e5c28@googlegroups.com> <6378807a-d938-4fac-938b-d3a8616d7f25@googlegroups.com> <297e4450-9934-40b8-9b55-1b16b3e421e4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 21 Jan 2018 22:20:54 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="d052cd3d19ddc359f465b01bf1560863"; logging-data="11348"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184XkKQTKGv2DkjFWBT41oCSKu1fJ0TOII=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: <297e4450-9934-40b8-9b55-1b16b3e421e4@googlegroups.com> Content-Language: en-US Cancel-Lock: sha1:iEfwuZCCOBgnEw8rpTRpD2qpdPQ= Xref: reader02.eternal-september.org comp.lang.ada:50044 Date: 2018-01-21T23:20:53+01:00 List-Id: On 01/21/2018 10:31 PM, Mehdi Saada wrote: > the exception handler "when P1.Zero_Denominateur => sth;" raises: Note that you write P1.Zero_Denominateur, not P1_G.Zero_Denominateur. The exception is declared in the instance, not in the generic. > P2_G.Child.adb:66:25: exception "Zero_Denominator" is declared in generic formal package > P2_G.Child.adb:66:25: and therefore cannot appear in handler (RM 11.2(8)) P1 is a generic formal package. > generic > with package P1 is new P1_G(<>); -- IN THERE Right, in P1, which is an instance of P1_G. A generic package is not a package; it's a mechanism for creating packages, called instances. A generic package doesn't declare anything; it states what instances will declare. -- Jeff Carter "Saving keystrokes is the job of the text editor, not the programming language." Preben Randhol 64