comp.lang.ada
 help / color / mirror / Atom feed
From: Geoff Bull <gbull@acenet.com.au>
Subject: Re: Mutually dependent private types
Date: 1998/05/30
Date: 1998-05-30T00:00:00+00:00	[thread overview]
Message-ID: <356F8561.A863216A@acenet.com.au> (raw)
In-Reply-To: 356E09A1.B493FE89@ac3i.dseg.ti.com


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







  parent reply	other threads:[~1998-05-30  0:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-21  0:00 Mutually dependent private types adam
1998-05-21  0:00 ` Matthew Heaney
1998-05-22  0:00   ` John Volan
1998-05-22  0:00     ` Matthew Heaney
1998-05-26  0:00       ` Robert I. Eachus
1998-05-26  0:00         ` John Volan
1998-05-27  0:00           ` Robert I. Eachus
1998-05-29  0:00             ` John Volan
1998-05-27  0:00           ` Jerry van Dijk
1998-05-29  0:00             ` John Volan
1998-05-26  0:00       ` John Volan
1998-05-26  0:00         ` Matthew Heaney
1998-05-27  0:00           ` John Volan
1998-05-27  0:00             ` Matthew Heaney
1998-05-28  0:00               ` John Volan
1998-05-28  0:00                 ` Matthew Heaney
1998-05-29  0:00                   ` John Volan
1998-05-29  0:00                 ` Brian Rogoff
1998-05-29  0:00                   ` John Volan
1998-05-29  0:00                     ` Brian Rogoff
1998-05-29  0:00                       ` John Volan
1998-05-30  0:00                 ` Geoff Bull [this message]
1998-05-30  0:00                   ` Fergus Henderson
1998-06-01  0:00                     ` John Volan
1998-06-02  0:00                       ` Fergus Henderson
1998-06-04  0:00                       ` Robert Dewar
1998-05-21  0:00 ` John Volan
  -- strict thread matches above, loose matches on Subject: below --
1998-05-22  0:00 adam
1998-05-22  0:00 ` Brian Rogoff
1998-05-22  0:00 ` Matthew Heaney
1998-05-22  0:00 ` John Volan
replies disabled

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