Version 1.1 of acs/ac-00268.txt

Unformatted version of acs/ac-00268.txt version 1.1
Other versions for file acs/ac-00268.txt

!standard 12.7(4)          15-06-03 AC95-00268/00
!standard 12.7(9)
!class confirmation 15-06-03
!status received no action 15-06-03
!status received 15-04-15
!subject Is a formal package a package?
!summary
!appendix

From: Randy Brukardt
Sent: Wednesday, April 15, 2015  7:46 PM

We know that a generic something is not a something (this is explained at the 
beginning of chapter 12). In particular, a generic package is not a package.

But the answer is not so clear for general formals. I don't see any clear
answer either way. In the particular case of generic formal packages,
12.7(9) says "A formal_package_declaration declares a generic formal package.",
which could be interpreted either way, 12.7(4) says in part that "the formal
package is an instance of the template." which suggests that it is a package
(as a package instance is a package).

The specific case for the moment is 8.4(5/2). I have a submitted test for the
"nonlimited" part of the rule, and I was wondering if there was anything else
untested. That led to the question of whether a formal package is allowed in
a package use clause. Which led to the above musings.

***************************************************************

From: Gary Dismukes
Sent: Wednesday, April 15, 2015  8:12 PM

I think that a formal package should be considered a package.  The fact that
it's an instance certainly supports that, and they should be allowed in use
clauses.  I guess the RM should clarify that, which I agree isn't clearly
stated.

***************************************************************

From: Bob Duff
Sent: Wednesday, April 15, 2015  8:19 PM

> We know that a generic something is not a something (this is explained 
> at the beginning of chapter 12). In particular, a generic package is 
> not a package.

Yes.  I'm not sure why that bothers some people -- it's just the way the
English language works.  There are lots of <adjective> <noun> phrases where
the <adjective> modifies the <noun> so much that it's no longer an instance
of that <noun>.  Pseudo-science is not science.  Ultra violet light is not
light (you can't see it) and it's not violet.  A "proposed amendment to Ada"
is not "an amendment to Ada" (at least not yet). Etc.

> But the answer is not so clear for general formals.

I think it's pretty clear that a generic formal X is an X.
At least, I can't think of any counterexamples.
(And by the way, a "counterexample of X" is not an "example of X" ;-).)

>...I don't see any clear
> answer either way. In the particular case of generic formal packages,
> 12.7(9) says "A formal_package_declaration declares a generic formal  
>package.", which could be interpreted either way, 12.7(4) says in part 
>that  "the formal package is an instance of the template." which 
>suggests that it  is a package (as a package instance is a package).

For sure, a generic formal package is a package.

> The specific case for the moment is 8.4(5/2). I have a submitted test 
> for the "nonlimited" part of the rule, and I was wondering if there 
> was anything else untested. That led to the question of whether a 
> formal package is allowed in a package use clause.

Yes, I'm quite sure that "use X" is allowed when X denotes a generic formal
package, and makes things in the visible part of X "potentially use-visible".
Just like when X denotes a package_declaration, or an old-fashioned
instantiation of a generic package.

>...Which led to the above musings.
> 
> Thoughts?

I think you're overthinking this.  ;-)

***************************************************************

From: Bob Duff
Sent: Wednesday, April 15, 2015  8:32 PM

> I think that a formal package should be considered a package.

Yes.

>...The fact
> that it's an instance certainly supports that, and they should be 
>allowed  in use clauses.  I guess the RM should clarify that, which I 
>agree isn't  clearly stated.

I don't think any clarification is needed.

Anyway, AARM-8.4(5.a) makes the intent clear:

5/2 {AI95-00217-06} A package_name of a use_package_clause shall denote a
    nonlimited view of a package.

5.a         Ramification: This includes formal packages.

***************************************************************

From: Randy Brukardt
Sent: Wednesday, April 15, 2015  8:53 PM

> > Thoughts?
> 
> I think you're overthinking this.  ;-)

Naw, I'm just trying to figure out what the guy who wrote the list of
objectives to test (that would have been me, circa 2007) was thinking when
he included "Check that the name in a use package clause cannot denote a
generic formal package." One possibility is that "formal" shouldn't have been
in there, or maybe it was intended as written.

And then I got confused, because a "generic package" is definitely not a
package, while a "generic formal package" seems like it shouldn't be either
(prefixing with "generic" seems to kill off the thingedness), while a "formal
package" might indeed be a package. But the latter two are two different ways
to write the same thing. Now I'm confused again. ;-)

> Anyway, AARM-8.4(5.a) makes the intent clear:
>
> 5/2 {AI95-00217-06} A package_name of a use_package_clause shall 
> denote a
nonlimited view of a package.
> 
> 5.a         Ramification: This includes formal packages.

How in the world did I miss that? I looked at 8.4(5/2) at least three separate
times while writing the original message. A spectacular version of tunnel
vision. Well, at least we'll have something to put in our AC index (the place
where uninteresting threads go to be forgotten).

Of course it doesn't answer whether that also applies to a generic formal
package. ;-)

I'll go back under my rock now. :-)

***************************************************************

From: Jean-Pierre Rosen
Sent: Wednesday, April 15, 2015  11:54 PM

> Yes.  I'm not sure why that bothers some people -- it's just the way 
> the English language works.  There are lots of <adjective> <noun> 
> phrases where the <adjective> modifies the <noun> so much that it's no 
> longer an instance of that <noun>.  Pseudo-science is not science.  
> Ultra violet light is not light (you can't see it) and it's not 
> violet.  A "proposed amendment to Ada" is not "an amendment to Ada" (at
> least not yet). Etc.

Sure. Or like I tell my students: "A blueprint of a house is not a house,
it's a blueprint".

>> The specific case for the moment is 8.4(5/2). I have a submitted test 
>> for the "nonlimited" part of the rule, and I was wondering if there 
>> was anything else untested. That led to the question of whether a 
>> formal package is allowed in a package use clause.
 
Well, it's certainly allowed as a prefix of a selected name, so I see no reason
to not allow it in use clauses. (and the fact that you can access elements
declared in it certainly shows that it's a package).

***************************************************************

From: Robert Dewar
Sent: Thursday, April 16, 2015  10:52 AM

> Yes.  I'm not sure why that bothers some people -- it's just the way 
> the English language works.  There are lots of <adjective> <noun> 
> phrases where the <adjective> modifies the <noun> so much that it's no 
> longer an instance of that <noun>.  Pseudo-science is not science.  
> Ultra violet light is not light (you can't see it) and it's not 
> violet.  A "proposed amendment to Ada" is not "an amendment to Ada" (at
> least not yet). Etc.

Well I have a better insight into how this very undesirable terminology
(generic package not a package) arose. If you don't understand why this is
bothersome, then you are missing a lot.

In general if we apply an adjective to a noun, it restricts,

an honorable man is still a man

a fragile package is still a package

etc etc etc

It is constantly confusing that a generic package is not a package to me, and
to many others. Sure there are exceptions, but the normal expectation is that
a bla bla gizmo, is still a gizmo.

for instance, it would be amazing (and horrible) if an integer exprssion were
not an expression, or a nested subprogram were not a subprogram etc. etc.

Please don't create more anomolies of this kind!

***************************************************************

From: Robert Dewar
Sent: Thursday, April 16, 2015  10:55 AM

BTW, to me it would have been much nicer to avoid the phrase generic package,
and instead use something like generic package template. No one would get
mixed up and think that a generic package template was a package.

***************************************************************

From: Robert Dewar
Sent: Thursday, April 16, 2015  10:57 AM

> "A blueprint of a house is not a
> house, it's a blueprint".

Bad analogy, this is not in the form adjective/noun.
If we had used the phrase:

generic template for a package

(which would bed analogous to your example)

then no one would have got confused.

***************************************************************

Questions? Ask the ACAA Technical Agent