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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7eac19a561a002ae X-Google-Attributes: gid103376,public From: garrigas@logica.com (Stephen M. Garriga) Subject: Re: [Q] Forward declaration Date: 1996/03/18 Message-ID: <4iju3h$9pg@romeo.logica.co.uk>#1/1 X-Deja-AN: 143966236 references: <314D63A6.143D@kihdata.kih.no> organization: Logica UK Ltd newsgroups: comp.lang.ada Date: 1996-03-18T00:00:00+00:00 List-Id: Vegard Bakke wrote: >>I have a package spesification A, that needs to know about >>package spesification B, that needs to know about a package >>spesification A, that ... The general opinion is that when you have two package spec's refering to each other, you have too many or too few packages. Either 1) combine the packages or 2) separate out the declarations witch both require into a 3rd package spec. >>Are there any forward declaration in ADA? How does it work? Yes - package specs & standard forward declaration (see following hack example0 package X is procedure a(p1 :in integer); procedure b; -- a & b are visible to all procedures in X end X; package body X is procedure c(fred :in out character); -- c is now visible to procedures following procedure d is begin c; end d; -- d is visible to procedures following procedure b is begin a; end b; procedure c(fred : in out character) is begin text_io.put_line("Yeuch!"); d; end c; procedure a(p1 : in integer) is begin b; end a; end X; >>Vegard >>-- >>_________________________________________________________________________ >>| snailto: Vegard Bakke, Kirkegata 9, 3600 Kongsberg, Norway >>| >>| mailto:vegard3@kihdata.kih.no http://knoll.kih.no:8001/stud/vegard3 >>| >>| no.test er best PS the example is designed to ILLUSTRATE and NOT to be functional Steve Garriga garrigas@logica.com type OPINION is access PERSONAL_THOUGHTS_AND_BIAS; OPINION_STATED : new OPINION := not LOGICA.OPINION; Logica UK Ltd. +44 171 637 9111 http://www.logica.com