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,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,28b389d4503cb555,start X-Google-Attributes: gid103376,public From: "Riyaz Mansoor" Subject: generic package dilemma Date: 1999/11/17 Message-ID: <80u48b$ghr$1@bunyip.cc.uq.edu.au>#1/1 X-Deja-AN: 549660139 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 942838859 16955 172.20.69.157 (17 Nov 1999 11:40:59 GMT) Organization: University of Queensland X-MSMail-Priority: Normal NNTP-Posting-Date: 17 Nov 1999 11:40:59 GMT Newsgroups: comp.lang.ada Date: 1999-11-17T11:40:59+00:00 List-Id: hi hi i'm working on a problem which requires me to use many packages. the design i've made is like this. i've not given the details of the packages or data structures as i think the problem is not in them but rather in the way i'm initialising. ============================================== the main procedure initialises "gen_pack1" and "gen_pack4" as below -- main procedure with gen_pack1; with gen_pack4; procedure main is package pack1 is new gen_pack1; use pack1; package pack4 is new gen_pack4; use pack4; blah blha begin blah end main; ============================================== "gen_pack1" initialises "gen_pack2" and "gen_pack3" as below. -- gen_pack1 with gen_pack2; with gen_pack3; package gen_pack1 is package pack2 is new gen_pack2; use pack2; package pack3 is new gen_pack3; use pack3; blah blah end gen_pack1; the above works fine (as i see it). main instantiates pack1, and then pack1 instantiates pack2 & pack3. the main does recieve a valid variable from pack1 (and therfore pack2 and pack3). heres the problem. this variable is now passed int pack4 from the main. pack4 NEEDS functions and procedures in pack2 and pack3 to manipulate the variable. at the moment i've set pack4 as below and it does NOT work -- gen_pack4 with gen_pack2; with gen_pack3; package gen_pack4 is -- create copy package pack21 is new gen_pack2; use pack21 package pack31 is new gen_pack3; use pack31; blah blah end gen_pack4; it gives a type error! says that expected type is pack2.(type) but found type is pack21.(type). same for the other package. i even tried using the same names (stupid maybe) but to no avail. how can i get out of this? or is this a major design flaw? NOTE: when i remove the genrics all packages work fine and give the correct output. riyaz ---------------------------------------------------- AND THEN THEIR WAS LIGHT