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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!v15g2000prn.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Visibility of package parameters in child packages Date: Wed, 16 Dec 2009 13:44:22 -0800 (PST) Organization: http://groups.google.com Message-ID: <3efa2955-34eb-42e3-b3c5-137fa80c01cd@v15g2000prn.googlegroups.com> 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> <4b292ce7$0$6730$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1260999862 28693 127.0.0.1 (16 Dec 2009 21:44:22 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 16 Dec 2009 21:44:22 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v15g2000prn.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8406 Date: 2009-12-16T13:44:22-08:00 List-Id: On Dec 16, 10:54=A0am, Georg Bauhaus wrote: > 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 > =A0 =A0with package P is new Q (<>); > =A0 =A0... > 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) Be careful here. (10) is not necessarily the tenth paragraph, because additions to the languages have caused paragraphs to be inserted, which are then given numbers like (4.1), (5.1), etc. In the Ada 2005 manual, 12.7(10) is actually the 18th paragraph of section 12.7. The RM available at www.adaic.org/standards has the official paragraph numbers. > "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 You're right that F should be as visible as anything else visible in P. The official rule in Ada 2005 is "for each actual parameter that is not required to match, a copy of the declaration of the corresponding formal parameter of the template is included in the visible part of the formal package." Thus, in the declaration with package P is new Q(<>); the formal package P will have copies of T and F in the visible part of P, in addition to the other stuff copied from the visible part of Q. Thus, "use P" should make T and F directly visible just as other declarations in the visible part of P would be directly visible. In answer to your previous question: Ada 2005 did change this, but it extended this by allowing generic formal packages in which some formal parameters were required to match but others were not. This change didn't affect the semantics of formal packages that were legal in Ada 95. -- Adam