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,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,12eefe849df97d15 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news3.google.com!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!195.14.215.230.MISMATCH!news.netcologne.de!newsfeed-hp2.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 16 Dec 2009 19:54:31 +0100 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Visibility of package parameters in child packages References: <4b27f8e9$0$6591$9b4e6d93@newsspool3.arcor-online.net> <02e4d172-0eb9-4c2a-ac0f-68e151916d59@o19g2000vbj.googlegroups.com> <4b28dd43$0$6586$9b4e6d93@newsspool3.arcor-online.net> <06a89bbe-6b1d-4996-b699-8da81bc6806a@m11g2000vbo.googlegroups.com> <4b2902a7$0$7633$9b4e6d93@newsspool1.arcor-online.net> <9bbb16f2-9ff2-45a5-bafd-be4bf47ef064@t19g2000vbc.googlegroups.com> In-Reply-To: <9bbb16f2-9ff2-45a5-bafd-be4bf47ef064@t19g2000vbc.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4b292ce7$0$6730$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 16 Dec 2009 19:54:31 CET NNTP-Posting-Host: f8901b16.newsspool2.arcor-online.net X-Trace: DXC=dLTni3S@4nh9kIfcjg:0fdA9EHlD;3Ycb4Fo<]lROoRa8kFjLh>_cHTX3jm2\hPaQ@:F_g X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8403 Date: 2009-12-16T19:54:31+01:00 List-Id: Andrea Taverna schrieb: > On 16 Dic, 16:54, Georg Bauhaus wrote: >> Andrea Taverna schrieb: >> >> >> >>> On 16 Dic, 14:14, Georg Bauhaus wrote: >>>> Andrea Taverna schrieb: >>>>> and the compiler replied >>>>> -----%<-----%<-----%<-----%<-----%< >>>>> ]# gnatmake main.adb >>>>> gcc -c main.adb >>>>> main.adb:9:05: instantiation error at parent-child.adb:6 >>>>> main.adb:9:05: "F" is not visible (more references follow) >>>>> main.adb:9:05: instantiation error at parent-child.adb:6 >>>>> main.adb:9:05: non-visible declaration at q.ads:3 >>>>> gnatmake: "main.adb" compilation error >>>>> -----%<-----%<-----%<-----%<-----%< >>>>> Am I missing something? >>>> It's not a "use" issue I think. P.F is marked invisible, >>>> too. >>> I'm not sure I understand you correctly here, however P.F *is* >>> visible, in fact the compiler stops complaining after prefixig P's >>> name to F. >> My mistake, sorry. (I had forgotton to prefix the other F.) >> >> Is the question then whether or not "use" of a generic >> formal package extends to the formal parameters of the >> generic formal package (a formal package with a (<>))? > > Hmm... I know that they are already visible in Parent as soon as I add > the use-clause. The problem is whether I can "use" the generic formal > package in a child of the generic package of which is a parameter.The > fact the package itself is visible in every children of such package > would suggest that I could. My idea, possibly confused, is that somehow the formal parameter F of generic package Q is not made visible in Parent.Child. With LRM 95 12.7(10) in mind, generic with package P is new Q (<>); ... package Parent... means, I think, that the parameters for which (<>) stands are included in visibility decisions. > http://www.adapower.com/adapower1/rm95/arm95_187.html (The paragraph numbering on that page is a bit different from what is normally used in the RM. (10) means the tenth paragraph which happens to be "Static Semantics, 2nd", on adapower.com) "The visible part of a formal package includes the first list of basic_declarative_items of the package_specification. In addition, if the formal_package_actual_part is (<>), it also includes the generic_formal_part of the template for the formal package." P is the formal package with formal_package_actual_part (<>). Q is the template, F is in Qs generic_format_part. So F should be as visible as anything specified in P. But I'm a layman, hopefully some expert can explain all this.