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: Geoff Bull Subject: Re: Mutually dependent private types Date: 1998/05/30 Message-ID: <356F8561.A863216A@acenet.com.au>#1/1 X-Deja-AN: 357851241 Content-Transfer-Encoding: 7bit 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Telstra Internet Browse Server Newsgroups: comp.lang.ada Date: 1998-05-30T00:00:00+00:00 List-Id: John Volan wrote: >>Matthew Heaney wrote: [snip] > > So now when he sees this > > > > with type P.T; > > [snip] > > 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? Isn't this whole thread about changing the language? Otherwise, put up with the language and use Cohen or similar method, end of thread. I agree that providing the occasional extra package to resolve circular dependencies is a pain. However this is probably less painful than working on poorly designed code that has used "pragma Mutual" or "with type" all through it. How does a compiler that uses a non source based compilation library "with" a package that hasn't been compiled yet? (i.e. would allowing circular dependencies introduce a big headache for just about every Ada compiler, except for Gnat?) ========================================== Geoff Bull Murray Bull Information Technology Pty Ltd ACN 056 703 274