comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Measurements components(need language lawyer input)
Date: 1996/03/20
Date: 1996-03-20T00:00:00+00:00	[thread overview]
Message-ID: <DoJnCu.IIM@world.std.com> (raw)
In-Reply-To: 4inncp$cr2@host-3.cyberhighway.net

In article <4inncp$cr2@host-3.cyberhighway.net>,
Mitchell E. James <mjames@spectra.net> wrote:
>generic
>   type t is private;
>package p is
>   x:t;
>end;
>
>-- This one gets the error:
>generic
>   with package other is new p(<>);
>package p.child is
>   y: other.t;
>end p.child;
>
>-- this one doesn't:
>with p;
>generic
>   with package other is new p(<>);
>package q is
>   y: other.t;
>end q;

I believe that's correct.  When you're inside a generic package, the
name of the generic package denotes the "current instance", which is a
package, not a generic package.  I'm too lazy to look up the RM
reference for you right now, but I'm pretty sure it's somewhere in 8.6.
Check "current instance" in the index.

So, in the P.Child case, P is a package, not a generic package.  A child
is logically *inside* its parent's declarative region, even though it is
physically separate.

In the case of Q, you're not inside P, so referring to P refers to the
generic package as usual.

I'm curious: What were you trying to do by having a generic formal
package that's an instance of the parent generic package?

- Bob




  reply	other threads:[~1996-03-20  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-20  0:00 Measurements components(need language lawyer input) Mitchell E. James
1996-03-20  0:00 ` Robert A Duff [this message]
1996-03-20  0:00 ` Jonas Nygren
replies disabled

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