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,b0b19ab80ff4550d,start X-Google-Attributes: gid103376,public From: bf14@prism.gatech.edu ("none") Subject: instantiation from an instantiation Date: 1997/03/08 Message-ID: <5fskee$a0@acmey.gatech.edu>#1/1 X-Deja-AN: 224025662 Organization: Georgia Institute of Technology Newsgroups: comp.lang.ada Date: 1997-03-08T00:00:00+00:00 List-Id: My program compiles fine but I'm getting a constraint error at run time. I've isolated the problem to a package which is instantiated by another package which is itself instantiated by the client program. The client program instantiates package_1 package my_package_1 is new package_1(thing_type => integer,"<" => "<" process => process); *in addition to defining thing_type's type I want to use the usual definition of < in package_1 and process is a function declared in the client program. package_1 has it's own instantiation declaration of another package called package_2 that package_1 uses. All the same types/definitions are passed on from package_1 to package_2. package pak_1_package is new package_2(thing_type,"<",process); package_2 is to be instantiated the same way as package_1 was. (i.e. the generics in package_2 is in the same order and have the same names as in package_1). My question is: Can the instantiated terms be passed up this way? Again to illustrate /client_program.adb/ with package_1;use package_1; procedure client_progragm is procedure process() begin null; end process; package my_package_1 is new package_1(thing_type => integer,"<" = "<", process => process); . . end client_program; ---------------------------------------------------------------------- /package_1.ads/ with package_2; generic type thing_type is private; with function "<"(left,right:thing_type) return boolean; with procedure process(target:thing_type); package package_1 is package pak_1_package is new package_2(thing_type,"<",process); . . end package_1; ------------------------------------------------------------------------ /package_2.ads/ generic type thing_type is private; with function "<"(left,right:thing_type) return boolean; with procedure process(target:thing_type); package package_2 is . . end package_2; /the constraint error pops up in package_2's body. My guess based on tests I've done is somehow the instantiations are not passed up correctly. i.e. thing_type is not integer, function "<" is not the usual "<" and process is not the process defined in the client./ Are the declarations basically correct and I should search for the error elsewhere? As an additional question is set_col part of standard ADA language or do I have to use "with" for another library? -- Brian Franklin Georgia Institute of Technology, Atlanta Georgia, 30332 uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!bf14 Internet: bf14@prism.gatech.edu