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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,901038687c38f61c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada References: <41769aaf$0$91004$39cecf19@news.twtelecom.net> Subject: Re: Idiom for a class and an object in Ada Date: Wed, 20 Oct 2004 16:04:17 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-ID: <4176c4c1$0$91008$39cecf19@news.twtelecom.net> Organization: Time-Warner Telecom NNTP-Posting-Date: 20 Oct 2004 20:04:17 GMT NNTP-Posting-Host: 7d1a1ba4.news.twtelecom.net X-Trace: DXC=kBST4Q9RBBLkQo;=iDEbGCC_A=>8kQj6MhHXa^^g6TZDLCE^3V]_2EEdYZAA8S: "Simon Wright" wrote in message news:x7voeixb2pl.fsf@smaug.pushface.org... > > And this is exactly why you end up with elaboration order problems! > > with A; > package body B is ...; This needs to say: with A; pragma Elaborate (A); package body B is ...; And now all is well. The problem is that without the pragma, your compile assumes Elaborate_All. But this is too strong, since A has a dependency on B. By explicitly using pragma Elaborate, this only elaborates package A. The elaboration order is thus: A spec B spec A body B body This is one of those few times when you need Elaborate, not Elaborate_All.