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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8fdcbb4347c7f20a X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Instantiation of child generics? Date: 1996/07/27 Message-ID: #1/1 X-Deja-AN: 170358889 references: <4t9itp$imd@goanna.cs.rmit.edu.au> <4taqvl$i11@michp1.redstone.army.mil> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-27T00:00:00+00:00 List-Id: In article <4taqvl$i11@michp1.redstone.army.mil>, Kevin J. Weise 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