comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Instantiation of child generics?
Date: 1996/07/27
Date: 1996-07-27T00:00:00+00:00	[thread overview]
Message-ID: <Dv6E72.IxE@world.std.com> (raw)
In-Reply-To: 4taqvl$i11@michp1.redstone.army.mil


In article <4taqvl$i11@michp1.redstone.army.mil>,
Kevin J. Weise <kweise@c3i-ccmail.sed.redstone.army.mil> wrote:
>FWIW, Mr. Taft, I don't think it is counterintuitive at all.  If the effect 
>is the same as if the child generic unit were nested within the parent 
>generic unit, you would still follow the same process:  instantiate the 
>parent first, then instantiate the child WRT the instance of the parent.

Yes, that all makes sense.  What is counter-intuitive is that you have
to say "with Parent_Generic.Child_Generic;".  Normally, you can't reach
into a generic and reference something inside it (you could never refer
to Generic_Package.Nested_Thing from outside).  This requires a special
visibility rule (see the last sentence of 10.1.6(2)).  And that "with"
magically makes Parent_Instance.Child_Generic visible.  I think that's
what Tucker meant by "counter-intuitive".  Once you've swallowed that
little oddity, everything makes sense -- instantiate the outer thing,
and then instantiate the Instance.inner-thing.

>I think the Ada9X team did a great job on child units.

The credit goes to Tucker and to Norman Cohen, who both apparently came
up with the same idea, somewhat independently.  (Tucker thought of it
all one night (he explained to me the next morning), and then realized
it was essentially the same as what Norman Cohen had proposed some
months earlier.)  The previous language definition was pretty hopeless,
actually.  Credit should also goes to the Swiss delegation to WG9, who
pushed the MRT into thinking about generic children in the first place.

>Now, if you want counterintuitive, I think there are some other areas that 
>may qualify.  But they've probably already been hashed over & certainly 
>belong in a different thread.

OK, I'm listening for different threads, with my language-designer hat
on.  ;-)

- Bob




  reply	other threads:[~1996-07-27  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-26  0:00 Instantiation of child generics? Dale Stanbrough
1996-07-26  0:00 ` Robert A Duff
1996-07-26  0:00 ` Tucker Taft
1996-07-26  0:00   ` Kevin J. Weise
1996-07-27  0:00     ` Robert A Duff [this message]
1996-07-30  0:00       ` Dale Stanbrough
1996-07-30  0:00         ` Robert A Duff
replies disabled

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