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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,28b389d4503cb555 X-Google-Attributes: gid103376,public From: "Riyaz Mansoor" Subject: Re: generic package dilemma Date: 1999/11/18 Message-ID: <810hdm$1fg$1@bunyip.cc.uq.edu.au>#1/1 X-Deja-AN: 550060016 References: <80u48b$ghr$1@bunyip.cc.uq.edu.au> <3832e27f_1@news1.prserv.net> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: news@uq.edu.au X-Trace: bunyip.cc.uq.edu.au 942917878 1520 172.20.69.157 (18 Nov 1999 09:37:58 GMT) Organization: University of Queensland X-MSMail-Priority: Normal NNTP-Posting-Date: 18 Nov 1999 09:37:58 GMT Newsgroups: comp.lang.ada Date: 1999-11-18T09:37:58+00:00 List-Id: > That's because these are different instantiations of Gen_Pack2 and > Gen_Pack3. The solution is to have Gen_Pack4 import the instantiations, > instead of making its own: i tried to do the above as u've suggested. just a note i forgot in the previous post. pack4 needs functins in pack2 and pack3 but pack4 can/should be able to manipulate then through pack1. hence the initialisation of pack2 and pack3 from within pack1. > > procedure main is > package pack1 is new gen_pack1; use pack1; > package pack4 is new gen_pack4 (Pack1.Pack2, Pack1.Pack3); use pack4; > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > blah blha > begin > blah > end main; hence i've initialise main as procedure main is package pack1 is new gen_pack1; use pack; package pack4 is new gen_pack4(pack1); use pack4; blah end main; for gen_pack4 > generic > with package Pack2 is new Gen_Pack2 (<>); > with package Pack3 is new Gen_Pack3 (<>); hence pack4 is initialised as generic with package pack1 is new gen_pack1(<>); i believe this is the same as u've suggested. but however it does not compile. it gives an error at the following point in the main. procedure main is package pack1 is new gen_pack1; use pack; package pack4 is new gen_pack4({error here}pack1); use pack4; blah end main; the error message says that "previous error in declaration of formal package" and i dont' know what that means!! any help appreciated thanx riyaz