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: a07f3367d7,a52a265b2d07ee2c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!postnews.google.com!t34g2000prm.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: child packages and nested packages Date: Thu, 4 Mar 2010 08:12:45 -0800 (PST) Organization: http://groups.google.com Message-ID: <8329703e-1c98-4679-aadc-387e27adb6af@t34g2000prm.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1267719165 22224 127.0.0.1 (4 Mar 2010 16:12:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 4 Mar 2010 16:12:45 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t34g2000prm.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9406 Date: 2010-03-04T08:12:45-08:00 List-Id: On Mar 3, 9:37=A0pm, Oliver Kellogg wrote: > Referring back tohttp://groups.google.com/group/comp.lang.ada/msg/c14a79f= 7d21f5ebf, > > On Mar 29 2002, 2:05 pm, Oliver Kellogg wrote: > > > Sergey Koshcheyev wrote: > > > Just a quick idea - maybe using "is separate" in some right places > > > would solve it? Like having the spec of A.B.Impl inside A.B, and > > > having the body separate. > > > That's definitely possible, but still only a workaround solution. > > I have to correct myself. It's not so definitely possible: > > -- file: a.ads > package A is =A0-- module A > =A0 =A0package B is =A0 =A0 -- interface B > =A0 =A0 =A0 package Impl is > =A0 =A0 =A0 =A0 =A0procedure X; > =A0 =A0 =A0 end Impl; > =A0 =A0end B; > end A; > > -- file: a.adb > package body A is > =A0 =A0package body B is > =A0 =A0 =A0 -- Implementation for interface B, > =A0 =A0 =A0 -- body to be provided by user > =A0 =A0 =A0 package body Impl is separate; > =A0 =A0end B; > end A; > > $ gcc -c a.adb > a.adb:6:07: stub cannot appear in an inner scope You can do it if you make B separate: package body A is package body B is separate; end A; separate(A) package body B is package body Impl is separate; end B; I'm not really familiar with the original problem so I don't know whether this helps you any. -- Adam