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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3e3b1c50b9a29c0b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Forwarding declaration? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1112344582.787855.248880@o13g2000cwo.googlegroups.com> Date: Fri, 1 Apr 2005 11:03:57 +0200 Message-ID: <12n3iagr7ygz6.fa1zf1uu12bf.dlg@40tude.net> NNTP-Posting-Date: 01 Apr 2005 11:03:52 MEST NNTP-Posting-Host: 81a4b6af.newsread2.arcor-online.net X-Trace: DXC=B1L83fU[BP9d9772DFAUn2Q5U85hF6f;4jW\KbG]kaM8]kI_X=5Kea6Ul26[mb<9>4[6LHn;2LCV>VVa[ZlQni_1EEiJ8 On 1 Apr 2005 00:36:22 -0800, Andrew wrote: > I have need of a forwarding declaration. How do I do that in Ada? > > --- example1 --- > type Boob is record > Avar : A_Ptr; > end record; > type Boob_Ptr is access all Boob; > > task type A(booby: Boob_Ptr) is > . . . > end A; > type A_Ptr is access all A; > ------------------ > > compiler says (and I say) that A_Ptr is undefined for Boob. > > Now if I could use a temporary placeholder for A_Ptr (a forwarding > declaration) then the compiler and I would be happy. > > --- example2 --- > -- forwarding declaration > temporary declaration of A_Ptr; > > type Boob is record > Avar : A_Ptr; > end record; > type Boob_Ptr is access all Boob; > > task type A(booby: Boob_Ptr) is > . . . > end A; > type A_Ptr is access all A; > ------------------ type A; -- Forward declaration of A type A_Ptr is access all A; type Boob is record Avar : A_Ptr; end record; type Boob_Ptr is access all Boob; task type A (booby : access Boob) is -- No need in pointers here ... end A; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de