comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Visibility of package parameters in child packages
Date: Wed, 16 Dec 2009 19:54:31 +0100
Date: 2009-12-16T19:54:31+01:00	[thread overview]
Message-ID: <4b292ce7$0$6730$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <9bbb16f2-9ff2-45a5-bafd-be4bf47ef064@t19g2000vbc.googlegroups.com>

Andrea Taverna schrieb:
> On 16 Dic, 16:54, Georg Bauhaus <rm.dash-bauh...@futureapps.de> wrote:
>> Andrea Taverna schrieb:
>>
>>
>>
>>> On 16 Dic, 14:14, Georg Bauhaus <rm.dash-bauh...@futureapps.de> 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.




  reply	other threads:[~2009-12-16 18:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 19:28 Visibility of package parameters in child packages Andrea Taverna
2009-12-15 21:00 ` Georg Bauhaus
2009-12-16 11:50   ` Andrea Taverna
2009-12-16 13:14     ` Georg Bauhaus
2009-12-16 14:21       ` Andrea Taverna
2009-12-16 15:54         ` Georg Bauhaus
2009-12-16 16:54           ` Andrea Taverna
2009-12-16 18:54             ` Georg Bauhaus [this message]
2009-12-16 21:44               ` Adam Beneschan
2009-12-16 21:26             ` sjw
2009-12-17  0:19     ` Randy Brukardt
2009-12-17 18:50       ` Ludovic Brenta
2009-12-16 21:27 ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox