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,56dbd715fa74735a X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Mutually dependent private types Date: 1998/05/28 Message-ID: #1/1 X-Deja-AN: 357542977 References: <6k25ra$6j7$1@nnrp1.dejanews.com> <3565B105.9BFB4788@ac3i.dseg.ti.com> <356B226F.EF05E927@ac3i.dseg.ti.com> <356C8A02.44354B09@ac3i.dseg.ti.com> <356E09A1.B493FE89@ac3i.dseg.ti.com> Organization: Network Intensive Newsgroups: comp.lang.ada Date: 1998-05-28T00:00:00+00:00 List-Id: John Volan writes: > > I don't know what to do really. Maybe a pragma be better: > > > > with P; > > pragma Mutual (P); > > package Q is > > It seems to me that if there's a mutual spec dependency going on between > P and Q, then the "with" clause here is already illegal according to > Ada95's language rules. So what exactly would this "Mutual" pragma > mean? "I know the with clause is illegal, but ignore that and pretend > to be a different language"? :-) What about Ada95's run-time > elaboration mechanism? When would the elaboration code for the specs of > packages P and Q get executed? In what order? The pragma idea is more or less equivalent to "with P.T". Thinking about it more, you could name it thusly: with P; pragma Elaborate_None (P); package Q is ...; So the answer to your question is that the spec for P is not elaborated prior to its use (with certain constraints) by Q. Yes, the "with type" idea was Tuck's, but I'd be willing to bet this problem will be solved using a new set of pragmas. We already have a precedent for using pragmas for elaboration control, and since this is really an elaboration issue, an additional pragma seems like a more natural fit.