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,c0be0882f0d853ce X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Thu, 30 Sep 2004 18:39:26 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: Subject: Re: Ada0Y limited with Date: Thu, 30 Sep 2004 18:40:36 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-ixp+tqFPz3Sjl6nvQ2cc4L6qM7wKuwTgUcGhds90dwm21A4bGSgyLe2ia8VwHSH8Sc1Qt2mpixPq5mV!cYTfaN1TwjYeOOjC6Ap9lJH443N00ZfiDqvpieElVrLl0yHeTdF13wFhAtPTe+2vdjILo4UHdtJc X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.16 Xref: g2news1.google.com comp.lang.ada:4470 Date: 2004-09-30T18:40:36-05:00 List-Id: "Wojtek Narczynski" wrote in message news:pan.2004.09.30.22.23.45.962614@power.com.pl... > Hello, > > (GNAT in gcc mainline refuses compile the example from the "An invitation > to Ada 2005" presentation, claiming "circular unit dependency" error, so > I have serious problems trying to understand how this is supposed to work.) > > Do I need to declare an access type every time I want to use a a type from > the limited-withed package, or can I just use the access type declared in > the limited-withed package? > > Which of the following is code illegal? > > with Parts; > package Whole is > > type Whole_Type is record > Part : Parts.Part_Type; > end record; > > type Whole_Access is access all Whole_Type; > > end Whole; > > > limited with Whole; > package Parts is > > type Part_Type is record > Prev : Whole.Whole_Access; > Next : access Whole.Whole_Type; > end record; > > end Parts; Limited with always gives you an incomplete view of any types, so that clearly applies to Whole_Access as well. The reason for expanding the use of anonymous access types is to avoid the junk conversions needed if you define named access types everywhere that you use limited withed packages. So, component Prev is wrong; it should look like component Next. Randy Brukardt.