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,c180f7ec8c114391,start X-Google-Attributes: gid103376,public From: David Morton Subject: Can a generic conatain another generic Date: 1996/04/26 Message-ID: <3180C808.63F1A041@jinx.sckans.edu>#1/1 X-Deja-AN: 151553401 content-type: text/plain; charset=us-ascii organization: student mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; Linux 1.3.81 i486) Date: 1996-04-26T00:00:00+00:00 List-Id: A little question... can a generic package contain another generic package? In particular, I have an integer type declared in a file_IO package, which a management package uses. The management package uses another screen_IO package for, you guessed it, screen io. The trouble is, I need to prompt for that integer type, making the screen_IO package have to "with" the file_IO package. I really don't want these two packages to have any inter-dependencies, so it seems to me that I need the screen_IO to have a generic function, instantiated with the management prog. But the screen_IO package will *also* have to instantiate Text_IO.Integer_IO. any ideas how to do this? I tried something like: generic type Integer_Type is <>; function Get_Index_Prompt(prompt : in string) return Integer_Type is Index_IO is new Text_IO.Integer_IO(Integer_Type); ... but it needs a type where the <> is. private won't work, cause the instantiation of Text_IO.Integer_IO needs an integer type. private integer won't work either... somehow I need to tell the generic declaration that Integer_Type *will* be an integer. but I can't just say "Integer" because it is only a particular integer type... The only other way to fix this is with a type cast in the management program, which, I believe, is usually frowned upon. any suggestions? -- David Morton mailto:dmorton@jinx.sckans.edu // If you use Netscape 2.0, 205 College, Winfield, KS 67156 // you can click on the mailto: part to reply! (HINT, HINT) :)